@syntrologie/runtime-sdk 2.4.0-canary.17 → 2.4.0-canary.19

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.
Files changed (36) hide show
  1. package/dist/actions/schema.d.ts +7256 -384
  2. package/dist/actions/schema.js +2 -2
  3. package/dist/actions/types.d.ts +7 -0
  4. package/dist/anchor/AnchorResolver.d.ts +18 -0
  5. package/dist/anchor/index.d.ts +2 -0
  6. package/dist/{chunk-LZLDT5DA.js → chunk-LR5AA5SE.js} +2 -2
  7. package/dist/{chunk-VIGV46CB.js → chunk-LRN3K2VD.js} +284 -102
  8. package/dist/chunk-LRN3K2VD.js.map +7 -0
  9. package/dist/{chunk-4NYS7GAW.js → chunk-P5G4KT2U.js} +39 -6
  10. package/dist/chunk-P5G4KT2U.js.map +7 -0
  11. package/dist/config/schema.d.ts +448 -40
  12. package/dist/config/schema.js +1 -1
  13. package/dist/context/schema.d.ts +8 -8
  14. package/dist/decisions/schema.d.ts +424 -1408
  15. package/dist/decisions/schema.js +5 -1
  16. package/dist/decisions/types.d.ts +22 -0
  17. package/dist/events/registerConfigPredicates.d.ts +6 -10
  18. package/dist/events/schema.d.ts +8 -8
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +9 -77
  21. package/dist/index.js.map +3 -3
  22. package/dist/overlays/schema.d.ts +22 -22
  23. package/dist/react.js +3 -3
  24. package/dist/runtime.d.ts +3 -0
  25. package/dist/smart-canvas.esm.js +36 -37
  26. package/dist/smart-canvas.esm.js.map +4 -4
  27. package/dist/smart-canvas.js +320 -179
  28. package/dist/smart-canvas.js.map +4 -4
  29. package/dist/smart-canvas.min.js +36 -37
  30. package/dist/smart-canvas.min.js.map +4 -4
  31. package/dist/version.d.ts +1 -1
  32. package/package.json +7 -7
  33. package/schema/canvas-config.schema.json +996 -56
  34. package/dist/chunk-4NYS7GAW.js.map +0 -7
  35. package/dist/chunk-VIGV46CB.js.map +0 -7
  36. /package/dist/{chunk-LZLDT5DA.js.map → chunk-LR5AA5SE.js.map} +0 -0
@@ -1,12 +1,12 @@
1
- var FT=Object.create;var Fc=Object.defineProperty;var UT=Object.getOwnPropertyDescriptor;var VT=Object.getOwnPropertyNames;var jT=Object.getPrototypeOf,PT=Object.prototype.hasOwnProperty;var Bb=t=>{throw TypeError(t)};var qT=(t,e,n)=>e in t?Fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Xn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ZT=(t,e)=>{for(var n in e)Fc(t,n,{get:e[n],enumerable:!0})},GT=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of VT(e))!PT.call(t,r)&&r!==n&&Fc(t,r,{get:()=>e[r],enumerable:!(i=UT(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?FT(jT(t)):{},GT(e||!t||!t.__esModule?Fc(n,"default",{value:t,enumerable:!0}):n,t));var j=(t,e,n)=>qT(t,typeof e!="symbol"?e+"":e,n),$b=(t,e,n)=>e.has(t)||Bb("Cannot "+n);var ge=(t,e,n)=>($b(t,e,"read from private field"),n?n.call(t):e.get(t)),ar=(t,e,n)=>e.has(t)?Bb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kn=(t,e,n,i)=>($b(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var Xb=Xn(ne=>{"use strict";var fp=Symbol.for("react.transitional.element"),YT=Symbol.for("react.portal"),WT=Symbol.for("react.fragment"),XT=Symbol.for("react.strict_mode"),KT=Symbol.for("react.profiler"),QT=Symbol.for("react.consumer"),JT=Symbol.for("react.context"),eR=Symbol.for("react.forward_ref"),tR=Symbol.for("react.suspense"),nR=Symbol.for("react.memo"),Pb=Symbol.for("react.lazy"),iR=Symbol.for("react.activity"),Fb=Symbol.iterator;function rR(t){return t===null||typeof t!="object"?null:(t=Fb&&t[Fb]||t["@@iterator"],typeof t=="function"?t:null)}var qb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zb=Object.assign,Gb={};function sa(t,e,n){this.props=t,this.context=e,this.refs=Gb,this.updater=n||qb}sa.prototype.isReactComponent={};sa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};sa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Yb(){}Yb.prototype=sa.prototype;function pp(t,e,n){this.props=t,this.context=e,this.refs=Gb,this.updater=n||qb}var hp=pp.prototype=new Yb;hp.constructor=pp;Zb(hp,sa.prototype);hp.isPureReactComponent=!0;var Ub=Array.isArray;function dp(){}var De={H:null,A:null,T:null,S:null},Wb=Object.prototype.hasOwnProperty;function gp(t,e,n){var i=n.ref;return{$$typeof:fp,type:t,key:e,ref:i!==void 0?i:null,props:n}}function oR(t,e){return gp(t.type,e,t.props)}function mp(t){return typeof t=="object"&&t!==null&&t.$$typeof===fp}function aR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Vb=/\/+/g;function up(t,e){return typeof t=="object"&&t!==null&&t.key!=null?aR(""+t.key):e.toString(36)}function sR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(dp,dp):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function aa(t,e,n,i,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case fp:case YT:a=!0;break;case Pb:return a=t._init,aa(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+up(t,0):i,Ub(r)?(n="",a!=null&&(n=a.replace(Vb,"$&/")+"/"),aa(r,e,n,"",function(c){return c})):r!=null&&(mp(r)&&(r=oR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Vb,"$&/")+"/")+a)),e.push(r)),1;a=0;var s=i===""?".":i+":";if(Ub(t))for(var l=0;l<t.length;l++)i=t[l],o=s+up(i,l),a+=aa(i,e,n,o,r);else if(l=rR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,o=s+up(i,l++),a+=aa(i,e,n,o,r);else if(o==="object"){if(typeof t.then=="function")return aa(sR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function Uc(t,e,n){if(t==null)return t;var i=[],r=0;return aa(t,i,"","",function(o){return e.call(n,o,r++)}),i}function lR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var jb=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},cR={map:Uc,forEach:function(t,e,n){Uc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Uc(t,function(){e++}),e},toArray:function(t){return Uc(t,function(e){return e})||[]},only:function(t){if(!mp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Activity=iR;ne.Children=cR;ne.Component=sa;ne.Fragment=WT;ne.Profiler=KT;ne.PureComponent=pp;ne.StrictMode=XT;ne.Suspense=tR;ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=De;ne.__COMPILER_RUNTIME={__proto__:null,c:function(t){return De.H.useMemoCache(t)}};ne.cache=function(t){return function(){return t.apply(null,arguments)}};ne.cacheSignal=function(){return null};ne.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Zb({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!Wb.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return gp(t.type,r,i)};ne.createContext=function(t){return t={$$typeof:JT,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:QT,_context:t},t};ne.createElement=function(t,e,n){var i,r={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)Wb.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return gp(t,o,r)};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:eR,render:t}};ne.isValidElement=mp;ne.lazy=function(t){return{$$typeof:Pb,_payload:{_status:-1,_result:t},_init:lR}};ne.memo=function(t,e){return{$$typeof:nR,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=De.T,n={};De.T=n;try{var i=t(),r=De.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(dp,jb)}catch(o){jb(o)}finally{e!==null&&n.types!==null&&(e.types=n.types),De.T=e}};ne.unstable_useCacheRefresh=function(){return De.H.useCacheRefresh()};ne.use=function(t){return De.H.use(t)};ne.useActionState=function(t,e,n){return De.H.useActionState(t,e,n)};ne.useCallback=function(t,e){return De.H.useCallback(t,e)};ne.useContext=function(t){return De.H.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t,e){return De.H.useDeferredValue(t,e)};ne.useEffect=function(t,e){return De.H.useEffect(t,e)};ne.useEffectEvent=function(t){return De.H.useEffectEvent(t)};ne.useId=function(){return De.H.useId()};ne.useImperativeHandle=function(t,e,n){return De.H.useImperativeHandle(t,e,n)};ne.useInsertionEffect=function(t,e){return De.H.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return De.H.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return De.H.useMemo(t,e)};ne.useOptimistic=function(t,e){return De.H.useOptimistic(t,e)};ne.useReducer=function(t,e,n){return De.H.useReducer(t,e,n)};ne.useRef=function(t){return De.H.useRef(t)};ne.useState=function(t){return De.H.useState(t)};ne.useSyncExternalStore=function(t,e,n){return De.H.useSyncExternalStore(t,e,n)};ne.useTransition=function(){return De.H.useTransition()};ne.version="19.2.4"});var Qe=Xn((tI,Kb)=>{"use strict";Kb.exports=Xb()});var Jb=Xn(Dt=>{"use strict";var uR=Qe();function Qb(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sr(){}var Nt={d:{f:sr,r:function(){throw Error(Qb(522))},D:sr,C:sr,L:sr,m:sr,X:sr,S:sr,M:sr},p:0,findDOMNode:null},dR=Symbol.for("react.portal");function fR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Hs=uR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Vc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Nt;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Qb(299));return fR(t,e,null,n)};Dt.flushSync=function(t){var e=Hs.T,n=Nt.p;try{if(Hs.T=null,Nt.p=2,t)return t()}finally{Hs.T=e,Nt.p=n,Nt.d.f()}};Dt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Nt.d.C(t,e))};Dt.prefetchDNS=function(t){typeof t=="string"&&Nt.d.D(t)};Dt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Vc(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Nt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:o}):n==="script"&&Nt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Dt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Vc(e.as,e.crossOrigin);Nt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Nt.d.M(t)};Dt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Vc(n,e.crossOrigin);Nt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Dt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Vc(e.as,e.crossOrigin);Nt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Nt.d.m(t)};Dt.requestFormReset=function(t){Nt.d.r(t)};Dt.unstable_batchedUpdates=function(t,e){return t(e)};Dt.useFormState=function(t,e,n){return Hs.H.useFormState(t,e,n)};Dt.useFormStatus=function(){return Hs.H.useHostTransitionStatus()};Dt.version="19.2.4"});var zs=Xn((iI,t0)=>{"use strict";function e0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e0)}catch(t){console.error(t)}}e0(),t0.exports=Jb()});var d0=Xn(ze=>{"use strict";function _p(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<jc(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Qn(t){return t.length===0?null:t[0]}function qc(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,o=r>>>1;i<o;){var a=2*(i+1)-1,s=t[a],l=a+1,c=t[l];if(0>jc(s,n))l<r&&0>jc(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[a]=n,i=a);else if(l<r&&0>jc(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function jc(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(n0=performance,ze.unstable_now=function(){return n0.now()}):(vp=Date,i0=vp.now(),ze.unstable_now=function(){return vp.now()-i0});var n0,vp,i0,gi=[],lr=[],pR=1,gn=null,At=3,xp=!1,Bs=!1,$s=!1,Sp=!1,a0=typeof setTimeout=="function"?setTimeout:null,s0=typeof clearTimeout=="function"?clearTimeout:null,r0=typeof setImmediate<"u"?setImmediate:null;function Pc(t){for(var e=Qn(lr);e!==null;){if(e.callback===null)qc(lr);else if(e.startTime<=t)qc(lr),e.sortIndex=e.expirationTime,_p(gi,e);else break;e=Qn(lr)}}function wp(t){if($s=!1,Pc(t),!Bs)if(Qn(gi)!==null)Bs=!0,ca||(ca=!0,la());else{var e=Qn(lr);e!==null&&Ep(wp,e.startTime-t)}}var ca=!1,Fs=-1,l0=5,c0=-1;function u0(){return Sp?!0:!(ze.unstable_now()-c0<l0)}function yp(){if(Sp=!1,ca){var t=ze.unstable_now();c0=t;var e=!0;try{e:{Bs=!1,$s&&($s=!1,s0(Fs),Fs=-1),xp=!0;var n=At;try{t:{for(Pc(t),gn=Qn(gi);gn!==null&&!(gn.expirationTime>t&&u0());){var i=gn.callback;if(typeof i=="function"){gn.callback=null,At=gn.priorityLevel;var r=i(gn.expirationTime<=t);if(t=ze.unstable_now(),typeof r=="function"){gn.callback=r,Pc(t),e=!0;break t}gn===Qn(gi)&&qc(gi),Pc(t)}else qc(gi);gn=Qn(gi)}if(gn!==null)e=!0;else{var o=Qn(lr);o!==null&&Ep(wp,o.startTime-t),e=!1}}break e}finally{gn=null,At=n,xp=!1}e=void 0}}finally{e?la():ca=!1}}}var la;typeof r0=="function"?la=function(){r0(yp)}:typeof MessageChannel<"u"?(bp=new MessageChannel,o0=bp.port2,bp.port1.onmessage=yp,la=function(){o0.postMessage(null)}):la=function(){a0(yp,0)};var bp,o0;function Ep(t,e){Fs=a0(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):l0=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return At};ze.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var n=At;At=e;try{return t()}finally{At=n}};ze.unstable_requestPaint=function(){Sp=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=At;At=t;try{return e()}finally{At=n}};ze.unstable_scheduleCallback=function(t,e,n){var i=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:pR++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,_p(lr,t),Qn(gi)===null&&t===Qn(lr)&&($s?(s0(Fs),Fs=-1):$s=!0,Ep(wp,n-i))):(t.sortIndex=r,_p(gi,t),Bs||xp||(Bs=!0,ca||(ca=!0,la()))),t};ze.unstable_shouldYield=u0;ze.unstable_wrapCallback=function(t){var e=At;return function(){var n=At;At=e;try{return t.apply(this,arguments)}finally{At=n}}}});var p0=Xn((oI,f0)=>{"use strict";f0.exports=d0()});var C1=Xn(md=>{"use strict";var at=p0(),$_=Qe(),hR=zs();function O(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function F_(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Al(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function U_(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function V_(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function h0(t){if(Al(t)!==t)throw Error(O(188))}function gR(t){var e=t.alternate;if(!e){if(e=Al(t),e===null)throw Error(O(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return h0(r),t;if(o===i)return h0(r),e;o=o.sibling}throw Error(O(188))}if(n.return!==i.return)n=r,i=o;else{for(var a=!1,s=r.child;s;){if(s===n){a=!0,n=r,i=o;break}if(s===i){a=!0,i=r,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,i=r;break}if(s===i){a=!0,i=o,n=r;break}s=s.sibling}if(!a)throw Error(O(189))}}if(n.alternate!==i)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?t:e}function j_(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=j_(t),e!==null)return e;t=t.sibling}return null}var He=Object.assign,mR=Symbol.for("react.element"),Zc=Symbol.for("react.transitional.element"),Ys=Symbol.for("react.portal"),ga=Symbol.for("react.fragment"),P_=Symbol.for("react.strict_mode"),rh=Symbol.for("react.profiler"),q_=Symbol.for("react.consumer"),wi=Symbol.for("react.context"),Jh=Symbol.for("react.forward_ref"),oh=Symbol.for("react.suspense"),ah=Symbol.for("react.suspense_list"),eg=Symbol.for("react.memo"),cr=Symbol.for("react.lazy"),sh=Symbol.for("react.activity"),vR=Symbol.for("react.memo_cache_sentinel"),g0=Symbol.iterator;function Us(t){return t===null||typeof t!="object"?null:(t=g0&&t[g0]||t["@@iterator"],typeof t=="function"?t:null)}var yR=Symbol.for("react.client.reference");function lh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===yR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ga:return"Fragment";case rh:return"Profiler";case P_:return"StrictMode";case oh:return"Suspense";case ah:return"SuspenseList";case sh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Ys:return"Portal";case wi:return t.displayName||"Context";case q_:return(t._context.displayName||"Context")+".Consumer";case Jh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case eg:return e=t.displayName||null,e!==null?e:lh(t.type)||"Memo";case cr:e=t._payload,t=t._init;try{return lh(t(e))}catch{}}return null}var Ws=Array.isArray,Q=$_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=hR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,po={pending:!1,data:null,method:null,action:null},ch=[],ma=-1;function ii(t){return{current:t}}function ft(t){0>ma||(t.current=ch[ma],ch[ma]=null,ma--)}function Re(t,e){ma++,ch[ma]=t.current,t.current=e}var ni=ii(null),fl=ii(null),_r=ii(null),Cu=ii(null);function Au(t,e){switch(Re(_r,e),Re(fl,t),Re(ni,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?S_(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=S_(e),t=d1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ft(ni),Re(ni,t)}function La(){ft(ni),ft(fl),ft(_r)}function uh(t){t.memoizedState!==null&&Re(Cu,t);var e=ni.current,n=d1(e,t.type);e!==n&&(Re(fl,t),Re(ni,n))}function ku(t){fl.current===t&&(ft(ni),ft(fl)),Cu.current===t&&(ft(Cu),wl._currentValue=po)}var Cp,m0;function lo(t){if(Cp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Cp=e&&e[1]||"",m0=-1<n.stack.indexOf(`
1
+ var iR=Object.create;var Wc=Object.defineProperty;var rR=Object.getOwnPropertyDescriptor;var oR=Object.getOwnPropertyNames;var aR=Object.getPrototypeOf,sR=Object.prototype.hasOwnProperty;var i0=t=>{throw TypeError(t)};var lR=(t,e,n)=>e in t?Wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Xn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),cR=(t,e)=>{for(var n in e)Wc(t,n,{get:e[n],enumerable:!0})},uR=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oR(e))!sR.call(t,r)&&r!==n&&Wc(t,r,{get:()=>e[r],enumerable:!(i=rR(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?iR(aR(t)):{},uR(e||!t||!t.__esModule?Wc(n,"default",{value:t,enumerable:!0}):n,t));var j=(t,e,n)=>lR(t,typeof e!="symbol"?e+"":e,n),r0=(t,e,n)=>e.has(t)||i0("Cannot "+n);var ge=(t,e,n)=>(r0(t,e,"read from private field"),n?n.call(t):e.get(t)),ar=(t,e,n)=>e.has(t)?i0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kn=(t,e,n,i)=>(r0(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var g0=Xn(ie=>{"use strict";var _p=Symbol.for("react.transitional.element"),dR=Symbol.for("react.portal"),fR=Symbol.for("react.fragment"),pR=Symbol.for("react.strict_mode"),hR=Symbol.for("react.profiler"),gR=Symbol.for("react.consumer"),mR=Symbol.for("react.context"),vR=Symbol.for("react.forward_ref"),yR=Symbol.for("react.suspense"),bR=Symbol.for("react.memo"),c0=Symbol.for("react.lazy"),_R=Symbol.for("react.activity"),o0=Symbol.iterator;function SR(t){return t===null||typeof t!="object"?null:(t=o0&&t[o0]||t["@@iterator"],typeof t=="function"?t:null)}var u0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d0=Object.assign,f0={};function la(t,e,n){this.props=t,this.context=e,this.refs=f0,this.updater=n||u0}la.prototype.isReactComponent={};la.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};la.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function p0(){}p0.prototype=la.prototype;function Sp(t,e,n){this.props=t,this.context=e,this.refs=f0,this.updater=n||u0}var xp=Sp.prototype=new p0;xp.constructor=Sp;d0(xp,la.prototype);xp.isPureReactComponent=!0;var a0=Array.isArray;function bp(){}var Ne={H:null,A:null,T:null,S:null},h0=Object.prototype.hasOwnProperty;function wp(t,e,n){var i=n.ref;return{$$typeof:_p,type:t,key:e,ref:i!==void 0?i:null,props:n}}function xR(t,e){return wp(t.type,e,t.props)}function Ep(t){return typeof t=="object"&&t!==null&&t.$$typeof===_p}function wR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var s0=/\/+/g;function yp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?wR(""+t.key):e.toString(36)}function ER(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(bp,bp):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function sa(t,e,n,i,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case _p:case dR:a=!0;break;case c0:return a=t._init,sa(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+yp(t,0):i,a0(r)?(n="",a!=null&&(n=a.replace(s0,"$&/")+"/"),sa(r,e,n,"",function(c){return c})):r!=null&&(Ep(r)&&(r=xR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(s0,"$&/")+"/")+a)),e.push(r)),1;a=0;var s=i===""?".":i+":";if(a0(t))for(var l=0;l<t.length;l++)i=t[l],o=s+yp(i,l),a+=sa(i,e,n,o,r);else if(l=SR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,o=s+yp(i,l++),a+=sa(i,e,n,o,r);else if(o==="object"){if(typeof t.then=="function")return sa(ER(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function Xc(t,e,n){if(t==null)return t;var i=[],r=0;return sa(t,i,"","",function(o){return e.call(n,o,r++)}),i}function CR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var l0=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},AR={map:Xc,forEach:function(t,e,n){Xc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Xc(t,function(){e++}),e},toArray:function(t){return Xc(t,function(e){return e})||[]},only:function(t){if(!Ep(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ie.Activity=_R;ie.Children=AR;ie.Component=la;ie.Fragment=fR;ie.Profiler=hR;ie.PureComponent=Sp;ie.StrictMode=pR;ie.Suspense=yR;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ne;ie.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ne.H.useMemoCache(t)}};ie.cache=function(t){return function(){return t.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=d0({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!h0.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return wp(t.type,r,i)};ie.createContext=function(t){return t={$$typeof:mR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:gR,_context:t},t};ie.createElement=function(t,e,n){var i,r={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)h0.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return wp(t,o,r)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(t){return{$$typeof:vR,render:t}};ie.isValidElement=Ep;ie.lazy=function(t){return{$$typeof:c0,_payload:{_status:-1,_result:t},_init:CR}};ie.memo=function(t,e){return{$$typeof:bR,type:t,compare:e===void 0?null:e}};ie.startTransition=function(t){var e=Ne.T,n={};Ne.T=n;try{var i=t(),r=Ne.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(bp,l0)}catch(o){l0(o)}finally{e!==null&&n.types!==null&&(e.types=n.types),Ne.T=e}};ie.unstable_useCacheRefresh=function(){return Ne.H.useCacheRefresh()};ie.use=function(t){return Ne.H.use(t)};ie.useActionState=function(t,e,n){return Ne.H.useActionState(t,e,n)};ie.useCallback=function(t,e){return Ne.H.useCallback(t,e)};ie.useContext=function(t){return Ne.H.useContext(t)};ie.useDebugValue=function(){};ie.useDeferredValue=function(t,e){return Ne.H.useDeferredValue(t,e)};ie.useEffect=function(t,e){return Ne.H.useEffect(t,e)};ie.useEffectEvent=function(t){return Ne.H.useEffectEvent(t)};ie.useId=function(){return Ne.H.useId()};ie.useImperativeHandle=function(t,e,n){return Ne.H.useImperativeHandle(t,e,n)};ie.useInsertionEffect=function(t,e){return Ne.H.useInsertionEffect(t,e)};ie.useLayoutEffect=function(t,e){return Ne.H.useLayoutEffect(t,e)};ie.useMemo=function(t,e){return Ne.H.useMemo(t,e)};ie.useOptimistic=function(t,e){return Ne.H.useOptimistic(t,e)};ie.useReducer=function(t,e,n){return Ne.H.useReducer(t,e,n)};ie.useRef=function(t){return Ne.H.useRef(t)};ie.useState=function(t){return Ne.H.useState(t)};ie.useSyncExternalStore=function(t,e,n){return Ne.H.useSyncExternalStore(t,e,n)};ie.useTransition=function(){return Ne.H.useTransition()};ie.version="19.2.4"});var Qe=Xn((pI,m0)=>{"use strict";m0.exports=g0()});var y0=Xn(Dt=>{"use strict";var TR=Qe();function v0(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sr(){}var Nt={d:{f:sr,r:function(){throw Error(v0(522))},D:sr,C:sr,L:sr,m:sr,X:sr,S:sr,M:sr},p:0,findDOMNode:null},kR=Symbol.for("react.portal");function RR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:kR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Bs=TR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Kc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Nt;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(v0(299));return RR(t,e,null,n)};Dt.flushSync=function(t){var e=Bs.T,n=Nt.p;try{if(Bs.T=null,Nt.p=2,t)return t()}finally{Bs.T=e,Nt.p=n,Nt.d.f()}};Dt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Nt.d.C(t,e))};Dt.prefetchDNS=function(t){typeof t=="string"&&Nt.d.D(t)};Dt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Kc(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Nt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:o}):n==="script"&&Nt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Dt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Kc(e.as,e.crossOrigin);Nt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Nt.d.M(t)};Dt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Kc(n,e.crossOrigin);Nt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Dt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Kc(e.as,e.crossOrigin);Nt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Nt.d.m(t)};Dt.requestFormReset=function(t){Nt.d.r(t)};Dt.unstable_batchedUpdates=function(t,e){return t(e)};Dt.useFormState=function(t,e,n){return Bs.H.useFormState(t,e,n)};Dt.useFormStatus=function(){return Bs.H.useHostTransitionStatus()};Dt.version="19.2.4"});var Fs=Xn((gI,_0)=>{"use strict";function b0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(b0)}catch(t){console.error(t)}}b0(),_0.exports=y0()});var O0=Xn(ze=>{"use strict";function kp(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Qc(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Qn(t){return t.length===0?null:t[0]}function eu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,o=r>>>1;i<o;){var a=2*(i+1)-1,s=t[a],l=a+1,c=t[l];if(0>Qc(s,n))l<r&&0>Qc(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[a]=n,i=a);else if(l<r&&0>Qc(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function Qc(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(S0=performance,ze.unstable_now=function(){return S0.now()}):(Cp=Date,x0=Cp.now(),ze.unstable_now=function(){return Cp.now()-x0});var S0,Cp,x0,gi=[],lr=[],OR=1,gn=null,At=3,Rp=!1,$s=!1,Us=!1,Op=!1,C0=typeof setTimeout=="function"?setTimeout:null,A0=typeof clearTimeout=="function"?clearTimeout:null,w0=typeof setImmediate<"u"?setImmediate:null;function Jc(t){for(var e=Qn(lr);e!==null;){if(e.callback===null)eu(lr);else if(e.startTime<=t)eu(lr),e.sortIndex=e.expirationTime,kp(gi,e);else break;e=Qn(lr)}}function Mp(t){if(Us=!1,Jc(t),!$s)if(Qn(gi)!==null)$s=!0,ua||(ua=!0,ca());else{var e=Qn(lr);e!==null&&Np(Mp,e.startTime-t)}}var ua=!1,Vs=-1,T0=5,k0=-1;function R0(){return Op?!0:!(ze.unstable_now()-k0<T0)}function Ap(){if(Op=!1,ua){var t=ze.unstable_now();k0=t;var e=!0;try{e:{$s=!1,Us&&(Us=!1,A0(Vs),Vs=-1),Rp=!0;var n=At;try{t:{for(Jc(t),gn=Qn(gi);gn!==null&&!(gn.expirationTime>t&&R0());){var i=gn.callback;if(typeof i=="function"){gn.callback=null,At=gn.priorityLevel;var r=i(gn.expirationTime<=t);if(t=ze.unstable_now(),typeof r=="function"){gn.callback=r,Jc(t),e=!0;break t}gn===Qn(gi)&&eu(gi),Jc(t)}else eu(gi);gn=Qn(gi)}if(gn!==null)e=!0;else{var o=Qn(lr);o!==null&&Np(Mp,o.startTime-t),e=!1}}break e}finally{gn=null,At=n,Rp=!1}e=void 0}}finally{e?ca():ua=!1}}}var ca;typeof w0=="function"?ca=function(){w0(Ap)}:typeof MessageChannel<"u"?(Tp=new MessageChannel,E0=Tp.port2,Tp.port1.onmessage=Ap,ca=function(){E0.postMessage(null)}):ca=function(){C0(Ap,0)};var Tp,E0;function Np(t,e){Vs=C0(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T0=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return At};ze.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var n=At;At=e;try{return t()}finally{At=n}};ze.unstable_requestPaint=function(){Op=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=At;At=t;try{return e()}finally{At=n}};ze.unstable_scheduleCallback=function(t,e,n){var i=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:OR++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,kp(lr,t),Qn(gi)===null&&t===Qn(lr)&&(Us?(A0(Vs),Vs=-1):Us=!0,Np(Mp,n-i))):(t.sortIndex=r,kp(gi,t),$s||Rp||($s=!0,ua||(ua=!0,ca()))),t};ze.unstable_shouldYield=R0;ze.unstable_wrapCallback=function(t){var e=At;return function(){var n=At;At=e;try{return t.apply(this,arguments)}finally{At=n}}}});var N0=Xn((vI,M0)=>{"use strict";M0.exports=O0()});var Pw=Xn(Cd=>{"use strict";var ot=N0(),rS=Qe(),MR=Fs();function O(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function oS(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function kl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function aS(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function sS(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function D0(t){if(kl(t)!==t)throw Error(O(188))}function NR(t){var e=t.alternate;if(!e){if(e=kl(t),e===null)throw Error(O(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return D0(r),t;if(o===i)return D0(r),e;o=o.sibling}throw Error(O(188))}if(n.return!==i.return)n=r,i=o;else{for(var a=!1,s=r.child;s;){if(s===n){a=!0,n=r,i=o;break}if(s===i){a=!0,i=r,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,i=r;break}if(s===i){a=!0,i=o,n=r;break}s=s.sibling}if(!a)throw Error(O(189))}}if(n.alternate!==i)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?t:e}function lS(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=lS(t),e!==null)return e;t=t.sibling}return null}var Ie=Object.assign,DR=Symbol.for("react.element"),tu=Symbol.for("react.transitional.element"),Xs=Symbol.for("react.portal"),ma=Symbol.for("react.fragment"),cS=Symbol.for("react.strict_mode"),fh=Symbol.for("react.profiler"),uS=Symbol.for("react.consumer"),wi=Symbol.for("react.context"),sg=Symbol.for("react.forward_ref"),ph=Symbol.for("react.suspense"),hh=Symbol.for("react.suspense_list"),lg=Symbol.for("react.memo"),cr=Symbol.for("react.lazy"),gh=Symbol.for("react.activity"),LR=Symbol.for("react.memo_cache_sentinel"),L0=Symbol.iterator;function js(t){return t===null||typeof t!="object"?null:(t=L0&&t[L0]||t["@@iterator"],typeof t=="function"?t:null)}var IR=Symbol.for("react.client.reference");function mh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===IR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ma:return"Fragment";case fh:return"Profiler";case cS:return"StrictMode";case ph:return"Suspense";case hh:return"SuspenseList";case gh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Xs:return"Portal";case wi:return t.displayName||"Context";case uS:return(t._context.displayName||"Context")+".Consumer";case sg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lg:return e=t.displayName||null,e!==null?e:mh(t.type)||"Memo";case cr:e=t._payload,t=t._init;try{return mh(t(e))}catch{}}return null}var Ks=Array.isArray,Q=rS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=MR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ho={pending:!1,data:null,method:null,action:null},vh=[],va=-1;function ii(t){return{current:t}}function ft(t){0>va||(t.current=vh[va],vh[va]=null,va--)}function Re(t,e){va++,vh[va]=t.current,t.current=e}var ni=ii(null),hl=ii(null),_r=ii(null),Lu=ii(null);function Iu(t,e){switch(Re(_r,e),Re(hl,t),Re(ni,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?U_(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=U_(e),t=Ow(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ft(ni),Re(ni,t)}function Ia(){ft(ni),ft(hl),ft(_r)}function yh(t){t.memoizedState!==null&&Re(Lu,t);var e=ni.current,n=Ow(e,t.type);e!==n&&(Re(hl,t),Re(ni,n))}function Hu(t){hl.current===t&&(ft(ni),ft(hl)),Lu.current===t&&(ft(Lu),Cl._currentValue=ho)}var Dp,I0;function co(t){if(Dp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Dp=e&&e[1]||"",I0=-1<n.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Cp+t+m0}var Ap=!1;function kp(t,e){if(!t||Ap)return"";Ap=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var p=g}Reflect.construct(t,[],d)}else{try{d.call()}catch(g){p=g}t.call(d.prototype)}}else{try{throw Error()}catch(g){p=g}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack=="string")return[g.stack,p.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var l=a.split(`
3
+ `+Dp+t+I0}var Lp=!1;function Ip(t,e){if(!t||Lp)return"";Lp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var h=g}Reflect.construct(t,[],d)}else{try{d.call()}catch(g){h=g}t.call(d.prototype)}}else{try{throw Error()}catch(g){h=g}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(g){if(g&&h&&typeof g.stack=="string")return[g.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var l=a.split(`
4
4
  `),c=s.split(`
5
5
  `);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
6
- `+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{Ap=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?lo(n):""}function bR(t,e){switch(t.tag){case 26:case 27:case 5:return lo(t.type);case 16:return lo("Lazy");case 13:return t.child!==e&&e!==null?lo("Suspense Fallback"):lo("Suspense");case 19:return lo("SuspenseList");case 0:case 15:return kp(t.type,!1);case 11:return kp(t.type.render,!1);case 1:return kp(t.type,!0);case 31:return lo("Activity");default:return""}}function v0(t){try{var e="",n=null;do e+=bR(t,n),n=t,t=t.return;while(t);return e}catch(i){return`
6
+ `+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{Lp=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?co(n):""}function HR(t,e){switch(t.tag){case 26:case 27:case 5:return co(t.type);case 16:return co("Lazy");case 13:return t.child!==e&&e!==null?co("Suspense Fallback"):co("Suspense");case 19:return co("SuspenseList");case 0:case 15:return Ip(t.type,!1);case 11:return Ip(t.type.render,!1);case 1:return Ip(t.type,!0);case 31:return co("Activity");default:return""}}function H0(t){try{var e="",n=null;do e+=HR(t,n),n=t,t=t.return;while(t);return e}catch(i){return`
7
7
  Error generating stack: `+i.message+`
8
- `+i.stack}}var dh=Object.prototype.hasOwnProperty,tg=at.unstable_scheduleCallback,Tp=at.unstable_cancelCallback,_R=at.unstable_shouldYield,xR=at.unstable_requestPaint,rn=at.unstable_now,SR=at.unstable_getCurrentPriorityLevel,Z_=at.unstable_ImmediatePriority,G_=at.unstable_UserBlockingPriority,Tu=at.unstable_NormalPriority,wR=at.unstable_LowPriority,Y_=at.unstable_IdlePriority,ER=at.log,CR=at.unstable_setDisableYieldValue,kl=null,on=null;function gr(t){if(typeof ER=="function"&&CR(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(kl,t)}catch{}}var an=Math.clz32?Math.clz32:TR,AR=Math.log,kR=Math.LN2;function TR(t){return t>>>=0,t===0?32:31-(AR(t)/kR|0)|0}var Gc=256,Yc=262144,Wc=4194304;function co(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ed(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,o=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~o,i!==0?r=co(i):(a&=s,a!==0?r=co(a):n||(n=s&~t,n!==0&&(r=co(n))))):(s=i&~o,s!==0?r=co(s):a!==0?r=co(a):n||(n=i&~t,n!==0&&(r=co(n)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,n=e&-e,o>=n||o===32&&(n&4194048)!==0)?e:r}function Tl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function RR(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function W_(){var t=Wc;return Wc<<=1,(Wc&62914560)===0&&(Wc=4194304),t}function Rp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Rl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function OR(t,e,n,i,r,o){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-an(n),d=1<<u;s[u]=0,l[u]=-1;var p=c[u];if(p!==null)for(c[u]=null,u=0;u<p.length;u++){var g=p[u];g!==null&&(g.lane&=-536870913)}n&=~d}i!==0&&X_(t,i,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(a&~e))}function X_(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function K_(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Q_(t,e){var n=e&-e;return n=(n&42)!==0?1:ng(n),(n&(t.suspendedLanes|e))!==0?0:n}function ng(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ig(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function J_(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:S1(t.type))}function y0(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var Dr=Math.random().toString(36).slice(2),mt="__reactFiber$"+Dr,jt="__reactProps$"+Dr,qa="__reactContainer$"+Dr,fh="__reactEvents$"+Dr,MR="__reactListeners$"+Dr,NR="__reactHandles$"+Dr,b0="__reactResources$"+Dr,Ol="__reactMarker$"+Dr;function rg(t){delete t[mt],delete t[jt],delete t[fh],delete t[MR],delete t[NR]}function va(t){var e=t[mt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[qa]||n[mt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=k_(t);t!==null;){if(n=t[mt])return n;t=k_(t)}return e}t=n,n=t.parentNode}return null}function Za(t){if(t=t[mt]||t[qa]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Xs(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(O(33))}function ka(t){var e=t[b0];return e||(e=t[b0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function dt(t){t[Ol]=!0}var ex=new Set,tx={};function wo(t,e){Ia(t,e),Ia(t+"Capture",e)}function Ia(t,e){for(tx[t]=e,t=0;t<e.length;t++)ex.add(e[t])}var DR=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),_0={},x0={};function LR(t){return dh.call(x0,t)?!0:dh.call(_0,t)?!1:DR.test(t)?x0[t]=!0:(_0[t]=!0,!1)}function uu(t,e,n){if(LR(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Xc(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function mi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nx(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function IR(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,o=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ph(t){if(!t._valueTracker){var e=nx(t)?"checked":"value";t._valueTracker=IR(t,e,""+t[e])}}function ix(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=nx(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Ru(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var HR=/[\n"\\]/g;function _n(t){return t.replace(HR,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function hh(t,e,n,i,r,o,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+vn(e)):t.value!==""+vn(e)&&(t.value=""+vn(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?gh(t,a,vn(e)):n!=null?gh(t,a,vn(n)):i!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+vn(s):t.removeAttribute("name")}function rx(t,e,n,i,r,o,a,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){ph(t);return}n=n!=null?""+vn(n):"",e=e!=null?""+vn(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),ph(t)}function gh(t,e,n){e==="number"&&Ru(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ta(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+vn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function ox(t,e,n){if(e!=null&&(e=""+vn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+vn(n):""}function ax(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(O(92));if(Ws(i)){if(1<i.length)throw Error(O(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=vn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),ph(t)}function Ha(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var zR=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function S0(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||zR.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function sx(t,e,n){if(e!=null&&typeof e!="object")throw Error(O(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&S0(t,r,i)}else for(var o in e)e.hasOwnProperty(o)&&S0(t,o,e[o])}function og(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var BR=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$R=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function du(t){return $R.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ei(){}var mh=null;function ag(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ya=null,Ra=null;function w0(t){var e=Za(t);if(e&&(t=e.stateNode)){var n=t[jt]||null;e:switch(t=e.stateNode,e.type){case"input":if(hh(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[jt]||null;if(!r)throw Error(O(90));hh(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&ix(i)}break e;case"textarea":ox(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Ta(t,!!n.multiple,e,!1)}}}var Op=!1;function lx(t,e,n){if(Op)return t(e,n);Op=!0;try{var i=t(e);return i}finally{if(Op=!1,(ya!==null||Ra!==null)&&(fd(),ya&&(e=ya,t=Ra,Ra=ya=null,w0(e),t)))for(e=0;e<t.length;e++)w0(t[e])}}function pl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[jt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(O(231,e,typeof n));return n}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vh=!1;if(Ri)try{ua={},Object.defineProperty(ua,"passive",{get:function(){vh=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{vh=!1}var ua,mr=null,sg=null,fu=null;function cx(){if(fu)return fu;var t,e=sg,n=e.length,i,r="value"in mr?mr.value:mr.textContent,o=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[o-i];i++);return fu=r.slice(t,1<i?1-i:void 0)}function pu(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Kc(){return!0}function E0(){return!1}function Pt(t){function e(n,i,r,o,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Kc:E0,this.isPropagationStopped=E0,this}return He(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Kc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kc)},persist:function(){},isPersistent:Kc}),e}var Eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=Pt(Eo),Ml=He({},Eo,{view:0,detail:0}),FR=Pt(Ml),Mp,Np,Vs,nd=He({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Vs&&(Vs&&t.type==="mousemove"?(Mp=t.screenX-Vs.screenX,Np=t.screenY-Vs.screenY):Np=Mp=0,Vs=t),Mp)},movementY:function(t){return"movementY"in t?t.movementY:Np}}),C0=Pt(nd),UR=He({},nd,{dataTransfer:0}),VR=Pt(UR),jR=He({},Ml,{relatedTarget:0}),Dp=Pt(jR),PR=He({},Eo,{animationName:0,elapsedTime:0,pseudoElement:0}),qR=Pt(PR),ZR=He({},Eo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),GR=Pt(ZR),YR=He({},Eo,{data:0}),A0=Pt(YR),WR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=KR[t])?!!e[t]:!1}function lg(){return QR}var JR=He({},Ml,{key:function(t){if(t.key){var e=WR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=pu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?XR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lg,charCode:function(t){return t.type==="keypress"?pu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),e2=Pt(JR),t2=He({},nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k0=Pt(t2),n2=He({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lg}),i2=Pt(n2),r2=He({},Eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),o2=Pt(r2),a2=He({},nd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),s2=Pt(a2),l2=He({},Eo,{newState:0,oldState:0}),c2=Pt(l2),u2=[9,13,27,32],cg=Ri&&"CompositionEvent"in window,Js=null;Ri&&"documentMode"in document&&(Js=document.documentMode);var d2=Ri&&"TextEvent"in window&&!Js,ux=Ri&&(!cg||Js&&8<Js&&11>=Js),T0=" ",R0=!1;function dx(t,e){switch(t){case"keyup":return u2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ba=!1;function f2(t,e){switch(t){case"compositionend":return fx(e);case"keypress":return e.which!==32?null:(R0=!0,T0);case"textInput":return t=e.data,t===T0&&R0?null:t;default:return null}}function p2(t,e){if(ba)return t==="compositionend"||!cg&&dx(t,e)?(t=cx(),fu=sg=mr=null,ba=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return ux&&e.locale!=="ko"?null:e.data;default:return null}}var h2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function O0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!h2[t.type]:e==="textarea"}function px(t,e,n,i){ya?Ra?Ra.push(i):Ra=[i]:ya=i,e=Gu(e,"onChange"),0<e.length&&(n=new td("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var el=null,hl=null;function g2(t){l1(t,0)}function id(t){var e=Xs(t);if(ix(e))return t}function M0(t,e){if(t==="change")return e}var hx=!1;Ri&&(Ri?(Jc="oninput"in document,Jc||(Lp=document.createElement("div"),Lp.setAttribute("oninput","return;"),Jc=typeof Lp.oninput=="function"),Qc=Jc):Qc=!1,hx=Qc&&(!document.documentMode||9<document.documentMode));var Qc,Jc,Lp;function N0(){el&&(el.detachEvent("onpropertychange",gx),hl=el=null)}function gx(t){if(t.propertyName==="value"&&id(hl)){var e=[];px(e,hl,t,ag(t)),lx(g2,e)}}function m2(t,e,n){t==="focusin"?(N0(),el=e,hl=n,el.attachEvent("onpropertychange",gx)):t==="focusout"&&N0()}function v2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return id(hl)}function y2(t,e){if(t==="click")return id(e)}function b2(t,e){if(t==="input"||t==="change")return id(e)}function _2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ln=typeof Object.is=="function"?Object.is:_2;function gl(t,e){if(ln(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!dh.call(e,r)||!ln(t[r],e[r]))return!1}return!0}function D0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function L0(t,e){var n=D0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=D0(n)}}function mx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?mx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function vx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ru(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ru(t.document)}return e}function ug(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var x2=Ri&&"documentMode"in document&&11>=document.documentMode,_a=null,yh=null,tl=null,bh=!1;function I0(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bh||_a==null||_a!==Ru(i)||(i=_a,"selectionStart"in i&&ug(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),tl&&gl(tl,i)||(tl=i,i=Gu(yh,"onSelect"),0<i.length&&(e=new td("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=_a)))}function so(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xa={animationend:so("Animation","AnimationEnd"),animationiteration:so("Animation","AnimationIteration"),animationstart:so("Animation","AnimationStart"),transitionrun:so("Transition","TransitionRun"),transitionstart:so("Transition","TransitionStart"),transitioncancel:so("Transition","TransitionCancel"),transitionend:so("Transition","TransitionEnd")},Ip={},yx={};Ri&&(yx=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Co(t){if(Ip[t])return Ip[t];if(!xa[t])return t;var e=xa[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in yx)return Ip[t]=e[n];return t}var bx=Co("animationend"),_x=Co("animationiteration"),xx=Co("animationstart"),S2=Co("transitionrun"),w2=Co("transitionstart"),E2=Co("transitioncancel"),Sx=Co("transitionend"),wx=new Map,_h="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_h.push("scrollEnd");function $n(t,e){wx.set(t,e),wo(e,[t])}var Ou=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mn=[],Sa=0,dg=0;function rd(){for(var t=Sa,e=dg=Sa=0;e<t;){var n=mn[e];mn[e++]=null;var i=mn[e];mn[e++]=null;var r=mn[e];mn[e++]=null;var o=mn[e];if(mn[e++]=null,i!==null&&r!==null){var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}o!==0&&Ex(n,r,o)}}function od(t,e,n,i){mn[Sa++]=t,mn[Sa++]=e,mn[Sa++]=n,mn[Sa++]=i,dg|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function fg(t,e,n,i){return od(t,e,n,i),Mu(t)}function Ao(t,e){return od(t,null,null,e),Mu(t)}function Ex(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,o=t.return;o!==null;)o.childLanes|=n,i=o.alternate,i!==null&&(i.childLanes|=n),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-an(n),t=o.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),o):null}function Mu(t){if(50<ul)throw ul=0,Uh=null,Error(O(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var wa={};function C2(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,i){return new C2(t,e,n,i)}function pg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ai(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function Cx(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function hu(t,e,n,i,r,o){var a=0;if(i=t,typeof t=="function")pg(t)&&(a=1);else if(typeof t=="string")a=TO(t,n,ni.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case sh:return t=tn(31,n,e,r),t.elementType=sh,t.lanes=o,t;case ga:return ho(n.children,r,o,e);case P_:a=8,r|=24;break;case rh:return t=tn(12,n,e,r|2),t.elementType=rh,t.lanes=o,t;case oh:return t=tn(13,n,e,r),t.elementType=oh,t.lanes=o,t;case ah:return t=tn(19,n,e,r),t.elementType=ah,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case wi:a=10;break e;case q_:a=9;break e;case Jh:a=11;break e;case eg:a=14;break e;case cr:a=16,i=null;break e}a=29,n=Error(O(130,t===null?"null":typeof t,"")),i=null}return e=tn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function ho(t,e,n,i){return t=tn(7,t,i,e),t.lanes=n,t}function Hp(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function Ax(t){var e=tn(18,null,null,0);return e.stateNode=t,e}function zp(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var H0=new WeakMap;function xn(t,e){if(typeof t=="object"&&t!==null){var n=H0.get(t);return n!==void 0?n:(e={value:t,source:e,stack:v0(e)},H0.set(t,e),e)}return{value:t,source:e,stack:v0(e)}}var Ea=[],Ca=0,Nu=null,ml=0,yn=[],bn=0,Rr=null,Jn=1,ei="";function xi(t,e){Ea[Ca++]=ml,Ea[Ca++]=Nu,Nu=t,ml=e}function kx(t,e,n){yn[bn++]=Jn,yn[bn++]=ei,yn[bn++]=Rr,Rr=t;var i=Jn;t=ei;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(e)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Jn=1<<32-an(e)+r|n<<r|i,ei=o+t}else Jn=1<<o|n<<r|i,ei=t}function hg(t){t.return!==null&&(xi(t,1),kx(t,1,0))}function gg(t){for(;t===Nu;)Nu=Ea[--Ca],Ea[Ca]=null,ml=Ea[--Ca],Ea[Ca]=null;for(;t===Rr;)Rr=yn[--bn],yn[bn]=null,ei=yn[--bn],yn[bn]=null,Jn=yn[--bn],yn[bn]=null}function Tx(t,e){yn[bn++]=Jn,yn[bn++]=ei,yn[bn++]=Rr,Jn=e.id,ei=e.overflow,Rr=t}var vt=null,Ie=null,he=!1,xr=null,Sn=!1,xh=Error(O(519));function Or(t){var e=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vl(xn(e,t)),xh}function z0(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mt]=t,e[jt]=i,n){case"dialog":le("cancel",e),le("close",e);break;case"iframe":case"object":case"embed":le("load",e);break;case"video":case"audio":for(n=0;n<xl.length;n++)le(xl[n],e);break;case"source":le("error",e);break;case"img":case"image":case"link":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"input":le("invalid",e),rx(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":le("invalid",e);break;case"textarea":le("invalid",e),ax(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||u1(e.textContent,n)?(i.popover!=null&&(le("beforetoggle",e),le("toggle",e)),i.onScroll!=null&&le("scroll",e),i.onScrollEnd!=null&&le("scrollend",e),i.onClick!=null&&(e.onclick=Ei),e=!0):e=!1,e||Or(t,!0)}function B0(t){for(vt=t.return;vt;)switch(vt.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:vt=vt.return}}function da(t){if(t!==vt)return!1;if(!he)return B0(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Zh(t.type,t.memoizedProps)),n=!n),n&&Ie&&Or(t),B0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));Ie=A_(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));Ie=A_(t)}else e===27?(e=Ie,Lr(t.type)?(t=Xh,Xh=null,Ie=t):Ie=e):Ie=vt?En(t.stateNode.nextSibling):null;return!0}function yo(){Ie=vt=null,he=!1}function Bp(){var t=xr;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),xr=null),t}function vl(t){xr===null?xr=[t]:xr.push(t)}var Sh=ii(null),ko=null,Ci=null;function dr(t,e,n){Re(Sh,e._currentValue),e._currentValue=n}function ki(t){t._currentValue=Sh.current,ft(Sh)}function wh(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Eh(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var a=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),wh(o.return,n,t),i||(a=null);break e}o=s.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(O(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),wh(a,n,t),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===t){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ga(t,e,n,i){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(O(387));if(a=a.memoizedProps,a!==null){var s=r.type;ln(r.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(r===Cu.current){if(a=r.alternate,a===null)throw Error(O(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(wl):t=[wl])}r=r.return}t!==null&&Eh(e,t,n,i),e.flags|=262144}function Du(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function bo(t){ko=t,Ci=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yt(t){return Rx(ko,t)}function eu(t,e){return ko===null&&bo(t),Rx(t,e)}function Rx(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ci===null){if(t===null)throw Error(O(308));Ci=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ci=Ci.next=e;return n}var A2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},k2=at.unstable_scheduleCallback,T2=at.unstable_NormalPriority,tt={$$typeof:wi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mg(){return{controller:new A2,data:new Map,refCount:0}}function Nl(t){t.refCount--,t.refCount===0&&k2(T2,function(){t.controller.abort()})}var nl=null,Ch=0,za=0,Oa=null;function R2(t,e){if(nl===null){var n=nl=[];Ch=0,za=Ug(),Oa={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Ch++,e.then($0,$0),e}function $0(){if(--Ch===0&&nl!==null){Oa!==null&&(Oa.status="fulfilled");var t=nl;nl=null,za=0,Oa=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function O2(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var F0=Q.S;Q.S=function(t,e){jS=rn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&R2(t,e),F0!==null&&F0(t,e)};var go=ii(null);function vg(){var t=go.current;return t!==null?t:Ae.pooledCache}function gu(t,e){e===null?Re(go,go.current):Re(go,e.pool)}function Ox(){var t=vg();return t===null?null:{parent:tt._currentValue,pool:t}}var Ya=Error(O(460)),yg=Error(O(474)),ad=Error(O(542)),Lu={then:function(){}};function U0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Mx(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Ei,Ei),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,j0(t),t;default:if(typeof e.status=="string")e.then(Ei,Ei);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(O(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,j0(t),t}throw mo=e,Ya}}function uo(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(mo=n,Ya):n}}var mo=null;function V0(){if(mo===null)throw Error(O(459));var t=mo;return mo=null,t}function j0(t){if(t===Ya||t===ad)throw Error(O(483))}var Ma=null,yl=0;function tu(t){var e=yl;return yl+=1,Ma===null&&(Ma=[]),Mx(Ma,t,e)}function js(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function nu(t,e){throw e.$$typeof===mR?Error(O(525)):(t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Nx(t){function e(f,h){if(t){var y=f.deletions;y===null?(f.deletions=[h],f.flags|=16):y.push(h)}}function n(f,h){if(!t)return null;for(;h!==null;)e(f,h),h=h.sibling;return null}function i(f){for(var h=new Map;f!==null;)f.key!==null?h.set(f.key,f):h.set(f.index,f),f=f.sibling;return h}function r(f,h){return f=Ai(f,h),f.index=0,f.sibling=null,f}function o(f,h,y){return f.index=y,t?(y=f.alternate,y!==null?(y=y.index,y<h?(f.flags|=67108866,h):y):(f.flags|=67108866,h)):(f.flags|=1048576,h)}function a(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,h,y,m){return h===null||h.tag!==6?(h=Hp(y,f.mode,m),h.return=f,h):(h=r(h,y),h.return=f,h)}function l(f,h,y,m){var S=y.type;return S===ga?u(f,h,y.props.children,m,y.key):h!==null&&(h.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cr&&uo(S)===h.type)?(h=r(h,y.props),js(h,y),h.return=f,h):(h=hu(y.type,y.key,y.props,null,f.mode,m),js(h,y),h.return=f,h)}function c(f,h,y,m){return h===null||h.tag!==4||h.stateNode.containerInfo!==y.containerInfo||h.stateNode.implementation!==y.implementation?(h=zp(y,f.mode,m),h.return=f,h):(h=r(h,y.children||[]),h.return=f,h)}function u(f,h,y,m,S){return h===null||h.tag!==7?(h=ho(y,f.mode,m,S),h.return=f,h):(h=r(h,y),h.return=f,h)}function d(f,h,y){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=Hp(""+h,f.mode,y),h.return=f,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Zc:return y=hu(h.type,h.key,h.props,null,f.mode,y),js(y,h),y.return=f,y;case Ys:return h=zp(h,f.mode,y),h.return=f,h;case cr:return h=uo(h),d(f,h,y)}if(Ws(h)||Us(h))return h=ho(h,f.mode,y,null),h.return=f,h;if(typeof h.then=="function")return d(f,tu(h),y);if(h.$$typeof===wi)return d(f,eu(f,h),y);nu(f,h)}return null}function p(f,h,y,m){var S=h!==null?h.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return S!==null?null:s(f,h,""+y,m);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Zc:return y.key===S?l(f,h,y,m):null;case Ys:return y.key===S?c(f,h,y,m):null;case cr:return y=uo(y),p(f,h,y,m)}if(Ws(y)||Us(y))return S!==null?null:u(f,h,y,m,null);if(typeof y.then=="function")return p(f,h,tu(y),m);if(y.$$typeof===wi)return p(f,h,eu(f,y),m);nu(f,y)}return null}function g(f,h,y,m,S){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return f=f.get(y)||null,s(h,f,""+m,S);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Zc:return f=f.get(m.key===null?y:m.key)||null,l(h,f,m,S);case Ys:return f=f.get(m.key===null?y:m.key)||null,c(h,f,m,S);case cr:return m=uo(m),g(f,h,y,m,S)}if(Ws(m)||Us(m))return f=f.get(y)||null,u(h,f,m,S,null);if(typeof m.then=="function")return g(f,h,y,tu(m),S);if(m.$$typeof===wi)return g(f,h,y,eu(h,m),S);nu(h,m)}return null}function _(f,h,y,m){for(var S=null,w=null,C=h,k=h=0,T=null;C!==null&&k<y.length;k++){C.index>k?(T=C,C=null):T=C.sibling;var E=p(f,C,y[k],m);if(E===null){C===null&&(C=T);break}t&&C&&E.alternate===null&&e(f,C),h=o(E,h,k),w===null?S=E:w.sibling=E,w=E,C=T}if(k===y.length)return n(f,C),he&&xi(f,k),S;if(C===null){for(;k<y.length;k++)C=d(f,y[k],m),C!==null&&(h=o(C,h,k),w===null?S=C:w.sibling=C,w=C);return he&&xi(f,k),S}for(C=i(C);k<y.length;k++)T=g(C,f,k,y[k],m),T!==null&&(t&&T.alternate!==null&&C.delete(T.key===null?k:T.key),h=o(T,h,k),w===null?S=T:w.sibling=T,w=T);return t&&C.forEach(function(M){return e(f,M)}),he&&xi(f,k),S}function b(f,h,y,m){if(y==null)throw Error(O(151));for(var S=null,w=null,C=h,k=h=0,T=null,E=y.next();C!==null&&!E.done;k++,E=y.next()){C.index>k?(T=C,C=null):T=C.sibling;var M=p(f,C,E.value,m);if(M===null){C===null&&(C=T);break}t&&C&&M.alternate===null&&e(f,C),h=o(M,h,k),w===null?S=M:w.sibling=M,w=M,C=T}if(E.done)return n(f,C),he&&xi(f,k),S;if(C===null){for(;!E.done;k++,E=y.next())E=d(f,E.value,m),E!==null&&(h=o(E,h,k),w===null?S=E:w.sibling=E,w=E);return he&&xi(f,k),S}for(C=i(C);!E.done;k++,E=y.next())E=g(C,f,k,E.value,m),E!==null&&(t&&E.alternate!==null&&C.delete(E.key===null?k:E.key),h=o(E,h,k),w===null?S=E:w.sibling=E,w=E);return t&&C.forEach(function(N){return e(f,N)}),he&&xi(f,k),S}function x(f,h,y,m){if(typeof y=="object"&&y!==null&&y.type===ga&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Zc:e:{for(var S=y.key;h!==null;){if(h.key===S){if(S=y.type,S===ga){if(h.tag===7){n(f,h.sibling),m=r(h,y.props.children),m.return=f,f=m;break e}}else if(h.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cr&&uo(S)===h.type){n(f,h.sibling),m=r(h,y.props),js(m,y),m.return=f,f=m;break e}n(f,h);break}else e(f,h);h=h.sibling}y.type===ga?(m=ho(y.props.children,f.mode,m,y.key),m.return=f,f=m):(m=hu(y.type,y.key,y.props,null,f.mode,m),js(m,y),m.return=f,f=m)}return a(f);case Ys:e:{for(S=y.key;h!==null;){if(h.key===S)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(f,h.sibling),m=r(h,y.children||[]),m.return=f,f=m;break e}else{n(f,h);break}else e(f,h);h=h.sibling}m=zp(y,f.mode,m),m.return=f,f=m}return a(f);case cr:return y=uo(y),x(f,h,y,m)}if(Ws(y))return _(f,h,y,m);if(Us(y)){if(S=Us(y),typeof S!="function")throw Error(O(150));return y=S.call(y),b(f,h,y,m)}if(typeof y.then=="function")return x(f,h,tu(y),m);if(y.$$typeof===wi)return x(f,h,eu(f,y),m);nu(f,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,h!==null&&h.tag===6?(n(f,h.sibling),m=r(h,y),m.return=f,f=m):(n(f,h),m=Hp(y,f.mode,m),m.return=f,f=m),a(f)):n(f,h)}return function(f,h,y,m){try{yl=0;var S=x(f,h,y,m);return Ma=null,S}catch(C){if(C===Ya||C===ad)throw C;var w=tn(29,C,null,f.mode);return w.lanes=m,w.return=f,w}}}var _o=Nx(!0),Dx=Nx(!1),ur=!1;function bg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ah(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Sr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function wr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Mu(t),Ex(t,null,n),e}return od(t,i,e,n),Mu(t)}function il(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,K_(t,n)}}function $p(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var kh=!1;function rl(){if(kh){var t=Oa;if(t!==null)throw t}}function ol(t,e,n,i){kh=!1;var r=t.updateQueue;ur=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;a=0,u=c=l=null,s=o;do{var p=s.lane&-536870913,g=p!==s.lane;if(g?(fe&p)===p:(i&p)===p){p!==0&&p===za&&(kh=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var _=t,b=s;p=e;var x=n;switch(b.tag){case 1:if(_=b.payload,typeof _=="function"){d=_.call(x,d,p);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=b.payload,p=typeof _=="function"?_.call(x,d,p):_,p==null)break e;d=He({},d,p);break e;case 2:ur=!0}}p=s.callback,p!==null&&(t.flags|=64,g&&(t.flags|=8192),g=r.callbacks,g===null?r.callbacks=[p]:g.push(p))}else g={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,a|=p;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;g=s,s=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,o===null&&(r.shared.lanes=0),Nr|=a,t.lanes=a,t.memoizedState=d}}function Lx(t,e){if(typeof t!="function")throw Error(O(191,t));t.call(e)}function Ix(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)Lx(n[t],e)}var Ba=ii(null),Iu=ii(0);function P0(t,e){t=Di,Re(Iu,t),Re(Ba,e),Di=t|e.baseLanes}function Th(){Re(Iu,Di),Re(Ba,Ba.current)}function _g(){Di=Iu.current,ft(Ba),ft(Iu)}var cn=ii(null),wn=null;function fr(t){var e=t.alternate;Re(Ye,Ye.current&1),Re(cn,t),wn===null&&(e===null||Ba.current!==null||e.memoizedState!==null)&&(wn=t)}function Rh(t){Re(Ye,Ye.current),Re(cn,t),wn===null&&(wn=t)}function Hx(t){t.tag===22?(Re(Ye,Ye.current),Re(cn,t),wn===null&&(wn=t)):pr(t)}function pr(){Re(Ye,Ye.current),Re(cn,cn.current)}function en(t){ft(cn),wn===t&&(wn=null),ft(Ye)}var Ye=ii(0);function Hu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Yh(n)||Wh(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Oi=0,re=null,Ee=null,Je=null,zu=!1,Na=!1,xo=!1,Bu=0,bl=0,Da=null,M2=0;function Ze(){throw Error(O(321))}function xg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ln(t[n],e[n]))return!1;return!0}function Sg(t,e,n,i,r,o){return Oi=o,re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q.H=t===null||t.memoizedState===null?pS:Dg,xo=!1,o=n(i,r),xo=!1,Na&&(o=Bx(e,n,i,r)),zx(t),o}function zx(t){Q.H=_l;var e=Ee!==null&&Ee.next!==null;if(Oi=0,Je=Ee=re=null,zu=!1,bl=0,Da=null,e)throw Error(O(300));t===null||nt||(t=t.dependencies,t!==null&&Du(t)&&(nt=!0))}function Bx(t,e,n,i){re=t;var r=0;do{if(Na&&(Da=null),bl=0,Na=!1,25<=r)throw Error(O(301));if(r+=1,Je=Ee=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Q.H=hS,o=e(n,i)}while(Na);return o}function N2(){var t=Q.H,e=t.useState()[0];return e=typeof e.then=="function"?Dl(e):e,t=t.useState()[0],(Ee!==null?Ee.memoizedState:null)!==t&&(re.flags|=1024),e}function wg(){var t=Bu!==0;return Bu=0,t}function Eg(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Cg(t){if(zu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}zu=!1}Oi=0,Je=Ee=re=null,Na=!1,bl=Bu=0,Da=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?re.memoizedState=Je=t:Je=Je.next=t,Je}function We(){if(Ee===null){var t=re.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Je===null?re.memoizedState:Je.next;if(e!==null)Je=e,Ee=t;else{if(t===null)throw re.alternate===null?Error(O(467)):Error(O(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Je===null?re.memoizedState=Je=t:Je=Je.next=t}return Je}function sd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(t){var e=bl;return bl+=1,Da===null&&(Da=[]),t=Mx(Da,t,e),e=re,(Je===null?e.memoizedState:Je.next)===null&&(e=e.alternate,Q.H=e===null||e.memoizedState===null?pS:Dg),t}function ld(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Dl(t);if(t.$$typeof===wi)return yt(t)}throw Error(O(438,String(t)))}function Ag(t){var e=null,n=re.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=sd(),re.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=vR;return e.index++,n}function Mi(t,e){return typeof e=="function"?e(t):e}function mu(t){var e=We();return kg(e,Ee,t)}function kg(t,e,n){var i=t.queue;if(i===null)throw Error(O(311));i.lastRenderedReducer=n;var r=t.baseQueue,o=i.pending;if(o!==null){if(r!==null){var a=r.next;r.next=o.next,o.next=a}e.baseQueue=r=o,i.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(fe&d)===d:(Oi&d)===d){var p=c.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===za&&(u=!0);else if((Oi&p)===p){c=c.next,p===za&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=o):l=l.next=d,re.lanes|=p,Nr|=p;d=c.action,xo&&n(o,d),o=c.hasEagerState?c.eagerState:n(o,d)}else p={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=p,a=o):l=l.next=p,re.lanes|=d,Nr|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=o:l.next=s,!ln(o,t.memoizedState)&&(nt=!0,u&&(n=Oa,n!==null)))throw n;t.memoizedState=o,t.baseState=a,t.baseQueue=l,i.lastRenderedState=o}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Fp(t){var e=We(),n=e.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,o=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do o=t(o,a.action),a=a.next;while(a!==r);ln(o,e.memoizedState)||(nt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,i]}function $x(t,e,n){var i=re,r=We(),o=he;if(o){if(n===void 0)throw Error(O(407));n=n()}else n=e();var a=!ln((Ee||r).memoizedState,n);if(a&&(r.memoizedState=n,nt=!0),r=r.queue,Tg(Vx.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Je!==null&&Je.memoizedState.tag&1){if(i.flags|=2048,$a(9,{destroy:void 0},Ux.bind(null,i,r,n,e),null),Ae===null)throw Error(O(349));o||(Oi&127)!==0||Fx(i,e,n)}return n}function Fx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=re.updateQueue,e===null?(e=sd(),re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Ux(t,e,n,i){e.value=n,e.getSnapshot=i,jx(e)&&Px(t)}function Vx(t,e,n){return n(function(){jx(e)&&Px(t)})}function jx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ln(t,n)}catch{return!0}}function Px(t){var e=Ao(t,2);e!==null&&Vt(e,t,2)}function Oh(t){var e=Lt();if(typeof t=="function"){var n=t;if(t=n(),xo){gr(!0);try{n()}finally{gr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:t},e}function qx(t,e,n,i){return t.baseState=n,kg(t,Ee,typeof i=="function"?i:Mi)}function D2(t,e,n,i,r){if(ud(t))throw Error(O(485));if(t=e.action,t!==null){var o={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){o.listeners.push(a)}};Q.T!==null?n(!0):o.isTransition=!1,i(o),n=e.pending,n===null?(o.next=e.pending=o,Zx(e,o)):(o.next=n.next,e.pending=n.next=o)}}function Zx(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var o=Q.T,a={};Q.T=a;try{var s=n(r,i),l=Q.S;l!==null&&l(a,s),q0(t,e,s)}catch(c){Mh(t,e,c)}finally{o!==null&&a.types!==null&&(o.types=a.types),Q.T=o}}else try{o=n(r,i),q0(t,e,o)}catch(c){Mh(t,e,c)}}function q0(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Z0(t,e,i)},function(i){return Mh(t,e,i)}):Z0(t,e,n)}function Z0(t,e,n){e.status="fulfilled",e.value=n,Gx(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,Zx(t,n)))}function Mh(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,Gx(e),e=e.next;while(e!==i)}t.action=null}function Gx(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Yx(t,e){return e}function G0(t,e){if(he){var n=Ae.formState;if(n!==null){e:{var i=re;if(he){if(Ie){t:{for(var r=Ie,o=Sn;r.nodeType!==8;){if(!o){r=null;break t}if(r=En(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ie=En(r.nextSibling),i=r.data==="F!";break e}}Or(i)}i=!1}i&&(e=n[0])}}return n=Lt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yx,lastRenderedState:e},n.queue=i,n=uS.bind(null,re,i),i.dispatch=n,i=Oh(!1),o=Ng.bind(null,re,!1,i.queue),i=Lt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=D2.bind(null,re,r,o,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function Y0(t){var e=We();return Wx(e,Ee,t)}function Wx(t,e,n){if(e=kg(t,e,Yx)[0],t=mu(Mi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Dl(e)}catch(a){throw a===Ya?ad:a}else i=e;e=We();var r=e.queue,o=r.dispatch;return n!==e.memoizedState&&(re.flags|=2048,$a(9,{destroy:void 0},L2.bind(null,r,n),null)),[i,o,t]}function L2(t,e){t.action=e}function W0(t){var e=We(),n=Ee;if(n!==null)return Wx(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function $a(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=re.updateQueue,e===null&&(e=sd(),re.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Xx(){return We().memoizedState}function vu(t,e,n,i){var r=Lt();re.flags|=t,r.memoizedState=$a(1|e,{destroy:void 0},n,i===void 0?null:i)}function cd(t,e,n,i){var r=We();i=i===void 0?null:i;var o=r.memoizedState.inst;Ee!==null&&i!==null&&xg(i,Ee.memoizedState.deps)?r.memoizedState=$a(e,o,n,i):(re.flags|=t,r.memoizedState=$a(1|e,o,n,i))}function X0(t,e){vu(8390656,8,t,e)}function Tg(t,e){cd(2048,8,t,e)}function I2(t){re.flags|=4;var e=re.updateQueue;if(e===null)e=sd(),re.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function Kx(t){var e=We().memoizedState;return I2({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(O(440));return e.impl.apply(void 0,arguments)}}function Qx(t,e){return cd(4,2,t,e)}function Jx(t,e){return cd(4,4,t,e)}function eS(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function tS(t,e,n){n=n!=null?n.concat([t]):null,cd(4,4,eS.bind(null,e,t),n)}function Rg(){}function nS(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&xg(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function iS(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&xg(e,i[1]))return i[0];if(i=t(),xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i}function Og(t,e,n){return n===void 0||(Oi&1073741824)!==0&&(fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=qS(),re.lanes|=t,Nr|=t,n)}function rS(t,e,n,i){return ln(n,e)?n:Ba.current!==null?(t=Og(t,n,i),ln(t,e)||(nt=!0),t):(Oi&42)===0||(Oi&1073741824)!==0&&(fe&261930)===0?(nt=!0,t.memoizedState=n):(t=qS(),re.lanes|=t,Nr|=t,e)}function oS(t,e,n,i,r){var o=ye.p;ye.p=o!==0&&8>o?o:8;var a=Q.T,s={};Q.T=s,Ng(t,!1,e,n);try{var l=r(),c=Q.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=O2(l,i);al(t,e,u,sn(t))}else al(t,e,i,sn(t))}catch(d){al(t,e,{then:function(){},status:"rejected",reason:d},sn())}finally{ye.p=o,a!==null&&s.types!==null&&(a.types=s.types),Q.T=a}}function H2(){}function Nh(t,e,n,i){if(t.tag!==5)throw Error(O(476));var r=aS(t).queue;oS(t,r,e,po,n===null?H2:function(){return sS(t),n(i)})}function aS(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:po,baseState:po,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:po},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function sS(t){var e=aS(t);e.next===null&&(e=t.alternate.memoizedState),al(t,e.next.queue,{},sn())}function Mg(){return yt(wl)}function lS(){return We().memoizedState}function cS(){return We().memoizedState}function z2(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=sn();t=Sr(n);var i=wr(e,t,n);i!==null&&(Vt(i,e,n),il(i,e,n)),e={cache:mg()},t.payload=e;return}e=e.return}}function B2(t,e,n){var i=sn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ud(t)?dS(e,n):(n=fg(t,e,n,i),n!==null&&(Vt(n,t,i),fS(n,e,i)))}function uS(t,e,n){var i=sn();al(t,e,n,i)}function al(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ud(t))dS(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,ln(s,a))return od(t,e,r,0),Ae===null&&rd(),!1}catch{}if(n=fg(t,e,r,i),n!==null)return Vt(n,t,i),fS(n,e,i),!0}return!1}function Ng(t,e,n,i){if(i={lane:2,revertLane:Ug(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ud(t)){if(e)throw Error(O(479))}else e=fg(t,n,i,2),e!==null&&Vt(e,t,2)}function ud(t){var e=t.alternate;return t===re||e!==null&&e===re}function dS(t,e){Na=zu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function fS(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,K_(t,n)}}var _l={readContext:yt,use:ld,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};_l.useEffectEvent=Ze;var pS={readContext:yt,use:ld,useCallback:function(t,e){return Lt().memoizedState=[t,e===void 0?null:e],t},useContext:yt,useEffect:X0,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,vu(4194308,4,eS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return vu(4194308,4,t,e)},useInsertionEffect:function(t,e){vu(4,2,t,e)},useMemo:function(t,e){var n=Lt();e=e===void 0?null:e;var i=t();if(xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Lt();if(n!==void 0){var r=n(e);if(xo){gr(!0);try{n(e)}finally{gr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=B2.bind(null,re,t),[i.memoizedState,t]},useRef:function(t){var e=Lt();return t={current:t},e.memoizedState=t},useState:function(t){t=Oh(t);var e=t.queue,n=uS.bind(null,re,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Rg,useDeferredValue:function(t,e){var n=Lt();return Og(n,t,e)},useTransition:function(){var t=Oh(!1);return t=oS.bind(null,re,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=re,r=Lt();if(he){if(n===void 0)throw Error(O(407));n=n()}else{if(n=e(),Ae===null)throw Error(O(349));(fe&127)!==0||Fx(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,X0(Vx.bind(null,i,o,t),[t]),i.flags|=2048,$a(9,{destroy:void 0},Ux.bind(null,i,o,n,e),null),n},useId:function(){var t=Lt(),e=Ae.identifierPrefix;if(he){var n=ei,i=Jn;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Bu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=M2++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Mg,useFormState:G0,useActionState:G0,useOptimistic:function(t){var e=Lt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Ng.bind(null,re,!0,n),n.dispatch=e,[t,e]},useMemoCache:Ag,useCacheRefresh:function(){return Lt().memoizedState=z2.bind(null,re)},useEffectEvent:function(t){var e=Lt(),n={impl:t};return e.memoizedState=n,function(){if((ve&2)!==0)throw Error(O(440));return n.impl.apply(void 0,arguments)}}},Dg={readContext:yt,use:ld,useCallback:nS,useContext:yt,useEffect:Tg,useImperativeHandle:tS,useInsertionEffect:Qx,useLayoutEffect:Jx,useMemo:iS,useReducer:mu,useRef:Xx,useState:function(){return mu(Mi)},useDebugValue:Rg,useDeferredValue:function(t,e){var n=We();return rS(n,Ee.memoizedState,t,e)},useTransition:function(){var t=mu(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:$x,useId:lS,useHostTransitionStatus:Mg,useFormState:Y0,useActionState:Y0,useOptimistic:function(t,e){var n=We();return qx(n,Ee,t,e)},useMemoCache:Ag,useCacheRefresh:cS};Dg.useEffectEvent=Kx;var hS={readContext:yt,use:ld,useCallback:nS,useContext:yt,useEffect:Tg,useImperativeHandle:tS,useInsertionEffect:Qx,useLayoutEffect:Jx,useMemo:iS,useReducer:Fp,useRef:Xx,useState:function(){return Fp(Mi)},useDebugValue:Rg,useDeferredValue:function(t,e){var n=We();return Ee===null?Og(n,t,e):rS(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Fp(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:$x,useId:lS,useHostTransitionStatus:Mg,useFormState:W0,useActionState:W0,useOptimistic:function(t,e){var n=We();return Ee!==null?qx(n,Ee,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Ag,useCacheRefresh:cS};hS.useEffectEvent=Kx;function Up(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:He({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Dh={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Sr(i);r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),il(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Sr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),il(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),i=Sr(n);i.tag=2,e!=null&&(i.callback=e),e=wr(t,i,n),e!==null&&(Vt(e,t,n),il(e,t,n))}};function K0(t,e,n,i,r,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,o,a):e.prototype&&e.prototype.isPureReactComponent?!gl(n,i)||!gl(r,o):!0}function Q0(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Dh.enqueueReplaceState(e,e.state,null)}function So(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=He({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function gS(t){Ou(t)}function mS(t){console.error(t)}function vS(t){Ou(t)}function $u(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function J0(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Lh(t,e,n){return n=Sr(n),n.tag=3,n.payload={element:null},n.callback=function(){$u(t,e)},n}function yS(t){return t=Sr(t),t.tag=3,t}function bS(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=i.value;t.payload=function(){return r(o)},t.callback=function(){J0(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){J0(e,n,i),typeof r!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function $2(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ga(e,n,r,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return wn===null?Pu():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Lu?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Qp(t,i,r)),!1;case 22:return n.flags|=65536,i===Lu?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Qp(t,i,r)),!1}throw Error(O(435,n.tag))}return Qp(t,i,r),Pu(),!1}if(he)return e=cn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==xh&&(t=Error(O(422),{cause:i}),vl(xn(t,n)))):(i!==xh&&(e=Error(O(423),{cause:i}),vl(xn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=xn(i,n),r=Lh(t.stateNode,i,r),$p(t,r),Ge!==4&&(Ge=2)),!1;var o=Error(O(520),{cause:i});if(o=xn(o,n),cl===null?cl=[o]:cl.push(o),Ge!==4&&(Ge=2),e===null)return!0;i=xn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Lh(n.stateNode,i,t),$p(n,t),!1;case 1:if(e=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Er===null||!Er.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=yS(r),bS(r,t,n,i),$p(n,r),!1}n=n.return}while(n!==null);return!1}var Lg=Error(O(461)),nt=!1;function gt(t,e,n,i){e.child=t===null?Dx(e,null,n,i):_o(e,t.child,n,i)}function e_(t,e,n,i,r){n=n.render;var o=e.ref;if("ref"in i){var a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}else a=i;return bo(e),i=Sg(t,e,n,a,o,r),s=wg(),t!==null&&!nt?(Eg(t,e,r),Ni(t,e,r)):(he&&s&&hg(e),e.flags|=1,gt(t,e,i,r),e.child)}function t_(t,e,n,i,r){if(t===null){var o=n.type;return typeof o=="function"&&!pg(o)&&o.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=o,_S(t,e,o,i,r)):(t=hu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!Ig(t,r)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:gl,n(a,i)&&t.ref===e.ref)return Ni(t,e,r)}return e.flags|=1,t=Ai(o,i),t.ref=e.ref,t.return=e,e.child=t}function _S(t,e,n,i,r){if(t!==null){var o=t.memoizedProps;if(gl(o,i)&&t.ref===e.ref)if(nt=!1,e.pendingProps=i=o,Ig(t,r))(t.flags&131072)!==0&&(nt=!0);else return e.lanes=t.lanes,Ni(t,e,r)}return Ih(t,e,n,i,r)}function xS(t,e,n,i){var r=i.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,e.child=null;return n_(t,e,o,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&gu(e,o!==null?o.cachePool:null),o!==null?P0(e,o):Th(),Hx(e);else return i=e.lanes=536870912,n_(t,e,o!==null?o.baseLanes|n:n,n,i)}else o!==null?(gu(e,o.cachePool),P0(e,o),pr(e),e.memoizedState=null):(t!==null&&gu(e,null),Th(),pr(e));return gt(t,e,r,n),e.child}function Ks(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function n_(t,e,n,i,r){var o=vg();return o=o===null?null:{parent:tt._currentValue,pool:o},e.memoizedState={baseLanes:n,cachePool:o},t!==null&&gu(e,null),Th(),Hx(e),t!==null&&Ga(t,e,i,!0),e.childLanes=r,null}function yu(t,e){return e=Fu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function i_(t,e,n){return _o(e,t.child,null,n),t=yu(e,e.pendingProps),t.flags|=2,en(e),e.memoizedState=null,t}function F2(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=yu(e,i),e.lanes=536870912,Ks(null,t);if(Rh(e),(t=Ie)?(t=p1(t,Sn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=Ax(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Or(e);return e.lanes=536870912,null}return yu(e,i)}var o=t.memoizedState;if(o!==null){var a=o.dehydrated;if(Rh(e),r)if(e.flags&256)e.flags&=-257,e=i_(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(O(558));else if(nt||Ga(t,e,n,!1),r=(n&t.childLanes)!==0,nt||r){if(i=Ae,i!==null&&(a=Q_(i,n),a!==0&&a!==o.retryLane))throw o.retryLane=a,Ao(t,a),Vt(i,t,a),Lg;Pu(),e=i_(t,e,n)}else t=o.treeContext,Ie=En(a.nextSibling),vt=e,he=!0,xr=null,Sn=!1,t!==null&&Tx(e,t),e=yu(e,i),e.flags|=4096;return e}return t=Ai(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function bu(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(O(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Ih(t,e,n,i,r){return bo(e),n=Sg(t,e,n,i,void 0,r),i=wg(),t!==null&&!nt?(Eg(t,e,r),Ni(t,e,r)):(he&&i&&hg(e),e.flags|=1,gt(t,e,n,r),e.child)}function r_(t,e,n,i,r,o){return bo(e),e.updateQueue=null,n=Bx(e,i,n,r),zx(t),i=wg(),t!==null&&!nt?(Eg(t,e,o),Ni(t,e,o)):(he&&i&&hg(e),e.flags|=1,gt(t,e,n,o),e.child)}function o_(t,e,n,i,r){if(bo(e),e.stateNode===null){var o=wa,a=n.contextType;typeof a=="object"&&a!==null&&(o=yt(a)),o=new n(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Dh,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},bg(e),a=n.contextType,o.context=typeof a=="object"&&a!==null?yt(a):wa,o.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Up(e,n,a,i),o.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(a=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),a!==o.state&&Dh.enqueueReplaceState(o,o.state,null),ol(e,i,o,r),rl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=So(n,s);o.props=l;var c=o.context,u=n.contextType;a=wa,typeof u=="object"&&u!==null&&(a=yt(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||c!==a)&&Q0(e,o,i,a),ur=!1;var p=e.memoizedState;o.state=p,ol(e,i,o,r),rl(),c=e.memoizedState,s||p!==c||ur?(typeof d=="function"&&(Up(e,n,d,i),c=e.memoizedState),(l=ur||K0(e,n,l,i,p,c,a))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,Ah(t,e),a=e.memoizedProps,u=So(n,a),o.props=u,d=e.pendingProps,p=o.context,c=n.contextType,l=wa,typeof c=="object"&&c!==null&&(l=yt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==l)&&Q0(e,o,i,l),ur=!1,p=e.memoizedState,o.state=p,ol(e,i,o,r),rl();var g=e.memoizedState;a!==d||p!==g||ur||t!==null&&t.dependencies!==null&&Du(t.dependencies)?(typeof s=="function"&&(Up(e,n,s,i),g=e.memoizedState),(u=ur||K0(e,n,u,i,p,g,l)||t!==null&&t.dependencies!==null&&Du(t.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),o.props=i,o.state=g,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),i=!1)}return o=i,bu(t,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&i?(e.child=_o(e,t.child,null,r),e.child=_o(e,null,n,r)):gt(t,e,n,r),e.memoizedState=o.state,t=e.child):t=Ni(t,e,r),t}function a_(t,e,n,i){return yo(),e.flags|=256,gt(t,e,n,i),e.child}var Vp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jp(t){return{baseLanes:t,cachePool:Ox()}}function Pp(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=nn),t}function SS(t,e,n){var i=e.pendingProps,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(Ye.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?fr(e):pr(e),(t=Ie)?(t=p1(t,Sn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=Ax(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Or(e);return Wh(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(pr(e),r=e.mode,s=Fu({mode:"hidden",children:s},r),i=ho(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=jp(n),i.childLanes=Pp(t,a,n),e.memoizedState=Vp,Ks(null,i)):(fr(e),Hh(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(fr(e),e.flags&=-257,e=qp(t,e,n)):e.memoizedState!==null?(pr(e),e.child=t.child,e.flags|=128,e=null):(pr(e),s=i.fallback,r=e.mode,i=Fu({mode:"visible",children:i.children},r),s=ho(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,_o(e,t.child,null,n),i=e.child,i.memoizedState=jp(n),i.childLanes=Pp(t,a,n),e.memoizedState=Vp,e=Ks(null,i));else if(fr(e),Wh(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(O(419)),i.stack="",i.digest=a,vl({value:i,source:null,stack:null}),e=qp(t,e,n)}else if(nt||Ga(t,e,n,!1),a=(n&t.childLanes)!==0,nt||a){if(a=Ae,a!==null&&(i=Q_(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,Ao(t,i),Vt(a,t,i),Lg;Yh(s)||Pu(),e=qp(t,e,n)}else Yh(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ie=En(s.nextSibling),vt=e,he=!0,xr=null,Sn=!1,t!==null&&Tx(e,t),e=Hh(e,i.children),e.flags|=4096);return e}return r?(pr(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Ai(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=Ai(c,s):(s=ho(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,Ks(null,i),i=e.child,s=t.child.memoizedState,s===null?s=jp(n):(r=s.cachePool,r!==null?(l=tt._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=Ox(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=Pp(t,a,n),e.memoizedState=Vp,Ks(t.child,i)):(fr(e),n=t.child,t=n.sibling,n=Ai(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Hh(t,e){return e=Fu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Fu(t,e){return t=tn(22,t,null,e),t.lanes=0,t}function qp(t,e,n){return _o(e,t.child,null,n),t=Hh(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function s_(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),wh(t.return,e,n)}function Zp(t,e,n,i,r,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function wS(t,e,n){var i=e.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=Ye.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,Re(Ye,a),gt(t,e,i,n),i=he?ml:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&s_(t,n,e);else if(t.tag===19)s_(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Hu(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Zp(e,!1,r,n,o,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Hu(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Zp(e,!0,n,null,o,i);break;case"together":Zp(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Ni(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Nr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ga(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(O(153));if(e.child!==null){for(t=e.child,n=Ai(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ai(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Ig(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Du(t)))}function U2(t,e,n){switch(e.tag){case 3:Au(e,e.stateNode.containerInfo),dr(e,tt,t.memoizedState.cache),yo();break;case 27:case 5:uh(e);break;case 4:Au(e,e.stateNode.containerInfo);break;case 10:dr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Rh(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(fr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?SS(t,e,n):(fr(e),t=Ni(t,e,n),t!==null?t.sibling:null);fr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ga(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return wS(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Re(Ye,Ye.current),i)break;return null;case 22:return e.lanes=0,xS(t,e,n,e.pendingProps);case 24:dr(e,tt,t.memoizedState.cache)}return Ni(t,e,n)}function ES(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)nt=!0;else{if(!Ig(t,n)&&(e.flags&128)===0)return nt=!1,U2(t,e,n);nt=(t.flags&131072)!==0}else nt=!1,he&&(e.flags&1048576)!==0&&kx(e,ml,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=uo(e.elementType),e.type=t,typeof t=="function")pg(t)?(i=So(t,i),e.tag=1,e=o_(null,e,t,i,n)):(e.tag=0,e=Ih(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===Jh){e.tag=11,e=e_(null,e,t,i,n);break e}else if(r===eg){e.tag=14,e=t_(null,e,t,i,n);break e}}throw e=lh(t)||t,Error(O(306,e,""))}}return e;case 0:return Ih(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=So(i,e.pendingProps),o_(t,e,i,r,n);case 3:e:{if(Au(e,e.stateNode.containerInfo),t===null)throw Error(O(387));i=e.pendingProps;var o=e.memoizedState;r=o.element,Ah(t,e),ol(e,i,null,n);var a=e.memoizedState;if(i=a.cache,dr(e,tt,i),i!==o.cache&&Eh(e,[tt],n,!0),rl(),i=a.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=a_(t,e,i,n);break e}else if(i!==r){r=xn(Error(O(424)),e),vl(r),e=a_(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ie=En(t.firstChild),vt=e,he=!0,xr=null,Sn=!0,n=Dx(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yo(),i===r){e=Ni(t,e,n);break e}gt(t,e,i,n)}e=e.child}return e;case 26:return bu(t,e),t===null?(n=R_(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=Yu(_r.current).createElement(n),i[mt]=e,i[jt]=t,bt(i,n,t),dt(i),e.stateNode=i):e.memoizedState=R_(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return uh(e),t===null&&he&&(i=e.stateNode=h1(e.type,e.pendingProps,_r.current),vt=e,Sn=!0,r=Ie,Lr(e.type)?(Xh=r,Ie=En(i.firstChild)):Ie=r),gt(t,e,e.pendingProps.children,n),bu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Ie)&&(i=gO(i,e.type,e.pendingProps,Sn),i!==null?(e.stateNode=i,vt=e,Ie=En(i.firstChild),Sn=!1,r=!0):r=!1),r||Or(e)),uh(e),r=e.type,o=e.pendingProps,a=t!==null?t.memoizedProps:null,i=o.children,Zh(r,o)?i=null:a!==null&&Zh(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Sg(t,e,N2,null,null,n),wl._currentValue=r),bu(t,e),gt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Ie)&&(n=mO(n,e.pendingProps,Sn),n!==null?(e.stateNode=n,vt=e,Ie=null,t=!0):t=!1),t||Or(e)),null;case 13:return SS(t,e,n);case 4:return Au(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=_o(e,null,i,n):gt(t,e,i,n),e.child;case 11:return e_(t,e,e.type,e.pendingProps,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,dr(e,e.type,i.value),gt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,bo(e),r=yt(r),i=i(r),e.flags|=1,gt(t,e,i,n),e.child;case 14:return t_(t,e,e.type,e.pendingProps,n);case 15:return _S(t,e,e.type,e.pendingProps,n);case 19:return wS(t,e,n);case 31:return F2(t,e,n);case 22:return xS(t,e,n,e.pendingProps);case 24:return bo(e),i=yt(tt),t===null?(r=vg(),r===null&&(r=Ae,o=mg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),e.memoizedState={parent:i,cache:r},bg(e),dr(e,tt,r)):((t.lanes&n)!==0&&(Ah(t,e),ol(e,null,null,n),rl()),r=t.memoizedState,o=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),dr(e,tt,i)):(i=o.cache,dr(e,tt,i),i!==r.cache&&Eh(e,[tt],n,!0))),gt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(O(156,e.tag))}function vi(t){t.flags|=4}function Gp(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(YS())t.flags|=8192;else throw mo=Lu,yg}else t.flags&=-16777217}function l_(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!v1(e))if(YS())t.flags|=8192;else throw mo=Lu,yg}function iu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?W_():536870912,t.lanes|=e,Fa|=e)}function Ps(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Le(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function V2(t,e,n){var i=e.pendingProps;switch(gg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(e),null;case 1:return Le(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),ki(tt),La(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(da(e)?vi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Bp())),Le(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(vi(e),o!==null?(Le(e),l_(e,o)):(Le(e),Gp(e,r,null,i,n))):o?o!==t.memoizedState?(vi(e),Le(e),l_(e,o)):(Le(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&vi(e),Le(e),Gp(e,r,t,i,n)),null;case 27:if(ku(e),n=_r.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return Le(e),null}t=ni.current,da(e)?z0(e,t):(t=h1(r,i,n),e.stateNode=t,vi(e))}return Le(e),null;case 5:if(ku(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return Le(e),null}if(o=ni.current,da(e))z0(e,o);else{var a=Yu(_r.current);switch(o){case 1:o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=a.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}o[mt]=e,o[jt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)o.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=o;e:switch(bt(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&vi(e)}}return Le(e),Gp(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(O(166));if(t=_r.current,da(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=vt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[mt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||u1(t.nodeValue,n)),t||Or(e,!0)}else t=Yu(t).createTextNode(i),t[mt]=e,e.stateNode=t}return Le(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=da(e),n!==null){if(t===null){if(!i)throw Error(O(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(557));t[mt]=e}else yo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),t=!1}else n=Bp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(en(e),e):(en(e),null);if((e.flags&128)!==0)throw Error(O(558))}return Le(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=da(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(O(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(O(317));r[mt]=e}else yo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),r=!1}else r=Bp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(en(e),e):(en(e),null)}return en(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),iu(e,e.updateQueue),Le(e),null);case 4:return La(),t===null&&Vg(e.stateNode.containerInfo),Le(e),null;case 10:return ki(e.type),Le(e),null;case 19:if(ft(Ye),i=e.memoizedState,i===null)return Le(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Ps(i,!1);else{if(Ge!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=Hu(t),o!==null){for(e.flags|=128,Ps(i,!1),t=o.updateQueue,e.updateQueue=t,iu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Cx(n,t),n=n.sibling;return Re(Ye,Ye.current&1|2),he&&xi(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&rn()>Vu&&(e.flags|=128,r=!0,Ps(i,!1),e.lanes=4194304)}else{if(!r)if(t=Hu(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,iu(e,t),Ps(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!he)return Le(e),null}else 2*rn()-i.renderingStartTime>Vu&&n!==536870912&&(e.flags|=128,r=!0,Ps(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(t=i.last,t!==null?t.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Ye.current,Re(Ye,r?n&1|2:n&1),he&&xi(e,i.treeForkCount),t):(Le(e),null);case 22:case 23:return en(e),_g(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Le(e),e.subtreeFlags&6&&(e.flags|=8192)):Le(e),n=e.updateQueue,n!==null&&iu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ft(go),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),ki(tt),Le(e),null;case 25:return null;case 30:return null}throw Error(O(156,e.tag))}function j2(t,e){switch(gg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ki(tt),La(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ku(e),null;case 31:if(e.memoizedState!==null){if(en(e),e.alternate===null)throw Error(O(340));yo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(en(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));yo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ft(Ye),null;case 4:return La(),null;case 10:return ki(e.type),null;case 22:case 23:return en(e),_g(),t!==null&&ft(go),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ki(tt),null;case 25:return null;default:return null}}function CS(t,e){switch(gg(e),e.tag){case 3:ki(tt),La();break;case 26:case 27:case 5:ku(e);break;case 4:La();break;case 31:e.memoizedState!==null&&en(e);break;case 13:en(e);break;case 19:ft(Ye);break;case 10:ki(e.type);break;case 22:case 23:en(e),_g(),t!==null&&ft(go);break;case 24:ki(tt)}}function Ll(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(s){_e(e,e.return,s)}}function Mr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&t)===t){var a=i.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){_e(r,l,u)}}}i=i.next}while(i!==o)}}catch(u){_e(e,e.return,u)}}function AS(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Ix(e,n)}catch(i){_e(t,t.return,i)}}}function kS(t,e,n){n.props=So(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){_e(t,e,i)}}function sl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){_e(t,e,r)}}function ti(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){_e(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(t,e,r)}else n.current=null}function TS(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(t,t.return,r)}}function Yp(t,e,n){try{var i=t.stateNode;cO(i,t.type,n,e),i[jt]=e}catch(r){_e(t,t.return,r)}}function RS(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Lr(t.type)||t.tag===4}function Wp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||RS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Lr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function zh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ei));else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(zh(t,e,n),t=t.sibling;t!==null;)zh(t,e,n),t=t.sibling}function Uu(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Uu(t,e,n),t=t.sibling;t!==null;)Uu(t,e,n),t=t.sibling}function OS(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);bt(e,i,n),e[mt]=t,e[jt]=n}catch(o){_e(t,t.return,o)}}var Si=!1,et=!1,Xp=!1,c_=typeof WeakSet=="function"?WeakSet:Set,ut=null;function P2(t,e){if(t=t.containerInfo,Ph=Qu,t=vx(t),ug(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,p=null;t:for(;;){for(var g;d!==n||r!==0&&d.nodeType!==3||(s=a+r),d!==o||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)p=d,d=g;for(;;){if(d===t)break t;if(p===n&&++c===r&&(s=a),p===o&&++u===i&&(l=a),(g=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(qh={focusedElem:t,selectionRange:n},Qu=!1,ut=e;ut!==null;)if(e=ut,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ut=t;else for(;ut!==null;){switch(e=ut,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,n=e,r=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var _=So(n.type,r);t=i.getSnapshotBeforeUpdate(_,o),i.__reactInternalSnapshotBeforeUpdate=t}catch(b){_e(n,n.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Gh(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Gh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(O(163))}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function MS(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:bi(t,n),i&4&&Ll(5,n);break;case 1:if(bi(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){_e(n,n.return,a)}else{var r=So(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){_e(n,n.return,a)}}i&64&&AS(n),i&512&&sl(n,n.return);break;case 3:if(bi(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{Ix(t,e)}catch(a){_e(n,n.return,a)}}break;case 27:e===null&&i&4&&OS(n);case 26:case 5:bi(t,n),e===null&&i&4&&TS(n),i&512&&sl(n,n.return);break;case 12:bi(t,n);break;case 31:bi(t,n),i&4&&LS(t,n);break;case 13:bi(t,n),i&4&&IS(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=J2.bind(null,n),vO(t,n))));break;case 22:if(i=n.memoizedState!==null||Si,!i){e=e!==null&&e.memoizedState!==null||et,r=Si;var o=et;Si=i,(et=e)&&!o?_i(t,n,(n.subtreeFlags&8772)!==0):bi(t,n),Si=r,et=o}break;case 30:break;default:bi(t,n)}}function NS(t){var e=t.alternate;e!==null&&(t.alternate=null,NS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&rg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Be=null,Ft=!1;function yi(t,e,n){for(n=n.child;n!==null;)DS(t,e,n),n=n.sibling}function DS(t,e,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(kl,n)}catch{}switch(n.tag){case 26:et||ti(n,e),yi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:et||ti(n,e);var i=Be,r=Ft;Lr(n.type)&&(Be=n.stateNode,Ft=!1),yi(t,e,n),dl(n.stateNode),Be=i,Ft=r;break;case 5:et||ti(n,e);case 6:if(i=Be,r=Ft,Be=null,yi(t,e,n),Be=i,Ft=r,Be!==null)if(Ft)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(o){_e(n,e,o)}else try{Be.removeChild(n.stateNode)}catch(o){_e(n,e,o)}break;case 18:Be!==null&&(Ft?(t=Be,E_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Pa(t)):E_(Be,n.stateNode));break;case 4:i=Be,r=Ft,Be=n.stateNode.containerInfo,Ft=!0,yi(t,e,n),Be=i,Ft=r;break;case 0:case 11:case 14:case 15:Mr(2,n,e),et||Mr(4,n,e),yi(t,e,n);break;case 1:et||(ti(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&kS(n,e,i)),yi(t,e,n);break;case 21:yi(t,e,n);break;case 22:et=(i=et)||n.memoizedState!==null,yi(t,e,n),et=i;break;default:yi(t,e,n)}}function LS(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Pa(t)}catch(n){_e(e,e.return,n)}}}function IS(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pa(t)}catch(n){_e(e,e.return,n)}}function q2(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new c_),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new c_),e;default:throw Error(O(435,t.tag))}}function ru(t,e){var n=q2(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=eO.bind(null,t,i);i.then(r,r)}})}function Bt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(Lr(s.type)){Be=s.stateNode,Ft=!1;break e}break;case 5:Be=s.stateNode,Ft=!1;break e;case 3:case 4:Be=s.stateNode.containerInfo,Ft=!0;break e}s=s.return}if(Be===null)throw Error(O(160));DS(o,a,r),Be=null,Ft=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)HS(e,t),e=e.sibling}var Bn=null;function HS(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bt(e,t),$t(t),i&4&&(Mr(3,t,t.return),Ll(3,t),Mr(5,t,t.return));break;case 1:Bt(e,t),$t(t),i&512&&(et||n===null||ti(n,n.return)),i&64&&Si&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Bn;if(Bt(e,t),$t(t),i&512&&(et||n===null||ti(n,n.return)),i&4){var o=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Ol]||o[mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(i),r.head.insertBefore(o,r.querySelector("head > title"))),bt(o,i,n),o[mt]=t,dt(o),i=o;break e;case"link":var a=M_("link","href",r).get(i+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(o=a[s],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;case"meta":if(a=M_("meta","content",r).get(i+(n.content||""))){for(s=0;s<a.length;s++)if(o=a[s],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;default:throw Error(O(468,i))}o[mt]=t,dt(o),i=o}t.stateNode=i}else N_(r,t.type,t.stateNode);else t.stateNode=O_(r,i,t.memoizedProps);else o!==i?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,i===null?N_(r,t.type,t.stateNode):O_(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Yp(t,t.memoizedProps,n.memoizedProps)}break;case 27:Bt(e,t),$t(t),i&512&&(et||n===null||ti(n,n.return)),n!==null&&i&4&&Yp(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Bt(e,t),$t(t),i&512&&(et||n===null||ti(n,n.return)),t.flags&32){r=t.stateNode;try{Ha(r,"")}catch(_){_e(t,t.return,_)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Yp(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Xp=!0);break;case 6:if(Bt(e,t),$t(t),i&4){if(t.stateNode===null)throw Error(O(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(_){_e(t,t.return,_)}}break;case 3:if(Su=null,r=Bn,Bn=Wu(e.containerInfo),Bt(e,t),Bn=r,$t(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Pa(e.containerInfo)}catch(_){_e(t,t.return,_)}Xp&&(Xp=!1,zS(t));break;case 4:i=Bn,Bn=Wu(t.stateNode.containerInfo),Bt(e,t),$t(t),Bn=i;break;case 12:Bt(e,t),$t(t);break;case 31:Bt(e,t),$t(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ru(t,i)));break;case 13:Bt(e,t),$t(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(dd=rn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ru(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Si,u=et;if(Si=c||r,et=u||l,Bt(e,t),et=u,Si=c,$t(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||Si||et||fo(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(o=l.stateNode,r)a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,p=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(_){_e(l,l.return,_)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(_){_e(l,l.return,_)}}}else if(e.tag===18){if(n===null){l=e;try{var g=l.stateNode;r?C_(g,!0):C_(l.stateNode,!1)}catch(_){_e(l,l.return,_)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,ru(t,n))));break;case 19:Bt(e,t),$t(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ru(t,i)));break;case 30:break;case 21:break;default:Bt(e,t),$t(t)}}function $t(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(RS(i)){n=i;break}i=i.return}if(n==null)throw Error(O(160));switch(n.tag){case 27:var r=n.stateNode,o=Wp(t);Uu(t,o,r);break;case 5:var a=n.stateNode;n.flags&32&&(Ha(a,""),n.flags&=-33);var s=Wp(t);Uu(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Wp(t);zh(t,c,l);break;default:throw Error(O(161))}}catch(u){_e(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function zS(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;zS(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function bi(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)MS(t,e.alternate,e),e=e.sibling}function fo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Mr(4,e,e.return),fo(e);break;case 1:ti(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&kS(e,e.return,n),fo(e);break;case 27:dl(e.stateNode);case 26:case 5:ti(e,e.return),fo(e);break;case 22:e.memoizedState===null&&fo(e);break;case 30:fo(e);break;default:fo(e)}t=t.sibling}}function _i(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,o=e,a=o.flags;switch(o.tag){case 0:case 11:case 15:_i(r,o,n),Ll(4,o);break;case 1:if(_i(r,o,n),i=o,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){_e(i,i.return,c)}if(i=o,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)Lx(l[r],s)}catch(c){_e(i,i.return,c)}}n&&a&64&&AS(o),sl(o,o.return);break;case 27:OS(o);case 26:case 5:_i(r,o,n),n&&i===null&&a&4&&TS(o),sl(o,o.return);break;case 12:_i(r,o,n);break;case 31:_i(r,o,n),n&&a&4&&LS(r,o);break;case 13:_i(r,o,n),n&&a&4&&IS(r,o);break;case 22:o.memoizedState===null&&_i(r,o,n),sl(o,o.return);break;case 30:break;default:_i(r,o,n)}e=e.sibling}}function Hg(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Nl(n))}function zg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t))}function zn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)BS(t,e,n,i),e=e.sibling}function BS(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:zn(t,e,n,i),r&2048&&Ll(9,e);break;case 1:zn(t,e,n,i);break;case 3:zn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t)));break;case 12:if(r&2048){zn(t,e,n,i),t=e.stateNode;try{var o=e.memoizedProps,a=o.id,s=o.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){_e(e,e.return,l)}}else zn(t,e,n,i);break;case 31:zn(t,e,n,i);break;case 13:zn(t,e,n,i);break;case 23:break;case 22:o=e.stateNode,a=e.alternate,e.memoizedState!==null?o._visibility&2?zn(t,e,n,i):ll(t,e):o._visibility&2?zn(t,e,n,i):(o._visibility|=2,pa(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Hg(a,e);break;case 24:zn(t,e,n,i),r&2048&&zg(e.alternate,e);break;default:zn(t,e,n,i)}}function pa(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,a=e,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:pa(o,a,s,l,r),Ll(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?pa(o,a,s,l,r):ll(o,a):(u._visibility|=2,pa(o,a,s,l,r)),r&&c&2048&&Hg(a.alternate,a);break;case 24:pa(o,a,s,l,r),r&&c&2048&&zg(a.alternate,a);break;default:pa(o,a,s,l,r)}e=e.sibling}}function ll(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ll(n,i),r&2048&&Hg(i.alternate,i);break;case 24:ll(n,i),r&2048&&zg(i.alternate,i);break;default:ll(n,i)}e=e.sibling}}var Qs=8192;function fa(t,e,n){if(t.subtreeFlags&Qs)for(t=t.child;t!==null;)$S(t,e,n),t=t.sibling}function $S(t,e,n){switch(t.tag){case 26:fa(t,e,n),t.flags&Qs&&t.memoizedState!==null&&RO(n,Bn,t.memoizedState,t.memoizedProps);break;case 5:fa(t,e,n);break;case 3:case 4:var i=Bn;Bn=Wu(t.stateNode.containerInfo),fa(t,e,n),Bn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=Qs,Qs=16777216,fa(t,e,n),Qs=i):fa(t,e,n));break;default:fa(t,e,n)}}function FS(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function qs(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,VS(i,t)}FS(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)US(t),t=t.sibling}function US(t){switch(t.tag){case 0:case 11:case 15:qs(t),t.flags&2048&&Mr(9,t,t.return);break;case 3:qs(t);break;case 12:qs(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,_u(t)):qs(t);break;default:qs(t)}}function _u(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,VS(i,t)}FS(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Mr(8,e,e.return),_u(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,_u(e));break;default:_u(e)}t=t.sibling}}function VS(t,e){for(;ut!==null;){var n=ut;switch(n.tag){case 0:case 11:case 15:Mr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Nl(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ut=i;else e:for(n=t;ut!==null;){i=ut;var r=i.sibling,o=i.return;if(NS(i),i===n){ut=null;break e}if(r!==null){r.return=o,ut=r;break e}ut=o}}}var Z2={getCacheForType:function(t){var e=yt(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return yt(tt).controller.signal}},G2=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ae=null,ce=null,fe=0,be=0,Jt=null,vr=!1,Wa=!1,Bg=!1,Di=0,Ge=0,Nr=0,vo=0,$g=0,nn=0,Fa=0,cl=null,Ut=null,Bh=!1,dd=0,jS=0,Vu=1/0,ju=null,Er=null,ot=0,Cr=null,Ua=null,Ti=0,$h=0,Fh=null,PS=null,ul=0,Uh=null;function sn(){return(ve&2)!==0&&fe!==0?fe&-fe:Q.T!==null?Ug():J_()}function qS(){if(nn===0)if((fe&536870912)===0||he){var t=Yc;Yc<<=1,(Yc&3932160)===0&&(Yc=262144),nn=t}else nn=536870912;return t=cn.current,t!==null&&(t.flags|=32),nn}function Vt(t,e,n){(t===Ae&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(Va(t,0),yr(t,fe,nn,!1)),Rl(t,n),((ve&2)===0||t!==Ae)&&(t===Ae&&((ve&2)===0&&(vo|=n),Ge===4&&yr(t,fe,nn,!1)),ri(t))}function ZS(t,e,n){if((ve&6)!==0)throw Error(O(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Tl(t,e),r=i?X2(t,e):Kp(t,e,!0),o=i;do{if(r===0){Wa&&!i&&yr(t,e,0,!1);break}else{if(n=t.current.alternate,o&&!Y2(n)){r=Kp(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var s=t;r=cl;var l=s.current.memoizedState.isDehydrated;if(l&&(Va(s,a).flags|=256),a=Kp(s,a,!1),a!==2){if(Bg&&!l){s.errorRecoveryDisabledLanes|=o,vo|=o,r=4;break e}o=Ut,Ut=r,o!==null&&(Ut===null?Ut=o:Ut.push.apply(Ut,o))}r=a}if(o=!1,r!==2)continue}}if(r===1){Va(t,0),yr(t,e,0,!0);break}e:{switch(i=t,o=r,o){case 0:case 1:throw Error(O(345));case 4:if((e&4194048)!==e)break;case 6:yr(i,e,nn,!vr);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(O(329))}if((e&62914560)===e&&(r=dd+300-rn(),10<r)){if(yr(i,e,nn,!vr),ed(i,0,!0)!==0)break e;Ti=e,i.timeoutHandle=f1(u_.bind(null,i,n,Ut,ju,Bh,e,nn,vo,Fa,vr,o,"Throttled",-0,0),r);break e}u_(i,n,Ut,ju,Bh,e,nn,vo,Fa,vr,o,null,-0,0)}}break}while(!0);ri(t)}function u_(t,e,n,i,r,o,a,s,l,c,u,d,p,g){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ei},$S(e,o,d);var _=(o&62914560)===o?dd-rn():(o&4194048)===o?jS-rn():0;if(_=OO(d,_),_!==null){Ti=o,t.cancelPendingCommit=_(f_.bind(null,t,e,o,n,i,r,a,s,l,u,d,null,p,g)),yr(t,o,a,!c);return}}f_(t,e,o,n,i,r,a,s,l)}function Y2(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ln(o(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function yr(t,e,n,i){e&=~$g,e&=~vo,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var o=31-an(r),a=1<<o;i[o]=-1,r&=~a}n!==0&&X_(t,n,e)}function fd(){return(ve&6)===0?(Il(0,!1),!1):!0}function Fg(){if(ce!==null){if(be===0)var t=ce.return;else t=ce,Ci=ko=null,Cg(t),Ma=null,yl=0,t=ce;for(;t!==null;)CS(t.alternate,t),t=t.return;ce=null}}function Va(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,fO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Ti=0,Fg(),Ae=t,ce=n=Ai(t.current,null),fe=e,be=0,Jt=null,vr=!1,Wa=Tl(t,e),Bg=!1,Fa=nn=$g=vo=Nr=Ge=0,Ut=cl=null,Bh=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),o=1<<r;e|=t[r],i&=~o}return Di=e,rd(),n}function GS(t,e){re=null,Q.H=_l,e===Ya||e===ad?(e=V0(),be=3):e===yg?(e=V0(),be=4):be=e===Lg?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Jt=e,ce===null&&(Ge=1,$u(t,xn(e,t.current)))}function YS(){var t=cn.current;return t===null?!0:(fe&4194048)===fe?wn===null:(fe&62914560)===fe||(fe&536870912)!==0?t===wn:!1}function WS(){var t=Q.H;return Q.H=_l,t===null?_l:t}function XS(){var t=Q.A;return Q.A=Z2,t}function Pu(){Ge=4,vr||(fe&4194048)!==fe&&cn.current!==null||(Wa=!0),(Nr&134217727)===0&&(vo&134217727)===0||Ae===null||yr(Ae,fe,nn,!1)}function Kp(t,e,n){var i=ve;ve|=2;var r=WS(),o=XS();(Ae!==t||fe!==e)&&(ju=null,Va(t,e)),e=!1;var a=Ge;e:do try{if(be!==0&&ce!==null){var s=ce,l=Jt;switch(be){case 8:Fg(),a=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(e=!0);var c=be;if(be=0,Jt=null,Aa(t,s,l,c),n&&Wa){a=0;break e}break;default:c=be,be=0,Jt=null,Aa(t,s,l,c)}}W2(),a=Ge;break}catch(u){GS(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ci=ko=null,ve=i,Q.H=r,Q.A=o,ce===null&&(Ae=null,fe=0,rd()),a}function W2(){for(;ce!==null;)KS(ce)}function X2(t,e){var n=ve;ve|=2;var i=WS(),r=XS();Ae!==t||fe!==e?(ju=null,Vu=rn()+500,Va(t,e)):Wa=Tl(t,e);e:do try{if(be!==0&&ce!==null){e=ce;var o=Jt;t:switch(be){case 1:be=0,Jt=null,Aa(t,e,o,1);break;case 2:case 9:if(U0(o)){be=0,Jt=null,d_(e);break}e=function(){be!==2&&be!==9||Ae!==t||(be=7),ri(t)},o.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:U0(o)?(be=0,Jt=null,d_(e)):(be=0,Jt=null,Aa(t,e,o,7));break;case 5:var a=null;switch(ce.tag){case 26:a=ce.memoizedState;case 5:case 27:var s=ce;if(a?v1(a):s.stateNode.complete){be=0,Jt=null;var l=s.sibling;if(l!==null)ce=l;else{var c=s.return;c!==null?(ce=c,pd(c)):ce=null}break t}}be=0,Jt=null,Aa(t,e,o,5);break;case 6:be=0,Jt=null,Aa(t,e,o,6);break;case 8:Fg(),Ge=6;break e;default:throw Error(O(462))}}K2();break}catch(u){GS(t,u)}while(!0);return Ci=ko=null,Q.H=i,Q.A=r,ve=n,ce!==null?0:(Ae=null,fe=0,rd(),Ge)}function K2(){for(;ce!==null&&!_R();)KS(ce)}function KS(t){var e=ES(t.alternate,t,Di);t.memoizedProps=t.pendingProps,e===null?pd(t):ce=e}function d_(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=r_(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=r_(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:Cg(e);default:CS(n,e),e=ce=Cx(e,Di),e=ES(n,e,Di)}t.memoizedProps=t.pendingProps,e===null?pd(t):ce=e}function Aa(t,e,n,i){Ci=ko=null,Cg(e),Ma=null,yl=0;var r=e.return;try{if($2(t,r,e,n,fe)){Ge=1,$u(t,xn(n,t.current)),ce=null;return}}catch(o){if(r!==null)throw ce=r,o;Ge=1,$u(t,xn(n,t.current)),ce=null;return}e.flags&32768?(he||i===1?t=!0:Wa||(fe&536870912)!==0?t=!1:(vr=t=!0,(i===2||i===9||i===3||i===6)&&(i=cn.current,i!==null&&i.tag===13&&(i.flags|=16384))),QS(e,t)):pd(e)}function pd(t){var e=t;do{if((e.flags&32768)!==0){QS(e,vr);return}t=e.return;var n=V2(e.alternate,e,Di);if(n!==null){ce=n;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ge===0&&(Ge=5)}function QS(t,e){do{var n=j2(t.alternate,t);if(n!==null){n.flags&=32767,ce=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=n}while(t!==null);Ge=6,ce=null}function f_(t,e,n,i,r,o,a,s,l){t.cancelPendingCommit=null;do hd();while(ot!==0);if((ve&6)!==0)throw Error(O(327));if(e!==null){if(e===t.current)throw Error(O(177));if(o=e.lanes|e.childLanes,o|=dg,OR(t,n,o,a,s,l),t===Ae&&(ce=Ae=null,fe=0),Ua=e,Cr=t,Ti=n,$h=o,Fh=r,PS=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,tO(Tu,function(){return i1(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,r=ye.p,ye.p=2,a=ve,ve|=4;try{P2(t,e,n)}finally{ve=a,ye.p=r,Q.T=i}}ot=1,JS(),e1(),t1()}}function JS(){if(ot===1){ot=0;var t=Cr,e=Ua,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{HS(e,t);var o=qh,a=vx(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&mx(s.ownerDocument.documentElement,s)){if(l!==null&&ug(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,p=d&&d.defaultView||window;if(p.getSelection){var g=p.getSelection(),_=s.textContent.length,b=Math.min(l.start,_),x=l.end===void 0?b:Math.min(l.end,_);!g.extend&&b>x&&(a=x,x=b,b=a);var f=L0(s,b),h=L0(s,x);if(f&&h&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==h.node||g.focusOffset!==h.offset)){var y=d.createRange();y.setStart(f.node,f.offset),g.removeAllRanges(),b>x?(g.addRange(y),g.extend(h.node,h.offset)):(y.setEnd(h.node,h.offset),g.addRange(y))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var m=d[s];m.element.scrollLeft=m.left,m.element.scrollTop=m.top}}Qu=!!Ph,qh=Ph=null}finally{ve=r,ye.p=i,Q.T=n}}t.current=e,ot=2}}function e1(){if(ot===2){ot=0;var t=Cr,e=Ua,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{MS(t,e.alternate,e)}finally{ve=r,ye.p=i,Q.T=n}}ot=3}}function t1(){if(ot===4||ot===3){ot=0,xR();var t=Cr,e=Ua,n=Ti,i=PS;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ot=5:(ot=0,Ua=Cr=null,n1(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Er=null),ig(n),e=e.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(kl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Q.T,r=ye.p,ye.p=2,Q.T=null;try{for(var o=t.onRecoverableError,a=0;a<i.length;a++){var s=i[a];o(s.value,{componentStack:s.stack})}}finally{Q.T=e,ye.p=r}}(Ti&3)!==0&&hd(),ri(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Uh?ul++:(ul=0,Uh=t):ul=0,Il(0,!1)}}function n1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Nl(e)))}function hd(){return JS(),e1(),t1(),i1()}function i1(){if(ot!==5)return!1;var t=Cr,e=$h;$h=0;var n=ig(Ti),i=Q.T,r=ye.p;try{ye.p=32>n?32:n,Q.T=null,n=Fh,Fh=null;var o=Cr,a=Ti;if(ot=0,Ua=Cr=null,Ti=0,(ve&6)!==0)throw Error(O(331));var s=ve;if(ve|=4,US(o.current),BS(o,o.current,a,n),ve=s,Il(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(kl,o)}catch{}return!0}finally{ye.p=r,Q.T=i,n1(t,e)}}function p_(t,e,n){e=xn(n,e),e=Lh(t.stateNode,e,2),t=wr(t,e,2),t!==null&&(Rl(t,2),ri(t))}function _e(t,e,n){if(t.tag===3)p_(t,t,n);else for(;e!==null;){if(e.tag===3){p_(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Er===null||!Er.has(i))){t=xn(n,t),n=yS(2),i=wr(e,n,2),i!==null&&(bS(n,i,e,t),Rl(i,2),ri(i));break}}e=e.return}}function Qp(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new G2;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Bg=!0,r.add(n),t=Q2.bind(null,t,e,n),e.then(t,t))}function Q2(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(fe&n)===n&&(Ge===4||Ge===3&&(fe&62914560)===fe&&300>rn()-dd?(ve&2)===0&&Va(t,0):$g|=n,Fa===fe&&(Fa=0)),ri(t)}function r1(t,e){e===0&&(e=W_()),t=Ao(t,e),t!==null&&(Rl(t,e),ri(t))}function J2(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),r1(t,n)}function eO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(O(314))}i!==null&&i.delete(e),r1(t,n)}function tO(t,e){return tg(t,e)}var qu=null,ha=null,Vh=!1,Zu=!1,Jp=!1,br=0;function ri(t){t!==ha&&t.next===null&&(ha===null?qu=ha=t:ha=ha.next=t),Zu=!0,Vh||(Vh=!0,iO())}function Il(t,e){if(!Jp&&Zu){Jp=!0;do for(var n=!1,i=qu;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-an(42|t)+1)-1,o&=r&~(a&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,h_(i,o))}else o=fe,o=ed(i,i===Ae?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Tl(i,o)||(n=!0,h_(i,o));i=i.next}while(n);Jp=!1}}function nO(){o1()}function o1(){Zu=Vh=!1;var t=0;br!==0&&dO()&&(t=br);for(var e=rn(),n=null,i=qu;i!==null;){var r=i.next,o=a1(i,e);o===0?(i.next=null,n===null?qu=r:n.next=r,r===null&&(ha=n)):(n=i,(t!==0||(o&3)!==0)&&(Zu=!0)),i=r}ot!==0&&ot!==5||Il(t,!1),br!==0&&(br=0)}function a1(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var a=31-an(o),s=1<<a,l=r[a];l===-1?((s&n)===0||(s&i)!==0)&&(r[a]=RR(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,n=fe,n=ed(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Tp(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Tl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Tp(i),ig(n)){case 2:case 8:n=G_;break;case 32:n=Tu;break;case 268435456:n=Y_;break;default:n=Tu}return i=s1.bind(null,t),n=tg(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Tp(i),t.callbackPriority=2,t.callbackNode=null,2}function s1(t,e){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(hd()&&t.callbackNode!==n)return null;var i=fe;return i=ed(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(ZS(t,i,e),a1(t,rn()),t.callbackNode!=null&&t.callbackNode===n?s1.bind(null,t):null)}function h_(t,e){if(hd())return null;ZS(t,e,!0)}function iO(){pO(function(){(ve&6)!==0?tg(Z_,nO):o1()})}function Ug(){if(br===0){var t=za;t===0&&(t=Gc,Gc<<=1,(Gc&261888)===0&&(Gc=256)),br=t}return br}function g_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:du(""+t)}function m_(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function rO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var o=g_((r[jt]||null).action),a=i.submitter;a&&(e=(e=a[jt]||null)?g_(e.formAction):a.getAttribute("formAction"),e!==null&&(o=e,a=null));var s=new td("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(br!==0){var l=a?m_(r,a):new FormData(r);Nh(n,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=a?m_(r,a):new FormData(r),Nh(n,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(ou=0;ou<_h.length;ou++)au=_h[ou],v_=au.toLowerCase(),y_=au[0].toUpperCase()+au.slice(1),$n(v_,"on"+y_);var au,v_,y_,ou;$n(bx,"onAnimationEnd");$n(_x,"onAnimationIteration");$n(xx,"onAnimationStart");$n("dblclick","onDoubleClick");$n("focusin","onFocus");$n("focusout","onBlur");$n(S2,"onTransitionRun");$n(w2,"onTransitionStart");$n(E2,"onTransitionCancel");$n(Sx,"onTransitionEnd");Ia("onMouseEnter",["mouseout","mouseover"]);Ia("onMouseLeave",["mouseout","mouseover"]);Ia("onPointerEnter",["pointerout","pointerover"]);Ia("onPointerLeave",["pointerout","pointerover"]);wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wo("onBeforeInput",["compositionend","keypress","textInput","paste"]);wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xl));function l1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){Ou(u)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(s=i[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){Ou(u)}r.currentTarget=null,o=l}}}}function le(t,e){var n=e[fh];n===void 0&&(n=e[fh]=new Set);var i=t+"__bubble";n.has(i)||(c1(e,t,2,!1),n.add(i))}function eh(t,e,n){var i=0;e&&(i|=4),c1(n,t,i,e)}var su="_reactListening"+Math.random().toString(36).slice(2);function Vg(t){if(!t[su]){t[su]=!0,ex.forEach(function(n){n!=="selectionchange"&&(oO.has(n)||eh(n,!1,t),eh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[su]||(e[su]=!0,eh("selectionchange",!1,e))}}function c1(t,e,n,i){switch(S1(e)){case 2:var r=DO;break;case 8:r=LO;break;default:r=Zg}n=r.bind(null,e,n,t),r=void 0,!vh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function th(t,e,n,i,r){var o=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var s=i.stateNode.containerInfo;if(s===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;s!==null;){if(a=va(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=o=a;continue e}s=s.parentNode}}i=i.return}lx(function(){var c=o,u=ag(n),d=[];e:{var p=wx.get(t);if(p!==void 0){var g=td,_=t;switch(t){case"keypress":if(pu(n)===0)break e;case"keydown":case"keyup":g=e2;break;case"focusin":_="focus",g=Dp;break;case"focusout":_="blur",g=Dp;break;case"beforeblur":case"afterblur":g=Dp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=C0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=VR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=i2;break;case bx:case _x:case xx:g=qR;break;case Sx:g=o2;break;case"scroll":case"scrollend":g=FR;break;case"wheel":g=s2;break;case"copy":case"cut":case"paste":g=GR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=k0;break;case"toggle":case"beforetoggle":g=c2}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?p!==null?p+"Capture":null:p;b=[];for(var h=c,y;h!==null;){var m=h;if(y=m.stateNode,m=m.tag,m!==5&&m!==26&&m!==27||y===null||f===null||(m=pl(h,f),m!=null&&b.push(Sl(h,m,y))),x)break;h=h.return}0<b.length&&(p=new g(p,_,null,n,u),d.push({event:p,listeners:b}))}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",p&&n!==mh&&(_=n.relatedTarget||n.fromElement)&&(va(_)||_[qa]))break e;if((g||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,g?(_=n.relatedTarget||n.toElement,g=c,_=_?va(_):null,_!==null&&(x=Al(_),b=_.tag,_!==x||b!==5&&b!==27&&b!==6)&&(_=null)):(g=null,_=c),g!==_)){if(b=C0,m="onMouseLeave",f="onMouseEnter",h="mouse",(t==="pointerout"||t==="pointerover")&&(b=k0,m="onPointerLeave",f="onPointerEnter",h="pointer"),x=g==null?p:Xs(g),y=_==null?p:Xs(_),p=new b(m,h+"leave",g,n,u),p.target=x,p.relatedTarget=y,m=null,va(u)===c&&(b=new b(f,h+"enter",_,n,u),b.target=y,b.relatedTarget=x,m=b),x=m,g&&_)t:{for(b=aO,f=g,h=_,y=0,m=f;m;m=b(m))y++;m=0;for(var S=h;S;S=b(S))m++;for(;0<y-m;)f=b(f),y--;for(;0<m-y;)h=b(h),m--;for(;y--;){if(f===h||h!==null&&f===h.alternate){b=f;break t}f=b(f),h=b(h)}b=null}else b=null;g!==null&&b_(d,p,g,b,!1),_!==null&&x!==null&&b_(d,x,_,b,!0)}}e:{if(p=c?Xs(c):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var w=M0;else if(O0(p))if(hx)w=b2;else{w=v2;var C=m2}else g=p.nodeName,!g||g.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&og(c.elementType)&&(w=M0):w=y2;if(w&&(w=w(t,c))){px(d,w,n,u);break e}C&&C(t,p,c),t==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&gh(p,"number",p.value)}switch(C=c?Xs(c):window,t){case"focusin":(O0(C)||C.contentEditable==="true")&&(_a=C,yh=c,tl=null);break;case"focusout":tl=yh=_a=null;break;case"mousedown":bh=!0;break;case"contextmenu":case"mouseup":case"dragend":bh=!1,I0(d,n,u);break;case"selectionchange":if(x2)break;case"keydown":case"keyup":I0(d,n,u)}var k;if(cg)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ba?dx(t,n)&&(T="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(ux&&n.locale!=="ko"&&(ba||T!=="onCompositionStart"?T==="onCompositionEnd"&&ba&&(k=cx()):(mr=u,sg="value"in mr?mr.value:mr.textContent,ba=!0)),C=Gu(c,T),0<C.length&&(T=new A0(T,t,null,n,u),d.push({event:T,listeners:C}),k?T.data=k:(k=fx(n),k!==null&&(T.data=k)))),(k=d2?f2(t,n):p2(t,n))&&(T=Gu(c,"onBeforeInput"),0<T.length&&(C=new A0("onBeforeInput","beforeinput",null,n,u),d.push({event:C,listeners:T}),C.data=k)),rO(d,t,c,n,u)}l1(d,e)})}function Sl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Gu(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=pl(t,n),r!=null&&i.unshift(Sl(t,r,o)),r=pl(t,e),r!=null&&i.push(Sl(t,r,o))),t.tag===3)return i;t=t.return}return[]}function aO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function b_(t,e,n,i,r){for(var o=e._reactName,a=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=pl(n,o),c!=null&&a.unshift(Sl(n,c,l))):r||(c=pl(n,o),c!=null&&a.push(Sl(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var sO=/\r\n?/g,lO=/\u0000|\uFFFD/g;function __(t){return(typeof t=="string"?t:""+t).replace(sO,`
9
- `).replace(lO,"")}function u1(t,e){return e=__(e),__(t)===e}function we(t,e,n,i,r,o){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Ha(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Ha(t,""+i);break;case"className":Xc(t,"class",i);break;case"tabIndex":Xc(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Xc(t,n,i);break;case"style":sx(t,i,o);break;case"data":if(e!=="object"){Xc(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=du(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=du(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=du(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":le("beforetoggle",t),le("toggle",t),uu(t,"popover",i);break;case"xlinkActuate":mi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":mi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":mi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":mi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":mi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":mi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":mi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":mi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":mi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":uu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=BR.get(n)||n,uu(t,n,i))}}function jh(t,e,n,i,r,o){switch(n){case"style":sx(t,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Ha(t,i):(typeof i=="number"||typeof i=="bigint")&&Ha(t,""+i);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tx.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),o=t[jt]||null,o=o!=null?o[n]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof i=="function")){typeof o!="function"&&o!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):uu(t,n,i)}}}function bt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",t),le("load",t);var i=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];if(a!=null)switch(o){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:we(t,e,o,a,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":le("invalid",t);var s=o=a=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(O(137,e));break;default:we(t,e,i,u,n,null)}}rx(t,o,s,l,c,a,r,!1);return;case"select":le("invalid",t),i=a=o=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":a=s;break;case"multiple":i=s;default:we(t,e,r,s,n,null)}e=o,n=a,t.multiple=!!i,e!=null?Ta(t,!!i,e,!1):n!=null&&Ta(t,!!i,n,!0);return;case"textarea":le("invalid",t),o=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(O(91));break;default:we(t,e,a,s,n,null)}ax(t,i,r,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,l,i,n,null));return;case"dialog":le("beforetoggle",t),le("toggle",t),le("cancel",t),le("close",t);break;case"iframe":case"object":le("load",t);break;case"video":case"audio":for(i=0;i<xl.length;i++)le(xl[i],t);break;case"image":le("error",t),le("load",t);break;case"details":le("toggle",t);break;case"embed":case"source":case"link":le("error",t),le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:we(t,e,c,i,n,null)}return;default:if(og(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&jh(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&we(t,e,s,i,n,null))}function cO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,a=null,s=null,l=null,c=null,u=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(g)||we(t,e,g,null,i,d)}}for(var p in i){var g=i[p];if(d=n[p],i.hasOwnProperty(p)&&(g!=null||d!=null))switch(p){case"type":o=g;break;case"name":r=g;break;case"checked":c=g;break;case"defaultChecked":u=g;break;case"value":a=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(O(137,e));break;default:g!==d&&we(t,e,p,g,i,d)}}hh(t,a,s,l,c,u,o,r);return;case"select":g=a=s=p=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":g=l;default:i.hasOwnProperty(o)||we(t,e,o,null,i,l)}for(r in i)if(o=i[r],l=n[r],i.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":p=o;break;case"defaultValue":s=o;break;case"multiple":a=o;default:o!==l&&we(t,e,r,o,i,l)}e=s,n=a,i=g,p!=null?Ta(t,!!n,p,!1):!!i!=!!n&&(e!=null?Ta(t,!!n,e,!0):Ta(t,!!n,n?[]:"",!1));return;case"textarea":g=p=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,i,r)}for(a in i)if(r=i[a],o=n[a],i.hasOwnProperty(a)&&(r!=null||o!=null))switch(a){case"value":p=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(O(91));break;default:r!==o&&we(t,e,a,r,i,o)}ox(t,p,g);return;case"option":for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!=null&&!i.hasOwnProperty(_)&&(_==="selected"?t.selected=!1:we(t,e,_,null,i,p));for(l in i)p=i[l],g=n[l],i.hasOwnProperty(l)&&p!==g&&(p!=null||g!=null)&&(l==="selected"?t.selected=p&&typeof p!="function"&&typeof p!="symbol":we(t,e,l,p,i,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)p=n[b],n.hasOwnProperty(b)&&p!=null&&!i.hasOwnProperty(b)&&we(t,e,b,null,i,p);for(c in i)if(p=i[c],g=n[c],i.hasOwnProperty(c)&&p!==g&&(p!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(O(137,e));break;default:we(t,e,c,p,i,g)}return;default:if(og(e)){for(var x in n)p=n[x],n.hasOwnProperty(x)&&p!==void 0&&!i.hasOwnProperty(x)&&jh(t,e,x,void 0,i,p);for(u in i)p=i[u],g=n[u],!i.hasOwnProperty(u)||p===g||p===void 0&&g===void 0||jh(t,e,u,p,i,g);return}}for(var f in n)p=n[f],n.hasOwnProperty(f)&&p!=null&&!i.hasOwnProperty(f)&&we(t,e,f,null,i,p);for(d in i)p=i[d],g=n[d],!i.hasOwnProperty(d)||p===g||p==null&&g==null||we(t,e,d,p,i,g)}function x_(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&x_(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&x_(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(o+a)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ph=null,qh=null;function Yu(t){return t.nodeType===9?t:t.ownerDocument}function S_(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function d1(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Zh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var nh=null;function dO(){var t=window.event;return t&&t.type==="popstate"?t===nh?!1:(nh=t,!0):(nh=null,!1)}var f1=typeof setTimeout=="function"?setTimeout:void 0,fO=typeof clearTimeout=="function"?clearTimeout:void 0,w_=typeof Promise=="function"?Promise:void 0,pO=typeof queueMicrotask=="function"?queueMicrotask:typeof w_<"u"?function(t){return w_.resolve(null).then(t).catch(hO)}:f1;function hO(t){setTimeout(function(){throw t})}function Lr(t){return t==="head"}function E_(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Pa(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")dl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,dl(n);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[Ol]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=a}}else n==="body"&&dl(t.ownerDocument.body);n=r}while(n);Pa(e)}function C_(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function Gh(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Gh(n),rg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function gO(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Ol])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=En(t.nextSibling),t===null)break}return null}function mO(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=En(t.nextSibling),t===null))return null;return t}function p1(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=En(t.nextSibling),t===null))return null;return t}function Yh(t){return t.data==="$?"||t.data==="$~"}function Wh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function vO(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function En(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Xh=null;function A_(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return En(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function k_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function h1(t,e,n){switch(e=Yu(n),t){case"html":if(t=e.documentElement,!t)throw Error(O(452));return t;case"head":if(t=e.head,!t)throw Error(O(453));return t;case"body":if(t=e.body,!t)throw Error(O(454));return t;default:throw Error(O(451))}}function dl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);rg(t)}var Cn=new Map,T_=new Set;function Wu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Li=ye.d;ye.d={f:yO,r:bO,D:_O,C:xO,L:SO,m:wO,X:CO,S:EO,M:AO};function yO(){var t=Li.f(),e=fd();return t||e}function bO(t){var e=Za(t);e!==null&&e.tag===5&&e.type==="form"?sS(e):Li.r(t)}var Xa=typeof document>"u"?null:document;function g1(t,e,n){var i=Xa;if(i&&typeof e=="string"&&e){var r=_n(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),T_.has(r)||(T_.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function _O(t){Li.D(t),g1("dns-prefetch",t,null)}function xO(t,e){Li.C(t,e),g1("preconnect",t,e)}function SO(t,e,n){Li.L(t,e,n);var i=Xa;if(i&&t&&e){var r='link[rel="preload"][as="'+_n(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_n(n.imageSizes)+'"]')):r+='[href="'+_n(t)+'"]';var o=r;switch(e){case"style":o=ja(t);break;case"script":o=Ka(t)}Cn.has(o)||(t=He({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Cn.set(o,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Hl(o))||e==="script"&&i.querySelector(zl(o))||(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function wO(t,e){Li.m(t,e);var n=Xa;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+_n(i)+'"][href="'+_n(t)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ka(t)}if(!Cn.has(o)&&(t=He({rel:"modulepreload",href:t},e),Cn.set(o,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(zl(o)))return}i=n.createElement("link"),bt(i,"link",t),dt(i),n.head.appendChild(i)}}}function EO(t,e,n){Li.S(t,e,n);var i=Xa;if(i&&t){var r=ka(i).hoistableStyles,o=ja(t);e=e||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(Hl(o)))s.loading=5;else{t=He({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Cn.get(o))&&jg(t,n);var l=a=i.createElement("link");dt(l),bt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,xu(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}}function CO(t,e){Li.X(t,e);var n=Xa;if(n&&t){var i=ka(n).hoistableScripts,r=Ka(t),o=i.get(r);o||(o=n.querySelector(zl(r)),o||(t=He({src:t,async:!0},e),(e=Cn.get(r))&&Pg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function AO(t,e){Li.M(t,e);var n=Xa;if(n&&t){var i=ka(n).hoistableScripts,r=Ka(t),o=i.get(r);o||(o=n.querySelector(zl(r)),o||(t=He({src:t,async:!0,type:"module"},e),(e=Cn.get(r))&&Pg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function R_(t,e,n,i){var r=(r=_r.current)?Wu(r):null;if(!r)throw Error(O(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=ja(n.href),n=ka(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=ja(n.href);var o=ka(r).hoistableStyles,a=o.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,a),(o=r.querySelector(Hl(t)))&&!o._p&&(a.instance=o,a.state.loading=5),Cn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cn.set(t,n),o||kO(r,t,n,a.state))),e&&i===null)throw Error(O(528,""));return a}if(e&&i!==null)throw Error(O(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Ka(n),n=ka(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,t))}}function ja(t){return'href="'+_n(t)+'"'}function Hl(t){return'link[rel="stylesheet"]['+t+"]"}function m1(t){return He({},t,{"data-precedence":t.precedence,precedence:null})}function kO(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),bt(e,"link",n),dt(e),t.head.appendChild(e))}function Ka(t){return'[src="'+_n(t)+'"]'}function zl(t){return"script[async]"+t}function O_(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+_n(n.href)+'"]');if(i)return e.instance=i,dt(i),i;var r=He({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),dt(i),bt(i,"style",r),xu(i,n.precedence,t),e.instance=i;case"stylesheet":r=ja(n.href);var o=t.querySelector(Hl(r));if(o)return e.state.loading|=4,e.instance=o,dt(o),o;i=m1(n),(r=Cn.get(r))&&jg(i,r),o=(t.ownerDocument||t).createElement("link"),dt(o);var a=o;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),e.state.loading|=4,xu(o,n.precedence,t),e.instance=o;case"script":return o=Ka(n.src),(r=t.querySelector(zl(o)))?(e.instance=r,dt(r),r):(i=n,(r=Cn.get(o))&&(i=He({},n),Pg(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),dt(r),bt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(O(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,xu(i,n.precedence,t));return e.instance}function xu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function jg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Pg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Su=null;function M_(t,e,n){if(Su===null){var i=new Map,r=Su=new Map;r.set(n,i)}else r=Su,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var o=n[r];if(!(o[Ol]||o[mt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var a=o.getAttribute(e)||"";a=t+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function N_(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function TO(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function v1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function RO(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=ja(i.href),o=e.querySelector(Hl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Xu.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=o,dt(o);return}o=e.ownerDocument||e,i=m1(i),(r=Cn.get(r))&&jg(i,r),o=o.createElement("link"),dt(o);var a=o;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),n.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Xu.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var ih=0;function OO(t,e){return t.stylesheets&&t.count===0&&wu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&ih===0&&(ih=62500*uO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>ih?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ku=null;function wu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ku=new Map,e.forEach(MO,t),Ku=null,Xu.call(t))}function MO(t,e){if(!(e.state.loading&4)){var n=Ku.get(t);if(n)var i=n.get(null);else{n=new Map,Ku.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}r=e.instance,a=r.getAttribute("data-precedence"),o=n.get(a)||i,o===i&&n.set(null,r),n.set(a,r),this.count++,i=Xu.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var wl={$$typeof:wi,Provider:null,Consumer:null,_currentValue:po,_currentValue2:po,_threadCount:0};function NO(t,e,n,i,r,o,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rp(0),this.hiddenUpdates=Rp(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function y1(t,e,n,i,r,o,a,s,l,c,u,d){return t=new NO(t,e,n,a,l,c,u,d,s),e=1,o===!0&&(e|=24),o=tn(3,null,null,e),t.current=o,o.stateNode=t,e=mg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:e},bg(o),t}function b1(t){return t?(t=wa,t):wa}function _1(t,e,n,i,r,o){r=b1(r),i.context===null?i.context=r:i.pendingContext=r,i=Sr(e),i.payload={element:n},o=o===void 0?null:o,o!==null&&(i.callback=o),n=wr(t,i,e),n!==null&&(Vt(n,t,e),il(n,t,e))}function D_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function qg(t,e){D_(t,e),(t=t.alternate)&&D_(t,e)}function x1(t){if(t.tag===13||t.tag===31){var e=Ao(t,67108864);e!==null&&Vt(e,t,67108864),qg(t,67108864)}}function L_(t){if(t.tag===13||t.tag===31){var e=sn();e=ng(e);var n=Ao(t,e);n!==null&&Vt(n,t,e),qg(t,e)}}var Qu=!0;function DO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=2,Zg(t,e,n,i)}finally{ye.p=o,Q.T=r}}function LO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=8,Zg(t,e,n,i)}finally{ye.p=o,Q.T=r}}function Zg(t,e,n,i){if(Qu){var r=Kh(i);if(r===null)th(t,e,i,Ju,n),I_(t,i);else if(HO(r,t,e,n,i))i.stopPropagation();else if(I_(t,i),e&4&&-1<IO.indexOf(t)){for(;r!==null;){var o=Za(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var a=co(o.pendingLanes);if(a!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-an(a);s.entanglements[1]|=l,a&=~l}ri(o),(ve&6)===0&&(Vu=rn()+500,Il(0,!1))}}break;case 31:case 13:s=Ao(o,2),s!==null&&Vt(s,o,2),fd(),qg(o,2)}if(o=Kh(i),o===null&&th(t,e,i,Ju,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else th(t,e,i,null,n)}}function Kh(t){return t=ag(t),Gg(t)}var Ju=null;function Gg(t){if(Ju=null,t=va(t),t!==null){var e=Al(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=U_(e),t!==null)return t;t=null}else if(n===31){if(t=V_(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Ju=t,null}function S1(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(SR()){case Z_:return 2;case G_:return 8;case Tu:case wR:return 32;case Y_:return 268435456;default:return 32}default:return 32}}var Qh=!1,Ar=null,kr=null,Tr=null,El=new Map,Cl=new Map,hr=[],IO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function I_(t,e){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":kr=null;break;case"mouseover":case"mouseout":Tr=null;break;case"pointerover":case"pointerout":El.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cl.delete(e.pointerId)}}function Zs(t,e,n,i,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Za(e),e!==null&&x1(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function HO(t,e,n,i,r){switch(e){case"focusin":return Ar=Zs(Ar,t,e,n,i,r),!0;case"dragenter":return kr=Zs(kr,t,e,n,i,r),!0;case"mouseover":return Tr=Zs(Tr,t,e,n,i,r),!0;case"pointerover":var o=r.pointerId;return El.set(o,Zs(El.get(o)||null,t,e,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Cl.set(o,Zs(Cl.get(o)||null,t,e,n,i,r)),!0}return!1}function w1(t){var e=va(t.target);if(e!==null){var n=Al(e);if(n!==null){if(e=n.tag,e===13){if(e=U_(n),e!==null){t.blockedOn=e,y0(t.priority,function(){L_(n)});return}}else if(e===31){if(e=V_(n),e!==null){t.blockedOn=e,y0(t.priority,function(){L_(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Eu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Kh(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);mh=i,n.target.dispatchEvent(i),mh=null}else return e=Za(n),e!==null&&x1(e),t.blockedOn=n,!1;e.shift()}return!0}function H_(t,e,n){Eu(t)&&n.delete(e)}function zO(){Qh=!1,Ar!==null&&Eu(Ar)&&(Ar=null),kr!==null&&Eu(kr)&&(kr=null),Tr!==null&&Eu(Tr)&&(Tr=null),El.forEach(H_),Cl.forEach(H_)}function lu(t,e){t.blockedOn===e&&(t.blockedOn=null,Qh||(Qh=!0,at.unstable_scheduleCallback(at.unstable_NormalPriority,zO)))}var cu=null;function z_(t){cu!==t&&(cu=t,at.unstable_scheduleCallback(at.unstable_NormalPriority,function(){cu===t&&(cu=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(Gg(i||n)===null)continue;break}var o=Za(n);o!==null&&(t.splice(e,3),e-=3,Nh(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Pa(t){function e(l){return lu(l,t)}Ar!==null&&lu(Ar,t),kr!==null&&lu(kr,t),Tr!==null&&lu(Tr,t),El.forEach(e),Cl.forEach(e);for(var n=0;n<hr.length;n++){var i=hr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<hr.length&&(n=hr[0],n.blockedOn===null);)w1(n),n.blockedOn===null&&hr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[jt]||null;if(typeof o=="function")a||z_(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[jt]||null)s=a.formAction;else if(Gg(r)!==null)continue}else s=a.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),z_(n)}}}function E1(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function Yg(t){this._internalRoot=t}gd.prototype.render=Yg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));var n=e.current,i=sn();_1(n,i,t,e,null,null)};gd.prototype.unmount=Yg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;_1(t.current,2,null,t,null,null),fd(),e[qa]=null}};function gd(t){this._internalRoot=t}gd.prototype.unstable_scheduleHydration=function(t){if(t){var e=J_();t={blockedOn:null,target:t,priority:e};for(var n=0;n<hr.length&&e!==0&&e<hr[n].priority;n++);hr.splice(n,0,t),n===0&&w1(t)}};var B_=$_.version;if(B_!=="19.2.4")throw Error(O(527,B_,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(O(188)):(t=Object.keys(t).join(","),Error(O(268,t)));return t=gR(e),t=t!==null?j_(t):null,t=t===null?null:t.stateNode,t};var BO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Gs.isDisabled&&Gs.supportsFiber))try{kl=Gs.inject(BO),on=Gs}catch{}var Gs;md.createRoot=function(t,e){if(!F_(t))throw Error(O(299));var n=!1,i="",r=gS,o=mS,a=vS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=y1(t,1,!1,null,null,n,i,null,r,o,a,E1),t[qa]=e.current,Vg(t),new Yg(e)};md.hydrateRoot=function(t,e,n){if(!F_(t))throw Error(O(299));var i=!1,r="",o=gS,a=mS,s=vS,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=y1(t,1,!0,e,n??null,i,r,l,o,a,s,E1),e.context=b1(null),n=e.current,i=sn(),i=ng(i),r=Sr(i),r.callback=null,wr(n,r,i),n=i,e.current.lanes=n,Rl(e,n),ri(e),t[qa]=e.current,Vg(t),new gd(e)};md.version="19.2.4"});var To=Xn((sI,k1)=>{"use strict";function A1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A1)}catch(t){console.error(t)}}A1(),k1.exports=C1()});var ww=Xn(Ld=>{"use strict";var MM=Symbol.for("react.transitional.element"),NM=Symbol.for("react.fragment");function Sw(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:MM,type:t,key:i,ref:e!==void 0?e:null,props:n}}Ld.Fragment=NM;Ld.jsx=Sw;Ld.jsxs=Sw});var Fe=Xn((CH,Ew)=>{"use strict";Ew.exports=ww()});var IT=X(Qe(),1),sp=X(zs(),1),Q5=X(To(),1);function T1(t,e,n,i){let r=i?.maxRetries??3,o=i?.debounceMs??50,a=t.parentElement??e.parentElement;if(!a)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(d=>{if(!c){for(let p of d)for(let g of p.removedNodes)if(g===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},o);return}}});return u.observe(a,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var $O=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Wg(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!$O.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),g=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(d||g)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var R1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for insertHtml, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=Wg(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":o=n.innerHTML,n.replaceWith(r);break}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let s=T1(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(s(),t.position==="replace"&&o!==null){let l=document.createElement(n.tagName);l.innerHTML=o,Array.from(n.attributes).forEach(c=>{l.setAttribute(c.name,c.value)}),r.replaceWith(l)}else r.remove()},updateFn:l=>{"html"in l&&typeof l.html=="string"&&(r.innerHTML=Wg(l.html))}}},O1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for setText, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},M1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for setAttr, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&o!==null?n.setAttribute(t.attr,o):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},N1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for addClass, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},D1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for removeClass, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},L1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-content] Anchor not found for setStyle, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=new Map;for(let r of Object.keys(t.styles)){let o=n.style.getPropertyValue(r);i.set(r,o)}for(let[r,o]of Object.entries(t.styles))n.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,o]of i)o?n.style.setProperty(r,o):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,a]of Object.entries(r.styles))n.style.setProperty(o,a)}}},Xg=[{kind:"content:insertHtml",executor:R1},{kind:"content:setText",executor:O1},{kind:"content:setAttr",executor:M1},{kind:"content:addClass",executor:N1},{kind:"content:removeClass",executor:D1},{kind:"content:setStyle",executor:L1}],Kg={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Xg};var FO={light:50,medium:100,heavy:200},UO=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],I1={init(t,e,n){let i=FO[n.intensity],r=n.colors.length>0?n.colors:UO,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,n){let i=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation),n.shape==="circle"?(t.beginPath(),t.arc(0,0,n.size/2,0,Math.PI*2),t.fill()):t.fillRect(-n.size/2,-n.size/2,n.size,n.size*.6),t.restore())}};var VO={light:20,medium:40,heavy:80},jO="\u{1F389}",H1={init(t,e,n){let i=VO[n.intensity],r=typeof n.props?.emoji=="string"?n.props.emoji:jO,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:r,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let a of o)a.data&&(a.data.originX=a.x);return o},update(t,e,n){let i=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,a=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(n*.003+o)*a*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e)n.opacity<.01||!n.emoji||(t.save(),t.globalAlpha=n.opacity,t.font=`${n.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(n.emoji,n.x,n.y),t.restore())}};var PO={light:20,medium:40,heavy:80},qO={light:3,medium:4,heavy:5},z1={init(t,e,n){let i=PO[n.intensity],r=qO[n.intensity],o=n.colors.length>0?n.colors:["#ff4444","#44ff44","#4444ff"],a=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,c=Math.random()*e*.6,u=o[Math.floor(Math.random()*o.length)];for(let d=0;d<i;d++){let p=Math.PI*2*d/i+(Math.random()-.5)*.3,g=Math.random()*3+2;a.push({x:l,y:c,vx:Math.cos(p)*g,vy:Math.sin(p)*g,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:u,opacity:1,shape:"circle",data:{centerX:l,centerY:c}})}}return a},update(t,e,n){let i=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.shadowBlur=12,t.shadowColor=n.color,t.beginPath(),t.arc(n.x,n.y,n.size,0,Math.PI*2),t.fill(),t.restore())}};var ZO={light:30,medium:60,heavy:120},B1={init(t,e,n){let i=ZO[n.intensity],r=n.colors.length>0?n.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:r[Math.floor(Math.random()*r.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,n){let i=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,a=r.data?.baseOpacity??1;if(a<=.01)r.opacity=0;else{let s=Math.sin(n*.005+o)*.4+.6;r.opacity=a*s}r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e){if(n.opacity<.01)continue;t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation);let i=n.size;t.beginPath(),t.moveTo(0,-i),t.lineTo(i*.3,-i*.3),t.lineTo(i,0),t.lineTo(i*.3,i*.3),t.lineTo(0,i),t.lineTo(-i*.3,i*.3),t.lineTo(-i,0),t.lineTo(-i*.3,-i*.3),t.closePath(),t.fill(),t.restore()}}};var vd=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,n,i){this.container=e,this.effect=n,this.duration=i.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,a=window.innerWidth,s=window.innerHeight;r.width=a*o,r.height=s*o,r.style.width=`${a}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=n.init(a,s,i),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let n=e-this.startTime,i=e-this.lastFrame;if(this.lastFrame=e,n>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,i,n)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var GO=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],$1=new Map([["confetti",I1],["fireworks",z1],["sparkles",B1],["emoji-rain",H1]]),F1=async(t,e)=>{let n=$1.get(t.effect);if(!n)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...$1.keys()].join(", ")}`),{cleanup:()=>{}};let i={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:t.colors??GO,props:t.props},r=new vd;return r.start(e.overlayRoot,n,i),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{r.stop()}}};var Jg="syntro_active_tour",yd=new Map;function YO(t){try{let e=localStorage.getItem(Jg);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function Qg(t){try{localStorage.setItem(Jg,JSON.stringify(t))}catch{}}function WO(){try{localStorage.removeItem(Jg)}catch{}}function Bl(){return window.location.pathname}function XO(t){if(!t.route)return!0;let e=Bl();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var em=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:o=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(yd.has(n))return{cleanup:async()=>{let y=yd.get(n);y&&await y.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=YO(n),s=!!a;if(!s&&!o)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},Qg(a));let l=i.findIndex(y=>y.id===a.currentStepId);if(l===-1){let y=r||i[0].id;l=i.findIndex(m=>m.id===y),l===-1&&(l=0),a.currentStepId=i[l].id,Qg(a)}let c=i[l];if(!XO(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:Bl()}),{cleanup:()=>{}};let u=!1,d=null,p=null,g=null,_=async()=>{p&&(p(),p=null),d?.isApplied()&&(await d.revert(),d=null)},b=async y=>{if(u)return;if(await _(),y==="end"){WO(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let m=i.find(S=>S.id===y);if(!m){console.error(`[Tour] Step "${y}" not found`);return}if(a.currentStepId=y,Qg(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:y}),m.route&&m.route!==Bl()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:y,targetRoute:m.route});return}await x(m)},x=async y=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:y.id,stepIndex:i.findIndex(m=>m.id===y.id),totalSteps:i.length});try{d=await e.applyAction(y.action)}catch(m){console.error(`[Tour] Failed to execute step "${y.id}":`,m),e.publishEvent("tour.step_failed",{tourId:n,stepId:y.id,error:String(m)});return}if(y.onAction&&e.subscribeEvent){p=e.subscribeEvent("action.modal_cta_clicked",w=>{let C=w?.actionId;if(C&&y.onAction){let k=y.onAction[C];k&&b(k)}});let m=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let C=w?.actionId;if(C&&y.onAction){let k=y.onAction[C];k&&b(k)}}),S=p;p=()=>{S(),m()}}}};g=(()=>{let y=Bl(),m=()=>{let C=Bl();C!==y&&(y=C,e.publishEvent("tour.route_changed",{tourId:n,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>m());window.addEventListener("popstate",m);let S=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...C)=>{S(...C),queueMicrotask(m)},history.replaceState=(...C)=>{w(...C),queueMicrotask(m)},()=>{window.removeEventListener("popstate",m),history.pushState=S,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:a.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:a.currentStepId}),await x(c);let h=async()=>{u=!0,yd.delete(n),await _(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return yd.set(n,{cleanup:h}),{cleanup:h}};var _t={white:"#ffffff",black:"#000000"},te={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},A={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},ke={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},xt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},$e={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},un={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},$l={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},st={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Fl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var Ii={primary:A[10],secondary:A[9],tertiary:A[8]},CI={primary:A[2],secondary:A[0]},tm={primary:A[4],secondary:A[3]},bd={primary:{text:_t.white,icon:_t.white,border:te[3],backgroundDefault:te[3],backgroundHover:te[2]},neutral:{text:A[10],textHover:_t.white,icon:A[10],iconHover:_t.white,border:A[4],background:A[2]},link:{text:_t.white,icon:_t.white,hover:te[5]},error:{text:$e[5],hover:$e[6]},success:{text:ke[5],hover:ke[6]}},AI={slateGrey:{content:A[10],pillOutline:A[10],borderPrimary:A[5],borderSecondary:A[5],background:A[3]},brand:{content:te[9],pillOutline:te[9],borderPrimary:te[6],borderSecondary:te[6],background:te[0]},red:{content:$e[8],pillOutline:$e[4],borderPrimary:$e[2],borderSecondary:$e[2],background:$e[0]},yellow:{content:xt[8],pillOutline:xt[4],borderPrimary:xt[2],borderSecondary:xt[2],background:xt[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:st[8],pillOutline:st[4],borderPrimary:st[2],borderSecondary:st[2],background:st[0]},blue:{content:un[8],pillOutline:un[4],borderPrimary:un[2],borderSecondary:un[2],background:un[0]},orange:{content:$l[8],pillOutline:$l[4],borderPrimary:$l[2],borderSecondary:$l[2],background:$l[0]},pink:{content:Fl[8],pillOutline:Fl[4],borderPrimary:Fl[2],borderSecondary:Fl[2],background:Fl[0]}},kI={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:xt[8],border:xt[2],background:xt[0]},red:{content:$e[8],border:$e[2],background:$e[0]}},TI={green:{content:ke[1],background:ke[9]},yellow:{content:xt[1],background:xt[9]},red:{content:$e[1],background:$e[9]}},RI={content:A[10],border:A[4],background:"#1c2124"},OI={backgroundDefault:A[2],backgroundHover:A[1],selected:A[3]},MI={background:A[2],icon:A[10],borderDefault:A[4],borderSelected:te[3],textLabel:A[9],textPlaceholder:A[8],textHint:A[8]},NI={backgroundDefault:A[2],backgroundDisabled:A[0],textLabel:A[9],textPlaceholder:A[8],textHint:A[8],textError:$e[5],iconDefault:A[9],iconPlaceholder:A[10],iconError:$e[5],borderDefault:A[4],borderSelected:te[3],borderError:$e[5]},DI={handleDefault:_t.white,handleDisabled:A[10],off:{backgroundDefault:A[4],backgroundHover:A[5],backgroundDisabled:A[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:A[4]}},LI={off:{backgroundDefault:"#00000000",backgroundHover:A[5],backgroundDisabled:A[2],border:A[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:A[2],border:ke[3]}},II={content:A[10],background:A[4]},HI={background:A[4],active:ke[3]},zI={background:A[1],content:A[9],border:A[4]},BI={backgroundDefault:A[1],backgroundHover:A[3],backgroundActive:A[4],border:A[4],contentPrimary:A[10],contentSecondary:A[9],contentTertiary:A[8]},$I={background:A[1],content:A[9],border:A[4]},FI={activeBackground:A[3],activeContent:te[5],inactiveContent:A[9],border:A[4]},UI={header:{textDefault:A[9],textHover:A[8],backgroundDefault:A[1]},border:A[4],cell:{textPrimary:A[10],textSecondary:A[9],backgroundDefault:A[2],backgroundHover:A[1]}},VI={textPrimaryDefault:A[10],textPrimaryHover:A[10],textSecondaryDefault:A[8],textSecondaryHover:A[9],iconPrimary:A[10],iconSecondary:A[8]},jI={background:ke[1],active:ke[5]},PI={textDefault:A[10],textSelected:_t.white,textDisabled:A[7],backgroundDefault:A[2],backgroundMiddle:A[3],backgroundSelected:te[3],border:A[4]},qI=A[9];var U1=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function V1(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??`var(--syntro-ring, ${un[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),d=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),p=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let _=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:_?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${a||p||un[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(b);let x=[];if(!U1)for(let T=0;T<4;T++){let E=document.createElement("div");E.style.position="fixed",E.style.background="inherit",x.push(E),g.appendChild(E)}let f=T=>{g.style.clipPath=T,g.style.webkitClipPath=T},h=()=>{if(!t.isConnected){k.destroy();return}let T=t.getBoundingClientRect(),E=Math.max(0,T.left-i),M=Math.max(0,T.top-i),N=Math.min(window.innerWidth,T.width+i*2),I=Math.min(window.innerHeight,T.height+i*2);if(Object.assign(b.style,{left:`${E}px`,top:`${M}px`,width:`${N}px`,height:`${I}px`}),U1){let H=window.innerWidth,q=window.innerHeight,V=Math.min(r,N/2,I/2),ie=`M 0 0 L ${H} 0 L ${H} ${q} L 0 ${q} Z`,D=`M ${E+V} ${M} A ${V} ${V} 0 0 0 ${E} ${M+V} L ${E} ${M+I-V} A ${V} ${V} 0 0 0 ${E+V} ${M+I} L ${E+N-V} ${M+I} A ${V} ${V} 0 0 0 ${E+N} ${M+I-V} L ${E+N} ${M+V} A ${V} ${V} 0 0 0 ${E+N-V} ${M} L ${E+V} ${M} Z`;f(`path('${ie} ${D}')`)}else{let[H,q,V,ie]=x;Object.assign(H.style,{left:"0px",top:"0px",width:"100vw",height:`${M}px`}),Object.assign(V.style,{left:"0px",top:`${M+I}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(M+I))}px`}),Object.assign(ie.style,{left:"0px",top:`${M}px`,width:`${E}px`,height:`${I}px`}),Object.assign(q.style,{left:`${E+N}px`,top:`${M}px`,width:`${Math.max(0,window.innerWidth-(E+N))}px`,height:`${I}px`})}},y=new ResizeObserver(()=>requestAnimationFrame(h));y.observe(t);let m=()=>requestAnimationFrame(h),S=()=>requestAnimationFrame(h);window.addEventListener("scroll",m,!0),window.addEventListener("resize",S);let w=T=>{T.key==="Escape"&&c&&k.destroy()};c&&window.addEventListener("keydown",w);let C=T=>{s?(T.preventDefault(),T.stopPropagation()):l&&k.destroy()};g.addEventListener("click",C);let k={destroy(){y.disconnect(),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",S),c&&window.removeEventListener("keydown",w),g.removeEventListener("click",C),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),b.remove()},220)}};return h(),k}var KO=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function dn(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!KO.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),p=(c==="href"||c==="src")&&u.startsWith("javascript:");(d||p)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var nm=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:o,dismiss:a,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
8
+ `+i.stack}}var bh=Object.prototype.hasOwnProperty,cg=ot.unstable_scheduleCallback,Hp=ot.unstable_cancelCallback,zR=ot.unstable_shouldYield,BR=ot.unstable_requestPaint,rn=ot.unstable_now,FR=ot.unstable_getCurrentPriorityLevel,dS=ot.unstable_ImmediatePriority,fS=ot.unstable_UserBlockingPriority,zu=ot.unstable_NormalPriority,$R=ot.unstable_LowPriority,pS=ot.unstable_IdlePriority,UR=ot.log,VR=ot.unstable_setDisableYieldValue,Rl=null,on=null;function gr(t){if(typeof UR=="function"&&VR(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Rl,t)}catch{}}var an=Math.clz32?Math.clz32:qR,jR=Math.log,PR=Math.LN2;function qR(t){return t>>>=0,t===0?32:31-(jR(t)/PR|0)|0}var nu=256,iu=262144,ru=4194304;function uo(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function cd(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,o=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~o,i!==0?r=uo(i):(a&=s,a!==0?r=uo(a):n||(n=s&~t,n!==0&&(r=uo(n))))):(s=i&~o,s!==0?r=uo(s):a!==0?r=uo(a):n||(n=i&~t,n!==0&&(r=uo(n)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,n=e&-e,o>=n||o===32&&(n&4194048)!==0)?e:r}function Ol(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function ZR(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hS(){var t=ru;return ru<<=1,(ru&62914560)===0&&(ru=4194304),t}function zp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ml(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function GR(t,e,n,i,r,o){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-an(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var g=h[u];g!==null&&(g.lane&=-536870913)}n&=~d}i!==0&&gS(t,i,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(a&~e))}function gS(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function mS(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function vS(t,e){var n=e&-e;return n=(n&42)!==0?1:ug(n),(n&(t.suspendedLanes|e))!==0?0:n}function ug(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function dg(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function yS(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:Uw(t.type))}function z0(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var Dr=Math.random().toString(36).slice(2),mt="__reactFiber$"+Dr,jt="__reactProps$"+Dr,Za="__reactContainer$"+Dr,_h="__reactEvents$"+Dr,YR="__reactListeners$"+Dr,WR="__reactHandles$"+Dr,B0="__reactResources$"+Dr,Nl="__reactMarker$"+Dr;function fg(t){delete t[mt],delete t[jt],delete t[_h],delete t[YR],delete t[WR]}function ya(t){var e=t[mt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Za]||n[mt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Z_(t);t!==null;){if(n=t[mt])return n;t=Z_(t)}return e}t=n,n=t.parentNode}return null}function Ga(t){if(t=t[mt]||t[Za]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Qs(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(O(33))}function ka(t){var e=t[B0];return e||(e=t[B0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function dt(t){t[Nl]=!0}var bS=new Set,_S={};function Eo(t,e){Ha(t,e),Ha(t+"Capture",e)}function Ha(t,e){for(_S[t]=e,t=0;t<e.length;t++)bS.add(e[t])}var XR=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),F0={},$0={};function KR(t){return bh.call($0,t)?!0:bh.call(F0,t)?!1:XR.test(t)?$0[t]=!0:(F0[t]=!0,!1)}function bu(t,e,n){if(KR(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function ou(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function mi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function SS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function QR(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,o=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Sh(t){if(!t._valueTracker){var e=SS(t)?"checked":"value";t._valueTracker=QR(t,e,""+t[e])}}function xS(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=SS(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Bu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var JR=/[\n"\\]/g;function _n(t){return t.replace(JR,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function xh(t,e,n,i,r,o,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+vn(e)):t.value!==""+vn(e)&&(t.value=""+vn(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?wh(t,a,vn(e)):n!=null?wh(t,a,vn(n)):i!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+vn(s):t.removeAttribute("name")}function wS(t,e,n,i,r,o,a,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Sh(t);return}n=n!=null?""+vn(n):"",e=e!=null?""+vn(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),Sh(t)}function wh(t,e,n){e==="number"&&Bu(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ra(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+vn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function ES(t,e,n){if(e!=null&&(e=""+vn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+vn(n):""}function CS(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(O(92));if(Ks(i)){if(1<i.length)throw Error(O(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=vn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),Sh(t)}function za(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var e2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function U0(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||e2.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function AS(t,e,n){if(e!=null&&typeof e!="object")throw Error(O(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&U0(t,r,i)}else for(var o in e)e.hasOwnProperty(o)&&U0(t,o,e[o])}function pg(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),n2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _u(t){return n2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ei(){}var Eh=null;function hg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ba=null,Oa=null;function V0(t){var e=Ga(t);if(e&&(t=e.stateNode)){var n=t[jt]||null;e:switch(t=e.stateNode,e.type){case"input":if(xh(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[jt]||null;if(!r)throw Error(O(90));xh(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&xS(i)}break e;case"textarea":ES(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Ra(t,!!n.multiple,e,!1)}}}var Bp=!1;function TS(t,e,n){if(Bp)return t(e,n);Bp=!0;try{var i=t(e);return i}finally{if(Bp=!1,(ba!==null||Oa!==null)&&(Sd(),ba&&(e=ba,t=Oa,Oa=ba=null,V0(e),t)))for(e=0;e<t.length;e++)V0(t[e])}}function gl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[jt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(O(231,e,typeof n));return n}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ch=!1;if(Ri)try{da={},Object.defineProperty(da,"passive",{get:function(){Ch=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{Ch=!1}var da,mr=null,gg=null,Su=null;function kS(){if(Su)return Su;var t,e=gg,n=e.length,i,r="value"in mr?mr.value:mr.textContent,o=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[o-i];i++);return Su=r.slice(t,1<i?1-i:void 0)}function xu(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function au(){return!0}function j0(){return!1}function Pt(t){function e(n,i,r,o,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?au:j0,this.isPropagationStopped=j0,this}return Ie(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=au)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=au)},persist:function(){},isPersistent:au}),e}var Co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ud=Pt(Co),Dl=Ie({},Co,{view:0,detail:0}),i2=Pt(Dl),Fp,$p,Ps,dd=Ie({},Dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ps&&(Ps&&t.type==="mousemove"?(Fp=t.screenX-Ps.screenX,$p=t.screenY-Ps.screenY):$p=Fp=0,Ps=t),Fp)},movementY:function(t){return"movementY"in t?t.movementY:$p}}),P0=Pt(dd),r2=Ie({},dd,{dataTransfer:0}),o2=Pt(r2),a2=Ie({},Dl,{relatedTarget:0}),Up=Pt(a2),s2=Ie({},Co,{animationName:0,elapsedTime:0,pseudoElement:0}),l2=Pt(s2),c2=Ie({},Co,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),u2=Pt(c2),d2=Ie({},Co,{data:0}),q0=Pt(d2),f2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},h2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=h2[t])?!!e[t]:!1}function mg(){return g2}var m2=Ie({},Dl,{key:function(t){if(t.key){var e=f2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=xu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?p2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(t){return t.type==="keypress"?xu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?xu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v2=Pt(m2),y2=Ie({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z0=Pt(y2),b2=Ie({},Dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),_2=Pt(b2),S2=Ie({},Co,{propertyName:0,elapsedTime:0,pseudoElement:0}),x2=Pt(S2),w2=Ie({},dd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),E2=Pt(w2),C2=Ie({},Co,{newState:0,oldState:0}),A2=Pt(C2),T2=[9,13,27,32],vg=Ri&&"CompositionEvent"in window,tl=null;Ri&&"documentMode"in document&&(tl=document.documentMode);var k2=Ri&&"TextEvent"in window&&!tl,RS=Ri&&(!vg||tl&&8<tl&&11>=tl),G0=" ",Y0=!1;function OS(t,e){switch(t){case"keyup":return T2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function MS(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _a=!1;function R2(t,e){switch(t){case"compositionend":return MS(e);case"keypress":return e.which!==32?null:(Y0=!0,G0);case"textInput":return t=e.data,t===G0&&Y0?null:t;default:return null}}function O2(t,e){if(_a)return t==="compositionend"||!vg&&OS(t,e)?(t=kS(),Su=gg=mr=null,_a=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return RS&&e.locale!=="ko"?null:e.data;default:return null}}var M2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function W0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!M2[t.type]:e==="textarea"}function NS(t,e,n,i){ba?Oa?Oa.push(i):Oa=[i]:ba=i,e=nd(e,"onChange"),0<e.length&&(n=new ud("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var nl=null,ml=null;function N2(t){Tw(t,0)}function fd(t){var e=Qs(t);if(xS(e))return t}function X0(t,e){if(t==="change")return e}var DS=!1;Ri&&(Ri?(lu="oninput"in document,lu||(Vp=document.createElement("div"),Vp.setAttribute("oninput","return;"),lu=typeof Vp.oninput=="function"),su=lu):su=!1,DS=su&&(!document.documentMode||9<document.documentMode));var su,lu,Vp;function K0(){nl&&(nl.detachEvent("onpropertychange",LS),ml=nl=null)}function LS(t){if(t.propertyName==="value"&&fd(ml)){var e=[];NS(e,ml,t,hg(t)),TS(N2,e)}}function D2(t,e,n){t==="focusin"?(K0(),nl=e,ml=n,nl.attachEvent("onpropertychange",LS)):t==="focusout"&&K0()}function L2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return fd(ml)}function I2(t,e){if(t==="click")return fd(e)}function H2(t,e){if(t==="input"||t==="change")return fd(e)}function z2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ln=typeof Object.is=="function"?Object.is:z2;function vl(t,e){if(ln(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!bh.call(e,r)||!ln(t[r],e[r]))return!1}return!0}function Q0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function J0(t,e){var n=Q0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Q0(n)}}function IS(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?IS(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function HS(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Bu(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Bu(t.document)}return e}function yg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var B2=Ri&&"documentMode"in document&&11>=document.documentMode,Sa=null,Ah=null,il=null,Th=!1;function e_(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Th||Sa==null||Sa!==Bu(i)||(i=Sa,"selectionStart"in i&&yg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),il&&vl(il,i)||(il=i,i=nd(Ah,"onSelect"),0<i.length&&(e=new ud("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Sa)))}function lo(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xa={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionrun:lo("Transition","TransitionRun"),transitionstart:lo("Transition","TransitionStart"),transitioncancel:lo("Transition","TransitionCancel"),transitionend:lo("Transition","TransitionEnd")},jp={},zS={};Ri&&(zS=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ao(t){if(jp[t])return jp[t];if(!xa[t])return t;var e=xa[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in zS)return jp[t]=e[n];return t}var BS=Ao("animationend"),FS=Ao("animationiteration"),$S=Ao("animationstart"),F2=Ao("transitionrun"),$2=Ao("transitionstart"),U2=Ao("transitioncancel"),US=Ao("transitionend"),VS=new Map,kh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");kh.push("scrollEnd");function Fn(t,e){VS.set(t,e),Eo(e,[t])}var Fu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mn=[],wa=0,bg=0;function pd(){for(var t=wa,e=bg=wa=0;e<t;){var n=mn[e];mn[e++]=null;var i=mn[e];mn[e++]=null;var r=mn[e];mn[e++]=null;var o=mn[e];if(mn[e++]=null,i!==null&&r!==null){var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}o!==0&&jS(n,r,o)}}function hd(t,e,n,i){mn[wa++]=t,mn[wa++]=e,mn[wa++]=n,mn[wa++]=i,bg|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function _g(t,e,n,i){return hd(t,e,n,i),$u(t)}function To(t,e){return hd(t,null,null,e),$u(t)}function jS(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,o=t.return;o!==null;)o.childLanes|=n,i=o.alternate,i!==null&&(i.childLanes|=n),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-an(n),t=o.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),o):null}function $u(t){if(50<fl)throw fl=0,Wh=null,Error(O(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ea={};function V2(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,i){return new V2(t,e,n,i)}function Sg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ai(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function PS(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function wu(t,e,n,i,r,o){var a=0;if(i=t,typeof t=="function")Sg(t)&&(a=1);else if(typeof t=="string")a=qO(t,n,ni.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case gh:return t=tn(31,n,e,r),t.elementType=gh,t.lanes=o,t;case ma:return go(n.children,r,o,e);case cS:a=8,r|=24;break;case fh:return t=tn(12,n,e,r|2),t.elementType=fh,t.lanes=o,t;case ph:return t=tn(13,n,e,r),t.elementType=ph,t.lanes=o,t;case hh:return t=tn(19,n,e,r),t.elementType=hh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case wi:a=10;break e;case uS:a=9;break e;case sg:a=11;break e;case lg:a=14;break e;case cr:a=16,i=null;break e}a=29,n=Error(O(130,t===null?"null":typeof t,"")),i=null}return e=tn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function go(t,e,n,i){return t=tn(7,t,i,e),t.lanes=n,t}function Pp(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function qS(t){var e=tn(18,null,null,0);return e.stateNode=t,e}function qp(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var t_=new WeakMap;function Sn(t,e){if(typeof t=="object"&&t!==null){var n=t_.get(t);return n!==void 0?n:(e={value:t,source:e,stack:H0(e)},t_.set(t,e),e)}return{value:t,source:e,stack:H0(e)}}var Ca=[],Aa=0,Uu=null,yl=0,yn=[],bn=0,Rr=null,Jn=1,ei="";function Si(t,e){Ca[Aa++]=yl,Ca[Aa++]=Uu,Uu=t,yl=e}function ZS(t,e,n){yn[bn++]=Jn,yn[bn++]=ei,yn[bn++]=Rr,Rr=t;var i=Jn;t=ei;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(e)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Jn=1<<32-an(e)+r|n<<r|i,ei=o+t}else Jn=1<<o|n<<r|i,ei=t}function xg(t){t.return!==null&&(Si(t,1),ZS(t,1,0))}function wg(t){for(;t===Uu;)Uu=Ca[--Aa],Ca[Aa]=null,yl=Ca[--Aa],Ca[Aa]=null;for(;t===Rr;)Rr=yn[--bn],yn[bn]=null,ei=yn[--bn],yn[bn]=null,Jn=yn[--bn],yn[bn]=null}function GS(t,e){yn[bn++]=Jn,yn[bn++]=ei,yn[bn++]=Rr,Jn=e.id,ei=e.overflow,Rr=t}var vt=null,Le=null,he=!1,Sr=null,xn=!1,Rh=Error(O(519));function Or(t){var e=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bl(Sn(e,t)),Rh}function n_(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mt]=t,e[jt]=i,n){case"dialog":le("cancel",e),le("close",e);break;case"iframe":case"object":case"embed":le("load",e);break;case"video":case"audio":for(n=0;n<wl.length;n++)le(wl[n],e);break;case"source":le("error",e);break;case"img":case"image":case"link":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"input":le("invalid",e),wS(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":le("invalid",e);break;case"textarea":le("invalid",e),CS(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||Rw(e.textContent,n)?(i.popover!=null&&(le("beforetoggle",e),le("toggle",e)),i.onScroll!=null&&le("scroll",e),i.onScrollEnd!=null&&le("scrollend",e),i.onClick!=null&&(e.onclick=Ei),e=!0):e=!1,e||Or(t,!0)}function i_(t){for(vt=t.return;vt;)switch(vt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:vt=vt.return}}function fa(t){if(t!==vt)return!1;if(!he)return i_(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||eg(t.type,t.memoizedProps)),n=!n),n&&Le&&Or(t),i_(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));Le=q_(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));Le=q_(t)}else e===27?(e=Le,Lr(t.type)?(t=rg,rg=null,Le=t):Le=e):Le=vt?En(t.stateNode.nextSibling):null;return!0}function bo(){Le=vt=null,he=!1}function Zp(){var t=Sr;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),Sr=null),t}function bl(t){Sr===null?Sr=[t]:Sr.push(t)}var Oh=ii(null),ko=null,Ci=null;function dr(t,e,n){Re(Oh,e._currentValue),e._currentValue=n}function Ti(t){t._currentValue=Oh.current,ft(Oh)}function Mh(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Nh(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var a=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Mh(o.return,n,t),i||(a=null);break e}o=s.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(O(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Mh(a,n,t),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===t){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ya(t,e,n,i){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(O(387));if(a=a.memoizedProps,a!==null){var s=r.type;ln(r.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(r===Lu.current){if(a=r.alternate,a===null)throw Error(O(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Cl):t=[Cl])}r=r.return}t!==null&&Nh(e,t,n,i),e.flags|=262144}function Vu(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _o(t){ko=t,Ci=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yt(t){return YS(ko,t)}function cu(t,e){return ko===null&&_o(t),YS(t,e)}function YS(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ci===null){if(t===null)throw Error(O(308));Ci=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ci=Ci.next=e;return n}var j2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},P2=ot.unstable_scheduleCallback,q2=ot.unstable_NormalPriority,tt={$$typeof:wi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Eg(){return{controller:new j2,data:new Map,refCount:0}}function Ll(t){t.refCount--,t.refCount===0&&P2(q2,function(){t.controller.abort()})}var rl=null,Dh=0,Ba=0,Ma=null;function Z2(t,e){if(rl===null){var n=rl=[];Dh=0,Ba=Wg(),Ma={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Dh++,e.then(r_,r_),e}function r_(){if(--Dh===0&&rl!==null){Ma!==null&&(Ma.status="fulfilled");var t=rl;rl=null,Ba=0,Ma=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function G2(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var o_=Q.S;Q.S=function(t,e){lw=rn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&Z2(t,e),o_!==null&&o_(t,e)};var mo=ii(null);function Cg(){var t=mo.current;return t!==null?t:Ae.pooledCache}function Eu(t,e){e===null?Re(mo,mo.current):Re(mo,e.pool)}function WS(){var t=Cg();return t===null?null:{parent:tt._currentValue,pool:t}}var Wa=Error(O(460)),Ag=Error(O(474)),gd=Error(O(542)),ju={then:function(){}};function a_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function XS(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Ei,Ei),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,l_(t),t;default:if(typeof e.status=="string")e.then(Ei,Ei);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(O(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,l_(t),t}throw vo=e,Wa}}function fo(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(vo=n,Wa):n}}var vo=null;function s_(){if(vo===null)throw Error(O(459));var t=vo;return vo=null,t}function l_(t){if(t===Wa||t===gd)throw Error(O(483))}var Na=null,_l=0;function uu(t){var e=_l;return _l+=1,Na===null&&(Na=[]),XS(Na,t,e)}function qs(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function du(t,e){throw e.$$typeof===DR?Error(O(525)):(t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function KS(t){function e(f,p){if(t){var v=f.deletions;v===null?(f.deletions=[p],f.flags|=16):v.push(p)}}function n(f,p){if(!t)return null;for(;p!==null;)e(f,p),p=p.sibling;return null}function i(f){for(var p=new Map;f!==null;)f.key!==null?p.set(f.key,f):p.set(f.index,f),f=f.sibling;return p}function r(f,p){return f=Ai(f,p),f.index=0,f.sibling=null,f}function o(f,p,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<p?(f.flags|=67108866,p):v):(f.flags|=67108866,p)):(f.flags|=1048576,p)}function a(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,p,v,y){return p===null||p.tag!==6?(p=Pp(v,f.mode,y),p.return=f,p):(p=r(p,v),p.return=f,p)}function l(f,p,v,y){var w=v.type;return w===ma?u(f,p,v.props.children,y,v.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cr&&fo(w)===p.type)?(p=r(p,v.props),qs(p,v),p.return=f,p):(p=wu(v.type,v.key,v.props,null,f.mode,y),qs(p,v),p.return=f,p)}function c(f,p,v,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=qp(v,f.mode,y),p.return=f,p):(p=r(p,v.children||[]),p.return=f,p)}function u(f,p,v,y,w){return p===null||p.tag!==7?(p=go(v,f.mode,y,w),p.return=f,p):(p=r(p,v),p.return=f,p)}function d(f,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Pp(""+p,f.mode,v),p.return=f,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case tu:return v=wu(p.type,p.key,p.props,null,f.mode,v),qs(v,p),v.return=f,v;case Xs:return p=qp(p,f.mode,v),p.return=f,p;case cr:return p=fo(p),d(f,p,v)}if(Ks(p)||js(p))return p=go(p,f.mode,v,null),p.return=f,p;if(typeof p.then=="function")return d(f,uu(p),v);if(p.$$typeof===wi)return d(f,cu(f,p),v);du(f,p)}return null}function h(f,p,v,y){var w=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:s(f,p,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case tu:return v.key===w?l(f,p,v,y):null;case Xs:return v.key===w?c(f,p,v,y):null;case cr:return v=fo(v),h(f,p,v,y)}if(Ks(v)||js(v))return w!==null?null:u(f,p,v,y,null);if(typeof v.then=="function")return h(f,p,uu(v),y);if(v.$$typeof===wi)return h(f,p,cu(f,v),y);du(f,v)}return null}function g(f,p,v,y,w){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(p,f,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case tu:return f=f.get(y.key===null?v:y.key)||null,l(p,f,y,w);case Xs:return f=f.get(y.key===null?v:y.key)||null,c(p,f,y,w);case cr:return y=fo(y),g(f,p,v,y,w)}if(Ks(y)||js(y))return f=f.get(v)||null,u(p,f,y,w,null);if(typeof y.then=="function")return g(f,p,v,uu(y),w);if(y.$$typeof===wi)return g(f,p,v,cu(p,y),w);du(p,y)}return null}function S(f,p,v,y){for(var w=null,T=null,x=p,k=p=0,C=null;x!==null&&k<v.length;k++){x.index>k?(C=x,x=null):C=x.sibling;var E=h(f,x,v[k],y);if(E===null){x===null&&(x=C);break}t&&x&&E.alternate===null&&e(f,x),p=o(E,p,k),T===null?w=E:T.sibling=E,T=E,x=C}if(k===v.length)return n(f,x),he&&Si(f,k),w;if(x===null){for(;k<v.length;k++)x=d(f,v[k],y),x!==null&&(p=o(x,p,k),T===null?w=x:T.sibling=x,T=x);return he&&Si(f,k),w}for(x=i(x);k<v.length;k++)C=g(x,f,k,v[k],y),C!==null&&(t&&C.alternate!==null&&x.delete(C.key===null?k:C.key),p=o(C,p,k),T===null?w=C:T.sibling=C,T=C);return t&&x.forEach(function(M){return e(f,M)}),he&&Si(f,k),w}function _(f,p,v,y){if(v==null)throw Error(O(151));for(var w=null,T=null,x=p,k=p=0,C=null,E=v.next();x!==null&&!E.done;k++,E=v.next()){x.index>k?(C=x,x=null):C=x.sibling;var M=h(f,x,E.value,y);if(M===null){x===null&&(x=C);break}t&&x&&M.alternate===null&&e(f,x),p=o(M,p,k),T===null?w=M:T.sibling=M,T=M,x=C}if(E.done)return n(f,x),he&&Si(f,k),w;if(x===null){for(;!E.done;k++,E=v.next())E=d(f,E.value,y),E!==null&&(p=o(E,p,k),T===null?w=E:T.sibling=E,T=E);return he&&Si(f,k),w}for(x=i(x);!E.done;k++,E=v.next())E=g(x,f,k,E.value,y),E!==null&&(t&&E.alternate!==null&&x.delete(E.key===null?k:E.key),p=o(E,p,k),T===null?w=E:T.sibling=E,T=E);return t&&x.forEach(function(I){return e(f,I)}),he&&Si(f,k),w}function b(f,p,v,y){if(typeof v=="object"&&v!==null&&v.type===ma&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case tu:e:{for(var w=v.key;p!==null;){if(p.key===w){if(w=v.type,w===ma){if(p.tag===7){n(f,p.sibling),y=r(p,v.props.children),y.return=f,f=y;break e}}else if(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cr&&fo(w)===p.type){n(f,p.sibling),y=r(p,v.props),qs(y,v),y.return=f,f=y;break e}n(f,p);break}else e(f,p);p=p.sibling}v.type===ma?(y=go(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=wu(v.type,v.key,v.props,null,f.mode,y),qs(y,v),y.return=f,f=y)}return a(f);case Xs:e:{for(w=v.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(f,p.sibling),y=r(p,v.children||[]),y.return=f,f=y;break e}else{n(f,p);break}else e(f,p);p=p.sibling}y=qp(v,f.mode,y),y.return=f,f=y}return a(f);case cr:return v=fo(v),b(f,p,v,y)}if(Ks(v))return S(f,p,v,y);if(js(v)){if(w=js(v),typeof w!="function")throw Error(O(150));return v=w.call(v),_(f,p,v,y)}if(typeof v.then=="function")return b(f,p,uu(v),y);if(v.$$typeof===wi)return b(f,p,cu(f,v),y);du(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(n(f,p.sibling),y=r(p,v),y.return=f,f=y):(n(f,p),y=Pp(v,f.mode,y),y.return=f,f=y),a(f)):n(f,p)}return function(f,p,v,y){try{_l=0;var w=b(f,p,v,y);return Na=null,w}catch(x){if(x===Wa||x===gd)throw x;var T=tn(29,x,null,f.mode);return T.lanes=y,T.return=f,T}}}var So=KS(!0),QS=KS(!1),ur=!1;function Tg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lh(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function wr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=$u(t),jS(t,null,n),e}return hd(t,i,e,n),$u(t)}function ol(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,mS(t,n)}}function Gp(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Ih=!1;function al(){if(Ih){var t=Ma;if(t!==null)throw t}}function sl(t,e,n,i){Ih=!1;var r=t.updateQueue;ur=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;a=0,u=c=l=null,s=o;do{var h=s.lane&-536870913,g=h!==s.lane;if(g?(fe&h)===h:(i&h)===h){h!==0&&h===Ba&&(Ih=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,_=s;h=e;var b=n;switch(_.tag){case 1:if(S=_.payload,typeof S=="function"){d=S.call(b,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=_.payload,h=typeof S=="function"?S.call(b,d,h):S,h==null)break e;d=Ie({},d,h);break e;case 2:ur=!0}}h=s.callback,h!==null&&(t.flags|=64,g&&(t.flags|=8192),g=r.callbacks,g===null?r.callbacks=[h]:g.push(h))}else g={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,a|=h;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;g=s,s=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,o===null&&(r.shared.lanes=0),Nr|=a,t.lanes=a,t.memoizedState=d}}function JS(t,e){if(typeof t!="function")throw Error(O(191,t));t.call(e)}function ex(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)JS(n[t],e)}var Fa=ii(null),Pu=ii(0);function c_(t,e){t=Di,Re(Pu,t),Re(Fa,e),Di=t|e.baseLanes}function Hh(){Re(Pu,Di),Re(Fa,Fa.current)}function kg(){Di=Pu.current,ft(Fa),ft(Pu)}var cn=ii(null),wn=null;function fr(t){var e=t.alternate;Re(Ye,Ye.current&1),Re(cn,t),wn===null&&(e===null||Fa.current!==null||e.memoizedState!==null)&&(wn=t)}function zh(t){Re(Ye,Ye.current),Re(cn,t),wn===null&&(wn=t)}function tx(t){t.tag===22?(Re(Ye,Ye.current),Re(cn,t),wn===null&&(wn=t)):pr(t)}function pr(){Re(Ye,Ye.current),Re(cn,cn.current)}function en(t){ft(cn),wn===t&&(wn=null),ft(Ye)}var Ye=ii(0);function qu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ng(n)||ig(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Oi=0,re=null,Ee=null,Je=null,Zu=!1,Da=!1,xo=!1,Gu=0,Sl=0,La=null,Y2=0;function Ze(){throw Error(O(321))}function Rg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ln(t[n],e[n]))return!1;return!0}function Og(t,e,n,i,r,o){return Oi=o,re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q.H=t===null||t.memoizedState===null?Nx:Ug,xo=!1,o=n(i,r),xo=!1,Da&&(o=ix(e,n,i,r)),nx(t),o}function nx(t){Q.H=xl;var e=Ee!==null&&Ee.next!==null;if(Oi=0,Je=Ee=re=null,Zu=!1,Sl=0,La=null,e)throw Error(O(300));t===null||nt||(t=t.dependencies,t!==null&&Vu(t)&&(nt=!0))}function ix(t,e,n,i){re=t;var r=0;do{if(Da&&(La=null),Sl=0,Da=!1,25<=r)throw Error(O(301));if(r+=1,Je=Ee=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Q.H=Dx,o=e(n,i)}while(Da);return o}function W2(){var t=Q.H,e=t.useState()[0];return e=typeof e.then=="function"?Il(e):e,t=t.useState()[0],(Ee!==null?Ee.memoizedState:null)!==t&&(re.flags|=1024),e}function Mg(){var t=Gu!==0;return Gu=0,t}function Ng(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Dg(t){if(Zu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Zu=!1}Oi=0,Je=Ee=re=null,Da=!1,Sl=Gu=0,La=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?re.memoizedState=Je=t:Je=Je.next=t,Je}function We(){if(Ee===null){var t=re.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Je===null?re.memoizedState:Je.next;if(e!==null)Je=e,Ee=t;else{if(t===null)throw re.alternate===null?Error(O(467)):Error(O(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Je===null?re.memoizedState=Je=t:Je=Je.next=t}return Je}function md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Il(t){var e=Sl;return Sl+=1,La===null&&(La=[]),t=XS(La,t,e),e=re,(Je===null?e.memoizedState:Je.next)===null&&(e=e.alternate,Q.H=e===null||e.memoizedState===null?Nx:Ug),t}function vd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Il(t);if(t.$$typeof===wi)return yt(t)}throw Error(O(438,String(t)))}function Lg(t){var e=null,n=re.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=md(),re.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=LR;return e.index++,n}function Mi(t,e){return typeof e=="function"?e(t):e}function Cu(t){var e=We();return Ig(e,Ee,t)}function Ig(t,e,n){var i=t.queue;if(i===null)throw Error(O(311));i.lastRenderedReducer=n;var r=t.baseQueue,o=i.pending;if(o!==null){if(r!==null){var a=r.next;r.next=o.next,o.next=a}e.baseQueue=r=o,i.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(fe&d)===d:(Oi&d)===d){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===Ba&&(u=!0);else if((Oi&h)===h){c=c.next,h===Ba&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=o):l=l.next=d,re.lanes|=h,Nr|=h;d=c.action,xo&&n(o,d),o=c.hasEagerState?c.eagerState:n(o,d)}else h={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=h,a=o):l=l.next=h,re.lanes|=d,Nr|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=o:l.next=s,!ln(o,t.memoizedState)&&(nt=!0,u&&(n=Ma,n!==null)))throw n;t.memoizedState=o,t.baseState=a,t.baseQueue=l,i.lastRenderedState=o}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Yp(t){var e=We(),n=e.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,o=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do o=t(o,a.action),a=a.next;while(a!==r);ln(o,e.memoizedState)||(nt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,i]}function rx(t,e,n){var i=re,r=We(),o=he;if(o){if(n===void 0)throw Error(O(407));n=n()}else n=e();var a=!ln((Ee||r).memoizedState,n);if(a&&(r.memoizedState=n,nt=!0),r=r.queue,Hg(sx.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Je!==null&&Je.memoizedState.tag&1){if(i.flags|=2048,$a(9,{destroy:void 0},ax.bind(null,i,r,n,e),null),Ae===null)throw Error(O(349));o||(Oi&127)!==0||ox(i,e,n)}return n}function ox(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=re.updateQueue,e===null?(e=md(),re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function ax(t,e,n,i){e.value=n,e.getSnapshot=i,lx(e)&&cx(t)}function sx(t,e,n){return n(function(){lx(e)&&cx(t)})}function lx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ln(t,n)}catch{return!0}}function cx(t){var e=To(t,2);e!==null&&Vt(e,t,2)}function Bh(t){var e=Lt();if(typeof t=="function"){var n=t;if(t=n(),xo){gr(!0);try{n()}finally{gr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:t},e}function ux(t,e,n,i){return t.baseState=n,Ig(t,Ee,typeof i=="function"?i:Mi)}function X2(t,e,n,i,r){if(bd(t))throw Error(O(485));if(t=e.action,t!==null){var o={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){o.listeners.push(a)}};Q.T!==null?n(!0):o.isTransition=!1,i(o),n=e.pending,n===null?(o.next=e.pending=o,dx(e,o)):(o.next=n.next,e.pending=n.next=o)}}function dx(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var o=Q.T,a={};Q.T=a;try{var s=n(r,i),l=Q.S;l!==null&&l(a,s),u_(t,e,s)}catch(c){Fh(t,e,c)}finally{o!==null&&a.types!==null&&(o.types=a.types),Q.T=o}}else try{o=n(r,i),u_(t,e,o)}catch(c){Fh(t,e,c)}}function u_(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){d_(t,e,i)},function(i){return Fh(t,e,i)}):d_(t,e,n)}function d_(t,e,n){e.status="fulfilled",e.value=n,fx(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,dx(t,n)))}function Fh(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,fx(e),e=e.next;while(e!==i)}t.action=null}function fx(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function px(t,e){return e}function f_(t,e){if(he){var n=Ae.formState;if(n!==null){e:{var i=re;if(he){if(Le){t:{for(var r=Le,o=xn;r.nodeType!==8;){if(!o){r=null;break t}if(r=En(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Le=En(r.nextSibling),i=r.data==="F!";break e}}Or(i)}i=!1}i&&(e=n[0])}}return n=Lt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:px,lastRenderedState:e},n.queue=i,n=Rx.bind(null,re,i),i.dispatch=n,i=Bh(!1),o=$g.bind(null,re,!1,i.queue),i=Lt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=X2.bind(null,re,r,o,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function p_(t){var e=We();return hx(e,Ee,t)}function hx(t,e,n){if(e=Ig(t,e,px)[0],t=Cu(Mi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Il(e)}catch(a){throw a===Wa?gd:a}else i=e;e=We();var r=e.queue,o=r.dispatch;return n!==e.memoizedState&&(re.flags|=2048,$a(9,{destroy:void 0},K2.bind(null,r,n),null)),[i,o,t]}function K2(t,e){t.action=e}function h_(t){var e=We(),n=Ee;if(n!==null)return hx(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function $a(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=re.updateQueue,e===null&&(e=md(),re.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function gx(){return We().memoizedState}function Au(t,e,n,i){var r=Lt();re.flags|=t,r.memoizedState=$a(1|e,{destroy:void 0},n,i===void 0?null:i)}function yd(t,e,n,i){var r=We();i=i===void 0?null:i;var o=r.memoizedState.inst;Ee!==null&&i!==null&&Rg(i,Ee.memoizedState.deps)?r.memoizedState=$a(e,o,n,i):(re.flags|=t,r.memoizedState=$a(1|e,o,n,i))}function g_(t,e){Au(8390656,8,t,e)}function Hg(t,e){yd(2048,8,t,e)}function Q2(t){re.flags|=4;var e=re.updateQueue;if(e===null)e=md(),re.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function mx(t){var e=We().memoizedState;return Q2({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(O(440));return e.impl.apply(void 0,arguments)}}function vx(t,e){return yd(4,2,t,e)}function yx(t,e){return yd(4,4,t,e)}function bx(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function _x(t,e,n){n=n!=null?n.concat([t]):null,yd(4,4,bx.bind(null,e,t),n)}function zg(){}function Sx(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Rg(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function xx(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Rg(e,i[1]))return i[0];if(i=t(),xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i}function Bg(t,e,n){return n===void 0||(Oi&1073741824)!==0&&(fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=uw(),re.lanes|=t,Nr|=t,n)}function wx(t,e,n,i){return ln(n,e)?n:Fa.current!==null?(t=Bg(t,n,i),ln(t,e)||(nt=!0),t):(Oi&42)===0||(Oi&1073741824)!==0&&(fe&261930)===0?(nt=!0,t.memoizedState=n):(t=uw(),re.lanes|=t,Nr|=t,e)}function Ex(t,e,n,i,r){var o=ye.p;ye.p=o!==0&&8>o?o:8;var a=Q.T,s={};Q.T=s,$g(t,!1,e,n);try{var l=r(),c=Q.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=G2(l,i);ll(t,e,u,sn(t))}else ll(t,e,i,sn(t))}catch(d){ll(t,e,{then:function(){},status:"rejected",reason:d},sn())}finally{ye.p=o,a!==null&&s.types!==null&&(a.types=s.types),Q.T=a}}function J2(){}function $h(t,e,n,i){if(t.tag!==5)throw Error(O(476));var r=Cx(t).queue;Ex(t,r,e,ho,n===null?J2:function(){return Ax(t),n(i)})}function Cx(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ho,baseState:ho,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:ho},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ax(t){var e=Cx(t);e.next===null&&(e=t.alternate.memoizedState),ll(t,e.next.queue,{},sn())}function Fg(){return yt(Cl)}function Tx(){return We().memoizedState}function kx(){return We().memoizedState}function eO(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=sn();t=xr(n);var i=wr(e,t,n);i!==null&&(Vt(i,e,n),ol(i,e,n)),e={cache:Eg()},t.payload=e;return}e=e.return}}function tO(t,e,n){var i=sn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bd(t)?Ox(e,n):(n=_g(t,e,n,i),n!==null&&(Vt(n,t,i),Mx(n,e,i)))}function Rx(t,e,n){var i=sn();ll(t,e,n,i)}function ll(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bd(t))Ox(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,ln(s,a))return hd(t,e,r,0),Ae===null&&pd(),!1}catch{}if(n=_g(t,e,r,i),n!==null)return Vt(n,t,i),Mx(n,e,i),!0}return!1}function $g(t,e,n,i){if(i={lane:2,revertLane:Wg(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},bd(t)){if(e)throw Error(O(479))}else e=_g(t,n,i,2),e!==null&&Vt(e,t,2)}function bd(t){var e=t.alternate;return t===re||e!==null&&e===re}function Ox(t,e){Da=Zu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Mx(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,mS(t,n)}}var xl={readContext:yt,use:vd,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};xl.useEffectEvent=Ze;var Nx={readContext:yt,use:vd,useCallback:function(t,e){return Lt().memoizedState=[t,e===void 0?null:e],t},useContext:yt,useEffect:g_,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Au(4194308,4,bx.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Au(4194308,4,t,e)},useInsertionEffect:function(t,e){Au(4,2,t,e)},useMemo:function(t,e){var n=Lt();e=e===void 0?null:e;var i=t();if(xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Lt();if(n!==void 0){var r=n(e);if(xo){gr(!0);try{n(e)}finally{gr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=tO.bind(null,re,t),[i.memoizedState,t]},useRef:function(t){var e=Lt();return t={current:t},e.memoizedState=t},useState:function(t){t=Bh(t);var e=t.queue,n=Rx.bind(null,re,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:zg,useDeferredValue:function(t,e){var n=Lt();return Bg(n,t,e)},useTransition:function(){var t=Bh(!1);return t=Ex.bind(null,re,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=re,r=Lt();if(he){if(n===void 0)throw Error(O(407));n=n()}else{if(n=e(),Ae===null)throw Error(O(349));(fe&127)!==0||ox(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,g_(sx.bind(null,i,o,t),[t]),i.flags|=2048,$a(9,{destroy:void 0},ax.bind(null,i,o,n,e),null),n},useId:function(){var t=Lt(),e=Ae.identifierPrefix;if(he){var n=ei,i=Jn;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Gu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=Y2++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Fg,useFormState:f_,useActionState:f_,useOptimistic:function(t){var e=Lt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=$g.bind(null,re,!0,n),n.dispatch=e,[t,e]},useMemoCache:Lg,useCacheRefresh:function(){return Lt().memoizedState=eO.bind(null,re)},useEffectEvent:function(t){var e=Lt(),n={impl:t};return e.memoizedState=n,function(){if((ve&2)!==0)throw Error(O(440));return n.impl.apply(void 0,arguments)}}},Ug={readContext:yt,use:vd,useCallback:Sx,useContext:yt,useEffect:Hg,useImperativeHandle:_x,useInsertionEffect:vx,useLayoutEffect:yx,useMemo:xx,useReducer:Cu,useRef:gx,useState:function(){return Cu(Mi)},useDebugValue:zg,useDeferredValue:function(t,e){var n=We();return wx(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Cu(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Il(t),e]},useSyncExternalStore:rx,useId:Tx,useHostTransitionStatus:Fg,useFormState:p_,useActionState:p_,useOptimistic:function(t,e){var n=We();return ux(n,Ee,t,e)},useMemoCache:Lg,useCacheRefresh:kx};Ug.useEffectEvent=mx;var Dx={readContext:yt,use:vd,useCallback:Sx,useContext:yt,useEffect:Hg,useImperativeHandle:_x,useInsertionEffect:vx,useLayoutEffect:yx,useMemo:xx,useReducer:Yp,useRef:gx,useState:function(){return Yp(Mi)},useDebugValue:zg,useDeferredValue:function(t,e){var n=We();return Ee===null?Bg(n,t,e):wx(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Yp(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Il(t),e]},useSyncExternalStore:rx,useId:Tx,useHostTransitionStatus:Fg,useFormState:h_,useActionState:h_,useOptimistic:function(t,e){var n=We();return Ee!==null?ux(n,Ee,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Lg,useCacheRefresh:kx};Dx.useEffectEvent=mx;function Wp(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ie({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Uh={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=sn(),r=xr(i);r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),ol(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=sn(),r=xr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),ol(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),i=xr(n);i.tag=2,e!=null&&(i.callback=e),e=wr(t,i,n),e!==null&&(Vt(e,t,n),ol(e,t,n))}};function m_(t,e,n,i,r,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,o,a):e.prototype&&e.prototype.isPureReactComponent?!vl(n,i)||!vl(r,o):!0}function v_(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Uh.enqueueReplaceState(e,e.state,null)}function wo(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Ie({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function Lx(t){Fu(t)}function Ix(t){console.error(t)}function Hx(t){Fu(t)}function Yu(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function y_(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Vh(t,e,n){return n=xr(n),n.tag=3,n.payload={element:null},n.callback=function(){Yu(t,e)},n}function zx(t){return t=xr(t),t.tag=3,t}function Bx(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=i.value;t.payload=function(){return r(o)},t.callback=function(){y_(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){y_(e,n,i),typeof r!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function nO(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ya(e,n,r,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return wn===null?Ju():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===ju?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),ah(t,i,r)),!1;case 22:return n.flags|=65536,i===ju?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),ah(t,i,r)),!1}throw Error(O(435,n.tag))}return ah(t,i,r),Ju(),!1}if(he)return e=cn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Rh&&(t=Error(O(422),{cause:i}),bl(Sn(t,n)))):(i!==Rh&&(e=Error(O(423),{cause:i}),bl(Sn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Sn(i,n),r=Vh(t.stateNode,i,r),Gp(t,r),Ge!==4&&(Ge=2)),!1;var o=Error(O(520),{cause:i});if(o=Sn(o,n),dl===null?dl=[o]:dl.push(o),Ge!==4&&(Ge=2),e===null)return!0;i=Sn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Vh(n.stateNode,i,t),Gp(n,t),!1;case 1:if(e=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Er===null||!Er.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=zx(r),Bx(r,t,n,i),Gp(n,r),!1}n=n.return}while(n!==null);return!1}var Vg=Error(O(461)),nt=!1;function gt(t,e,n,i){e.child=t===null?QS(e,null,n,i):So(e,t.child,n,i)}function b_(t,e,n,i,r){n=n.render;var o=e.ref;if("ref"in i){var a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}else a=i;return _o(e),i=Og(t,e,n,a,o,r),s=Mg(),t!==null&&!nt?(Ng(t,e,r),Ni(t,e,r)):(he&&s&&xg(e),e.flags|=1,gt(t,e,i,r),e.child)}function __(t,e,n,i,r){if(t===null){var o=n.type;return typeof o=="function"&&!Sg(o)&&o.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=o,Fx(t,e,o,i,r)):(t=wu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!jg(t,r)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:vl,n(a,i)&&t.ref===e.ref)return Ni(t,e,r)}return e.flags|=1,t=Ai(o,i),t.ref=e.ref,t.return=e,e.child=t}function Fx(t,e,n,i,r){if(t!==null){var o=t.memoizedProps;if(vl(o,i)&&t.ref===e.ref)if(nt=!1,e.pendingProps=i=o,jg(t,r))(t.flags&131072)!==0&&(nt=!0);else return e.lanes=t.lanes,Ni(t,e,r)}return jh(t,e,n,i,r)}function $x(t,e,n,i){var r=i.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,e.child=null;return S_(t,e,o,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Eu(e,o!==null?o.cachePool:null),o!==null?c_(e,o):Hh(),tx(e);else return i=e.lanes=536870912,S_(t,e,o!==null?o.baseLanes|n:n,n,i)}else o!==null?(Eu(e,o.cachePool),c_(e,o),pr(e),e.memoizedState=null):(t!==null&&Eu(e,null),Hh(),pr(e));return gt(t,e,r,n),e.child}function Js(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function S_(t,e,n,i,r){var o=Cg();return o=o===null?null:{parent:tt._currentValue,pool:o},e.memoizedState={baseLanes:n,cachePool:o},t!==null&&Eu(e,null),Hh(),tx(e),t!==null&&Ya(t,e,i,!0),e.childLanes=r,null}function Tu(t,e){return e=Wu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function x_(t,e,n){return So(e,t.child,null,n),t=Tu(e,e.pendingProps),t.flags|=2,en(e),e.memoizedState=null,t}function iO(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=Tu(e,i),e.lanes=536870912,Js(null,t);if(zh(e),(t=Le)?(t=Nw(t,xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=qS(t),n.return=e,e.child=n,vt=e,Le=null)):t=null,t===null)throw Or(e);return e.lanes=536870912,null}return Tu(e,i)}var o=t.memoizedState;if(o!==null){var a=o.dehydrated;if(zh(e),r)if(e.flags&256)e.flags&=-257,e=x_(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(O(558));else if(nt||Ya(t,e,n,!1),r=(n&t.childLanes)!==0,nt||r){if(i=Ae,i!==null&&(a=vS(i,n),a!==0&&a!==o.retryLane))throw o.retryLane=a,To(t,a),Vt(i,t,a),Vg;Ju(),e=x_(t,e,n)}else t=o.treeContext,Le=En(a.nextSibling),vt=e,he=!0,Sr=null,xn=!1,t!==null&&GS(e,t),e=Tu(e,i),e.flags|=4096;return e}return t=Ai(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ku(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(O(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function jh(t,e,n,i,r){return _o(e),n=Og(t,e,n,i,void 0,r),i=Mg(),t!==null&&!nt?(Ng(t,e,r),Ni(t,e,r)):(he&&i&&xg(e),e.flags|=1,gt(t,e,n,r),e.child)}function w_(t,e,n,i,r,o){return _o(e),e.updateQueue=null,n=ix(e,i,n,r),nx(t),i=Mg(),t!==null&&!nt?(Ng(t,e,o),Ni(t,e,o)):(he&&i&&xg(e),e.flags|=1,gt(t,e,n,o),e.child)}function E_(t,e,n,i,r){if(_o(e),e.stateNode===null){var o=Ea,a=n.contextType;typeof a=="object"&&a!==null&&(o=yt(a)),o=new n(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Uh,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},Tg(e),a=n.contextType,o.context=typeof a=="object"&&a!==null?yt(a):Ea,o.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Wp(e,n,a,i),o.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(a=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),a!==o.state&&Uh.enqueueReplaceState(o,o.state,null),sl(e,i,o,r),al(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=wo(n,s);o.props=l;var c=o.context,u=n.contextType;a=Ea,typeof u=="object"&&u!==null&&(a=yt(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||c!==a)&&v_(e,o,i,a),ur=!1;var h=e.memoizedState;o.state=h,sl(e,i,o,r),al(),c=e.memoizedState,s||h!==c||ur?(typeof d=="function"&&(Wp(e,n,d,i),c=e.memoizedState),(l=ur||m_(e,n,l,i,h,c,a))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,Lh(t,e),a=e.memoizedProps,u=wo(n,a),o.props=u,d=e.pendingProps,h=o.context,c=n.contextType,l=Ea,typeof c=="object"&&c!==null&&(l=yt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&v_(e,o,i,l),ur=!1,h=e.memoizedState,o.state=h,sl(e,i,o,r),al();var g=e.memoizedState;a!==d||h!==g||ur||t!==null&&t.dependencies!==null&&Vu(t.dependencies)?(typeof s=="function"&&(Wp(e,n,s,i),g=e.memoizedState),(u=ur||m_(e,n,u,i,h,g,l)||t!==null&&t.dependencies!==null&&Vu(t.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),o.props=i,o.state=g,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return o=i,ku(t,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&i?(e.child=So(e,t.child,null,r),e.child=So(e,null,n,r)):gt(t,e,n,r),e.memoizedState=o.state,t=e.child):t=Ni(t,e,r),t}function C_(t,e,n,i){return bo(),e.flags|=256,gt(t,e,n,i),e.child}var Xp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kp(t){return{baseLanes:t,cachePool:WS()}}function Qp(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=nn),t}function Ux(t,e,n){var i=e.pendingProps,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(Ye.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?fr(e):pr(e),(t=Le)?(t=Nw(t,xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=qS(t),n.return=e,e.child=n,vt=e,Le=null)):t=null,t===null)throw Or(e);return ig(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(pr(e),r=e.mode,s=Wu({mode:"hidden",children:s},r),i=go(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=Kp(n),i.childLanes=Qp(t,a,n),e.memoizedState=Xp,Js(null,i)):(fr(e),Ph(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(fr(e),e.flags&=-257,e=Jp(t,e,n)):e.memoizedState!==null?(pr(e),e.child=t.child,e.flags|=128,e=null):(pr(e),s=i.fallback,r=e.mode,i=Wu({mode:"visible",children:i.children},r),s=go(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,So(e,t.child,null,n),i=e.child,i.memoizedState=Kp(n),i.childLanes=Qp(t,a,n),e.memoizedState=Xp,e=Js(null,i));else if(fr(e),ig(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(O(419)),i.stack="",i.digest=a,bl({value:i,source:null,stack:null}),e=Jp(t,e,n)}else if(nt||Ya(t,e,n,!1),a=(n&t.childLanes)!==0,nt||a){if(a=Ae,a!==null&&(i=vS(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,To(t,i),Vt(a,t,i),Vg;ng(s)||Ju(),e=Jp(t,e,n)}else ng(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Le=En(s.nextSibling),vt=e,he=!0,Sr=null,xn=!1,t!==null&&GS(e,t),e=Ph(e,i.children),e.flags|=4096);return e}return r?(pr(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Ai(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=Ai(c,s):(s=go(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,Js(null,i),i=e.child,s=t.child.memoizedState,s===null?s=Kp(n):(r=s.cachePool,r!==null?(l=tt._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=WS(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=Qp(t,a,n),e.memoizedState=Xp,Js(t.child,i)):(fr(e),n=t.child,t=n.sibling,n=Ai(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Ph(t,e){return e=Wu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Wu(t,e){return t=tn(22,t,null,e),t.lanes=0,t}function Jp(t,e,n){return So(e,t.child,null,n),t=Ph(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function A_(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Mh(t.return,e,n)}function eh(t,e,n,i,r,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function Vx(t,e,n){var i=e.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=Ye.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,Re(Ye,a),gt(t,e,i,n),i=he?yl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&A_(t,n,e);else if(t.tag===19)A_(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&qu(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),eh(e,!1,r,n,o,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&qu(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}eh(e,!0,n,null,o,i);break;case"together":eh(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Ni(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Nr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ya(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(O(153));if(e.child!==null){for(t=e.child,n=Ai(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ai(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function jg(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Vu(t)))}function rO(t,e,n){switch(e.tag){case 3:Iu(e,e.stateNode.containerInfo),dr(e,tt,t.memoizedState.cache),bo();break;case 27:case 5:yh(e);break;case 4:Iu(e,e.stateNode.containerInfo);break;case 10:dr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,zh(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(fr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Ux(t,e,n):(fr(e),t=Ni(t,e,n),t!==null?t.sibling:null);fr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ya(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return Vx(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Re(Ye,Ye.current),i)break;return null;case 22:return e.lanes=0,$x(t,e,n,e.pendingProps);case 24:dr(e,tt,t.memoizedState.cache)}return Ni(t,e,n)}function jx(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)nt=!0;else{if(!jg(t,n)&&(e.flags&128)===0)return nt=!1,rO(t,e,n);nt=(t.flags&131072)!==0}else nt=!1,he&&(e.flags&1048576)!==0&&ZS(e,yl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=fo(e.elementType),e.type=t,typeof t=="function")Sg(t)?(i=wo(t,i),e.tag=1,e=E_(null,e,t,i,n)):(e.tag=0,e=jh(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===sg){e.tag=11,e=b_(null,e,t,i,n);break e}else if(r===lg){e.tag=14,e=__(null,e,t,i,n);break e}}throw e=mh(t)||t,Error(O(306,e,""))}}return e;case 0:return jh(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=wo(i,e.pendingProps),E_(t,e,i,r,n);case 3:e:{if(Iu(e,e.stateNode.containerInfo),t===null)throw Error(O(387));i=e.pendingProps;var o=e.memoizedState;r=o.element,Lh(t,e),sl(e,i,null,n);var a=e.memoizedState;if(i=a.cache,dr(e,tt,i),i!==o.cache&&Nh(e,[tt],n,!0),al(),i=a.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=C_(t,e,i,n);break e}else if(i!==r){r=Sn(Error(O(424)),e),bl(r),e=C_(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Le=En(t.firstChild),vt=e,he=!0,Sr=null,xn=!0,n=QS(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bo(),i===r){e=Ni(t,e,n);break e}gt(t,e,i,n)}e=e.child}return e;case 26:return ku(t,e),t===null?(n=Y_(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=id(_r.current).createElement(n),i[mt]=e,i[jt]=t,bt(i,n,t),dt(i),e.stateNode=i):e.memoizedState=Y_(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return yh(e),t===null&&he&&(i=e.stateNode=Dw(e.type,e.pendingProps,_r.current),vt=e,xn=!0,r=Le,Lr(e.type)?(rg=r,Le=En(i.firstChild)):Le=r),gt(t,e,e.pendingProps.children,n),ku(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Le)&&(i=NO(i,e.type,e.pendingProps,xn),i!==null?(e.stateNode=i,vt=e,Le=En(i.firstChild),xn=!1,r=!0):r=!1),r||Or(e)),yh(e),r=e.type,o=e.pendingProps,a=t!==null?t.memoizedProps:null,i=o.children,eg(r,o)?i=null:a!==null&&eg(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Og(t,e,W2,null,null,n),Cl._currentValue=r),ku(t,e),gt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Le)&&(n=DO(n,e.pendingProps,xn),n!==null?(e.stateNode=n,vt=e,Le=null,t=!0):t=!1),t||Or(e)),null;case 13:return Ux(t,e,n);case 4:return Iu(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=So(e,null,i,n):gt(t,e,i,n),e.child;case 11:return b_(t,e,e.type,e.pendingProps,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,dr(e,e.type,i.value),gt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,_o(e),r=yt(r),i=i(r),e.flags|=1,gt(t,e,i,n),e.child;case 14:return __(t,e,e.type,e.pendingProps,n);case 15:return Fx(t,e,e.type,e.pendingProps,n);case 19:return Vx(t,e,n);case 31:return iO(t,e,n);case 22:return $x(t,e,n,e.pendingProps);case 24:return _o(e),i=yt(tt),t===null?(r=Cg(),r===null&&(r=Ae,o=Eg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),e.memoizedState={parent:i,cache:r},Tg(e),dr(e,tt,r)):((t.lanes&n)!==0&&(Lh(t,e),sl(e,null,null,n),al()),r=t.memoizedState,o=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),dr(e,tt,i)):(i=o.cache,dr(e,tt,i),i!==r.cache&&Nh(e,[tt],n,!0))),gt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(O(156,e.tag))}function vi(t){t.flags|=4}function th(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(pw())t.flags|=8192;else throw vo=ju,Ag}else t.flags&=-16777217}function T_(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Hw(e))if(pw())t.flags|=8192;else throw vo=ju,Ag}function fu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?hS():536870912,t.lanes|=e,Ua|=e)}function Zs(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function De(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function oO(t,e,n){var i=e.pendingProps;switch(wg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(e),null;case 1:return De(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Ti(tt),Ia(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(fa(e)?vi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Zp())),De(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(vi(e),o!==null?(De(e),T_(e,o)):(De(e),th(e,r,null,i,n))):o?o!==t.memoizedState?(vi(e),De(e),T_(e,o)):(De(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&vi(e),De(e),th(e,r,t,i,n)),null;case 27:if(Hu(e),n=_r.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return De(e),null}t=ni.current,fa(e)?n_(e,t):(t=Dw(r,i,n),e.stateNode=t,vi(e))}return De(e),null;case 5:if(Hu(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return De(e),null}if(o=ni.current,fa(e))n_(e,o);else{var a=id(_r.current);switch(o){case 1:o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=a.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}o[mt]=e,o[jt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)o.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=o;e:switch(bt(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&vi(e)}}return De(e),th(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(O(166));if(t=_r.current,fa(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=vt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[mt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Rw(t.nodeValue,n)),t||Or(e,!0)}else t=id(t).createTextNode(i),t[mt]=e,e.stateNode=t}return De(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=fa(e),n!==null){if(t===null){if(!i)throw Error(O(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(557));t[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;De(e),t=!1}else n=Zp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(en(e),e):(en(e),null);if((e.flags&128)!==0)throw Error(O(558))}return De(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=fa(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(O(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(O(317));r[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;De(e),r=!1}else r=Zp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(en(e),e):(en(e),null)}return en(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),fu(e,e.updateQueue),De(e),null);case 4:return Ia(),t===null&&Xg(e.stateNode.containerInfo),De(e),null;case 10:return Ti(e.type),De(e),null;case 19:if(ft(Ye),i=e.memoizedState,i===null)return De(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Zs(i,!1);else{if(Ge!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=qu(t),o!==null){for(e.flags|=128,Zs(i,!1),t=o.updateQueue,e.updateQueue=t,fu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)PS(n,t),n=n.sibling;return Re(Ye,Ye.current&1|2),he&&Si(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&rn()>Ku&&(e.flags|=128,r=!0,Zs(i,!1),e.lanes=4194304)}else{if(!r)if(t=qu(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,fu(e,t),Zs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!he)return De(e),null}else 2*rn()-i.renderingStartTime>Ku&&n!==536870912&&(e.flags|=128,r=!0,Zs(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(t=i.last,t!==null?t.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Ye.current,Re(Ye,r?n&1|2:n&1),he&&Si(e,i.treeForkCount),t):(De(e),null);case 22:case 23:return en(e),kg(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(De(e),e.subtreeFlags&6&&(e.flags|=8192)):De(e),n=e.updateQueue,n!==null&&fu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ft(mo),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ti(tt),De(e),null;case 25:return null;case 30:return null}throw Error(O(156,e.tag))}function aO(t,e){switch(wg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ti(tt),Ia(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Hu(e),null;case 31:if(e.memoizedState!==null){if(en(e),e.alternate===null)throw Error(O(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(en(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ft(Ye),null;case 4:return Ia(),null;case 10:return Ti(e.type),null;case 22:case 23:return en(e),kg(),t!==null&&ft(mo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ti(tt),null;case 25:return null;default:return null}}function Px(t,e){switch(wg(e),e.tag){case 3:Ti(tt),Ia();break;case 26:case 27:case 5:Hu(e);break;case 4:Ia();break;case 31:e.memoizedState!==null&&en(e);break;case 13:en(e);break;case 19:ft(Ye);break;case 10:Ti(e.type);break;case 22:case 23:en(e),kg(),t!==null&&ft(mo);break;case 24:Ti(tt)}}function Hl(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(s){_e(e,e.return,s)}}function Mr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&t)===t){var a=i.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){_e(r,l,u)}}}i=i.next}while(i!==o)}}catch(u){_e(e,e.return,u)}}function qx(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{ex(e,n)}catch(i){_e(t,t.return,i)}}}function Zx(t,e,n){n.props=wo(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){_e(t,e,i)}}function cl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){_e(t,e,r)}}function ti(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){_e(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(t,e,r)}else n.current=null}function Gx(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(t,t.return,r)}}function nh(t,e,n){try{var i=t.stateNode;AO(i,t.type,n,e),i[jt]=e}catch(r){_e(t,t.return,r)}}function Yx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Lr(t.type)||t.tag===4}function ih(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Yx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Lr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ei));else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(qh(t,e,n),t=t.sibling;t!==null;)qh(t,e,n),t=t.sibling}function Xu(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Xu(t,e,n),t=t.sibling;t!==null;)Xu(t,e,n),t=t.sibling}function Wx(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);bt(e,i,n),e[mt]=t,e[jt]=n}catch(o){_e(t,t.return,o)}}var xi=!1,et=!1,rh=!1,k_=typeof WeakSet=="function"?WeakSet:Set,ut=null;function sO(t,e){if(t=t.containerInfo,Qh=sd,t=HS(t),yg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var g;d!==n||r!==0&&d.nodeType!==3||(s=a+r),d!==o||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===t)break t;if(h===n&&++c===r&&(s=a),h===o&&++u===i&&(l=a),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jh={focusedElem:t,selectionRange:n},sd=!1,ut=e;ut!==null;)if(e=ut,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ut=t;else for(;ut!==null;){switch(e=ut,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,n=e,r=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var S=wo(n.type,r);t=i.getSnapshotBeforeUpdate(S,o),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){_e(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)tg(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":tg(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(O(163))}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function Xx(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:bi(t,n),i&4&&Hl(5,n);break;case 1:if(bi(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){_e(n,n.return,a)}else{var r=wo(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){_e(n,n.return,a)}}i&64&&qx(n),i&512&&cl(n,n.return);break;case 3:if(bi(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{ex(t,e)}catch(a){_e(n,n.return,a)}}break;case 27:e===null&&i&4&&Wx(n);case 26:case 5:bi(t,n),e===null&&i&4&&Gx(n),i&512&&cl(n,n.return);break;case 12:bi(t,n);break;case 31:bi(t,n),i&4&&Jx(t,n);break;case 13:bi(t,n),i&4&&ew(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=mO.bind(null,n),LO(t,n))));break;case 22:if(i=n.memoizedState!==null||xi,!i){e=e!==null&&e.memoizedState!==null||et,r=xi;var o=et;xi=i,(et=e)&&!o?_i(t,n,(n.subtreeFlags&8772)!==0):bi(t,n),xi=r,et=o}break;case 30:break;default:bi(t,n)}}function Kx(t){var e=t.alternate;e!==null&&(t.alternate=null,Kx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&fg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Be=null,$t=!1;function yi(t,e,n){for(n=n.child;n!==null;)Qx(t,e,n),n=n.sibling}function Qx(t,e,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Rl,n)}catch{}switch(n.tag){case 26:et||ti(n,e),yi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:et||ti(n,e);var i=Be,r=$t;Lr(n.type)&&(Be=n.stateNode,$t=!1),yi(t,e,n),pl(n.stateNode),Be=i,$t=r;break;case 5:et||ti(n,e);case 6:if(i=Be,r=$t,Be=null,yi(t,e,n),Be=i,$t=r,Be!==null)if($t)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(o){_e(n,e,o)}else try{Be.removeChild(n.stateNode)}catch(o){_e(n,e,o)}break;case 18:Be!==null&&($t?(t=Be,j_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),qa(t)):j_(Be,n.stateNode));break;case 4:i=Be,r=$t,Be=n.stateNode.containerInfo,$t=!0,yi(t,e,n),Be=i,$t=r;break;case 0:case 11:case 14:case 15:Mr(2,n,e),et||Mr(4,n,e),yi(t,e,n);break;case 1:et||(ti(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Zx(n,e,i)),yi(t,e,n);break;case 21:yi(t,e,n);break;case 22:et=(i=et)||n.memoizedState!==null,yi(t,e,n),et=i;break;default:yi(t,e,n)}}function Jx(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{qa(t)}catch(n){_e(e,e.return,n)}}}function ew(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{qa(t)}catch(n){_e(e,e.return,n)}}function lO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new k_),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new k_),e;default:throw Error(O(435,t.tag))}}function pu(t,e){var n=lO(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=vO.bind(null,t,i);i.then(r,r)}})}function Bt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(Lr(s.type)){Be=s.stateNode,$t=!1;break e}break;case 5:Be=s.stateNode,$t=!1;break e;case 3:case 4:Be=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(Be===null)throw Error(O(160));Qx(o,a,r),Be=null,$t=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)tw(e,t),e=e.sibling}var Bn=null;function tw(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bt(e,t),Ft(t),i&4&&(Mr(3,t,t.return),Hl(3,t),Mr(5,t,t.return));break;case 1:Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),i&64&&xi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Bn;if(Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),i&4){var o=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Nl]||o[mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(i),r.head.insertBefore(o,r.querySelector("head > title"))),bt(o,i,n),o[mt]=t,dt(o),i=o;break e;case"link":var a=X_("link","href",r).get(i+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(o=a[s],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;case"meta":if(a=X_("meta","content",r).get(i+(n.content||""))){for(s=0;s<a.length;s++)if(o=a[s],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;default:throw Error(O(468,i))}o[mt]=t,dt(o),i=o}t.stateNode=i}else K_(r,t.type,t.stateNode);else t.stateNode=W_(r,i,t.memoizedProps);else o!==i?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,i===null?K_(r,t.type,t.stateNode):W_(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&nh(t,t.memoizedProps,n.memoizedProps)}break;case 27:Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),n!==null&&i&4&&nh(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),t.flags&32){r=t.stateNode;try{za(r,"")}catch(S){_e(t,t.return,S)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,nh(t,r,n!==null?n.memoizedProps:r)),i&1024&&(rh=!0);break;case 6:if(Bt(e,t),Ft(t),i&4){if(t.stateNode===null)throw Error(O(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(S){_e(t,t.return,S)}}break;case 3:if(Mu=null,r=Bn,Bn=rd(e.containerInfo),Bt(e,t),Bn=r,Ft(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{qa(e.containerInfo)}catch(S){_e(t,t.return,S)}rh&&(rh=!1,nw(t));break;case 4:i=Bn,Bn=rd(t.stateNode.containerInfo),Bt(e,t),Ft(t),Bn=i;break;case 12:Bt(e,t),Ft(t);break;case 31:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,pu(t,i)));break;case 13:Bt(e,t),Ft(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(_d=rn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,pu(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=xi,u=et;if(xi=c||r,et=u||l,Bt(e,t),et=u,xi=c,Ft(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||xi||et||po(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(o=l.stateNode,r)a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(S){_e(l,l.return,S)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(S){_e(l,l.return,S)}}}else if(e.tag===18){if(n===null){l=e;try{var g=l.stateNode;r?P_(g,!0):P_(l.stateNode,!1)}catch(S){_e(l,l.return,S)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,pu(t,n))));break;case 19:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,pu(t,i)));break;case 30:break;case 21:break;default:Bt(e,t),Ft(t)}}function Ft(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(Yx(i)){n=i;break}i=i.return}if(n==null)throw Error(O(160));switch(n.tag){case 27:var r=n.stateNode,o=ih(t);Xu(t,o,r);break;case 5:var a=n.stateNode;n.flags&32&&(za(a,""),n.flags&=-33);var s=ih(t);Xu(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=ih(t);qh(t,c,l);break;default:throw Error(O(161))}}catch(u){_e(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function nw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;nw(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function bi(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Xx(t,e.alternate,e),e=e.sibling}function po(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Mr(4,e,e.return),po(e);break;case 1:ti(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Zx(e,e.return,n),po(e);break;case 27:pl(e.stateNode);case 26:case 5:ti(e,e.return),po(e);break;case 22:e.memoizedState===null&&po(e);break;case 30:po(e);break;default:po(e)}t=t.sibling}}function _i(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,o=e,a=o.flags;switch(o.tag){case 0:case 11:case 15:_i(r,o,n),Hl(4,o);break;case 1:if(_i(r,o,n),i=o,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){_e(i,i.return,c)}if(i=o,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)JS(l[r],s)}catch(c){_e(i,i.return,c)}}n&&a&64&&qx(o),cl(o,o.return);break;case 27:Wx(o);case 26:case 5:_i(r,o,n),n&&i===null&&a&4&&Gx(o),cl(o,o.return);break;case 12:_i(r,o,n);break;case 31:_i(r,o,n),n&&a&4&&Jx(r,o);break;case 13:_i(r,o,n),n&&a&4&&ew(r,o);break;case 22:o.memoizedState===null&&_i(r,o,n),cl(o,o.return);break;case 30:break;default:_i(r,o,n)}e=e.sibling}}function Pg(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Ll(n))}function qg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ll(t))}function zn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)iw(t,e,n,i),e=e.sibling}function iw(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:zn(t,e,n,i),r&2048&&Hl(9,e);break;case 1:zn(t,e,n,i);break;case 3:zn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ll(t)));break;case 12:if(r&2048){zn(t,e,n,i),t=e.stateNode;try{var o=e.memoizedProps,a=o.id,s=o.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){_e(e,e.return,l)}}else zn(t,e,n,i);break;case 31:zn(t,e,n,i);break;case 13:zn(t,e,n,i);break;case 23:break;case 22:o=e.stateNode,a=e.alternate,e.memoizedState!==null?o._visibility&2?zn(t,e,n,i):ul(t,e):o._visibility&2?zn(t,e,n,i):(o._visibility|=2,ha(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Pg(a,e);break;case 24:zn(t,e,n,i),r&2048&&qg(e.alternate,e);break;default:zn(t,e,n,i)}}function ha(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,a=e,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:ha(o,a,s,l,r),Hl(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?ha(o,a,s,l,r):ul(o,a):(u._visibility|=2,ha(o,a,s,l,r)),r&&c&2048&&Pg(a.alternate,a);break;case 24:ha(o,a,s,l,r),r&&c&2048&&qg(a.alternate,a);break;default:ha(o,a,s,l,r)}e=e.sibling}}function ul(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ul(n,i),r&2048&&Pg(i.alternate,i);break;case 24:ul(n,i),r&2048&&qg(i.alternate,i);break;default:ul(n,i)}e=e.sibling}}var el=8192;function pa(t,e,n){if(t.subtreeFlags&el)for(t=t.child;t!==null;)rw(t,e,n),t=t.sibling}function rw(t,e,n){switch(t.tag){case 26:pa(t,e,n),t.flags&el&&t.memoizedState!==null&&ZO(n,Bn,t.memoizedState,t.memoizedProps);break;case 5:pa(t,e,n);break;case 3:case 4:var i=Bn;Bn=rd(t.stateNode.containerInfo),pa(t,e,n),Bn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=el,el=16777216,pa(t,e,n),el=i):pa(t,e,n));break;default:pa(t,e,n)}}function ow(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Gs(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,sw(i,t)}ow(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)aw(t),t=t.sibling}function aw(t){switch(t.tag){case 0:case 11:case 15:Gs(t),t.flags&2048&&Mr(9,t,t.return);break;case 3:Gs(t);break;case 12:Gs(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Ru(t)):Gs(t);break;default:Gs(t)}}function Ru(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,sw(i,t)}ow(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Mr(8,e,e.return),Ru(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Ru(e));break;default:Ru(e)}t=t.sibling}}function sw(t,e){for(;ut!==null;){var n=ut;switch(n.tag){case 0:case 11:case 15:Mr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ll(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ut=i;else e:for(n=t;ut!==null;){i=ut;var r=i.sibling,o=i.return;if(Kx(i),i===n){ut=null;break e}if(r!==null){r.return=o,ut=r;break e}ut=o}}}var cO={getCacheForType:function(t){var e=yt(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return yt(tt).controller.signal}},uO=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ae=null,ce=null,fe=0,be=0,Jt=null,vr=!1,Xa=!1,Zg=!1,Di=0,Ge=0,Nr=0,yo=0,Gg=0,nn=0,Ua=0,dl=null,Ut=null,Zh=!1,_d=0,lw=0,Ku=1/0,Qu=null,Er=null,rt=0,Cr=null,Va=null,ki=0,Gh=0,Yh=null,cw=null,fl=0,Wh=null;function sn(){return(ve&2)!==0&&fe!==0?fe&-fe:Q.T!==null?Wg():yS()}function uw(){if(nn===0)if((fe&536870912)===0||he){var t=iu;iu<<=1,(iu&3932160)===0&&(iu=262144),nn=t}else nn=536870912;return t=cn.current,t!==null&&(t.flags|=32),nn}function Vt(t,e,n){(t===Ae&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(ja(t,0),yr(t,fe,nn,!1)),Ml(t,n),((ve&2)===0||t!==Ae)&&(t===Ae&&((ve&2)===0&&(yo|=n),Ge===4&&yr(t,fe,nn,!1)),ri(t))}function dw(t,e,n){if((ve&6)!==0)throw Error(O(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Ol(t,e),r=i?pO(t,e):oh(t,e,!0),o=i;do{if(r===0){Xa&&!i&&yr(t,e,0,!1);break}else{if(n=t.current.alternate,o&&!dO(n)){r=oh(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var s=t;r=dl;var l=s.current.memoizedState.isDehydrated;if(l&&(ja(s,a).flags|=256),a=oh(s,a,!1),a!==2){if(Zg&&!l){s.errorRecoveryDisabledLanes|=o,yo|=o,r=4;break e}o=Ut,Ut=r,o!==null&&(Ut===null?Ut=o:Ut.push.apply(Ut,o))}r=a}if(o=!1,r!==2)continue}}if(r===1){ja(t,0),yr(t,e,0,!0);break}e:{switch(i=t,o=r,o){case 0:case 1:throw Error(O(345));case 4:if((e&4194048)!==e)break;case 6:yr(i,e,nn,!vr);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(O(329))}if((e&62914560)===e&&(r=_d+300-rn(),10<r)){if(yr(i,e,nn,!vr),cd(i,0,!0)!==0)break e;ki=e,i.timeoutHandle=Mw(R_.bind(null,i,n,Ut,Qu,Zh,e,nn,yo,Ua,vr,o,"Throttled",-0,0),r);break e}R_(i,n,Ut,Qu,Zh,e,nn,yo,Ua,vr,o,null,-0,0)}}break}while(!0);ri(t)}function R_(t,e,n,i,r,o,a,s,l,c,u,d,h,g){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ei},rw(e,o,d);var S=(o&62914560)===o?_d-rn():(o&4194048)===o?lw-rn():0;if(S=GO(d,S),S!==null){ki=o,t.cancelPendingCommit=S(M_.bind(null,t,e,o,n,i,r,a,s,l,u,d,null,h,g)),yr(t,o,a,!c);return}}M_(t,e,o,n,i,r,a,s,l)}function dO(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ln(o(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function yr(t,e,n,i){e&=~Gg,e&=~yo,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var o=31-an(r),a=1<<o;i[o]=-1,r&=~a}n!==0&&gS(t,n,e)}function Sd(){return(ve&6)===0?(zl(0,!1),!1):!0}function Yg(){if(ce!==null){if(be===0)var t=ce.return;else t=ce,Ci=ko=null,Dg(t),Na=null,_l=0,t=ce;for(;t!==null;)Px(t.alternate,t),t=t.return;ce=null}}function ja(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,RO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ki=0,Yg(),Ae=t,ce=n=Ai(t.current,null),fe=e,be=0,Jt=null,vr=!1,Xa=Ol(t,e),Zg=!1,Ua=nn=Gg=yo=Nr=Ge=0,Ut=dl=null,Zh=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),o=1<<r;e|=t[r],i&=~o}return Di=e,pd(),n}function fw(t,e){re=null,Q.H=xl,e===Wa||e===gd?(e=s_(),be=3):e===Ag?(e=s_(),be=4):be=e===Vg?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Jt=e,ce===null&&(Ge=1,Yu(t,Sn(e,t.current)))}function pw(){var t=cn.current;return t===null?!0:(fe&4194048)===fe?wn===null:(fe&62914560)===fe||(fe&536870912)!==0?t===wn:!1}function hw(){var t=Q.H;return Q.H=xl,t===null?xl:t}function gw(){var t=Q.A;return Q.A=cO,t}function Ju(){Ge=4,vr||(fe&4194048)!==fe&&cn.current!==null||(Xa=!0),(Nr&134217727)===0&&(yo&134217727)===0||Ae===null||yr(Ae,fe,nn,!1)}function oh(t,e,n){var i=ve;ve|=2;var r=hw(),o=gw();(Ae!==t||fe!==e)&&(Qu=null,ja(t,e)),e=!1;var a=Ge;e:do try{if(be!==0&&ce!==null){var s=ce,l=Jt;switch(be){case 8:Yg(),a=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(e=!0);var c=be;if(be=0,Jt=null,Ta(t,s,l,c),n&&Xa){a=0;break e}break;default:c=be,be=0,Jt=null,Ta(t,s,l,c)}}fO(),a=Ge;break}catch(u){fw(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ci=ko=null,ve=i,Q.H=r,Q.A=o,ce===null&&(Ae=null,fe=0,pd()),a}function fO(){for(;ce!==null;)mw(ce)}function pO(t,e){var n=ve;ve|=2;var i=hw(),r=gw();Ae!==t||fe!==e?(Qu=null,Ku=rn()+500,ja(t,e)):Xa=Ol(t,e);e:do try{if(be!==0&&ce!==null){e=ce;var o=Jt;t:switch(be){case 1:be=0,Jt=null,Ta(t,e,o,1);break;case 2:case 9:if(a_(o)){be=0,Jt=null,O_(e);break}e=function(){be!==2&&be!==9||Ae!==t||(be=7),ri(t)},o.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:a_(o)?(be=0,Jt=null,O_(e)):(be=0,Jt=null,Ta(t,e,o,7));break;case 5:var a=null;switch(ce.tag){case 26:a=ce.memoizedState;case 5:case 27:var s=ce;if(a?Hw(a):s.stateNode.complete){be=0,Jt=null;var l=s.sibling;if(l!==null)ce=l;else{var c=s.return;c!==null?(ce=c,xd(c)):ce=null}break t}}be=0,Jt=null,Ta(t,e,o,5);break;case 6:be=0,Jt=null,Ta(t,e,o,6);break;case 8:Yg(),Ge=6;break e;default:throw Error(O(462))}}hO();break}catch(u){fw(t,u)}while(!0);return Ci=ko=null,Q.H=i,Q.A=r,ve=n,ce!==null?0:(Ae=null,fe=0,pd(),Ge)}function hO(){for(;ce!==null&&!zR();)mw(ce)}function mw(t){var e=jx(t.alternate,t,Di);t.memoizedProps=t.pendingProps,e===null?xd(t):ce=e}function O_(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=w_(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=w_(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:Dg(e);default:Px(n,e),e=ce=PS(e,Di),e=jx(n,e,Di)}t.memoizedProps=t.pendingProps,e===null?xd(t):ce=e}function Ta(t,e,n,i){Ci=ko=null,Dg(e),Na=null,_l=0;var r=e.return;try{if(nO(t,r,e,n,fe)){Ge=1,Yu(t,Sn(n,t.current)),ce=null;return}}catch(o){if(r!==null)throw ce=r,o;Ge=1,Yu(t,Sn(n,t.current)),ce=null;return}e.flags&32768?(he||i===1?t=!0:Xa||(fe&536870912)!==0?t=!1:(vr=t=!0,(i===2||i===9||i===3||i===6)&&(i=cn.current,i!==null&&i.tag===13&&(i.flags|=16384))),vw(e,t)):xd(e)}function xd(t){var e=t;do{if((e.flags&32768)!==0){vw(e,vr);return}t=e.return;var n=oO(e.alternate,e,Di);if(n!==null){ce=n;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ge===0&&(Ge=5)}function vw(t,e){do{var n=aO(t.alternate,t);if(n!==null){n.flags&=32767,ce=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=n}while(t!==null);Ge=6,ce=null}function M_(t,e,n,i,r,o,a,s,l){t.cancelPendingCommit=null;do wd();while(rt!==0);if((ve&6)!==0)throw Error(O(327));if(e!==null){if(e===t.current)throw Error(O(177));if(o=e.lanes|e.childLanes,o|=bg,GR(t,n,o,a,s,l),t===Ae&&(ce=Ae=null,fe=0),Va=e,Cr=t,ki=n,Gh=o,Yh=r,cw=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,yO(zu,function(){return xw(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,r=ye.p,ye.p=2,a=ve,ve|=4;try{sO(t,e,n)}finally{ve=a,ye.p=r,Q.T=i}}rt=1,yw(),bw(),_w()}}function yw(){if(rt===1){rt=0;var t=Cr,e=Va,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{tw(e,t);var o=Jh,a=HS(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&IS(s.ownerDocument.documentElement,s)){if(l!==null&&yg(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var g=h.getSelection(),S=s.textContent.length,_=Math.min(l.start,S),b=l.end===void 0?_:Math.min(l.end,S);!g.extend&&_>b&&(a=b,b=_,_=a);var f=J0(s,_),p=J0(s,b);if(f&&p&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==p.node||g.focusOffset!==p.offset)){var v=d.createRange();v.setStart(f.node,f.offset),g.removeAllRanges(),_>b?(g.addRange(v),g.extend(p.node,p.offset)):(v.setEnd(p.node,p.offset),g.addRange(v))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var y=d[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}sd=!!Qh,Jh=Qh=null}finally{ve=r,ye.p=i,Q.T=n}}t.current=e,rt=2}}function bw(){if(rt===2){rt=0;var t=Cr,e=Va,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Xx(t,e.alternate,e)}finally{ve=r,ye.p=i,Q.T=n}}rt=3}}function _w(){if(rt===4||rt===3){rt=0,BR();var t=Cr,e=Va,n=ki,i=cw;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?rt=5:(rt=0,Va=Cr=null,Sw(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Er=null),dg(n),e=e.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Rl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Q.T,r=ye.p,ye.p=2,Q.T=null;try{for(var o=t.onRecoverableError,a=0;a<i.length;a++){var s=i[a];o(s.value,{componentStack:s.stack})}}finally{Q.T=e,ye.p=r}}(ki&3)!==0&&wd(),ri(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Wh?fl++:(fl=0,Wh=t):fl=0,zl(0,!1)}}function Sw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Ll(e)))}function wd(){return yw(),bw(),_w(),xw()}function xw(){if(rt!==5)return!1;var t=Cr,e=Gh;Gh=0;var n=dg(ki),i=Q.T,r=ye.p;try{ye.p=32>n?32:n,Q.T=null,n=Yh,Yh=null;var o=Cr,a=ki;if(rt=0,Va=Cr=null,ki=0,(ve&6)!==0)throw Error(O(331));var s=ve;if(ve|=4,aw(o.current),iw(o,o.current,a,n),ve=s,zl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Rl,o)}catch{}return!0}finally{ye.p=r,Q.T=i,Sw(t,e)}}function N_(t,e,n){e=Sn(n,e),e=Vh(t.stateNode,e,2),t=wr(t,e,2),t!==null&&(Ml(t,2),ri(t))}function _e(t,e,n){if(t.tag===3)N_(t,t,n);else for(;e!==null;){if(e.tag===3){N_(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Er===null||!Er.has(i))){t=Sn(n,t),n=zx(2),i=wr(e,n,2),i!==null&&(Bx(n,i,e,t),Ml(i,2),ri(i));break}}e=e.return}}function ah(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new uO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Zg=!0,r.add(n),t=gO.bind(null,t,e,n),e.then(t,t))}function gO(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(fe&n)===n&&(Ge===4||Ge===3&&(fe&62914560)===fe&&300>rn()-_d?(ve&2)===0&&ja(t,0):Gg|=n,Ua===fe&&(Ua=0)),ri(t)}function ww(t,e){e===0&&(e=hS()),t=To(t,e),t!==null&&(Ml(t,e),ri(t))}function mO(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ww(t,n)}function vO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(O(314))}i!==null&&i.delete(e),ww(t,n)}function yO(t,e){return cg(t,e)}var ed=null,ga=null,Xh=!1,td=!1,sh=!1,br=0;function ri(t){t!==ga&&t.next===null&&(ga===null?ed=ga=t:ga=ga.next=t),td=!0,Xh||(Xh=!0,_O())}function zl(t,e){if(!sh&&td){sh=!0;do for(var n=!1,i=ed;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-an(42|t)+1)-1,o&=r&~(a&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,D_(i,o))}else o=fe,o=cd(i,i===Ae?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Ol(i,o)||(n=!0,D_(i,o));i=i.next}while(n);sh=!1}}function bO(){Ew()}function Ew(){td=Xh=!1;var t=0;br!==0&&kO()&&(t=br);for(var e=rn(),n=null,i=ed;i!==null;){var r=i.next,o=Cw(i,e);o===0?(i.next=null,n===null?ed=r:n.next=r,r===null&&(ga=n)):(n=i,(t!==0||(o&3)!==0)&&(td=!0)),i=r}rt!==0&&rt!==5||zl(t,!1),br!==0&&(br=0)}function Cw(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var a=31-an(o),s=1<<a,l=r[a];l===-1?((s&n)===0||(s&i)!==0)&&(r[a]=ZR(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,n=fe,n=cd(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Hp(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Ol(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Hp(i),dg(n)){case 2:case 8:n=fS;break;case 32:n=zu;break;case 268435456:n=pS;break;default:n=zu}return i=Aw.bind(null,t),n=cg(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Hp(i),t.callbackPriority=2,t.callbackNode=null,2}function Aw(t,e){if(rt!==0&&rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(wd()&&t.callbackNode!==n)return null;var i=fe;return i=cd(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(dw(t,i,e),Cw(t,rn()),t.callbackNode!=null&&t.callbackNode===n?Aw.bind(null,t):null)}function D_(t,e){if(wd())return null;dw(t,e,!0)}function _O(){OO(function(){(ve&6)!==0?cg(dS,bO):Ew()})}function Wg(){if(br===0){var t=Ba;t===0&&(t=nu,nu<<=1,(nu&261888)===0&&(nu=256)),br=t}return br}function L_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:_u(""+t)}function I_(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function SO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var o=L_((r[jt]||null).action),a=i.submitter;a&&(e=(e=a[jt]||null)?L_(e.formAction):a.getAttribute("formAction"),e!==null&&(o=e,a=null));var s=new ud("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(br!==0){var l=a?I_(r,a):new FormData(r);$h(n,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=a?I_(r,a):new FormData(r),$h(n,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(hu=0;hu<kh.length;hu++)gu=kh[hu],H_=gu.toLowerCase(),z_=gu[0].toUpperCase()+gu.slice(1),Fn(H_,"on"+z_);var gu,H_,z_,hu;Fn(BS,"onAnimationEnd");Fn(FS,"onAnimationIteration");Fn($S,"onAnimationStart");Fn("dblclick","onDoubleClick");Fn("focusin","onFocus");Fn("focusout","onBlur");Fn(F2,"onTransitionRun");Fn($2,"onTransitionStart");Fn(U2,"onTransitionCancel");Fn(US,"onTransitionEnd");Ha("onMouseEnter",["mouseout","mouseover"]);Ha("onMouseLeave",["mouseout","mouseover"]);Ha("onPointerEnter",["pointerout","pointerover"]);Ha("onPointerLeave",["pointerout","pointerover"]);Eo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Eo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Eo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Eo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function Tw(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){Fu(u)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(s=i[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){Fu(u)}r.currentTarget=null,o=l}}}}function le(t,e){var n=e[_h];n===void 0&&(n=e[_h]=new Set);var i=t+"__bubble";n.has(i)||(kw(e,t,2,!1),n.add(i))}function lh(t,e,n){var i=0;e&&(i|=4),kw(n,t,i,e)}var mu="_reactListening"+Math.random().toString(36).slice(2);function Xg(t){if(!t[mu]){t[mu]=!0,bS.forEach(function(n){n!=="selectionchange"&&(xO.has(n)||lh(n,!1,t),lh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[mu]||(e[mu]=!0,lh("selectionchange",!1,e))}}function kw(t,e,n,i){switch(Uw(e)){case 2:var r=XO;break;case 8:r=KO;break;default:r=em}n=r.bind(null,e,n,t),r=void 0,!Ch||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function ch(t,e,n,i,r){var o=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var s=i.stateNode.containerInfo;if(s===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;s!==null;){if(a=ya(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=o=a;continue e}s=s.parentNode}}i=i.return}TS(function(){var c=o,u=hg(n),d=[];e:{var h=VS.get(t);if(h!==void 0){var g=ud,S=t;switch(t){case"keypress":if(xu(n)===0)break e;case"keydown":case"keyup":g=v2;break;case"focusin":S="focus",g=Up;break;case"focusout":S="blur",g=Up;break;case"beforeblur":case"afterblur":g=Up;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=P0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=o2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=_2;break;case BS:case FS:case $S:g=l2;break;case US:g=x2;break;case"scroll":case"scrollend":g=i2;break;case"wheel":g=E2;break;case"copy":case"cut":case"paste":g=u2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Z0;break;case"toggle":case"beforetoggle":g=A2}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),f=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,v;p!==null;){var y=p;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=gl(p,f),y!=null&&_.push(El(p,y,v))),b)break;p=p.return}0<_.length&&(h=new g(h,S,null,n,u),d.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==Eh&&(S=n.relatedTarget||n.fromElement)&&(ya(S)||S[Za]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(S=n.relatedTarget||n.toElement,g=c,S=S?ya(S):null,S!==null&&(b=kl(S),_=S.tag,S!==b||_!==5&&_!==27&&_!==6)&&(S=null)):(g=null,S=c),g!==S)){if(_=P0,y="onMouseLeave",f="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=Z0,y="onPointerLeave",f="onPointerEnter",p="pointer"),b=g==null?h:Qs(g),v=S==null?h:Qs(S),h=new _(y,p+"leave",g,n,u),h.target=b,h.relatedTarget=v,y=null,ya(u)===c&&(_=new _(f,p+"enter",S,n,u),_.target=v,_.relatedTarget=b,y=_),b=y,g&&S)t:{for(_=wO,f=g,p=S,v=0,y=f;y;y=_(y))v++;y=0;for(var w=p;w;w=_(w))y++;for(;0<v-y;)f=_(f),v--;for(;0<y-v;)p=_(p),y--;for(;v--;){if(f===p||p!==null&&f===p.alternate){_=f;break t}f=_(f),p=_(p)}_=null}else _=null;g!==null&&B_(d,h,g,_,!1),S!==null&&b!==null&&B_(d,b,S,_,!0)}}e:{if(h=c?Qs(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var T=X0;else if(W0(h))if(DS)T=H2;else{T=L2;var x=D2}else g=h.nodeName,!g||g.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&pg(c.elementType)&&(T=X0):T=I2;if(T&&(T=T(t,c))){NS(d,T,n,u);break e}x&&x(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&wh(h,"number",h.value)}switch(x=c?Qs(c):window,t){case"focusin":(W0(x)||x.contentEditable==="true")&&(Sa=x,Ah=c,il=null);break;case"focusout":il=Ah=Sa=null;break;case"mousedown":Th=!0;break;case"contextmenu":case"mouseup":case"dragend":Th=!1,e_(d,n,u);break;case"selectionchange":if(B2)break;case"keydown":case"keyup":e_(d,n,u)}var k;if(vg)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else _a?OS(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(RS&&n.locale!=="ko"&&(_a||C!=="onCompositionStart"?C==="onCompositionEnd"&&_a&&(k=kS()):(mr=u,gg="value"in mr?mr.value:mr.textContent,_a=!0)),x=nd(c,C),0<x.length&&(C=new q0(C,t,null,n,u),d.push({event:C,listeners:x}),k?C.data=k:(k=MS(n),k!==null&&(C.data=k)))),(k=k2?R2(t,n):O2(t,n))&&(C=nd(c,"onBeforeInput"),0<C.length&&(x=new q0("onBeforeInput","beforeinput",null,n,u),d.push({event:x,listeners:C}),x.data=k)),SO(d,t,c,n,u)}Tw(d,e)})}function El(t,e,n){return{instance:t,listener:e,currentTarget:n}}function nd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=gl(t,n),r!=null&&i.unshift(El(t,r,o)),r=gl(t,e),r!=null&&i.push(El(t,r,o))),t.tag===3)return i;t=t.return}return[]}function wO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function B_(t,e,n,i,r){for(var o=e._reactName,a=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=gl(n,o),c!=null&&a.unshift(El(n,c,l))):r||(c=gl(n,o),c!=null&&a.push(El(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var EO=/\r\n?/g,CO=/\u0000|\uFFFD/g;function F_(t){return(typeof t=="string"?t:""+t).replace(EO,`
9
+ `).replace(CO,"")}function Rw(t,e){return e=F_(e),F_(t)===e}function we(t,e,n,i,r,o){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||za(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&za(t,""+i);break;case"className":ou(t,"class",i);break;case"tabIndex":ou(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ou(t,n,i);break;case"style":AS(t,i,o);break;case"data":if(e!=="object"){ou(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=_u(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=_u(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=_u(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":le("beforetoggle",t),le("toggle",t),bu(t,"popover",i);break;case"xlinkActuate":mi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":mi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":mi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":mi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":mi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":mi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":mi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":mi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":mi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":bu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=t2.get(n)||n,bu(t,n,i))}}function Kh(t,e,n,i,r,o){switch(n){case"style":AS(t,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"children":typeof i=="string"?za(t,i):(typeof i=="number"||typeof i=="bigint")&&za(t,""+i);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_S.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),o=t[jt]||null,o=o!=null?o[n]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof i=="function")){typeof o!="function"&&o!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):bu(t,n,i)}}}function bt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",t),le("load",t);var i=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];if(a!=null)switch(o){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:we(t,e,o,a,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":le("invalid",t);var s=o=a=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(O(137,e));break;default:we(t,e,i,u,n,null)}}wS(t,o,s,l,c,a,r,!1);return;case"select":le("invalid",t),i=a=o=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":a=s;break;case"multiple":i=s;default:we(t,e,r,s,n,null)}e=o,n=a,t.multiple=!!i,e!=null?Ra(t,!!i,e,!1):n!=null&&Ra(t,!!i,n,!0);return;case"textarea":le("invalid",t),o=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(O(91));break;default:we(t,e,a,s,n,null)}CS(t,i,r,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,l,i,n,null));return;case"dialog":le("beforetoggle",t),le("toggle",t),le("cancel",t),le("close",t);break;case"iframe":case"object":le("load",t);break;case"video":case"audio":for(i=0;i<wl.length;i++)le(wl[i],t);break;case"image":le("error",t),le("load",t);break;case"details":le("toggle",t);break;case"embed":case"source":case"link":le("error",t),le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:we(t,e,c,i,n,null)}return;default:if(pg(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Kh(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&we(t,e,s,i,n,null))}function AO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,a=null,s=null,l=null,c=null,u=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(g)||we(t,e,g,null,i,d)}}for(var h in i){var g=i[h];if(d=n[h],i.hasOwnProperty(h)&&(g!=null||d!=null))switch(h){case"type":o=g;break;case"name":r=g;break;case"checked":c=g;break;case"defaultChecked":u=g;break;case"value":a=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(O(137,e));break;default:g!==d&&we(t,e,h,g,i,d)}}xh(t,a,s,l,c,u,o,r);return;case"select":g=a=s=h=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":g=l;default:i.hasOwnProperty(o)||we(t,e,o,null,i,l)}for(r in i)if(o=i[r],l=n[r],i.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":a=o;default:o!==l&&we(t,e,r,o,i,l)}e=s,n=a,i=g,h!=null?Ra(t,!!n,h,!1):!!i!=!!n&&(e!=null?Ra(t,!!n,e,!0):Ra(t,!!n,n?[]:"",!1));return;case"textarea":g=h=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,i,r)}for(a in i)if(r=i[a],o=n[a],i.hasOwnProperty(a)&&(r!=null||o!=null))switch(a){case"value":h=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(O(91));break;default:r!==o&&we(t,e,a,r,i,o)}ES(t,h,g);return;case"option":for(var S in n)h=n[S],n.hasOwnProperty(S)&&h!=null&&!i.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,i,h));for(l in i)h=i[l],g=n[l],i.hasOwnProperty(l)&&h!==g&&(h!=null||g!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,i,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in n)h=n[_],n.hasOwnProperty(_)&&h!=null&&!i.hasOwnProperty(_)&&we(t,e,_,null,i,h);for(c in i)if(h=i[c],g=n[c],i.hasOwnProperty(c)&&h!==g&&(h!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(O(137,e));break;default:we(t,e,c,h,i,g)}return;default:if(pg(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Kh(t,e,b,void 0,i,h);for(u in i)h=i[u],g=n[u],!i.hasOwnProperty(u)||h===g||h===void 0&&g===void 0||Kh(t,e,u,h,i,g);return}}for(var f in n)h=n[f],n.hasOwnProperty(f)&&h!=null&&!i.hasOwnProperty(f)&&we(t,e,f,null,i,h);for(d in i)h=i[d],g=n[d],!i.hasOwnProperty(d)||h===g||h==null&&g==null||we(t,e,d,h,i,g)}function $_(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&$_(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&$_(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(o+a)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qh=null,Jh=null;function id(t){return t.nodeType===9?t:t.ownerDocument}function U_(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ow(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function eg(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var uh=null;function kO(){var t=window.event;return t&&t.type==="popstate"?t===uh?!1:(uh=t,!0):(uh=null,!1)}var Mw=typeof setTimeout=="function"?setTimeout:void 0,RO=typeof clearTimeout=="function"?clearTimeout:void 0,V_=typeof Promise=="function"?Promise:void 0,OO=typeof queueMicrotask=="function"?queueMicrotask:typeof V_<"u"?function(t){return V_.resolve(null).then(t).catch(MO)}:Mw;function MO(t){setTimeout(function(){throw t})}function Lr(t){return t==="head"}function j_(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),qa(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")pl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,pl(n);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[Nl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=a}}else n==="body"&&pl(t.ownerDocument.body);n=r}while(n);qa(e)}function P_(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function tg(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":tg(n),fg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function NO(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Nl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=En(t.nextSibling),t===null)break}return null}function DO(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=En(t.nextSibling),t===null))return null;return t}function Nw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=En(t.nextSibling),t===null))return null;return t}function ng(t){return t.data==="$?"||t.data==="$~"}function ig(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function LO(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function En(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var rg=null;function q_(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return En(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function Z_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function Dw(t,e,n){switch(e=id(n),t){case"html":if(t=e.documentElement,!t)throw Error(O(452));return t;case"head":if(t=e.head,!t)throw Error(O(453));return t;case"body":if(t=e.body,!t)throw Error(O(454));return t;default:throw Error(O(451))}}function pl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);fg(t)}var Cn=new Map,G_=new Set;function rd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Li=ye.d;ye.d={f:IO,r:HO,D:zO,C:BO,L:FO,m:$O,X:VO,S:UO,M:jO};function IO(){var t=Li.f(),e=Sd();return t||e}function HO(t){var e=Ga(t);e!==null&&e.tag===5&&e.type==="form"?Ax(e):Li.r(t)}var Ka=typeof document>"u"?null:document;function Lw(t,e,n){var i=Ka;if(i&&typeof e=="string"&&e){var r=_n(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),G_.has(r)||(G_.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function zO(t){Li.D(t),Lw("dns-prefetch",t,null)}function BO(t,e){Li.C(t,e),Lw("preconnect",t,e)}function FO(t,e,n){Li.L(t,e,n);var i=Ka;if(i&&t&&e){var r='link[rel="preload"][as="'+_n(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_n(n.imageSizes)+'"]')):r+='[href="'+_n(t)+'"]';var o=r;switch(e){case"style":o=Pa(t);break;case"script":o=Qa(t)}Cn.has(o)||(t=Ie({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Cn.set(o,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Bl(o))||e==="script"&&i.querySelector(Fl(o))||(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function $O(t,e){Li.m(t,e);var n=Ka;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+_n(i)+'"][href="'+_n(t)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Qa(t)}if(!Cn.has(o)&&(t=Ie({rel:"modulepreload",href:t},e),Cn.set(o,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Fl(o)))return}i=n.createElement("link"),bt(i,"link",t),dt(i),n.head.appendChild(i)}}}function UO(t,e,n){Li.S(t,e,n);var i=Ka;if(i&&t){var r=ka(i).hoistableStyles,o=Pa(t);e=e||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(Bl(o)))s.loading=5;else{t=Ie({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Cn.get(o))&&Kg(t,n);var l=a=i.createElement("link");dt(l),bt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Ou(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}}function VO(t,e){Li.X(t,e);var n=Ka;if(n&&t){var i=ka(n).hoistableScripts,r=Qa(t),o=i.get(r);o||(o=n.querySelector(Fl(r)),o||(t=Ie({src:t,async:!0},e),(e=Cn.get(r))&&Qg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function jO(t,e){Li.M(t,e);var n=Ka;if(n&&t){var i=ka(n).hoistableScripts,r=Qa(t),o=i.get(r);o||(o=n.querySelector(Fl(r)),o||(t=Ie({src:t,async:!0,type:"module"},e),(e=Cn.get(r))&&Qg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function Y_(t,e,n,i){var r=(r=_r.current)?rd(r):null;if(!r)throw Error(O(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Pa(n.href),n=ka(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Pa(n.href);var o=ka(r).hoistableStyles,a=o.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,a),(o=r.querySelector(Bl(t)))&&!o._p&&(a.instance=o,a.state.loading=5),Cn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cn.set(t,n),o||PO(r,t,n,a.state))),e&&i===null)throw Error(O(528,""));return a}if(e&&i!==null)throw Error(O(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Qa(n),n=ka(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,t))}}function Pa(t){return'href="'+_n(t)+'"'}function Bl(t){return'link[rel="stylesheet"]['+t+"]"}function Iw(t){return Ie({},t,{"data-precedence":t.precedence,precedence:null})}function PO(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),bt(e,"link",n),dt(e),t.head.appendChild(e))}function Qa(t){return'[src="'+_n(t)+'"]'}function Fl(t){return"script[async]"+t}function W_(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+_n(n.href)+'"]');if(i)return e.instance=i,dt(i),i;var r=Ie({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),dt(i),bt(i,"style",r),Ou(i,n.precedence,t),e.instance=i;case"stylesheet":r=Pa(n.href);var o=t.querySelector(Bl(r));if(o)return e.state.loading|=4,e.instance=o,dt(o),o;i=Iw(n),(r=Cn.get(r))&&Kg(i,r),o=(t.ownerDocument||t).createElement("link"),dt(o);var a=o;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),e.state.loading|=4,Ou(o,n.precedence,t),e.instance=o;case"script":return o=Qa(n.src),(r=t.querySelector(Fl(o)))?(e.instance=r,dt(r),r):(i=n,(r=Cn.get(o))&&(i=Ie({},n),Qg(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),dt(r),bt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(O(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Ou(i,n.precedence,t));return e.instance}function Ou(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Kg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Qg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Mu=null;function X_(t,e,n){if(Mu===null){var i=new Map,r=Mu=new Map;r.set(n,i)}else r=Mu,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var o=n[r];if(!(o[Nl]||o[mt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var a=o.getAttribute(e)||"";a=t+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function K_(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function qO(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Hw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function ZO(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Pa(i.href),o=e.querySelector(Bl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=od.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=o,dt(o);return}o=e.ownerDocument||e,i=Iw(i),(r=Cn.get(r))&&Kg(i,r),o=o.createElement("link"),dt(o);var a=o;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),n.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=od.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var dh=0;function GO(t,e){return t.stylesheets&&t.count===0&&Nu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Nu(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&dh===0&&(dh=62500*TO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Nu(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>dh?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function od(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ad=null;function Nu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ad=new Map,e.forEach(YO,t),ad=null,od.call(t))}function YO(t,e){if(!(e.state.loading&4)){var n=ad.get(t);if(n)var i=n.get(null);else{n=new Map,ad.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}r=e.instance,a=r.getAttribute("data-precedence"),o=n.get(a)||i,o===i&&n.set(null,r),n.set(a,r),this.count++,i=od.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Cl={$$typeof:wi,Provider:null,Consumer:null,_currentValue:ho,_currentValue2:ho,_threadCount:0};function WO(t,e,n,i,r,o,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zp(0),this.hiddenUpdates=zp(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function zw(t,e,n,i,r,o,a,s,l,c,u,d){return t=new WO(t,e,n,a,l,c,u,d,s),e=1,o===!0&&(e|=24),o=tn(3,null,null,e),t.current=o,o.stateNode=t,e=Eg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:e},Tg(o),t}function Bw(t){return t?(t=Ea,t):Ea}function Fw(t,e,n,i,r,o){r=Bw(r),i.context===null?i.context=r:i.pendingContext=r,i=xr(e),i.payload={element:n},o=o===void 0?null:o,o!==null&&(i.callback=o),n=wr(t,i,e),n!==null&&(Vt(n,t,e),ol(n,t,e))}function Q_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Jg(t,e){Q_(t,e),(t=t.alternate)&&Q_(t,e)}function $w(t){if(t.tag===13||t.tag===31){var e=To(t,67108864);e!==null&&Vt(e,t,67108864),Jg(t,67108864)}}function J_(t){if(t.tag===13||t.tag===31){var e=sn();e=ug(e);var n=To(t,e);n!==null&&Vt(n,t,e),Jg(t,e)}}var sd=!0;function XO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=2,em(t,e,n,i)}finally{ye.p=o,Q.T=r}}function KO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=8,em(t,e,n,i)}finally{ye.p=o,Q.T=r}}function em(t,e,n,i){if(sd){var r=og(i);if(r===null)ch(t,e,i,ld,n),eS(t,i);else if(JO(r,t,e,n,i))i.stopPropagation();else if(eS(t,i),e&4&&-1<QO.indexOf(t)){for(;r!==null;){var o=Ga(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var a=uo(o.pendingLanes);if(a!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-an(a);s.entanglements[1]|=l,a&=~l}ri(o),(ve&6)===0&&(Ku=rn()+500,zl(0,!1))}}break;case 31:case 13:s=To(o,2),s!==null&&Vt(s,o,2),Sd(),Jg(o,2)}if(o=og(i),o===null&&ch(t,e,i,ld,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else ch(t,e,i,null,n)}}function og(t){return t=hg(t),tm(t)}var ld=null;function tm(t){if(ld=null,t=ya(t),t!==null){var e=kl(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=aS(e),t!==null)return t;t=null}else if(n===31){if(t=sS(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return ld=t,null}function Uw(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(FR()){case dS:return 2;case fS:return 8;case zu:case $R:return 32;case pS:return 268435456;default:return 32}default:return 32}}var ag=!1,Ar=null,Tr=null,kr=null,Al=new Map,Tl=new Map,hr=[],QO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function eS(t,e){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Al.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(e.pointerId)}}function Ys(t,e,n,i,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Ga(e),e!==null&&$w(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function JO(t,e,n,i,r){switch(e){case"focusin":return Ar=Ys(Ar,t,e,n,i,r),!0;case"dragenter":return Tr=Ys(Tr,t,e,n,i,r),!0;case"mouseover":return kr=Ys(kr,t,e,n,i,r),!0;case"pointerover":var o=r.pointerId;return Al.set(o,Ys(Al.get(o)||null,t,e,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Tl.set(o,Ys(Tl.get(o)||null,t,e,n,i,r)),!0}return!1}function Vw(t){var e=ya(t.target);if(e!==null){var n=kl(e);if(n!==null){if(e=n.tag,e===13){if(e=aS(n),e!==null){t.blockedOn=e,z0(t.priority,function(){J_(n)});return}}else if(e===31){if(e=sS(n),e!==null){t.blockedOn=e,z0(t.priority,function(){J_(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Du(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=og(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Eh=i,n.target.dispatchEvent(i),Eh=null}else return e=Ga(n),e!==null&&$w(e),t.blockedOn=n,!1;e.shift()}return!0}function tS(t,e,n){Du(t)&&n.delete(e)}function eM(){ag=!1,Ar!==null&&Du(Ar)&&(Ar=null),Tr!==null&&Du(Tr)&&(Tr=null),kr!==null&&Du(kr)&&(kr=null),Al.forEach(tS),Tl.forEach(tS)}function vu(t,e){t.blockedOn===e&&(t.blockedOn=null,ag||(ag=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,eM)))}var yu=null;function nS(t){yu!==t&&(yu=t,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,function(){yu===t&&(yu=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(tm(i||n)===null)continue;break}var o=Ga(n);o!==null&&(t.splice(e,3),e-=3,$h(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function qa(t){function e(l){return vu(l,t)}Ar!==null&&vu(Ar,t),Tr!==null&&vu(Tr,t),kr!==null&&vu(kr,t),Al.forEach(e),Tl.forEach(e);for(var n=0;n<hr.length;n++){var i=hr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<hr.length&&(n=hr[0],n.blockedOn===null);)Vw(n),n.blockedOn===null&&hr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[jt]||null;if(typeof o=="function")a||nS(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[jt]||null)s=a.formAction;else if(tm(r)!==null)continue}else s=a.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),nS(n)}}}function jw(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function nm(t){this._internalRoot=t}Ed.prototype.render=nm.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));var n=e.current,i=sn();Fw(n,i,t,e,null,null)};Ed.prototype.unmount=nm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Fw(t.current,2,null,t,null,null),Sd(),e[Za]=null}};function Ed(t){this._internalRoot=t}Ed.prototype.unstable_scheduleHydration=function(t){if(t){var e=yS();t={blockedOn:null,target:t,priority:e};for(var n=0;n<hr.length&&e!==0&&e<hr[n].priority;n++);hr.splice(n,0,t),n===0&&Vw(t)}};var iS=rS.version;if(iS!=="19.2.4")throw Error(O(527,iS,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(O(188)):(t=Object.keys(t).join(","),Error(O(268,t)));return t=NR(e),t=t!==null?lS(t):null,t=t===null?null:t.stateNode,t};var tM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ws=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ws.isDisabled&&Ws.supportsFiber))try{Rl=Ws.inject(tM),on=Ws}catch{}var Ws;Cd.createRoot=function(t,e){if(!oS(t))throw Error(O(299));var n=!1,i="",r=Lx,o=Ix,a=Hx;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=zw(t,1,!1,null,null,n,i,null,r,o,a,jw),t[Za]=e.current,Xg(t),new nm(e)};Cd.hydrateRoot=function(t,e,n){if(!oS(t))throw Error(O(299));var i=!1,r="",o=Lx,a=Ix,s=Hx,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=zw(t,1,!0,e,n??null,i,r,l,o,a,s,jw),e.context=Bw(null),n=e.current,i=sn(),i=ug(i),r=xr(i),r.callback=null,wr(n,r,i),n=i,e.current.lanes=n,Ml(e,n),ri(e),t[Za]=e.current,Xg(t),new Ed(e)};Cd.version="19.2.4"});var Ro=Xn((bI,Zw)=>{"use strict";function qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qw)}catch(t){console.error(t)}}qw(),Zw.exports=Pw()});var V1=Xn(jd=>{"use strict";var YM=Symbol.for("react.transitional.element"),WM=Symbol.for("react.fragment");function U1(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:YM,type:t,key:i,ref:e!==void 0?e:null,props:n}}jd.Fragment=WM;jd.jsx=U1;jd.jsxs=U1});var $e=Xn((zH,j1)=>{"use strict";j1.exports=V1()});var Qk=X(Qe(),1),gp=X(Fs(),1),uI=X(Ro(),1);function Gw(t,e,n,i){let r=i?.maxRetries??3,o=i?.debounceMs??50,a=t.parentElement??e.parentElement;if(!a)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(d=>{if(!c){for(let h of d)for(let g of h.removedNodes)if(g===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},o);return}}});return u.observe(a,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var nM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function im(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!nM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),g=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(d||g)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var Yw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=im(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":o=n.innerHTML,n.replaceWith(r);break}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let s=Gw(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(s(),t.position==="replace"&&o!==null){let l=document.createElement(n.tagName);l.innerHTML=o,Array.from(n.attributes).forEach(c=>{l.setAttribute(c.name,c.value)}),r.replaceWith(l)}else r.remove()},updateFn:l=>{"html"in l&&typeof l.html=="string"&&(r.innerHTML=im(l.html))}}},Ww=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},Xw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&o!==null?n.setAttribute(t.attr,o):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},Kw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},Qw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},Jw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=new Map;for(let r of Object.keys(t.styles)){let o=n.style.getPropertyValue(r);i.set(r,o)}for(let[r,o]of Object.entries(t.styles))n.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,o]of i)o?n.style.setProperty(r,o):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,a]of Object.entries(r.styles))n.style.setProperty(o,a)}}},rm=[{kind:"content:insertHtml",executor:Yw},{kind:"content:setText",executor:Ww},{kind:"content:setAttr",executor:Xw},{kind:"content:addClass",executor:Kw},{kind:"content:removeClass",executor:Qw},{kind:"content:setStyle",executor:Jw}],om={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:rm};var iM={light:50,medium:100,heavy:200},rM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],e1={init(t,e,n){let i=iM[n.intensity],r=n.colors.length>0?n.colors:rM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,n){let i=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation),n.shape==="circle"?(t.beginPath(),t.arc(0,0,n.size/2,0,Math.PI*2),t.fill()):t.fillRect(-n.size/2,-n.size/2,n.size,n.size*.6),t.restore())}};var oM={light:20,medium:40,heavy:80},aM="\u{1F389}",t1={init(t,e,n){let i=oM[n.intensity],r=typeof n.props?.emoji=="string"?n.props.emoji:aM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:r,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let a of o)a.data&&(a.data.originX=a.x);return o},update(t,e,n){let i=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,a=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(n*.003+o)*a*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e)n.opacity<.01||!n.emoji||(t.save(),t.globalAlpha=n.opacity,t.font=`${n.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(n.emoji,n.x,n.y),t.restore())}};var sM={light:20,medium:40,heavy:80},lM={light:3,medium:4,heavy:5},n1={init(t,e,n){let i=sM[n.intensity],r=lM[n.intensity],o=n.colors.length>0?n.colors:["#ff4444","#44ff44","#4444ff"],a=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,c=Math.random()*e*.6,u=o[Math.floor(Math.random()*o.length)];for(let d=0;d<i;d++){let h=Math.PI*2*d/i+(Math.random()-.5)*.3,g=Math.random()*3+2;a.push({x:l,y:c,vx:Math.cos(h)*g,vy:Math.sin(h)*g,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:u,opacity:1,shape:"circle",data:{centerX:l,centerY:c}})}}return a},update(t,e,n){let i=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.shadowBlur=12,t.shadowColor=n.color,t.beginPath(),t.arc(n.x,n.y,n.size,0,Math.PI*2),t.fill(),t.restore())}};var cM={light:30,medium:60,heavy:120},i1={init(t,e,n){let i=cM[n.intensity],r=n.colors.length>0?n.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:r[Math.floor(Math.random()*r.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,n){let i=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,a=r.data?.baseOpacity??1;if(a<=.01)r.opacity=0;else{let s=Math.sin(n*.005+o)*.4+.6;r.opacity=a*s}r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e){if(n.opacity<.01)continue;t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation);let i=n.size;t.beginPath(),t.moveTo(0,-i),t.lineTo(i*.3,-i*.3),t.lineTo(i,0),t.lineTo(i*.3,i*.3),t.lineTo(0,i),t.lineTo(-i*.3,i*.3),t.lineTo(-i,0),t.lineTo(-i*.3,-i*.3),t.closePath(),t.fill(),t.restore()}}};var Ad=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,n,i){this.container=e,this.effect=n,this.duration=i.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,a=window.innerWidth,s=window.innerHeight;r.width=a*o,r.height=s*o,r.style.width=`${a}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=n.init(a,s,i),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let n=e-this.startTime,i=e-this.lastFrame;if(this.lastFrame=e,n>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,i,n)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var uM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],r1=new Map([["confetti",e1],["fireworks",n1],["sparkles",i1],["emoji-rain",t1]]),o1=async(t,e)=>{let n=r1.get(t.effect);if(!n)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...r1.keys()].join(", ")}`),{cleanup:()=>{}};let i={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:t.colors??uM,props:t.props},r=new Ad;return r.start(e.overlayRoot,n,i),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{r.stop()}}};var sm="syntro_active_tour",Td=new Map;function dM(t){try{let e=localStorage.getItem(sm);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function am(t){try{localStorage.setItem(sm,JSON.stringify(t))}catch{}}function fM(){try{localStorage.removeItem(sm)}catch{}}function $l(){return window.location.pathname}function pM(t){if(!t.route)return!0;let e=$l();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var lm=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:o=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(Td.has(n))return{cleanup:async()=>{let v=Td.get(n);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=dM(n),s=!!a;if(!s&&!o)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},am(a));let l=i.findIndex(v=>v.id===a.currentStepId);if(l===-1){let v=r||i[0].id;l=i.findIndex(y=>y.id===v),l===-1&&(l=0),a.currentStepId=i[l].id,am(a)}let c=i[l];if(!pM(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:$l()}),{cleanup:()=>{}};let u=!1,d=null,h=null,g=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},_=async v=>{if(u)return;if(await S(),v==="end"){fM(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let y=i.find(w=>w.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(a.currentStepId=v,am(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:v}),y.route&&y.route!==$l()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:v,targetRoute:y.route});return}await b(y)},b=async v=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:v.id,stepIndex:i.findIndex(y=>y.id===v.id),totalSteps:i.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",T=>{let x=T?.actionId;if(x&&v.onAction){let k=v.onAction[x];k&&_(k)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",T=>{let x=T?.actionId;if(x&&v.onAction){let k=v.onAction[x];k&&_(k)}}),w=h;h=()=>{w(),y()}}}};g=(()=>{let v=$l(),y=()=>{let x=$l();x!==v&&(v=x,e.publishEvent("tour.route_changed",{tourId:n,newRoute:x}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let w=history.pushState.bind(history),T=history.replaceState.bind(history);return history.pushState=(...x)=>{w(...x),queueMicrotask(y)},history.replaceState=(...x)=>{T(...x),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=T}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:a.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:a.currentStepId}),await b(c);let p=async()=>{u=!0,Td.delete(n),await S(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return Td.set(n,{cleanup:p}),{cleanup:p}};var _t={white:"#ffffff",black:"#000000"},ne={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},A={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},Te={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},St={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Fe={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},un={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Ul={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},at={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Vl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var Ii={primary:A[10],secondary:A[9],tertiary:A[8]},zI={primary:A[2],secondary:A[0]},cm={primary:A[4],secondary:A[3]},kd={primary:{text:_t.white,icon:_t.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:A[10],textHover:_t.white,icon:A[10],iconHover:_t.white,border:A[4],background:A[2]},link:{text:_t.white,icon:_t.white,hover:ne[5]},error:{text:Fe[5],hover:Fe[6]},success:{text:Te[5],hover:Te[6]}},BI={slateGrey:{content:A[10],pillOutline:A[10],borderPrimary:A[5],borderSecondary:A[5],background:A[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Fe[8],pillOutline:Fe[4],borderPrimary:Fe[2],borderSecondary:Fe[2],background:Fe[0]},yellow:{content:St[8],pillOutline:St[4],borderPrimary:St[2],borderSecondary:St[2],background:St[0]},green:{content:Te[8],pillOutline:Te[4],borderPrimary:Te[2],borderSecondary:Te[2],background:Te[0]},purple:{content:at[8],pillOutline:at[4],borderPrimary:at[2],borderSecondary:at[2],background:at[0]},blue:{content:un[8],pillOutline:un[4],borderPrimary:un[2],borderSecondary:un[2],background:un[0]},orange:{content:Ul[8],pillOutline:Ul[4],borderPrimary:Ul[2],borderSecondary:Ul[2],background:Ul[0]},pink:{content:Vl[8],pillOutline:Vl[4],borderPrimary:Vl[2],borderSecondary:Vl[2],background:Vl[0]}},FI={green:{content:Te[8],border:Te[2],background:Te[0]},yellow:{content:St[8],border:St[2],background:St[0]},red:{content:Fe[8],border:Fe[2],background:Fe[0]}},$I={green:{content:Te[1],background:Te[9]},yellow:{content:St[1],background:St[9]},red:{content:Fe[1],background:Fe[9]}},UI={content:A[10],border:A[4],background:"#1c2124"},VI={backgroundDefault:A[2],backgroundHover:A[1],selected:A[3]},jI={background:A[2],icon:A[10],borderDefault:A[4],borderSelected:ne[3],textLabel:A[9],textPlaceholder:A[8],textHint:A[8]},PI={backgroundDefault:A[2],backgroundDisabled:A[0],textLabel:A[9],textPlaceholder:A[8],textHint:A[8],textError:Fe[5],iconDefault:A[9],iconPlaceholder:A[10],iconError:Fe[5],borderDefault:A[4],borderSelected:ne[3],borderError:Fe[5]},qI={handleDefault:_t.white,handleDisabled:A[10],off:{backgroundDefault:A[4],backgroundHover:A[5],backgroundDisabled:A[4]},on:{backgroundDefault:Te[3],backgroundHover:Te[2],backgroundDisabled:A[4]}},ZI={off:{backgroundDefault:"#00000000",backgroundHover:A[5],backgroundDisabled:A[2],border:A[6]},on:{backgroundDefault:Te[0],backgroundHover:Te[1],backgroundDisabled:A[2],border:Te[3]}},GI={content:A[10],background:A[4]},YI={background:A[4],active:Te[3]},WI={background:A[1],content:A[9],border:A[4]},XI={backgroundDefault:A[1],backgroundHover:A[3],backgroundActive:A[4],border:A[4],contentPrimary:A[10],contentSecondary:A[9],contentTertiary:A[8]},KI={background:A[1],content:A[9],border:A[4]},QI={activeBackground:A[3],activeContent:ne[5],inactiveContent:A[9],border:A[4]},JI={header:{textDefault:A[9],textHover:A[8],backgroundDefault:A[1]},border:A[4],cell:{textPrimary:A[10],textSecondary:A[9],backgroundDefault:A[2],backgroundHover:A[1]}},eH={textPrimaryDefault:A[10],textPrimaryHover:A[10],textSecondaryDefault:A[8],textSecondaryHover:A[9],iconPrimary:A[10],iconSecondary:A[8]},tH={background:Te[1],active:Te[5]},nH={textDefault:A[10],textSelected:_t.white,textDisabled:A[7],backgroundDefault:A[2],backgroundMiddle:A[3],backgroundSelected:ne[3],border:A[4]},iH=A[9];var a1=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function s1(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??`var(--syntro-ring, ${un[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),d=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let S=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:S?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${a||h||un[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(_);let b=[];if(!a1)for(let C=0;C<4;C++){let E=document.createElement("div");E.style.position="fixed",E.style.background="inherit",b.push(E),g.appendChild(E)}let f=C=>{g.style.clipPath=C,g.style.webkitClipPath=C},p=()=>{if(!t.isConnected){k.destroy();return}let C=t.getBoundingClientRect(),E=Math.max(0,C.left-i),M=Math.max(0,C.top-i),I=Math.min(window.innerWidth,C.width+i*2),N=Math.min(window.innerHeight,C.height+i*2);if(Object.assign(_.style,{left:`${E}px`,top:`${M}px`,width:`${I}px`,height:`${N}px`}),a1){let F=window.innerWidth,Y=window.innerHeight,z=Math.min(r,I/2,N/2),te=`M 0 0 L ${F} 0 L ${F} ${Y} L 0 ${Y} Z`,L=`M ${E+z} ${M} A ${z} ${z} 0 0 0 ${E} ${M+z} L ${E} ${M+N-z} A ${z} ${z} 0 0 0 ${E+z} ${M+N} L ${E+I-z} ${M+N} A ${z} ${z} 0 0 0 ${E+I} ${M+N-z} L ${E+I} ${M+z} A ${z} ${z} 0 0 0 ${E+I-z} ${M} L ${E+z} ${M} Z`;f(`path('${te} ${L}')`)}else{let[F,Y,z,te]=b;Object.assign(F.style,{left:"0px",top:"0px",width:"100vw",height:`${M}px`}),Object.assign(z.style,{left:"0px",top:`${M+N}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(M+N))}px`}),Object.assign(te.style,{left:"0px",top:`${M}px`,width:`${E}px`,height:`${N}px`}),Object.assign(Y.style,{left:`${E+I}px`,top:`${M}px`,width:`${Math.max(0,window.innerWidth-(E+I))}px`,height:`${N}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(p));v.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let T=C=>{C.key==="Escape"&&c&&k.destroy()};c&&window.addEventListener("keydown",T);let x=C=>{s?(C.preventDefault(),C.stopPropagation()):l&&k.destroy()};g.addEventListener("click",x);let k={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",T),g.removeEventListener("click",x),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),_.remove()},220)}};return p(),k}var hM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function dn(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!hM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(d||h)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var um=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:o,dismiss:a,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
10
10
  position: fixed;
11
11
  inset: 0;
12
12
  background: rgba(0, 0, 0, ${o?.opacity??.6});
@@ -42,10 +42,10 @@ Error generating stack: `+i.message+`
42
42
  <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
43
43
  </svg>
44
44
  </button>
45
- `),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let S of s){let w=S.primary??!1;d+=`
45
+ `),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of s){let T=w.primary??!1;d+=`
46
46
  <button
47
- class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
48
- data-syntro-action="${dn(S.actionId)}"
47
+ class="syntro-modal-btn ${T?"syntro-modal-btn-primary":""}"
48
+ data-syntro-action="${dn(w.actionId)}"
49
49
  style="
50
50
  padding: 10px 20px;
51
51
  border-radius: 8px;
@@ -53,12 +53,12 @@ Error generating stack: `+i.message+`
53
53
  font-weight: 500;
54
54
  cursor: pointer;
55
55
  transition: background 150ms ease;
56
- ${w?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
56
+ ${T?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
57
57
  "
58
58
  >
59
- ${dn(S.label)}
59
+ ${dn(w.label)}
60
60
  </button>
61
- `}d+="</div>"}c.innerHTML=d,e.overlayRoot.appendChild(c);let p=null,g=c.querySelectorAll("[data-syntro-action]"),_=S=>{let C=S.currentTarget.getAttribute("data-syntro-action");C&&(p=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),m.destroy())};g.forEach(S=>S.addEventListener("click",_));let b=S=>{S.key==="Escape"&&a?.onEsc!==!1&&m.destroy()};window.addEventListener("keydown",b);let x=()=>{r||m.destroy()};l.addEventListener("click",x);let f=[];r&&Array.from(document.body.children).forEach(S=>{S!==e.overlayRoot&&S.getAttribute("inert")===null&&!S.querySelector("[data-syntro-editor-panel]")&&!S.hasAttribute("data-syntro-editor-panel")&&(S.setAttribute("inert",""),f.push(S))});let h;a?.timeoutMs&&(h=setTimeout(()=>{m.destroy()},a.timeoutMs));let y=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');y.length>0&&requestAnimationFrame(()=>y[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let m={destroy(){h&&clearTimeout(h),window.removeEventListener("keydown",b),l.removeEventListener("click",x),g.forEach(S=>S.removeEventListener("click",_)),f.forEach(S=>S.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:p})}};return{cleanup:()=>{m.destroy()}}};var q1=["top","right","bottom","left"];var Ir=Math.min,Hi=Math.max,Vl=Math.round,jl=Math.floor,Fn=t=>({x:t,y:t}),QO={left:"right",right:"left",bottom:"top",top:"bottom"},JO={start:"end",end:"start"};function xd(t,e,n){return Hi(t,Ir(e,n))}function Ro(t,e){return typeof t=="function"?t(e):t}function Hr(t){return t.split("-")[0]}function Qa(t){return t.split("-")[1]}function im(t){return t==="x"?"y":"x"}function Sd(t){return t==="y"?"height":"width"}var eM=new Set(["top","bottom"]);function zi(t){return eM.has(Hr(t))?"y":"x"}function wd(t){return im(zi(t))}function Z1(t,e,n){n===void 0&&(n=!1);let i=Qa(t),r=wd(t),o=Sd(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=Ul(a)),[a,Ul(a)]}function G1(t){let e=Ul(t);return[_d(t),e,_d(e)]}function _d(t){return t.replace(/start|end/g,e=>JO[e])}var j1=["left","right"],P1=["right","left"],tM=["top","bottom"],nM=["bottom","top"];function iM(t,e,n){switch(t){case"top":case"bottom":return n?e?P1:j1:e?j1:P1;case"left":case"right":return e?tM:nM;default:return[]}}function Y1(t,e,n,i){let r=Qa(t),o=iM(Hr(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(_d)))),o}function Ul(t){return t.replace(/left|right|bottom|top/g,e=>QO[e])}function rM(t){return{top:0,right:0,bottom:0,left:0,...t}}function rm(t){return typeof t!="number"?rM(t):{top:t,right:t,bottom:t,left:t}}function Oo(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function W1(t,e,n){let{reference:i,floating:r}=t,o=zi(e),a=wd(e),s=Sd(a),l=Hr(e),c=o==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,p=i[s]/2-r[s]/2,g;switch(l){case"top":g={x:u,y:i.y-r.height};break;case"bottom":g={x:u,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:d};break;case"left":g={x:i.x-r.width,y:d};break;default:g={x:i.x,y:i.y}}switch(Qa(e)){case"start":g[a]-=p*(n&&c?-1:1);break;case"end":g[a]+=p*(n&&c?-1:1);break}return g}async function Q1(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:o,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:g=0}=Ro(e,t),_=rm(g),x=s[p?d==="floating"?"reference":"floating":d],f=Oo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),h=d==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),m=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},S=Oo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:h,offsetParent:y,strategy:l}):h);return{top:(f.top-S.top+_.top)/m.y,bottom:(S.bottom-f.bottom+_.bottom)/m.y,left:(f.left-S.left+_.left)/m.x,right:(S.right-f.right+_.right)/m.x}}var J1=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=W1(c,i,l),p=i,g={},_=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:h}=s[x],{x:y,y:m,data:S,reset:w}=await h({x:u,y:d,initialPlacement:i,placement:p,strategy:r,middlewareData:g,rects:c,platform:{...a,detectOverflow:(b=a.detectOverflow)!=null?b:Q1},elements:{reference:t,floating:e}});u=y??u,d=m??d,g={...g,[f]:{...g[f],...S}},w&&_<=50&&(_++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(c=w.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):w.rects),{x:u,y:d}=W1(c,p,l)),x=-1)}return{x:u,y:d,placement:p,strategy:r,middlewareData:g}},ew=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Ro(t,e)||{};if(c==null)return{};let d=rm(u),p={x:n,y:i},g=wd(r),_=Sd(g),b=await a.getDimensions(c),x=g==="y",f=x?"top":"left",h=x?"bottom":"right",y=x?"clientHeight":"clientWidth",m=o.reference[_]+o.reference[g]-p[g]-o.floating[_],S=p[g]-o.reference[g],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),C=w?w[y]:0;(!C||!await(a.isElement==null?void 0:a.isElement(w)))&&(C=s.floating[y]||o.floating[_]);let k=m/2-S/2,T=C/2-b[_]/2-1,E=Ir(d[f],T),M=Ir(d[h],T),N=E,I=C-b[_]-M,H=C/2-b[_]/2+k,q=xd(N,H,I),V=!l.arrow&&Qa(r)!=null&&H!==q&&o.reference[_]/2-(H<N?E:M)-b[_]/2<0,ie=V?H<N?H-N:H-I:0;return{[g]:p[g]+ie,data:{[g]:q,centerOffset:H-q-ie,...V&&{alignmentOffset:ie}},reset:V}}});var tw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:b=!0,...x}=Ro(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=Hr(r),h=zi(s),y=Hr(s)===s,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(y||!b?[Ul(s)]:G1(s)),w=_!=="none";!p&&w&&S.push(...Y1(s,b,_,m));let C=[s,...S],k=await l.detectOverflow(e,x),T=[],E=((i=o.flip)==null?void 0:i.overflows)||[];if(u&&T.push(k[f]),d){let H=Z1(r,a,m);T.push(k[H[0]],k[H[1]])}if(E=[...E,{placement:r,overflows:T}],!T.every(H=>H<=0)){var M,N;let H=(((M=o.flip)==null?void 0:M.index)||0)+1,q=C[H];if(q&&(!(d==="alignment"?h!==zi(q):!1)||E.every(D=>zi(D.placement)===h?D.overflows[0]>0:!0)))return{data:{index:H,overflows:E},reset:{placement:q}};let V=(N=E.filter(ie=>ie.overflows[0]<=0).sort((ie,D)=>ie.overflows[1]-D.overflows[1])[0])==null?void 0:N.placement;if(!V)switch(g){case"bestFit":{var I;let ie=(I=E.filter(D=>{if(w){let Y=zi(D.placement);return Y===h||Y==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Y=>Y>0).reduce((Y,ee)=>Y+ee,0)]).sort((D,Y)=>D[1]-Y[1])[0])==null?void 0:I[0];ie&&(V=ie);break}case"initialPlacement":V=s;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function X1(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function K1(t){return q1.some(e=>t[e]>=0)}var nw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=Ro(t,e);switch(r){case"referenceHidden":{let a=await i.detectOverflow(e,{...o,elementContext:"reference"}),s=X1(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:K1(s)}}}case"escaped":{let a=await i.detectOverflow(e,{...o,altBoundary:!0}),s=X1(a,n.floating);return{data:{escapedOffsets:s,escaped:K1(s)}}}default:return{}}}}};var oM=new Set(["left","top"]);async function aM(t,e){let{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Hr(n),s=Qa(n),l=zi(n)==="y",c=oM.has(a)?-1:1,u=o&&l?-1:1,d=Ro(e,t),{mainAxis:p,crossAxis:g,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof _=="number"&&(g=s==="end"?_*-1:_),l?{x:g*u,y:p*c}:{x:p*c,y:g*u}}var iw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:o,placement:a,middlewareData:s}=e,l=await aM(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},rw=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:h,y}=f;return{x:h,y}}},...c}=Ro(t,e),u={x:n,y:i},d=await o.detectOverflow(e,c),p=zi(Hr(r)),g=im(p),_=u[g],b=u[p];if(a){let f=g==="y"?"top":"left",h=g==="y"?"bottom":"right",y=_+d[f],m=_-d[h];_=xd(y,_,m)}if(s){let f=p==="y"?"top":"left",h=p==="y"?"bottom":"right",y=b+d[f],m=b-d[h];b=xd(y,b,m)}let x=l.fn({...e,[g]:_,[p]:b});return{...x,data:{x:x.x-n,y:x.y-i,enabled:{[g]:a,[p]:s}}}}}};function Ed(){return typeof window<"u"}function Mo(t){return aw(t)?(t.nodeName||"").toLowerCase():"#document"}function qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Un(t){var e;return(e=(aw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function aw(t){return Ed()?t instanceof Node||t instanceof qt(t).Node:!1}function An(t){return Ed()?t instanceof Element||t instanceof qt(t).Element:!1}function Vn(t){return Ed()?t instanceof HTMLElement||t instanceof qt(t).HTMLElement:!1}function ow(t){return!Ed()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qt(t).ShadowRoot}var sM=new Set(["inline","contents"]);function es(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=kn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!sM.has(r)}var lM=new Set(["table","td","th"]);function sw(t){return lM.has(Mo(t))}var cM=[":popover-open",":modal"];function Pl(t){return cM.some(e=>{try{return t.matches(e)}catch{return!1}})}var uM=["transform","translate","scale","rotate","perspective"],dM=["transform","translate","scale","rotate","perspective","filter"],fM=["paint","layout","strict","content"];function Cd(t){let e=Ad(),n=An(t)?kn(t):t;return uM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||dM.some(i=>(n.willChange||"").includes(i))||fM.some(i=>(n.contain||"").includes(i))}function lw(t){let e=Bi(t);for(;Vn(e)&&!No(e);){if(Cd(e))return e;if(Pl(e))return null;e=Bi(e)}return null}function Ad(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var pM=new Set(["html","body","#document"]);function No(t){return pM.has(Mo(t))}function kn(t){return qt(t).getComputedStyle(t)}function ql(t){return An(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bi(t){if(Mo(t)==="html")return t;let e=t.assignedSlot||t.parentNode||ow(t)&&t.host||Un(t);return ow(e)?e.host:e}function cw(t){let e=Bi(t);return No(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vn(e)&&es(e)?e:cw(e)}function Ja(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=cw(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=qt(r);if(o){let s=kd(a);return e.concat(a,a.visualViewport||[],es(r)?r:[],s&&n?Ja(s):[])}return e.concat(r,Ja(r,[],n))}function kd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pw(t){let e=kn(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Vn(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=Vl(n)!==o||Vl(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function am(t){return An(t)?t:t.contextElement}function ts(t){let e=am(t);if(!Vn(e))return Fn(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=pw(e),a=(o?Vl(n.width):n.width)/i,s=(o?Vl(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var hM=Fn(0);function hw(t){let e=qt(t);return!Ad()||!e.visualViewport?hM:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function gM(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==qt(t)?!1:e}function Do(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),o=am(t),a=Fn(1);e&&(i?An(i)&&(a=ts(i)):a=ts(t));let s=gM(o,n,i)?hw(o):Fn(0),l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){let p=qt(o),g=i&&An(i)?qt(i):i,_=p,b=kd(_);for(;b&&i&&g!==_;){let x=ts(b),f=b.getBoundingClientRect(),h=kn(b),y=f.left+(b.clientLeft+parseFloat(h.paddingLeft))*x.x,m=f.top+(b.clientTop+parseFloat(h.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,d*=x.y,l+=y,c+=m,_=qt(b),b=kd(_)}}return Oo({width:u,height:d,x:l,y:c})}function Td(t,e){let n=ql(t).scrollLeft;return e?e.left+n:Do(Un(t)).left+n}function gw(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Td(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function mM(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o=r==="fixed",a=Un(i),s=e?Pl(e.floating):!1;if(i===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Fn(1),u=Fn(0),d=Vn(i);if((d||!d&&!o)&&((Mo(i)!=="body"||es(a))&&(l=ql(i)),Vn(i))){let g=Do(i);c=ts(i),u.x=g.x+i.clientLeft,u.y=g.y+i.clientTop}let p=a&&!d&&!o?gw(a,l):Fn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function vM(t){return Array.from(t.getClientRects())}function yM(t){let e=Un(t),n=ql(t),i=t.ownerDocument.body,r=Hi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Hi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+Td(t),s=-n.scrollTop;return kn(i).direction==="rtl"&&(a+=Hi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}var uw=25;function bM(t,e){let n=qt(t),i=Un(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;let u=Ad();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=Td(i);if(c<=0){let u=i.ownerDocument,d=u.body,p=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,_=Math.abs(i.clientWidth-d.clientWidth-g);_<=uw&&(o-=_)}else c<=uw&&(o+=c);return{width:o,height:a,x:s,y:l}}var _M=new Set(["absolute","fixed"]);function xM(t,e){let n=Do(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Vn(t)?ts(t):Fn(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:a,height:s,x:l,y:c}}function dw(t,e,n){let i;if(e==="viewport")i=bM(t,n);else if(e==="document")i=yM(Un(t));else if(An(e))i=xM(e,n);else{let r=hw(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Oo(i)}function mw(t,e){let n=Bi(t);return n===e||!An(n)||No(n)?!1:kn(n).position==="fixed"||mw(n,e)}function SM(t,e){let n=e.get(t);if(n)return n;let i=Ja(t,[],!1).filter(s=>An(s)&&Mo(s)!=="body"),r=null,o=kn(t).position==="fixed",a=o?Bi(t):t;for(;An(a)&&!No(a);){let s=kn(a),l=Cd(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&_M.has(r.position)||es(a)&&!l&&mw(t,a))?i=i.filter(u=>u!==a):r=s,a=Bi(a)}return e.set(t,i),i}function wM(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?Pl(e)?[]:SM(e,this._c):[].concat(n),i],s=a[0],l=a.reduce((c,u)=>{let d=dw(e,u,r);return c.top=Hi(d.top,c.top),c.right=Ir(d.right,c.right),c.bottom=Ir(d.bottom,c.bottom),c.left=Hi(d.left,c.left),c},dw(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function EM(t){let{width:e,height:n}=pw(t);return{width:e,height:n}}function CM(t,e,n){let i=Vn(e),r=Un(e),o=n==="fixed",a=Do(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Fn(0);function c(){l.x=Td(r)}if(i||!i&&!o)if((Mo(e)!=="body"||es(r))&&(s=ql(e)),i){let g=Do(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else r&&c();o&&!i&&r&&c();let u=r&&!i&&!o?gw(r,s):Fn(0),d=a.left+s.scrollLeft-l.x-u.x,p=a.top+s.scrollTop-l.y-u.y;return{x:d,y:p,width:a.width,height:a.height}}function om(t){return kn(t).position==="static"}function fw(t,e){if(!Vn(t)||kn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Un(t)===n&&(n=n.ownerDocument.body),n}function vw(t,e){let n=qt(t);if(Pl(t))return n;if(!Vn(t)){let r=Bi(t);for(;r&&!No(r);){if(An(r)&&!om(r))return r;r=Bi(r)}return n}let i=fw(t,e);for(;i&&sw(i)&&om(i);)i=fw(i,e);return i&&No(i)&&om(i)&&!Cd(i)?n:i||lw(t)||n}var AM=async function(t){let e=this.getOffsetParent||vw,n=this.getDimensions,i=await n(t.floating);return{reference:CM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function kM(t){return kn(t).direction==="rtl"}var TM={convertOffsetParentRelativeRectToViewportRelativeRect:mM,getDocumentElement:Un,getClippingRect:wM,getOffsetParent:vw,getElementRects:AM,getClientRects:vM,getDimensions:EM,getScale:ts,isElement:An,isRTL:kM};function yw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function RM(t,e){let n=null,i,r=Un(t);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:d,width:p,height:g}=c;if(s||e(),!p||!g)return;let _=jl(d),b=jl(r.clientWidth-(u+p)),x=jl(r.clientHeight-(d+g)),f=jl(u),y={rootMargin:-_+"px "+-b+"px "+-x+"px "+-f+"px",threshold:Hi(0,Ir(1,l))||1},m=!0;function S(w){let C=w[0].intersectionRatio;if(C!==l){if(!m)return a();C?a(!1,C):i=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!yw(c,t.getBoundingClientRect())&&a(),m=!1}try{n=new IntersectionObserver(S,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return a(!0),o}function Rd(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=am(t),u=r||o?[...c?Ja(c):[],...Ja(e)]:[];u.forEach(f=>{r&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&s?RM(c,n):null,p=-1,g=null;a&&(g=new ResizeObserver(f=>{let[h]=f;h&&h.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let _,b=l?Do(t):null;l&&x();function x(){let f=Do(t);b&&!yw(b,f)&&n(),b=f,_=requestAnimationFrame(x)}return n(),()=>{var f;u.forEach(h=>{r&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(_)}}var Od=iw;var Md=rw,Nd=tw;var bw=nw,_w=ew;var Dd=(t,e,n)=>{let i=new Map,r={platform:TM,...n},o={...r.platform,_c:i};return J1(t,e,{...r,platform:o})};function OM(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let o=Math.max(e.left,0),a=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(o+s)/2,u=(a+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function xw(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=dn(n.html),!n.trigger||n.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>x.destroy()),o.style.position="relative",o.appendChild(f)}let a=o.querySelectorAll("[data-syntro-action]"),s=f=>{let y=f.currentTarget.getAttribute("data-syntro-action");y&&n.onAction&&n.onAction(y)};a.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[Od(n.offsetPx??8),Nd(),Md({padding:8}),bw(),_w({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",d=Rd(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=OM(t),h=await Dd(f,o,{placement:u,strategy:"fixed",middleware:c}),{x:y,y:m,strategy:S,middlewareData:w,placement:C}=h;if(Object.assign(o.style,{left:`${y}px`,top:`${m}px`,position:S}),w.arrow){let{x:k,y:T}=w.arrow,E=C.split("-")[0],M={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:k!=null?`${k}px`:"",top:T!=null?`${T}px`:"",right:"",bottom:"",[M[E]]:"-4px"});let N={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${N[E]||"0deg"})`}}),p=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",p);let g=[];if(n.blocking){Array.from(document.body.children).forEach(h=>{h!==e&&h.getAttribute("inert")===null&&(h.setAttribute("inert",""),g.push(h.id||h.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let h=f[0],y=f[f.length-1],m=S=>{S.key==="Tab"&&(S.shiftKey?document.activeElement===h&&(y.focus(),S.preventDefault()):document.activeElement===y&&(h.focus(),S.preventDefault()))};o.addEventListener("keydown",m),requestAnimationFrame(()=>h.focus())}}let b=(()=>{if(n.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},h=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",h),t.addEventListener("focus",f),t.addEventListener("blur",h),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",h),t.removeEventListener("focus",f),t.removeEventListener("blur",h)}}if(n.trigger==="click"){let f=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){d(),b(),window.removeEventListener("keydown",p),a.forEach(f=>f.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var sm=X(Fe(),1),Pe=X(Qe(),1),kw=X(To(),1);var Ue=X(Fe(),1);function DM({completed:t,total:e}){let n=e>0?Math.round(t/e*100):0;return(0,Ue.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ue.jsx)("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${n}%`}})})}function LM({step:t,isCompleted:e,isCurrent:n,tourId:i,onStepClick:r}){return(0,Ue.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":n?"true":void 0,"data-completed":e?"true":void 0,"aria-current":n?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${n?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(i,t.id),children:[(0,Ue.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ue.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):n?(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ue.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function IM({workflow:t,expanded:e,onStepClick:n,onDismiss:i}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ue.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ue.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ue.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ue.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ue.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>i(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ue.jsxs)("div",{className:"se-mb-2",children:[(0,Ue.jsx)(DM,{completed:r,total:o}),(0,Ue.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ue.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(a=>(0,Ue.jsx)(LM,{step:a,isCompleted:t.completedSteps.includes(a.id),isCurrent:t.currentStepId===a.id,tourId:t.tourId,onStepClick:n},a.id))}),e&&t.meta.description&&(0,Ue.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function Cw({workflows:t,expanded:e,onStepClick:n,onDismiss:i}){return t.length===0?(0,Ue.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ue.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ue.jsx)(IM,{workflow:r,expanded:e,onStepClick:n,onDismiss:i},r.tourId))})}function Aw(t,e){let n=document.createElement("div");n.setAttribute("data-testid","workflow-toast"),n.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(n.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let i=document.createElement("div");if(i.className="se-font-semibold",i.style.fontWeight="600",i.textContent=e.title,n.appendChild(i),e.body){let a=document.createElement("div");a.className="se-mt-1 se-text-sm",a.style.marginTop="4px",a.style.fontSize="13px",a.style.color="var(--se-color-text-secondary, #666)",a.textContent=e.body,n.appendChild(a)}t.appendChild(n);let r,o=setTimeout(()=>{n.style.opacity="0",r=setTimeout(()=>{n.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),n.remove()}}function HM(t){let e=new Map;for(let n of t){let i=n.action;if(i.kind==="core:tour"&&i.workflow&&i.tourId){let r=i.workflow,a=(i.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(i.tourId,{meta:r,steps:a})}}return e}function zM({runtime:t}){let[e,n]=(0,Pe.useState)(0),i=(0,Pe.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return HM(x)},[t,e]),r=(0,Pe.useRef)(i);r.current=i,(0,Pe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>n(x=>x+1))},[t]);let o=(0,Pe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),a=(0,Pe.useRef)(new Set),s=(0,Pe.useRef)([]),l=(0,Pe.useRef)(null),c=(0,Pe.useRef)({}),[u,d]=(0,Pe.useState)([]),p=(0,Pe.useRef)(!1);if(!p.current&&o){let x=o.get?.("notified")||[];for(let h of x)a.current.add(h);let f=o.get?.("completed")||{};c.current={...f},p.current=!0}(0,Pe.useEffect)(()=>{if(i.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(h=>{let y=new Set(h.map(S=>S.tourId)),m=[];for(let[S,{meta:w,steps:C}]of i){if(y.has(S))continue;let k="active";x.includes(S)?k="dismissed":f[S]&&(k="completed"),m.push({tourId:S,meta:w,steps:C,currentStepId:null,completedSteps:[],status:k,completedAt:f[S]||void 0})}return m.length>0?[...h,...m]:h});for(let[h,{meta:y}]of i)if(!a.current.has(h)&&y.notification&&l.current&&!x.includes(h)&&!f[h]){a.current.add(h),o?.set?.("notified",[...a.current]);let m=Aw(l.current,y.notification);s.current.push(m)}},[i,o]),(0,Pe.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let h=f.props?.tourId;if(!h)return;let y=r.current;if(!y.has(h)&&f.name==="tour.started"){n(m=>m+1);return}y.has(h)&&d(m=>m.map(w=>{if(w.tourId!==h)return w;switch(f.name){case"tour.started":{let C=f.props?.startStepId||w.steps[0]?.id||null;if(!a.current.has(h)){a.current.add(h),o?.set?.("notified",[...a.current]);let T=y.get(h);if(T?.meta.notification&&l.current){let E=Aw(l.current,T.meta.notification);s.current.push(E)}}let k=m.filter(T=>T.status==="active"||T.tourId===h).map(T=>T.tourId);return k.includes(h)||k.push(h),o?.set?.("active",[...new Set(k)]),{...w,status:"active",currentStepId:C,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let C=f.props?.stepId;return{...w,currentStepId:C||w.currentStepId}}case"tour.step_changed":{let C=f.props?.previousStepId,k=f.props?.nextStepId,T=C&&!w.completedSteps.includes(C)?[...w.completedSteps,C]:w.completedSteps;return{...w,currentStepId:k||w.currentStepId,completedSteps:T}}case"tour.completed":{let C=Date.now();return c.current[h]=C,o?.set?.("completed",{...c.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(k=>k.id),completedAt:C}}case"tour.paused":return w;default:return w}}))});return()=>{x();for(let f of s.current)f();s.current=[]}},[t,o]);let g=(0,Pe.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),_=(0,Pe.useCallback)(x=>{d(f=>{let h=f.map(m=>m.tourId===x?{...m,status:"dismissed"}:m),y=h.filter(m=>m.status==="dismissed").map(m=>m.tourId);return o?.set?.("dismissed",y),h})},[o]),b=(0,Pe.useMemo)(()=>u.filter(x=>x.status==="active"),[u]);return(0,sm.jsx)("div",{ref:l,children:(0,sm.jsx)(Cw,{workflows:b,onStepClick:g,onDismiss:_})})}var Tw={mount(t,e){let n=e?.runtime||null,i=(0,kw.createRoot)(t);return i.render(Pe.default.createElement(zM,{runtime:n})),()=>{i.unmount()}}};var Rw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-overlays] Anchor not found for highlight, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=V1(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},Ow=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-overlays] Anchor not found for pulse, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.duration??2e3;if(!document.querySelector("[data-syntro-pulse-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-pulse-styles",""),a.textContent=`
61
+ `}d+="</div>"}c.innerHTML=d,e.overlayRoot.appendChild(c);let h=null,g=c.querySelectorAll("[data-syntro-action]"),S=w=>{let x=w.currentTarget.getAttribute("data-syntro-action");x&&(h=x,e.publishEvent("action.modal_cta_clicked",{actionId:x}),y.destroy())};g.forEach(w=>w.addEventListener("click",S));let _=w=>{w.key==="Escape"&&a?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let b=()=>{r||y.destroy()};l.addEventListener("click",b);let f=[];r&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&!w.querySelector("[data-syntro-editor-panel]")&&!w.hasAttribute("data-syntro-editor-panel")&&(w.setAttribute("inert",""),f.push(w))});let p;a?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},a.timeoutMs));let v=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",b),g.forEach(w=>w.removeEventListener("click",S)),f.forEach(w=>w.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var u1=["top","right","bottom","left"];var Ir=Math.min,Hi=Math.max,Pl=Math.round,ql=Math.floor,$n=t=>({x:t,y:t}),gM={left:"right",right:"left",bottom:"top",top:"bottom"},mM={start:"end",end:"start"};function Od(t,e,n){return Hi(t,Ir(e,n))}function Oo(t,e){return typeof t=="function"?t(e):t}function Hr(t){return t.split("-")[0]}function Ja(t){return t.split("-")[1]}function dm(t){return t==="x"?"y":"x"}function Md(t){return t==="y"?"height":"width"}var vM=new Set(["top","bottom"]);function zi(t){return vM.has(Hr(t))?"y":"x"}function Nd(t){return dm(zi(t))}function d1(t,e,n){n===void 0&&(n=!1);let i=Ja(t),r=Nd(t),o=Md(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=jl(a)),[a,jl(a)]}function f1(t){let e=jl(t);return[Rd(t),e,Rd(e)]}function Rd(t){return t.replace(/start|end/g,e=>mM[e])}var l1=["left","right"],c1=["right","left"],yM=["top","bottom"],bM=["bottom","top"];function _M(t,e,n){switch(t){case"top":case"bottom":return n?e?c1:l1:e?l1:c1;case"left":case"right":return e?yM:bM;default:return[]}}function p1(t,e,n,i){let r=Ja(t),o=_M(Hr(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(Rd)))),o}function jl(t){return t.replace(/left|right|bottom|top/g,e=>gM[e])}function SM(t){return{top:0,right:0,bottom:0,left:0,...t}}function fm(t){return typeof t!="number"?SM(t):{top:t,right:t,bottom:t,left:t}}function Mo(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function h1(t,e,n){let{reference:i,floating:r}=t,o=zi(e),a=Nd(e),s=Md(a),l=Hr(e),c=o==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2,g;switch(l){case"top":g={x:u,y:i.y-r.height};break;case"bottom":g={x:u,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:d};break;case"left":g={x:i.x-r.width,y:d};break;default:g={x:i.x,y:i.y}}switch(Ja(e)){case"start":g[a]-=h*(n&&c?-1:1);break;case"end":g[a]+=h*(n&&c?-1:1);break}return g}async function v1(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:o,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Oo(e,t),S=fm(g),b=s[h?d==="floating"?"reference":"floating":d],f=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),p=d==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},w=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:v,strategy:l}):p);return{top:(f.top-w.top+S.top)/y.y,bottom:(w.bottom-f.bottom+S.bottom)/y.y,left:(f.left-w.left+S.left)/y.x,right:(w.right-f.right+S.right)/y.x}}var y1=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=h1(c,i,l),h=i,g={},S=0;for(let b=0;b<s.length;b++){var _;let{name:f,fn:p}=s[b],{x:v,y,data:w,reset:T}=await p({x:u,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:g,rects:c,platform:{...a,detectOverflow:(_=a.detectOverflow)!=null?_:v1},elements:{reference:t,floating:e}});u=v??u,d=y??d,g={...g,[f]:{...g[f],...w}},T&&S<=50&&(S++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):T.rects),{x:u,y:d}=h1(c,h,l)),b=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:g}},b1=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Oo(t,e)||{};if(c==null)return{};let d=fm(u),h={x:n,y:i},g=Nd(r),S=Md(g),_=await a.getDimensions(c),b=g==="y",f=b?"top":"left",p=b?"bottom":"right",v=b?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[g]-h[g]-o.floating[S],w=h[g]-o.reference[g],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),x=T?T[v]:0;(!x||!await(a.isElement==null?void 0:a.isElement(T)))&&(x=s.floating[v]||o.floating[S]);let k=y/2-w/2,C=x/2-_[S]/2-1,E=Ir(d[f],C),M=Ir(d[p],C),I=E,N=x-_[S]-M,F=x/2-_[S]/2+k,Y=Od(I,F,N),z=!l.arrow&&Ja(r)!=null&&F!==Y&&o.reference[S]/2-(F<I?E:M)-_[S]/2<0,te=z?F<I?F-I:F-N:0;return{[g]:h[g]+te,data:{[g]:Y,centerOffset:F-Y-te,...z&&{alignmentOffset:te}},reset:z}}});var _1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...b}=Oo(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=Hr(r),p=zi(s),v=Hr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(v||!_?[jl(s)]:f1(s)),T=S!=="none";!h&&T&&w.push(...p1(s,_,S,y));let x=[s,...w],k=await l.detectOverflow(e,b),C=[],E=((i=o.flip)==null?void 0:i.overflows)||[];if(u&&C.push(k[f]),d){let F=d1(r,a,y);C.push(k[F[0]],k[F[1]])}if(E=[...E,{placement:r,overflows:C}],!C.every(F=>F<=0)){var M,I;let F=(((M=o.flip)==null?void 0:M.index)||0)+1,Y=x[F];if(Y&&(!(d==="alignment"?p!==zi(Y):!1)||E.every(L=>zi(L.placement)===p?L.overflows[0]>0:!0)))return{data:{index:F,overflows:E},reset:{placement:Y}};let z=(I=E.filter(te=>te.overflows[0]<=0).sort((te,L)=>te.overflows[1]-L.overflows[1])[0])==null?void 0:I.placement;if(!z)switch(g){case"bestFit":{var N;let te=(N=E.filter(L=>{if(T){let Z=zi(L.placement);return Z===p||Z==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Z=>Z>0).reduce((Z,J)=>Z+J,0)]).sort((L,Z)=>L[1]-Z[1])[0])==null?void 0:N[0];te&&(z=te);break}case"initialPlacement":z=s;break}if(r!==z)return{reset:{placement:z}}}return{}}}};function g1(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function m1(t){return u1.some(e=>t[e]>=0)}var S1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=Oo(t,e);switch(r){case"referenceHidden":{let a=await i.detectOverflow(e,{...o,elementContext:"reference"}),s=g1(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:m1(s)}}}case"escaped":{let a=await i.detectOverflow(e,{...o,altBoundary:!0}),s=g1(a,n.floating);return{data:{escapedOffsets:s,escaped:m1(s)}}}default:return{}}}}};var xM=new Set(["left","top"]);async function wM(t,e){let{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Hr(n),s=Ja(n),l=zi(n)==="y",c=xM.has(a)?-1:1,u=o&&l?-1:1,d=Oo(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof S=="number"&&(g=s==="end"?S*-1:S),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}var x1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:o,placement:a,middlewareData:s}=e,l=await wM(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},w1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:p,y:v}=f;return{x:p,y:v}}},...c}=Oo(t,e),u={x:n,y:i},d=await o.detectOverflow(e,c),h=zi(Hr(r)),g=dm(h),S=u[g],_=u[h];if(a){let f=g==="y"?"top":"left",p=g==="y"?"bottom":"right",v=S+d[f],y=S-d[p];S=Od(v,S,y)}if(s){let f=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=_+d[f],y=_-d[p];_=Od(v,_,y)}let b=l.fn({...e,[g]:S,[h]:_});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[g]:a,[h]:s}}}}}};function Dd(){return typeof window<"u"}function No(t){return C1(t)?(t.nodeName||"").toLowerCase():"#document"}function qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Un(t){var e;return(e=(C1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function C1(t){return Dd()?t instanceof Node||t instanceof qt(t).Node:!1}function An(t){return Dd()?t instanceof Element||t instanceof qt(t).Element:!1}function Vn(t){return Dd()?t instanceof HTMLElement||t instanceof qt(t).HTMLElement:!1}function E1(t){return!Dd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qt(t).ShadowRoot}var EM=new Set(["inline","contents"]);function ts(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=Tn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!EM.has(r)}var CM=new Set(["table","td","th"]);function A1(t){return CM.has(No(t))}var AM=[":popover-open",":modal"];function Zl(t){return AM.some(e=>{try{return t.matches(e)}catch{return!1}})}var TM=["transform","translate","scale","rotate","perspective"],kM=["transform","translate","scale","rotate","perspective","filter"],RM=["paint","layout","strict","content"];function Ld(t){let e=Id(),n=An(t)?Tn(t):t;return TM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||kM.some(i=>(n.willChange||"").includes(i))||RM.some(i=>(n.contain||"").includes(i))}function T1(t){let e=Bi(t);for(;Vn(e)&&!Do(e);){if(Ld(e))return e;if(Zl(e))return null;e=Bi(e)}return null}function Id(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var OM=new Set(["html","body","#document"]);function Do(t){return OM.has(No(t))}function Tn(t){return qt(t).getComputedStyle(t)}function Gl(t){return An(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bi(t){if(No(t)==="html")return t;let e=t.assignedSlot||t.parentNode||E1(t)&&t.host||Un(t);return E1(e)?e.host:e}function k1(t){let e=Bi(t);return Do(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vn(e)&&ts(e)?e:k1(e)}function es(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=k1(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=qt(r);if(o){let s=Hd(a);return e.concat(a,a.visualViewport||[],ts(r)?r:[],s&&n?es(s):[])}return e.concat(r,es(r,[],n))}function Hd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function N1(t){let e=Tn(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Vn(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=Pl(n)!==o||Pl(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function hm(t){return An(t)?t:t.contextElement}function ns(t){let e=hm(t);if(!Vn(e))return $n(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=N1(e),a=(o?Pl(n.width):n.width)/i,s=(o?Pl(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var MM=$n(0);function D1(t){let e=qt(t);return!Id()||!e.visualViewport?MM:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function NM(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==qt(t)?!1:e}function Lo(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),o=hm(t),a=$n(1);e&&(i?An(i)&&(a=ns(i)):a=ns(t));let s=NM(o,n,i)?D1(o):$n(0),l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){let h=qt(o),g=i&&An(i)?qt(i):i,S=h,_=Hd(S);for(;_&&i&&g!==S;){let b=ns(_),f=_.getBoundingClientRect(),p=Tn(_),v=f.left+(_.clientLeft+parseFloat(p.paddingLeft))*b.x,y=f.top+(_.clientTop+parseFloat(p.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=v,c+=y,S=qt(_),_=Hd(S)}}return Mo({width:u,height:d,x:l,y:c})}function zd(t,e){let n=Gl(t).scrollLeft;return e?e.left+n:Lo(Un(t)).left+n}function L1(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-zd(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function DM(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o=r==="fixed",a=Un(i),s=e?Zl(e.floating):!1;if(i===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=$n(1),u=$n(0),d=Vn(i);if((d||!d&&!o)&&((No(i)!=="body"||ts(a))&&(l=Gl(i)),Vn(i))){let g=Lo(i);c=ns(i),u.x=g.x+i.clientLeft,u.y=g.y+i.clientTop}let h=a&&!d&&!o?L1(a,l):$n(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function LM(t){return Array.from(t.getClientRects())}function IM(t){let e=Un(t),n=Gl(t),i=t.ownerDocument.body,r=Hi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Hi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+zd(t),s=-n.scrollTop;return Tn(i).direction==="rtl"&&(a+=Hi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}var R1=25;function HM(t,e){let n=qt(t),i=Un(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;let u=Id();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=zd(i);if(c<=0){let u=i.ownerDocument,d=u.body,h=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(i.clientWidth-d.clientWidth-g);S<=R1&&(o-=S)}else c<=R1&&(o+=c);return{width:o,height:a,x:s,y:l}}var zM=new Set(["absolute","fixed"]);function BM(t,e){let n=Lo(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Vn(t)?ns(t):$n(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:a,height:s,x:l,y:c}}function O1(t,e,n){let i;if(e==="viewport")i=HM(t,n);else if(e==="document")i=IM(Un(t));else if(An(e))i=BM(e,n);else{let r=D1(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Mo(i)}function I1(t,e){let n=Bi(t);return n===e||!An(n)||Do(n)?!1:Tn(n).position==="fixed"||I1(n,e)}function FM(t,e){let n=e.get(t);if(n)return n;let i=es(t,[],!1).filter(s=>An(s)&&No(s)!=="body"),r=null,o=Tn(t).position==="fixed",a=o?Bi(t):t;for(;An(a)&&!Do(a);){let s=Tn(a),l=Ld(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&zM.has(r.position)||ts(a)&&!l&&I1(t,a))?i=i.filter(u=>u!==a):r=s,a=Bi(a)}return e.set(t,i),i}function $M(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?Zl(e)?[]:FM(e,this._c):[].concat(n),i],s=a[0],l=a.reduce((c,u)=>{let d=O1(e,u,r);return c.top=Hi(d.top,c.top),c.right=Ir(d.right,c.right),c.bottom=Ir(d.bottom,c.bottom),c.left=Hi(d.left,c.left),c},O1(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UM(t){let{width:e,height:n}=N1(t);return{width:e,height:n}}function VM(t,e,n){let i=Vn(e),r=Un(e),o=n==="fixed",a=Lo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$n(0);function c(){l.x=zd(r)}if(i||!i&&!o)if((No(e)!=="body"||ts(r))&&(s=Gl(e)),i){let g=Lo(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else r&&c();o&&!i&&r&&c();let u=r&&!i&&!o?L1(r,s):$n(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function pm(t){return Tn(t).position==="static"}function M1(t,e){if(!Vn(t)||Tn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Un(t)===n&&(n=n.ownerDocument.body),n}function H1(t,e){let n=qt(t);if(Zl(t))return n;if(!Vn(t)){let r=Bi(t);for(;r&&!Do(r);){if(An(r)&&!pm(r))return r;r=Bi(r)}return n}let i=M1(t,e);for(;i&&A1(i)&&pm(i);)i=M1(i,e);return i&&Do(i)&&pm(i)&&!Ld(i)?n:i||T1(t)||n}var jM=async function(t){let e=this.getOffsetParent||H1,n=this.getDimensions,i=await n(t.floating);return{reference:VM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function PM(t){return Tn(t).direction==="rtl"}var qM={convertOffsetParentRelativeRectToViewportRelativeRect:DM,getDocumentElement:Un,getClippingRect:$M,getOffsetParent:H1,getElementRects:jM,getClientRects:LM,getDimensions:UM,getScale:ns,isElement:An,isRTL:PM};function z1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ZM(t,e){let n=null,i,r=Un(t);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=c;if(s||e(),!h||!g)return;let S=ql(d),_=ql(r.clientWidth-(u+h)),b=ql(r.clientHeight-(d+g)),f=ql(u),v={rootMargin:-S+"px "+-_+"px "+-b+"px "+-f+"px",threshold:Hi(0,Ir(1,l))||1},y=!0;function w(T){let x=T[0].intersectionRatio;if(x!==l){if(!y)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}x===1&&!z1(c,t.getBoundingClientRect())&&a(),y=!1}try{n=new IntersectionObserver(w,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return a(!0),o}function Bd(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=hm(t),u=r||o?[...c?es(c):[],...es(e)]:[];u.forEach(f=>{r&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&s?ZM(c,n):null,h=-1,g=null;a&&(g=new ResizeObserver(f=>{let[p]=f;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let S,_=l?Lo(t):null;l&&b();function b(){let f=Lo(t);_&&!z1(_,f)&&n(),_=f,S=requestAnimationFrame(b)}return n(),()=>{var f;u.forEach(p=>{r&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),d?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(S)}}var Fd=x1;var $d=w1,Ud=_1;var B1=S1,F1=b1;var Vd=(t,e,n)=>{let i=new Map,r={platform:qM,...n},o={...r.platform,_c:i};return y1(t,e,{...r,platform:o})};function GM(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let o=Math.max(e.left,0),a=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(o+s)/2,u=(a+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function $1(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=dn(n.html),!n.trigger||n.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>b.destroy()),o.style.position="relative",o.appendChild(f)}let a=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&n.onAction&&n.onAction(v)};a.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[Fd(n.offsetPx??8),Ud(),$d({padding:8}),B1(),F1({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",d=Bd(t,o,async()=>{if(!t.isConnected){b.destroy();return}let f=GM(t),p=await Vd(f,o,{placement:u,strategy:"fixed",middleware:c}),{x:v,y,strategy:w,middlewareData:T,placement:x}=p;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:w}),T.arrow){let{x:k,y:C}=T.arrow,E=x.split("-")[0],M={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:k!=null?`${k}px`:"",top:C!=null?`${C}px`:"",right:"",bottom:"",[M[E]]:"-4px"});let I={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${I[E]||"0deg"})`}}),h=f=>{f.key==="Escape"&&b.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let p=f[0],v=f[f.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(v.focus(),w.preventDefault()):document.activeElement===v&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",p),t.addEventListener("focus",f),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",f),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let f=()=>{o.style.visibility==="visible"?b.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),b={el:o,destroy(){d(),_(),window.removeEventListener("keydown",h),a.forEach(f=>f.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return b}var gm=X($e(),1),Pe=X(Qe(),1),Z1=X(Ro(),1);var Ue=X($e(),1);function XM({completed:t,total:e}){let n=e>0?Math.round(t/e*100):0;return(0,Ue.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ue.jsx)("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${n}%`}})})}function KM({step:t,isCompleted:e,isCurrent:n,tourId:i,onStepClick:r}){return(0,Ue.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":n?"true":void 0,"data-completed":e?"true":void 0,"aria-current":n?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${n?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(i,t.id),children:[(0,Ue.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ue.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):n?(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ue.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function QM({workflow:t,expanded:e,onStepClick:n,onDismiss:i}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ue.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ue.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ue.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ue.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ue.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>i(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ue.jsxs)("div",{className:"se-mb-2",children:[(0,Ue.jsx)(XM,{completed:r,total:o}),(0,Ue.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ue.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(a=>(0,Ue.jsx)(KM,{step:a,isCompleted:t.completedSteps.includes(a.id),isCurrent:t.currentStepId===a.id,tourId:t.tourId,onStepClick:n},a.id))}),e&&t.meta.description&&(0,Ue.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function P1({workflows:t,expanded:e,onStepClick:n,onDismiss:i}){return t.length===0?(0,Ue.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ue.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ue.jsx)(QM,{workflow:r,expanded:e,onStepClick:n,onDismiss:i},r.tourId))})}function q1(t,e){let n=document.createElement("div");n.setAttribute("data-testid","workflow-toast"),n.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(n.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let i=document.createElement("div");if(i.className="se-font-semibold",i.style.fontWeight="600",i.textContent=e.title,n.appendChild(i),e.body){let a=document.createElement("div");a.className="se-mt-1 se-text-sm",a.style.marginTop="4px",a.style.fontSize="13px",a.style.color="var(--se-color-text-secondary, #666)",a.textContent=e.body,n.appendChild(a)}t.appendChild(n);let r,o=setTimeout(()=>{n.style.opacity="0",r=setTimeout(()=>{n.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),n.remove()}}function JM(t){let e=new Map;for(let n of t){let i=n.action;if(i.kind==="core:tour"&&i.workflow&&i.tourId){let r=i.workflow,a=(i.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(i.tourId,{meta:r,steps:a})}}return e}function eN({runtime:t}){let[e,n]=(0,Pe.useState)(0),i=(0,Pe.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return JM(b)},[t,e]),r=(0,Pe.useRef)(i);r.current=i,(0,Pe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>n(b=>b+1))},[t]);let o=(0,Pe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),a=(0,Pe.useRef)(new Set),s=(0,Pe.useRef)([]),l=(0,Pe.useRef)(null),c=(0,Pe.useRef)({}),[u,d]=(0,Pe.useState)([]),h=(0,Pe.useRef)(!1);if(!h.current&&o){let b=o.get?.("notified")||[];for(let p of b)a.current.add(p);let f=o.get?.("completed")||{};c.current={...f},h.current=!0}(0,Pe.useEffect)(()=>{if(i.size===0)return;let b=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(p=>{let v=new Set(p.map(w=>w.tourId)),y=[];for(let[w,{meta:T,steps:x}]of i){if(v.has(w))continue;let k="active";b.includes(w)?k="dismissed":f[w]&&(k="completed"),y.push({tourId:w,meta:T,steps:x,currentStepId:null,completedSteps:[],status:k,completedAt:f[w]||void 0})}return y.length>0?[...p,...y]:p});for(let[p,{meta:v}]of i)if(!a.current.has(p)&&v.notification&&l.current&&!b.includes(p)&&!f[p]){a.current.add(p),o?.set?.("notified",[...a.current]);let y=q1(l.current,v.notification);s.current.push(y)}},[i,o]),(0,Pe.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},f=>{let p=f.props?.tourId;if(!p)return;let v=r.current;if(!v.has(p)&&f.name==="tour.started"){n(y=>y+1);return}v.has(p)&&d(y=>y.map(T=>{if(T.tourId!==p)return T;switch(f.name){case"tour.started":{let x=f.props?.startStepId||T.steps[0]?.id||null;if(!a.current.has(p)){a.current.add(p),o?.set?.("notified",[...a.current]);let C=v.get(p);if(C?.meta.notification&&l.current){let E=q1(l.current,C.meta.notification);s.current.push(E)}}let k=y.filter(C=>C.status==="active"||C.tourId===p).map(C=>C.tourId);return k.includes(p)||k.push(p),o?.set?.("active",[...new Set(k)]),{...T,status:"active",currentStepId:x,completedSteps:T.status==="active"?T.completedSteps:[]}}case"tour.step_started":{let x=f.props?.stepId;return{...T,currentStepId:x||T.currentStepId}}case"tour.step_changed":{let x=f.props?.previousStepId,k=f.props?.nextStepId,C=x&&!T.completedSteps.includes(x)?[...T.completedSteps,x]:T.completedSteps;return{...T,currentStepId:k||T.currentStepId,completedSteps:C}}case"tour.completed":{let x=Date.now();return c.current[p]=x,o?.set?.("completed",{...c.current}),{...T,status:"completed",currentStepId:null,completedSteps:T.steps.map(k=>k.id),completedAt:x}}case"tour.paused":return T;default:return T}}))});return()=>{b();for(let f of s.current)f();s.current=[]}},[t,o]);let g=(0,Pe.useCallback)((b,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:f})},[t]),S=(0,Pe.useCallback)(b=>{d(f=>{let p=f.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),v=p.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),p})},[o]),_=(0,Pe.useMemo)(()=>u.filter(b=>b.status==="active"),[u]);return(0,gm.jsx)("div",{ref:l,children:(0,gm.jsx)(P1,{workflows:_,onStepClick:g,onDismiss:S})})}var G1={mount(t,e){let n=e?.runtime||null,i=(0,Z1.createRoot)(t);return i.render(Pe.default.createElement(eN,{runtime:n})),()=>{i.unmount()}}};var Y1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=s1(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},W1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.duration??2e3;if(!document.querySelector("[data-syntro-pulse-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-pulse-styles",""),a.textContent=`
62
62
  @keyframes syntro-pulse-anim {
63
63
  0%, 100% {
64
64
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
@@ -67,7 +67,7 @@ Error generating stack: `+i.message+`
67
67
  box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
68
68
  }
69
69
  }
70
- `,document.head.appendChild(a)}let r=n.style.animation;n.style.animation="syntro-pulse-anim 1s cubic-bezier(0.4, 0, 0.6, 1) infinite",n.setAttribute("data-syntro-pulse","true");let o=setTimeout(()=>{n.style.animation=r,n.removeAttribute("data-syntro-pulse")},i);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:i}),{cleanup:()=>{clearTimeout(o),n.style.animation=r,n.removeAttribute("data-syntro-pulse")}}},Mw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-overlays] Anchor not found for badge, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=document.createElement("div");i.textContent=t.content,i.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(i.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:"var(--syntro-accent, #4f46e5)",borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let r=t.position??"top-right",o=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(i),r){case"top-left":Object.assign(i.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(i.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(i.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(i.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:r}),{cleanup:()=>{i.remove(),o!==void 0&&(n.style.position=o)},updateFn:a=>{"content"in a&&typeof a.content=="string"&&(i.textContent=a.content)}}},Nw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)return console.error(`[adaptive-overlays] Anchor not found for tooltip, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:i}=t,r="";if(i.title&&(r+=`<div class="syntro-tt-title">${dn(i.title)}</div>`),r+=`<div class="syntro-tt-body">${dn(i.body)}</div>`,i.ctaButtons&&i.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let a of i.ctaButtons){let s=a.primary??!1;r+=`
70
+ `,document.head.appendChild(a)}let r=n.style.animation;n.style.animation="syntro-pulse-anim 1s cubic-bezier(0.4, 0, 0.6, 1) infinite",n.setAttribute("data-syntro-pulse","true");let o=setTimeout(()=>{n.style.animation=r,n.removeAttribute("data-syntro-pulse")},i);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:i}),{cleanup:()=>{clearTimeout(o),n.style.animation=r,n.removeAttribute("data-syntro-pulse")}}},X1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=document.createElement("div");i.textContent=t.content,i.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(i.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:"var(--syntro-accent, #4f46e5)",borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let r=t.position??"top-right",o=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(i),r){case"top-left":Object.assign(i.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(i.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(i.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(i.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:r}),{cleanup:()=>{i.remove(),o!==void 0&&(n.style.position=o)},updateFn:a=>{"content"in a&&typeof a.content=="string"&&(i.textContent=a.content)}}},K1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:i}=t,r="";if(i.title&&(r+=`<div class="syntro-tt-title">${dn(i.title)}</div>`),r+=`<div class="syntro-tt-body">${dn(i.body)}</div>`,i.ctaButtons&&i.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let a of i.ctaButtons){let s=a.primary??!1;r+=`
71
71
  <button
72
72
  class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
73
73
  data-syntro-action="${dn(a.actionId)}"
@@ -78,39 +78,39 @@ Error generating stack: `+i.message+`
78
78
  <button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
79
79
  ${dn(i.cta.label)}
80
80
  </button>
81
- </div>`);let o=xw(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:a=>{if(a==="dismiss"){o.destroy();return}if(a==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let s=i.ctaButtons.find(l=>l.actionId===a);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:a,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},lm=[{kind:"overlays:highlight",executor:Rw},{kind:"overlays:pulse",executor:Ow},{kind:"overlays:badge",executor:Mw},{kind:"overlays:tooltip",executor:Nw},{kind:"overlays:modal",executor:nm},{kind:"core:tour",executor:em},{kind:"overlays:celebrate",executor:F1}],cm={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:lm,widgets:[{id:"workflow:tracker",component:Tw,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function um(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,o=[],a=[],s=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>s.get(c),set:(c,u)=>s.set(c,u),remove:c=>s.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,d)=>{let p=n.surfaces.mount(c,u,{...d,adaptiveId:e});return{unmount:()=>p.unmount(),update:g=>p.update(g)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),a.push(c.id)}}}function dm(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var BM=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),$M={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function Dw(t){return $M[t]??t}function Lw(t){return BM.has(t)}function Iw(t){if(Lw(t))return null;let e=t.indexOf(":");return e===-1?null:Dw(t.slice(0,e))}function fm(t){let e=t.indexOf(":");return e===-1?null:Dw(t.slice(0,e))}function pm(t){let{cdnBase:e,registry:n,timeout:i=1e4,onLoadStart:r,onLoadEnd:o}=t,a=new Map,s=new Set,l=new Map;function c(b){return`${e}/adaptives/${b}/index.js`}async function u(b){if(n.has(b))return{appId:b,success:!0,manifest:n.get(b)?.manifest};if(l.has(b))return l.get(b);if(a.has(b))return a.get(b);let x=(async()=>{r?.(b);try{let f=c(b);if(s.has(f)){let S=n.get(b);if(S)return o?.(b,!0),{appId:b,success:!0,manifest:S.manifest}}let h=new Promise((S,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${b}`)),i)}),y=d(f,b);await Promise.race([y,h]),s.add(f);let m=n.get(b);if(!m)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:m.manifest}}catch(f){let h=f instanceof Error?f.message:String(f);o?.(b,!1,h);let y={appId:b,success:!1,error:h};return l.set(b,y),y}finally{a.delete(b)}})();return a.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?n.register(f.manifest):f.default?.manifest?n.register(f.default.manifest):f.default&&n.register(f.default);return}catch{}return new Promise((f,h)=>{let y=document.createElement("script");y.src=b,y.async=!0,y.onload=()=>{n.get(x)?f():h(new Error(`App ${x} did not self-register`))},y.onerror=()=>{h(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(y)})}throw new Error("Dynamic app loading not supported in SSR")}function p(b){let x=new Set;if(b.apps)for(let f of b.apps)x.add(f);if(b.actions)for(let f of b.actions){let h=Iw(f.kind);if(h&&x.add(h),f.kind==="core:mountWidget"){let y=f.widget?.widgetId;if(y){let m=fm(y);m&&x.add(m)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let h=fm(f.widget);h&&x.add(h)}}return Array.from(x)}async function g(b){let x=p(b);return x.length===0?[]:await Promise.all(x.map(h=>u(h)))}async function _(b){return Promise.all(b.map(x=>u(x)))}return{loadApp:u,loadAppsForConfig:g,preloadApps:_,getRequiredApps:p,getAppUrl:c}}var Id=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"||n.state==="activating"){console.warn(`[AppRegistry] App already ${n.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let i of n.manifest.dependencies){let r=this.apps.get(i);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${i}, which is not active`)}n.state="activating";try{let i=n.manifest.metadata?.isBuiltIn===!0,r=um({appId:e,runtime:this.runtime,isBuiltIn:i}),{runtime:o}=n.manifest,a=[];if(o){if(o.actions)for(let s of o.actions)r.registerAction(s);if(o.widgets)for(let s of o.widgets)r.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(c=>{if(s.names.includes(c.name)){let u={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{s.handler(c,u)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});a.push(l)}}n.cleanup=async()=>{for(let s of a)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}dm(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[i,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${i} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async unregister(e){let n=this.apps.get(e);n&&(n.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let n of this.eventListeners)try{n(e)}catch(i){console.error("[AppRegistry] Event listener error:",i)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Zl=new Id;var Pn=X(Fe(),1);var Lo=X(Qe(),1),gm=X(To(),1);var $i=X(Qe(),1);var Hw=/```json\s*\n([\s\S]*?)```/g;function zw(t){let e=[],n=t,i=[],r;for(Hw.lastIndex=0;(r=Hw.exec(t))!==null;)i.push({fullMatch:r[0],json:r[1],index:r.index});for(let o=i.length-1;o>=0;o--){let{fullMatch:a,json:s}=i[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),n=n.replace(a,""))}return n=n.replace(/\n{3,}/g,`
81
+ </div>`);let o=$1(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:a=>{if(a==="dismiss"){o.destroy();return}if(a==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let s=i.ctaButtons.find(l=>l.actionId===a);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:a,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},mm=[{kind:"overlays:highlight",executor:Y1},{kind:"overlays:pulse",executor:W1},{kind:"overlays:badge",executor:X1},{kind:"overlays:tooltip",executor:K1},{kind:"overlays:modal",executor:um},{kind:"core:tour",executor:lm},{kind:"overlays:celebrate",executor:o1}],vm={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:mm,widgets:[{id:"workflow:tracker",component:G1,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function ym(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,o=[],a=[],s=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>s.get(c),set:(c,u)=>s.set(c,u),remove:c=>s.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,d)=>{let h=n.surfaces.mount(c,u,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),a.push(c.id)}}}function bm(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var tN=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),nN={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function Q1(t){return nN[t]??t}function J1(t){return tN.has(t)}function eE(t){if(J1(t))return null;let e=t.indexOf(":");return e===-1?null:Q1(t.slice(0,e))}function _m(t){let e=t.indexOf(":");return e===-1?null:Q1(t.slice(0,e))}function Sm(t){let{cdnBase:e,registry:n,timeout:i=1e4,onLoadStart:r,onLoadEnd:o}=t,a=new Map,s=new Set,l=new Map;function c(_){return`${e}/adaptives/${_}/index.js`}async function u(_){if(n.has(_))return{appId:_,success:!0,manifest:n.get(_)?.manifest};if(l.has(_))return l.get(_);if(a.has(_))return a.get(_);let b=(async()=>{r?.(_);try{let f=c(_);if(s.has(f)){let w=n.get(_);if(w)return o?.(_,!0),{appId:_,success:!0,manifest:w.manifest}}let p=new Promise((w,T)=>{setTimeout(()=>T(new Error(`Timeout loading app: ${_}`)),i)}),v=d(f,_);await Promise.race([v,p]),s.add(f);let y=n.get(_);if(!y)throw new Error(`App ${_} did not register after loading`);return o?.(_,!0),{appId:_,success:!0,manifest:y.manifest}}catch(f){let p=f instanceof Error?f.message:String(f);o?.(_,!1,p);let v={appId:_,success:!1,error:p};return l.set(_,v),v}finally{a.delete(_)}})();return a.set(_,b),b}async function d(_,b){if(typeof window<"u"){try{let f=await import(_);f.manifest?n.register(f.manifest):f.default?.manifest?n.register(f.default.manifest):f.default&&n.register(f.default);return}catch{}return new Promise((f,p)=>{let v=document.createElement("script");v.src=_,v.async=!0,v.onload=()=>{n.get(b)?f():p(new Error(`App ${b} did not self-register`))},v.onerror=()=>{p(new Error(`Failed to load app script: ${_}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(_){let b=new Set;if(_.apps)for(let f of _.apps)b.add(f);if(_.actions)for(let f of _.actions){let p=eE(f.kind);if(p&&b.add(p),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=_m(v);y&&b.add(y)}}}if(_.tiles){for(let f of _.tiles)if(f.widget){let p=_m(f.widget);p&&b.add(p)}}return Array.from(b)}async function g(_){let b=h(_);return b.length===0?[]:await Promise.all(b.map(p=>u(p)))}async function S(_){return Promise.all(_.map(b=>u(b)))}return{loadApp:u,loadAppsForConfig:g,preloadApps:S,getRequiredApps:h,getAppUrl:c}}var Pd=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"||n.state==="activating"){console.warn(`[AppRegistry] App already ${n.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let i of n.manifest.dependencies){let r=this.apps.get(i);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${i}, which is not active`)}n.state="activating";try{let i=n.manifest.metadata?.isBuiltIn===!0,r=ym({appId:e,runtime:this.runtime,isBuiltIn:i}),{runtime:o}=n.manifest,a=[];if(o){if(o.actions)for(let s of o.actions)r.registerAction(s);if(o.widgets)for(let s of o.widgets)r.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(c=>{if(s.names.includes(c.name)){let u={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{s.handler(c,u)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});a.push(l)}}n.cleanup=async()=>{for(let s of a)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}bm(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[i,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${i} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async unregister(e){let n=this.apps.get(e);n&&(n.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let n of this.eventListeners)try{n(e)}catch(i){console.error("[AppRegistry] Event listener error:",i)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Yl=new Pd;var Pn=X($e(),1);var Io=X(Qe(),1),wm=X(Ro(),1);var Fi=X(Qe(),1);var tE=/```json\s*\n([\s\S]*?)```/g;function nE(t){let e=[],n=t,i=[],r;for(tE.lastIndex=0;(r=tE.exec(t))!==null;)i.push({fullMatch:r[0],json:r[1],index:r.index});for(let o=i.length-1;o>=0;o--){let{fullMatch:a,json:s}=i[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),n=n.replace(a,""))}return n=n.replace(/\n{3,}/g,`
82
82
 
83
- `).trim(),{displayText:n,actions:e}}var Gl=class extends Error{constructor(e){super(e),this.name="AuthError"}};function FM(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new Gl("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new Gl("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function Bw(t,e){let n=FM(),i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(e)});if(!i.ok)throw i.status===401?new Gl("Session expired or unauthorized"):new Error(`Chat request failed: ${i.status} ${i.statusText}`);return i.json()}var UM=0;function hm(){return`msg-${Date.now()}-${++UM}`}function $w(t){let{backendUrl:e,tileId:n,runtime:i,greeting:r,maxHistory:o=20,mlflowRunId:a,config:s}=t,[l,c]=(0,$i.useState)(()=>r?[{id:hm(),role:"assistant",text:r,timestamp:Date.now()}]:[]),[u,d]=(0,$i.useState)(!1),[p,g]=(0,$i.useState)(null),_=(0,$i.useRef)(null),b=(0,$i.useCallback)(async f=>{let h=f.trim();if(!h)return;g(null);let y={id:hm(),role:"user",text:h,timestamp:Date.now()};c(m=>[...m,y]),d(!0);try{let S=[...l,y].slice(-o).map(E=>({role:E.role,content:E.text})),w=await Bw(e,{message:h,history:S,mlflow_run_id:a,current_config:s}),{displayText:C,actions:k}=zw(w.response),T={id:hm(),role:"assistant",text:C,timestamp:Date.now()};c(E=>[...E,T]),k.length>0&&(_.current?.isApplied()&&await _.current.revertAll(),_.current=await i.actions.applyBatch(k),i.events.publish("chatbot.actions_applied",{count:k.length,kinds:k.map(E=>E.kind),tileId:n}))}catch(m){let S=m instanceof Error?m.message:"An unexpected error occurred";g(S)}finally{d(!1)}},[e,l,o,a,s,i,n]),x=(0,$i.useCallback)(()=>{c([]),g(null),_.current?.isApplied()&&(_.current.revertAll(),_.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${n}`)},[n]);return{messages:l,isLoading:u,error:p,sendMessage:b,clearMessages:x}}var jn={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:st[4],color:_t.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:A[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:A[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:$e[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:A[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:st[4],color:_t.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function VM({message:t}){let e=t.role==="user",n={...jn.messageBubble,...e?jn.userMessage:jn.assistantMessage};return(0,Pn.jsx)("div",{style:n,children:t.text})}function jM({config:t,runtime:e,tileId:n}){let{messages:i,isLoading:r,error:o,sendMessage:a,clearMessages:s}=$w({backendUrl:t.backendUrl,tileId:n,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Lo.useRef)(null),c=(0,Lo.useRef)(null);(0,Lo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let u=d=>{d.preventDefault();let p=c.current;if(!p||!p.value.trim()||r)return;let g=p.value;p.value="",a(g)};return(0,Pn.jsxs)("div",{style:jn.container,"data-testid":"chat-assistant",children:[(0,Pn.jsxs)("div",{ref:l,style:jn.messageList,children:[i.map(d=>(0,Pn.jsx)(VM,{message:d},d.id)),r&&(0,Pn.jsx)("div",{style:jn.loadingDots,children:"Thinking..."})]}),o&&(0,Pn.jsx)("div",{style:jn.errorBanner,children:o}),(0,Pn.jsxs)("form",{onSubmit:u,style:jn.inputForm,children:[(0,Pn.jsx)("input",{ref:c,style:jn.input,placeholder:"Ask anything...",disabled:r,"data-testid":"chat-input"}),(0,Pn.jsx)("button",{type:"submit",disabled:r,style:{...jn.sendButton,...r?jn.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var Fw={mount(t,e){let{config:n,runtime:i,tileId:r="chatbot-widget"}=e||{};if(n&&i&&typeof gm.createRoot=="function"){let o=(0,gm.createRoot)(t);return o.render(Lo.default.createElement(jM,{config:n,runtime:i,tileId:r})),()=>{o.unmount()}}return!n||!i?(t.innerHTML=`<div style="padding: 16px; color: ${A[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
83
+ `).trim(),{displayText:n,actions:e}}var Wl=class extends Error{constructor(e){super(e),this.name="AuthError"}};function iN(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new Wl("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new Wl("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function iE(t,e){let n=iN(),i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(e)});if(!i.ok)throw i.status===401?new Wl("Session expired or unauthorized"):new Error(`Chat request failed: ${i.status} ${i.statusText}`);return i.json()}var rN=0;function xm(){return`msg-${Date.now()}-${++rN}`}function rE(t){let{backendUrl:e,tileId:n,runtime:i,greeting:r,maxHistory:o=20,mlflowRunId:a,config:s}=t,[l,c]=(0,Fi.useState)(()=>r?[{id:xm(),role:"assistant",text:r,timestamp:Date.now()}]:[]),[u,d]=(0,Fi.useState)(!1),[h,g]=(0,Fi.useState)(null),S=(0,Fi.useRef)(null),_=(0,Fi.useCallback)(async f=>{let p=f.trim();if(!p)return;g(null);let v={id:xm(),role:"user",text:p,timestamp:Date.now()};c(y=>[...y,v]),d(!0);try{let w=[...l,v].slice(-o).map(E=>({role:E.role,content:E.text})),T=await iE(e,{message:p,history:w,mlflow_run_id:a,current_config:s}),{displayText:x,actions:k}=nE(T.response),C={id:xm(),role:"assistant",text:x,timestamp:Date.now()};c(E=>[...E,C]),k.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await i.actions.applyBatch(k),i.events.publish("chatbot.actions_applied",{count:k.length,kinds:k.map(E=>E.kind),tileId:n}))}catch(y){let w=y instanceof Error?y.message:"An unexpected error occurred";g(w)}finally{d(!1)}},[e,l,o,a,s,i,n]),b=(0,Fi.useCallback)(()=>{c([]),g(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${n}`)},[n]);return{messages:l,isLoading:u,error:h,sendMessage:_,clearMessages:b}}var jn={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:at[4],color:_t.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:A[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:A[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:Fe[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:A[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:at[4],color:_t.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function oN({message:t}){let e=t.role==="user",n={...jn.messageBubble,...e?jn.userMessage:jn.assistantMessage};return(0,Pn.jsx)("div",{style:n,children:t.text})}function aN({config:t,runtime:e,tileId:n}){let{messages:i,isLoading:r,error:o,sendMessage:a,clearMessages:s}=rE({backendUrl:t.backendUrl,tileId:n,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Io.useRef)(null),c=(0,Io.useRef)(null);(0,Io.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let u=d=>{d.preventDefault();let h=c.current;if(!h||!h.value.trim()||r)return;let g=h.value;h.value="",a(g)};return(0,Pn.jsxs)("div",{style:jn.container,"data-testid":"chat-assistant",children:[(0,Pn.jsxs)("div",{ref:l,style:jn.messageList,children:[i.map(d=>(0,Pn.jsx)(oN,{message:d},d.id)),r&&(0,Pn.jsx)("div",{style:jn.loadingDots,children:"Thinking..."})]}),o&&(0,Pn.jsx)("div",{style:jn.errorBanner,children:o}),(0,Pn.jsxs)("form",{onSubmit:u,style:jn.inputForm,children:[(0,Pn.jsx)("input",{ref:c,style:jn.input,placeholder:"Ask anything...",disabled:r,"data-testid":"chat-input"}),(0,Pn.jsx)("button",{type:"submit",disabled:r,style:{...jn.sendButton,...r?jn.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var oE={mount(t,e){let{config:n,runtime:i,tileId:r="chatbot-widget"}=e||{};if(n&&i&&typeof wm.createRoot=="function"){let o=(0,wm.createRoot)(t);return o.render(Io.default.createElement(aN,{config:n,runtime:i,tileId:r})),()=>{o.unmount()}}return!n||!i?(t.innerHTML=`<div style="padding: 16px; color: ${A[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
84
84
  <div style="padding: 16px; font-family: system-ui; color: ${A[10]};">
85
85
  <p style="margin: 0 0 8px; color: ${A[8]};">${n.greeting||"Hi! How can I help?"}</p>
86
86
  <p style="margin: 0; font-size: 12px; color: ${A[7]};">Chat widget mounted. Awaiting React renderer.</p>
87
87
  </div>
88
- `,()=>{t.innerHTML=""})}};var Uw={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:Fw,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function Vw(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function PM(t,e,n){let i=Vw(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function qM(t,e,n){let i=Vw(n,t.itemId,t.itemQuestion),{id:r}=i.config,o=t.state??"toggle",a;switch(o){case"open":n.expand(r),a="open";break;case"closed":n.collapse(r),a="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),a=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:a}),{cleanup:()=>{}}}async function ZM(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var jw=[{kind:"faq:scroll_to",executor:PM},{kind:"faq:toggle_item",executor:qM},{kind:"faq:update",executor:ZM}];var Ve=X(Fe(),1);var Oe=X(Qe(),1),mm=X(To(),1);function Pw(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function GM(t){return typeof t=="string"?(0,Ve.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Ve.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Ve.jsx)("p",{style:{margin:0},children:t.content})}function YM(t){return t?t===!0?{style:"thumbs"}:t:null}function WM(t){return t.prompt||"Was this helpful?"}var kt={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"16px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease"},accordion:{display:"flex",flexDirection:"column",gap:"8px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"15px",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"18px",transition:"transform 0.2s ease"},answer:{padding:"0 20px 16px 20px",fontSize:"14px",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"13px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 6px 4px",marginTop:"8px"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},ns={light:{container:{backgroundColor:_t.white,color:A[1]},searchInput:{backgroundColor:A[12],border:`1px solid ${A[11]}`,color:A[1]},item:{backgroundColor:A[12],border:`1px solid ${A[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:A[1]},questionHover:{backgroundColor:A[12]},answer:{color:A[6]},category:{backgroundColor:st[8],color:st[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]},feedbackPrompt:{color:A[7]}},dark:{container:{backgroundColor:A[1],color:A[12]},searchInput:{backgroundColor:A[3],border:`1px solid ${A[5]}`,color:A[12]},item:{backgroundColor:A[3],border:`1px solid ${A[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},question:{backgroundColor:"transparent",color:A[12]},questionHover:{backgroundColor:A[5]},answer:{color:A[8]},category:{backgroundColor:st[0],color:st[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]},feedbackPrompt:{color:A[8]}}};function XM({item:t,isExpanded:e,onToggle:n,theme:i,feedbackConfig:r,feedbackValue:o,onFeedback:a}){let[s,l]=(0,Oe.useState)(!1),c=ns[i],{question:u,answer:d}=t.config,p={...kt.item,...c.item,...e?c.itemExpanded:{}},g={...kt.question,...c.question,...s?c.questionHover:{}},_={...kt.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...kt.answer,...c.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},x={...kt.feedback,...c.feedbackPrompt};return(0,Ve.jsxs)("div",{style:p,"data-faq-item-id":t.config.id,children:[(0,Ve.jsxs)("button",{type:"button",style:g,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[(0,Ve.jsx)("span",{children:u}),(0,Ve.jsx)("span",{style:_,children:"\u25BC"})]}),(0,Ve.jsxs)("div",{style:b,"aria-hidden":!e,children:[GM(d),e&&r&&(0,Ve.jsxs)("div",{style:x,children:[(0,Ve.jsx)("span",{children:WM(r)}),(0,Ve.jsx)("button",{type:"button",style:{...kt.feedbackButton,...o==="up"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>a(t.config.id,u,"up"),children:"\u{1F44D}"}),(0,Ve.jsx)("button",{type:"button",style:{...kt.feedbackButton,...o==="down"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>a(t.config.id,u,"down"),children:"\u{1F44E}"})]})]})]})}function KM({config:t,runtime:e,instanceId:n}){let[i,r]=(0,Oe.useReducer)(T=>T+1,0),[o,a]=(0,Oe.useState)(new Set),[s,l]=(0,Oe.useState)(""),[c,u]=(0,Oe.useState)(new Map),d=(0,Oe.useMemo)(()=>YM(t.feedback),[t.feedback]);(0,Oe.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,Oe.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,Oe.useEffect)(()=>{if(!t.scope||!e.accumulator?.register)return;let{events:T,urlContains:E,props:M}=t.scope,N=new Set;for(let I of t.actions)if(I.triggerWhen?.type==="rules")for(let H of I.triggerWhen.rules)for(let q of H.conditions)q.type==="event_count"&&q.key&&N.add(q.key);for(let I of N)e.accumulator.register(I,H=>{if(!T.includes(H.name)||E&&!String(H.props?.pathname??"").includes(E))return!1;if(M){for(let[q,V]of Object.entries(M))if(H.props?.[q]!==V)return!1}return!0})},[t.scope,t.actions,e.accumulator]),(0,Oe.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let M=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(N=>{let I=N.props?.actionId;return typeof I=="string"&&I.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let N=M.props.actionId.replace("faq:open:","");a(new Set([N])),requestAnimationFrame(()=>{let I=document.querySelector(`[data-faq-item-id="${N}"]`);I&&I.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},E=>{let M=E.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let N=M.replace("faq:open:","");a(new Set([N])),requestAnimationFrame(()=>{let I=document.querySelector(`[data-faq-item-id="${N}"]`);I&&I.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]);let p=(0,Oe.useMemo)(()=>t.actions.filter(T=>T.triggerWhen?e.evaluateSync(T.triggerWhen).value:!0),[t.actions,e,i]),g=(0,Oe.useMemo)(()=>t.ordering==="priority"?[...p].sort((T,E)=>(E.config.priority??0)-(T.config.priority??0)):p,[p,t.ordering]),_=(0,Oe.useMemo)(()=>{if(!t.searchable||!s.trim())return g;let T=s.toLowerCase();return g.filter(E=>E.config.question.toLowerCase().includes(T)||Pw(E.config.answer).toLowerCase().includes(T)||E.config.category?.toLowerCase().includes(T))},[g,s,t.searchable]),b=(0,Oe.useMemo)(()=>{let T=new Map;for(let E of _){let M=E.config.category;T.has(M)||T.set(M,[]),T.get(M).push(E)}return T},[_]),x=(0,Oe.useMemo)(()=>_.some(T=>T.config.category),[_]),f=(0,Oe.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),h=(0,Oe.useCallback)(T=>{a(E=>{let M=new Set(E);return t.expandBehavior==="single"?E.has(T)?new Set:new Set([T]):(E.has(T)?M.delete(T):M.add(T),M)}),e.events.publish("faq:toggled",{instanceId:n,questionId:T,expanded:!o.has(T),timestamp:Date.now()})},[t.expandBehavior,e.events,n,o]),y=(0,Oe.useCallback)((T,E,M)=>{u(N=>{let I=new Map(N);return I.set(T,M),I}),e.events.publish("faq:feedback",{itemId:T,question:E,value:M})},[e.events]),m={...kt.container,...ns[f].container},S={...kt.searchInput,...ns[f].searchInput},w={...kt.emptyState,...ns[f].emptyState},C={...kt.categoryHeader,...ns[f].categoryHeader},k=T=>T.map(E=>(0,Ve.jsx)(XM,{item:E,isExpanded:o.has(E.config.id),onToggle:()=>h(E.config.id),theme:f,feedbackConfig:d,feedbackValue:c.get(E.config.id),onFeedback:y},E.config.id));return p.length===0?(0,Ve.jsx)("div",{style:m,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,Ve.jsx)("div",{style:w,children:"No FAQ questions available."})}):(0,Ve.jsxs)("div",{style:m,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Ve.jsx)("div",{style:kt.searchWrapper,children:(0,Ve.jsx)("input",{type:"text",placeholder:"Search questions...",value:s,onChange:T=>l(T.target.value),style:S})}),(0,Ve.jsx)("div",{style:kt.accordion,children:x?Array.from(b.entries()).map(([T,E])=>(0,Ve.jsxs)(Oe.default.Fragment,{children:[T&&(0,Ve.jsx)("div",{style:C,"data-category-header":T,children:T}),k(E)]},T??"__ungrouped")):k(_)}),t.searchable&&_.length===0&&s&&(0,Ve.jsxs)("div",{style:{...kt.noResults,...ns[f].emptyState},children:['No questions found matching "',s,'"']})]})}var qw={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof mm.createRoot=="function"){let a=(0,mm.createRoot)(t);return a.render(Oe.default.createElement(KM,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
88
+ `,()=>{t.innerHTML=""})}};var aE={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:oE,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function sE(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function sN(t,e,n){let i=sE(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function lN(t,e,n){let i=sE(n,t.itemId,t.itemQuestion),{id:r}=i.config,o=t.state??"toggle",a;switch(o){case"open":n.expand(r),a="open";break;case"closed":n.collapse(r),a="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),a=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:a}),{cleanup:()=>{}}}async function cN(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var lE=[{kind:"faq:scroll_to",executor:sN},{kind:"faq:toggle_item",executor:lN},{kind:"faq:update",executor:cN}];var Ve=X($e(),1);var He=X(Qe(),1),Em=X(Ro(),1);function cE(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function uN(t){return typeof t=="string"?(0,Ve.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Ve.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Ve.jsx)("p",{style:{margin:0},children:t.content})}function dN(t){return t?t===!0?{style:"thumbs"}:t:null}function fN(t){return t.prompt||"Was this helpful?"}var Tt={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"16px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease"},accordion:{display:"flex",flexDirection:"column",gap:"8px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"15px",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"18px",transition:"transform 0.2s ease"},answer:{padding:"0 20px 16px 20px",fontSize:"14px",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"13px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 6px 4px",marginTop:"8px"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},is={light:{container:{backgroundColor:_t.white,color:A[1]},searchInput:{backgroundColor:A[12],border:`1px solid ${A[11]}`,color:A[1]},item:{backgroundColor:A[12],border:`1px solid ${A[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:A[1]},questionHover:{backgroundColor:A[12]},answer:{color:A[6]},category:{backgroundColor:at[8],color:at[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]},feedbackPrompt:{color:A[7]}},dark:{container:{backgroundColor:A[1],color:A[12]},searchInput:{backgroundColor:A[3],border:`1px solid ${A[5]}`,color:A[12]},item:{backgroundColor:A[3],border:`1px solid ${A[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},question:{backgroundColor:"transparent",color:A[12]},questionHover:{backgroundColor:A[5]},answer:{color:A[8]},category:{backgroundColor:at[0],color:at[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]},feedbackPrompt:{color:A[8]}}};function pN({item:t,isExpanded:e,onToggle:n,theme:i,feedbackConfig:r,feedbackValue:o,onFeedback:a}){let[s,l]=(0,He.useState)(!1),c=is[i],{question:u,answer:d}=t.config,h={...Tt.item,...c.item,...e?c.itemExpanded:{}},g={...Tt.question,...c.question,...s?c.questionHover:{}},S={...Tt.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},_={...Tt.answer,...c.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},b={...Tt.feedback,...c.feedbackPrompt};return(0,Ve.jsxs)("div",{style:h,"data-faq-item-id":t.config.id,children:[(0,Ve.jsxs)("button",{type:"button",style:g,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[(0,Ve.jsx)("span",{children:u}),(0,Ve.jsx)("span",{style:S,children:"\u25BC"})]}),(0,Ve.jsxs)("div",{style:_,"aria-hidden":!e,children:[uN(d),e&&r&&(0,Ve.jsxs)("div",{style:b,children:[(0,Ve.jsx)("span",{children:fN(r)}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...o==="up"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>a(t.config.id,u,"up"),children:"\u{1F44D}"}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...o==="down"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>a(t.config.id,u,"down"),children:"\u{1F44E}"})]})]})]})}function hN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,He.useReducer)(C=>C+1,0),[o,a]=(0,He.useState)(new Set),[s,l]=(0,He.useState)(""),[c,u]=(0,He.useState)(new Map),d=(0,He.useMemo)(()=>dN(t.feedback),[t.feedback]);(0,He.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,He.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,He.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let M=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(I=>{let N=I.props?.actionId;return typeof N=="string"&&N.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let I=M.props.actionId.replace("faq:open:","");a(new Set([I])),requestAnimationFrame(()=>{let N=document.querySelector(`[data-faq-item-id="${I}"]`);N&&N.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},E=>{let M=E.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let I=M.replace("faq:open:","");a(new Set([I])),requestAnimationFrame(()=>{let N=document.querySelector(`[data-faq-item-id="${I}"]`);N&&N.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]);let h=(0,He.useMemo)(()=>t.actions.filter(C=>C.triggerWhen?e.evaluateSync(C.triggerWhen).value:!0),[t.actions,e,i]),g=(0,He.useMemo)(()=>t.ordering==="priority"?[...h].sort((C,E)=>(E.config.priority??0)-(C.config.priority??0)):h,[h,t.ordering]),S=(0,He.useMemo)(()=>{if(!t.searchable||!s.trim())return g;let C=s.toLowerCase();return g.filter(E=>E.config.question.toLowerCase().includes(C)||cE(E.config.answer).toLowerCase().includes(C)||E.config.category?.toLowerCase().includes(C))},[g,s,t.searchable]),_=(0,He.useMemo)(()=>{let C=new Map;for(let E of S){let M=E.config.category;C.has(M)||C.set(M,[]),C.get(M).push(E)}return C},[S]),b=(0,He.useMemo)(()=>S.some(C=>C.config.category),[S]),f=(0,He.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),p=(0,He.useCallback)(C=>{a(E=>{let M=new Set(E);return t.expandBehavior==="single"?E.has(C)?new Set:new Set([C]):(E.has(C)?M.delete(C):M.add(C),M)}),e.events.publish("faq:toggled",{instanceId:n,questionId:C,expanded:!o.has(C),timestamp:Date.now()})},[t.expandBehavior,e.events,n,o]),v=(0,He.useCallback)((C,E,M)=>{u(I=>{let N=new Map(I);return N.set(C,M),N}),e.events.publish("faq:feedback",{itemId:C,question:E,value:M})},[e.events]),y={...Tt.container,...is[f].container},w={...Tt.searchInput,...is[f].searchInput},T={...Tt.emptyState,...is[f].emptyState},x={...Tt.categoryHeader,...is[f].categoryHeader},k=C=>C.map(E=>(0,Ve.jsx)(pN,{item:E,isExpanded:o.has(E.config.id),onToggle:()=>p(E.config.id),theme:f,feedbackConfig:d,feedbackValue:c.get(E.config.id),onFeedback:v},E.config.id));return h.length===0?(0,Ve.jsx)("div",{style:y,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,Ve.jsx)("div",{style:T,children:"No FAQ questions available."})}):(0,Ve.jsxs)("div",{style:y,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Ve.jsx)("div",{style:Tt.searchWrapper,children:(0,Ve.jsx)("input",{type:"text",placeholder:"Search questions...",value:s,onChange:C=>l(C.target.value),style:w})}),(0,Ve.jsx)("div",{style:Tt.accordion,children:b?Array.from(_.entries()).map(([C,E])=>(0,Ve.jsxs)(He.default.Fragment,{children:[C&&(0,Ve.jsx)("div",{style:x,"data-category-header":C,children:C}),k(E)]},C??"__ungrouped")):k(S)}),t.searchable&&S.length===0&&s&&(0,Ve.jsxs)("div",{style:{...Tt.noResults,...is[f].emptyState},children:['No questions found matching "',s,'"']})]})}var uE={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof Em.createRoot=="function"){let a=(0,Em.createRoot)(t);return a.render(He.default.createElement(hN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
89
89
  <div style="font-family: system-ui; max-width: 800px;">
90
90
  ${o.map(a=>`
91
91
  <div style="margin-bottom: 8px; padding: 16px; background: ${A[12]}; border-radius: 8px;">
92
92
  <strong>${a.config.question}</strong>
93
- <p style="margin-top: 8px; color: ${A[6]};">${Pw(a.config.answer)}</p>
93
+ <p style="margin-top: 8px; color: ${A[6]};">${cE(a.config.answer)}</p>
94
94
  </div>
95
95
  `).join("")}
96
96
  </div>
97
- `,()=>{t.innerHTML=""}}};var Zw={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:jw,widgets:[{id:"adaptive-faq:accordion",component:qw,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`faq:${n.config.id}`,strategy:n.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:n.config.id,question:n.config.question,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var QM=async(t,e)=>{let{badgeId:n}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:n,awardedAt:Date.now()}),{cleanup:()=>{}}},JM=async(t,e)=>{let{points:n,reason:i}=t;return e.publishEvent("gamification.points_added",{points:n,reason:i,timestamp:Date.now()}),{cleanup:()=>{}}},eN={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},tN=[{kind:"gamification:awardBadge",executor:QM},{kind:"gamification:addPoints",executor:JM}],nN=[eN],Gw={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:tN,eventHandlers:nN};var St=X(Fe(),1);var it=X(Qe(),1),vm=X(To(),1);function Hd(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var qn={container:{fontFamily:"system-ui, -apple-system, sans-serif",padding:"8px",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"4px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"12px 16px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"10px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"0 16px"},description:{fontSize:"13px",lineHeight:"1.5",margin:0},linkButton:{display:"inline-flex",alignItems:"center",gap:"4px",marginTop:"10px",padding:"6px 12px",borderRadius:"6px",textDecoration:"none",fontSize:"13px",fontWeight:500,cursor:"pointer",border:"none",transition:"background-color 0.15s ease"},categoryHeader:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 4px"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},zd={light:{container:{backgroundColor:_t.white,color:A[1]},item:{backgroundColor:A[12],border:`1px solid ${A[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:A[1]},headerHover:{backgroundColor:A[12]},body:{color:A[6]},linkButton:{backgroundColor:st[8],color:st[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]}},dark:{container:{backgroundColor:A[1],color:A[12]},item:{backgroundColor:A[3],border:`1px solid ${A[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},header:{backgroundColor:"transparent",color:A[12]},headerHover:{backgroundColor:A[5]},body:{color:A[8]},linkButton:{backgroundColor:st[0],color:st[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]}}};function iN({item:t,isExpanded:e,onToggle:n,onNavigate:i,theme:r}){let[o,a]=(0,it.useState)(!1),s=zd[r],{title:l,description:c,href:u,icon:d,external:p}=t.config,g={...qn.item,...s.item,...e?s.itemExpanded:{}},_={...qn.header,...s.header,...o?s.headerHover:{}},b={...qn.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},x={...qn.body,...s.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},f=h=>{h.preventDefault(),h.stopPropagation(),u&&i(u,p??!1)};return(0,St.jsxs)("div",{style:g,"data-nav-tip-id":t.config.id,children:[(0,St.jsxs)("button",{type:"button",style:_,onClick:n,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),"aria-expanded":e,children:[d&&(0,St.jsx)("span",{style:qn.icon,children:d}),(0,St.jsx)("span",{children:l}),(0,St.jsx)("span",{style:b,children:"\u25BC"})]}),(0,St.jsxs)("div",{style:x,"aria-hidden":!e,children:[(0,St.jsx)("p",{style:qn.description,children:c}),u&&(0,St.jsxs)("a",{href:u,onClick:f,style:{...qn.linkButton,...s.linkButton},target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,children:["Go ",p?"\u2197":"\u2192"]})]})]})}function rN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,it.useReducer)(f=>f+1,0),[o,a]=(0,it.useState)(new Set);(0,it.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,it.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,it.useEffect)(()=>{if(!t.scope||!e.accumulator?.register)return;let{events:f,urlContains:h,props:y}=t.scope,m=new Set;for(let S of t.actions)if(S.triggerWhen?.type==="rules")for(let w of S.triggerWhen.rules)for(let C of w.conditions)C.type==="event_count"&&C.key&&m.add(C.key);for(let S of m)e.accumulator.register(S,w=>{if(!f.includes(w.name)||h&&!String(w.props?.pathname??"").includes(h))return!1;if(y){for(let[C,k]of Object.entries(y))if(w.props?.[C]!==k)return!1}return!0})},[t.scope,t.actions,e.accumulator]);let s=(0,it.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,i]),l=(0,it.useMemo)(()=>{let f=new Map;for(let h of s){let y=h.config.category;f.has(y)||f.set(y,[]),f.get(y).push(h)}return f},[s]),c=(0,it.useMemo)(()=>s.some(f=>f.config.category),[s]),u=(0,it.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,it.useCallback)(f=>{a(h=>{let y=h.has(f),m;if(t.expandBehavior==="single"){for(let S of h)S!==f&&e.events.publish("nav:toggled",{instanceId:n,tipId:S,expanded:!1,timestamp:Date.now()});m=y?new Set:new Set([f])}else m=new Set(h),y?m.delete(f):m.add(f);return e.events.publish("nav:toggled",{instanceId:n,tipId:f,expanded:!y,timestamp:Date.now()}),m})},[t.expandBehavior,e.events,n]),p=(0,it.useCallback)((f,h)=>{let y=f.trim().toLowerCase();y.startsWith("javascript:")||y.startsWith("data:")||(e.events.publish("nav:tip_clicked",{instanceId:n,href:f,external:h,timestamp:Date.now()}),h?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f)},[e.events,n]),g={...qn.container,...zd[u].container},_={...qn.categoryHeader,...zd[u].categoryHeader},b={...qn.emptyState,...zd[u].emptyState},x=f=>f.map(h=>(0,St.jsx)(iN,{item:h,isExpanded:o.has(h.config.id),onToggle:()=>d(h.config.id),onNavigate:p,theme:u},h.config.id));return s.length===0?(0,St.jsx)("div",{style:g,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,St.jsx)("div",{style:b,children:"No navigation tips available."})}):(0,St.jsx)("div",{style:g,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,St.jsx)("div",{style:qn.accordion,children:c?Array.from(l.entries()).map(([f,h])=>(0,St.jsxs)(it.default.Fragment,{children:[f&&(0,St.jsx)("div",{style:_,"data-category-header":f,children:f}),x(h)]},f??"__ungrouped")):x(s)})})}var Yw={mount(t,e){let{runtime:n,instanceId:i="nav-widget",...r}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(n&&typeof vm.createRoot=="function"){let a=(0,vm.createRoot)(t);return a.render(it.default.createElement(rN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
97
+ `,()=>{t.innerHTML=""}}};var dE={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:lE,widgets:[{id:"adaptive-faq:accordion",component:uE,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`faq:${n.config.id}`,strategy:n.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:n.config.id,question:n.config.question,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var gN=async(t,e)=>{let{badgeId:n}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:n,awardedAt:Date.now()}),{cleanup:()=>{}}},mN=async(t,e)=>{let{points:n,reason:i}=t;return e.publishEvent("gamification.points_added",{points:n,reason:i,timestamp:Date.now()}),{cleanup:()=>{}}},vN={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},yN=[{kind:"gamification:awardBadge",executor:gN},{kind:"gamification:addPoints",executor:mN}],bN=[vN],fE={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:yN,eventHandlers:bN};var xt=X($e(),1);var st=X(Qe(),1),Cm=X(Ro(),1);function qd(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var qn={container:{fontFamily:"system-ui, -apple-system, sans-serif",padding:"8px",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"4px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"12px 16px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"10px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"0 16px"},description:{fontSize:"13px",lineHeight:"1.5",margin:0},linkButton:{display:"inline-flex",alignItems:"center",gap:"4px",marginTop:"10px",padding:"6px 12px",borderRadius:"6px",textDecoration:"none",fontSize:"13px",fontWeight:500,cursor:"pointer",border:"none",transition:"background-color 0.15s ease"},categoryHeader:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 4px"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},Zd={light:{container:{backgroundColor:_t.white,color:A[1]},item:{backgroundColor:A[12],border:`1px solid ${A[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:A[1]},headerHover:{backgroundColor:A[12]},body:{color:A[6]},linkButton:{backgroundColor:at[8],color:at[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]}},dark:{container:{backgroundColor:A[1],color:A[12]},item:{backgroundColor:A[3],border:`1px solid ${A[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},header:{backgroundColor:"transparent",color:A[12]},headerHover:{backgroundColor:A[5]},body:{color:A[8]},linkButton:{backgroundColor:at[0],color:at[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]}}};function _N({item:t,isExpanded:e,onToggle:n,onNavigate:i,theme:r}){let[o,a]=(0,st.useState)(!1),s=Zd[r],{title:l,description:c,href:u,icon:d,external:h}=t.config,g={...qn.item,...s.item,...e?s.itemExpanded:{}},S={...qn.header,...s.header,...o?s.headerHover:{}},_={...qn.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...qn.body,...s.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},f=p=>{p.preventDefault(),p.stopPropagation(),u&&i(u,h??!1)};return(0,xt.jsxs)("div",{style:g,"data-nav-tip-id":t.config.id,children:[(0,xt.jsxs)("button",{type:"button",style:S,onClick:n,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),"aria-expanded":e,children:[d&&(0,xt.jsx)("span",{style:qn.icon,children:d}),(0,xt.jsx)("span",{children:l}),(0,xt.jsx)("span",{style:_,children:"\u25BC"})]}),(0,xt.jsxs)("div",{style:b,"aria-hidden":!e,children:[(0,xt.jsx)("p",{style:qn.description,children:c}),u&&(0,xt.jsxs)("a",{href:u,onClick:f,style:{...qn.linkButton,...s.linkButton},target:h?"_blank":void 0,rel:h?"noopener noreferrer":void 0,children:["Go ",h?"\u2197":"\u2192"]})]})]})}function SN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,st.useReducer)(f=>f+1,0),[o,a]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]);let s=(0,st.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,i]),l=(0,st.useMemo)(()=>{let f=new Map;for(let p of s){let v=p.config.category;f.has(v)||f.set(v,[]),f.get(v).push(p)}return f},[s]),c=(0,st.useMemo)(()=>s.some(f=>f.config.category),[s]),u=(0,st.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,st.useCallback)(f=>{a(p=>{let v=p.has(f),y;if(t.expandBehavior==="single"){for(let w of p)w!==f&&e.events.publish("nav:toggled",{instanceId:n,tipId:w,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(p),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:n,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,n]),h=(0,st.useCallback)((f,p)=>{let v=f.trim().toLowerCase();v.startsWith("javascript:")||v.startsWith("data:")||(e.events.publish("nav:tip_clicked",{instanceId:n,href:f,external:p,timestamp:Date.now()}),p?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f)},[e.events,n]),g={...qn.container,...Zd[u].container},S={...qn.categoryHeader,...Zd[u].categoryHeader},_={...qn.emptyState,...Zd[u].emptyState},b=f=>f.map(p=>(0,xt.jsx)(_N,{item:p,isExpanded:o.has(p.config.id),onToggle:()=>d(p.config.id),onNavigate:h,theme:u},p.config.id));return s.length===0?(0,xt.jsx)("div",{style:g,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,xt.jsx)("div",{style:_,children:"No navigation tips available."})}):(0,xt.jsx)("div",{style:g,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,xt.jsx)("div",{style:qn.accordion,children:c?Array.from(l.entries()).map(([f,p])=>(0,xt.jsxs)(st.default.Fragment,{children:[f&&(0,xt.jsx)("div",{style:S,"data-category-header":f,children:f}),b(p)]},f??"__ungrouped")):b(s)})})}var pE={mount(t,e){let{runtime:n,instanceId:i="nav-widget",...r}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(n&&typeof Cm.createRoot=="function"){let a=(0,Cm.createRoot)(t);return a.render(st.default.createElement(SN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
98
98
  <div style="font-family: system-ui; max-width: 100%;">
99
99
  ${o.map(a=>`
100
100
  <div style="margin-bottom: 4px; padding: 12px 16px; background: ${A[12]}; border-radius: 8px;">
101
- ${a.config.icon?`<span>${Hd(a.config.icon)}</span> `:""}<strong>${Hd(a.config.title)}</strong>
102
- <p style="margin-top: 8px; color: ${A[6]}; font-size: 13px;">${Hd(a.config.description)}</p>
103
- ${a.config.href?`<a href="${Hd(a.config.href)}" style="color: ${st[2]}; font-size: 13px;">Go &rarr;</a>`:""}
101
+ ${a.config.icon?`<span>${qd(a.config.icon)}</span> `:""}<strong>${qd(a.config.title)}</strong>
102
+ <p style="margin-top: 8px; color: ${A[6]}; font-size: 13px;">${qd(a.config.description)}</p>
103
+ ${a.config.href?`<a href="${qd(a.config.href)}" style="color: ${at[2]}; font-size: 13px;">Go &rarr;</a>`:""}
104
104
  </div>
105
105
  `).join("")}
106
106
  </div>
107
- `,()=>{t.innerHTML=""}}};var oN=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);return n?(n.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}):(console.error(`[adaptive-nav] Anchor not found for scrollTo, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}})};function aN(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var sN=async(t,e)=>{let n=t.url.trim();if(n.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let i=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:i}),i==="_blank"?window.open(n,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&aN(n)?(window.history.pushState(null,"",n),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=n,{cleanup:()=>{}}},lN=[{kind:"navigation:scrollTo",executor:oN},{kind:"navigation:navigate",executor:sN}],Ww={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:lN,widgets:[{id:"adaptive-nav:tips",component:Yw,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`nav:${n.config.id}`,strategy:n.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:n.config.id,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var cN=[Uw,Kg,Zw,Gw,Ww,cm],uN=cN.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:n})=>({kind:e,executor:n})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function Xw(t){let e=0;for(let n of uN)t.has(n.id)||(t.register(n),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var Kw={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function Qw(t={}){let{timeout:e,className:n,style:i,hostLoadingSelector:r,waitForHostReady:o}={...Kw,...t};if(r&&document.querySelector(r))return()=>{};let a=document.createElement("style");a.textContent=`.${n} { ${i} }`,document.head.appendChild(a),document.documentElement.classList.add(n);let s=!1,l=()=>{s||(s=!0,clearTimeout(u),document.documentElement.classList.remove(n),a.remove(),o&&c&&document.removeEventListener(o,c))},c;o&&(c=()=>l(),document.addEventListener(o,c));let u=setTimeout(()=>{l()},e);return()=>{l()}}function dN(t={}){let{className:e,style:n}={...Kw,...t};return`
107
+ `,()=>{t.innerHTML=""}}};var xN=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);return n?(n.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}):(console.error(`[adaptive-nav] Anchor not found for scrollTo, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}})};function wN(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var EN=async(t,e)=>{let n=t.url.trim();if(n.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let i=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:i}),i==="_blank"?window.open(n,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&wN(n)?(window.history.pushState(null,"",n),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=n,{cleanup:()=>{}}},CN=[{kind:"navigation:scrollTo",executor:xN},{kind:"navigation:navigate",executor:EN}],hE={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:CN,widgets:[{id:"adaptive-nav:tips",component:pE,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`nav:${n.config.id}`,strategy:n.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:n.config.id,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var AN=[aE,om,dE,fE,hE,vm],TN=AN.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:n})=>({kind:e,executor:n})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function gE(t){let e=0;for(let n of TN)t.has(n.id)||(t.register(n),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var mE={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function vE(t={}){let{timeout:e,className:n,style:i,hostLoadingSelector:r,waitForHostReady:o}={...mE,...t};if(r&&document.querySelector(r))return()=>{};let a=document.createElement("style");a.textContent=`.${n} { ${i} }`,document.head.appendChild(a),document.documentElement.classList.add(n);let s=!1,l=()=>{s||(s=!0,clearTimeout(u),document.documentElement.classList.remove(n),a.remove(),o&&c&&document.removeEventListener(o,c))},c;o&&(c=()=>l(),document.addEventListener(o,c));let u=setTimeout(()=>{l()},e);return()=>{l()}}function kN(t={}){let{className:e,style:n}={...mE,...t};return`
108
108
  (function() {
109
109
  var s = document.createElement('style');
110
110
  s.textContent = '.${e} { ${n} }';
111
111
  document.head.appendChild(s);
112
112
  document.documentElement.className += ' ${e}';
113
- })();`}function Bd(t,e,n="first-match"){for(let i of e){let r=t.getFeatureValue?.(i,null);if(!r||typeof r!="object")continue;let o=r,a=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(a||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var ym=!1;function Jw(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function bm(t){if(Jw()){ym=!0;return}ym=t??!1}function fN(){return Jw()?!0:ym}function G(t,e,n){fN()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function fn(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function $d(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var _m="2.4.0-canary.17";var zr="2.0";var pN=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function hN(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):pN.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function gN(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var eE="syntro_config_cache",mN=1440*60*1e3;function tE(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function vN(t,e){if(tE())try{let n={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(eE,JSON.stringify(n))}catch{}}function yN(t){if(!tE())return null;try{let e=localStorage.getItem(eE);if(!e)return null;let n=JSON.parse(e);return!n.config||typeof n.timestamp!="number"||!n.sdkVersion||n.sdkVersion!==t||Date.now()-n.timestamp>mN?null:n.config}catch{return null}}var xm=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let i=e?.getFeatureValue?.(n,null);if(i)return i};function bN(t,e,n){if(e){let i=t.getFeatureValue?.(e,null);if(i&&typeof i=="object"){let r=i.variant_flags;if(r&&r.length>0)return r}}if(n&&t.getAllFeatures){let i=t.getAllFeatures();return Object.keys(i).filter(r=>r.startsWith(n))}return[]}var is=({configUri:t,experiments:e,featureKey:n,credentials:i,configFeatureKey:r="smart-canvas-config",manifestKey:o,variantFlagPrefix:a,sdkVersion:s})=>async()=>{if(e&&r){let u=e.getFeatureValue?.(r,null);if(u&&typeof u=="object")return G("SmartCanvas Config","Resolved config directly from feature flag",u),u}if(e&&(o||a)){let u=bN(e,o,a);if(u.length>0){let d=Bd(e,u);if(d)return G("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=xm({configUri:t,experiments:e,featureKey:n});if(!l)return G("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!hN(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let c=i??(gN(l)?"include":"omit");try{let u=await fetch(l,{credentials:c,headers:{"X-SDK-Version":_m,"X-SDK-Schema-Version":zr}});if(!u.ok)throw new Error(`SmartCanvas: failed to fetch config (${u.status})`);let d=await u.json();return G("SmartCanvas Config","Fetched config from URI",d),s&&vN(d,s),d}catch(u){if(s){let d=yN(s);if(d)return G("SmartCanvas Config","Serving config from offline cache"),d}throw u}};var _N=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function nE(t){if(typeof window>"u")return null;let n=new URLSearchParams(window.location.search).get(t);if(!n)return null;try{let i=n.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(i))}catch(i){return fn("Syntro Runtime",`Failed to decode ${t}:`,i),null}}var rs,os;function Br(){if(rs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)rs={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${rs.token.slice(0,15)}...)`);else{let e=nE("editor_source");e&&(rs=e),console.log(`[DIAG] getEditorSource: from URL param \u2192 ${e?`token=${e.token?.slice(0,15)}...`:"NULL"}`),!e&&typeof window<"u"&&console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0,200)}`)}}return rs??null}function Io(){if(os==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)os={mode:t.mode,audit_session_id:t.auditSessionId,syntro_token:t.syntroToken,workspace_id:t.workspaceId},console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${os.mode})`);else{let e=nE("editor_conf");e&&(os=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return os??null}function xN(t){G("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return G("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(fn("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):_N.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r)?(G("Syntro Runtime","\u2713 Editor URL validated"),!0):(fn("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return fn("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var iE=()=>{let t=Io();return!Br()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function SN(){return Br()?.token??null}function wN(){return Br()?.api_base??null}var Yl=null,rE=async t=>{if(G("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){G("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){G("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(Yl)return G("Syntro Runtime","Editor SDK load already in progress, waiting..."),Yl;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){G("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),G("Syntro Runtime","================================");return}let n=wN(),r=(n?`${n}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!r){fn("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),G("Syntro Runtime","================================");return}let o=SN();if(!o){fn("Syntro Runtime","\u274C No token found in editor_source."),G("Syntro Runtime","================================");return}let a=`${r}?token=${encodeURIComponent(o)}`;if(G("Syntro Runtime","Editor URL:",a),G("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!r,hasApiBase:!!n,tokenPrefix:`${o.slice(0,10)}...`}),!xN(r)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",r),G("Syntro Runtime","================================");return}return G("Syntro Runtime","\u2713 URL validated, injecting script tag..."),Yl=new Promise((s,l)=>{let c=document.createElement("script");c.src=a,c.async=!0,e.integrity&&(c.integrity=e.integrity,c.crossOrigin="anonymous",G("Syntro Runtime","SRI integrity check enabled")),c.onload=()=>{G("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),G("Syntro Runtime","================================"),s()},c.onerror=u=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",u),console.error("[Syntro Runtime] URL attempted:",a),G("Syntro Runtime","================================"),Yl=null,l(u)},document.head.appendChild(c),G("Syntro Runtime","Script tag appended to <head>")}),Yl};function Fd(t,e,n){for(let i of t){let r=i.props;if(!r)continue;let o=r.scope;if(!o?.events)continue;let a=r.actions;if(!a)continue;let s=new Set;for(let d of a)if(d.triggerWhen?.type==="rules")for(let p of d.triggerWhen.rules)for(let g of p.conditions)g.type==="event_count"&&g.key&&s.add(g.key);if(s.size===0)continue;let{events:l,urlContains:c,props:u}=o;for(let d of s)e.register(d,p=>{if(!l.includes(p.name)||c&&!String(p.props?.pathname??"").includes(c))return!1;if(u){for(let[g,_]of Object.entries(u))if(p.props?.[g]!==_)return!1}return!0})}if(n)for(let i of n){let o=i.triggerWhen;if(o?.type==="rules")for(let a of o.rules)for(let s of a.conditions)s.type==="event_count"&&s.key&&e.register(s.key,()=>!0)}}var oi=null;function aE(t){oi&&oi!==t?t.appendChild(oi):oi=t;let e=t.getRootNode();e instanceof ShadowRoot&&EN(e)}function sE(){return oi||(oi=document.createElement("div"),oi.id="syntro-overlays",Object.assign(oi.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(oi)),oi}var oE=!1;function EN(t){if(oE)return;let e=`
113
+ })();`}function Gd(t,e,n="first-match"){for(let i of e){let r=t.getFeatureValue?.(i,null);if(!r||typeof r!="object")continue;let o=r,a=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(a||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Am=!1;function yE(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function Tm(t){if(yE()){Am=!0;return}Am=t??!1}function RN(){return yE()?!0:Am}function G(t,e,n){RN()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function fn(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function Yd(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var km="2.4.0-canary.19";var zr="2.0";var ON=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function MN(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):ON.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function NN(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var bE="syntro_config_cache",DN=1440*60*1e3;function _E(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function LN(t,e){if(_E())try{let n={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(bE,JSON.stringify(n))}catch{}}function IN(t){if(!_E())return null;try{let e=localStorage.getItem(bE);if(!e)return null;let n=JSON.parse(e);return!n.config||typeof n.timestamp!="number"||!n.sdkVersion||n.sdkVersion!==t||Date.now()-n.timestamp>DN?null:n.config}catch{return null}}var Rm=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let i=e?.getFeatureValue?.(n,null);if(i)return i};function HN(t,e,n){if(e){let i=t.getFeatureValue?.(e,null);if(i&&typeof i=="object"){let r=i.variant_flags;if(r&&r.length>0)return r}}if(n&&t.getAllFeatures){let i=t.getAllFeatures();return Object.keys(i).filter(r=>r.startsWith(n))}return[]}var rs=({configUri:t,experiments:e,featureKey:n,credentials:i,configFeatureKey:r="smart-canvas-config",manifestKey:o,variantFlagPrefix:a,sdkVersion:s})=>async()=>{if(e&&r){let u=e.getFeatureValue?.(r,null);if(u&&typeof u=="object")return G("SmartCanvas Config","Resolved config directly from feature flag",u),u}if(e&&(o||a)){let u=HN(e,o,a);if(u.length>0){let d=Gd(e,u);if(d)return G("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Rm({configUri:t,experiments:e,featureKey:n});if(!l)return G("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!MN(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let c=i??(NN(l)?"include":"omit");try{let u=await fetch(l,{credentials:c,headers:{"X-SDK-Version":km,"X-SDK-Schema-Version":zr}});if(!u.ok)throw new Error(`SmartCanvas: failed to fetch config (${u.status})`);let d=await u.json();return G("SmartCanvas Config","Fetched config from URI",d),s&&LN(d,s),d}catch(u){if(s){let d=IN(s);if(d)return G("SmartCanvas Config","Serving config from offline cache"),d}throw u}};var zN=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function SE(t){if(typeof window>"u")return null;let n=new URLSearchParams(window.location.search).get(t);if(!n)return null;try{let i=n.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(i))}catch(i){return fn("Syntro Runtime",`Failed to decode ${t}:`,i),null}}var os,as;function Br(){if(os==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)os={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${os.token.slice(0,15)}...)`);else{let e=SE("editor_source");e&&(os=e),console.log(`[DIAG] getEditorSource: from URL param \u2192 ${e?`token=${e.token?.slice(0,15)}...`:"NULL"}`),!e&&typeof window<"u"&&console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0,200)}`)}}return os??null}function Ho(){if(as==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)as={mode:t.mode,audit_session_id:t.auditSessionId,syntro_token:t.syntroToken,workspace_id:t.workspaceId},console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${as.mode})`);else{let e=SE("editor_conf");e&&(as=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return as??null}function BN(t){G("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return G("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(fn("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):zN.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r)?(G("Syntro Runtime","\u2713 Editor URL validated"),!0):(fn("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return fn("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var xE=()=>{let t=Ho();return!Br()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function FN(){return Br()?.token??null}function $N(){return Br()?.api_base??null}var Xl=null,wE=async t=>{if(G("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){G("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){G("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(Xl)return G("Syntro Runtime","Editor SDK load already in progress, waiting..."),Xl;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){G("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),G("Syntro Runtime","================================");return}let n=$N(),r=(n?`${n}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!r){fn("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),G("Syntro Runtime","================================");return}let o=FN();if(!o){fn("Syntro Runtime","\u274C No token found in editor_source."),G("Syntro Runtime","================================");return}let a=`${r}?token=${encodeURIComponent(o)}`;if(G("Syntro Runtime","Editor URL:",a),G("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!r,hasApiBase:!!n,tokenPrefix:`${o.slice(0,10)}...`}),!BN(r)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",r),G("Syntro Runtime","================================");return}return G("Syntro Runtime","\u2713 URL validated, injecting script tag..."),Xl=new Promise((s,l)=>{let c=document.createElement("script");c.src=a,c.async=!0,e.integrity&&(c.integrity=e.integrity,c.crossOrigin="anonymous",G("Syntro Runtime","SRI integrity check enabled")),c.onload=()=>{G("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),G("Syntro Runtime","================================"),s()},c.onerror=u=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",u),console.error("[Syntro Runtime] URL attempted:",a),G("Syntro Runtime","================================"),Xl=null,l(u)},document.head.appendChild(c),G("Syntro Runtime","Script tag appended to <head>")}),Xl};var UN=new Set(["tag_name","$el_text"]);function VN(t){return UN.has(t)||t.startsWith("attr__")}function EE(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function jN(t){let{events:e,match:n}=t;return i=>{if(!e.includes(i.name))return!1;if(n){for(let[r,o]of Object.entries(n))if(VN(r)){let a=i.props?.elements;if(!a||!a.some(l=>EE(o,l[r])))return!1}else if(!EE(o,i.props?.[r]))return!1}return!0}}function CE(t,e){for(let n of t.rules)for(let i of n.conditions)if(i.type==="event_count"&&i.key){let r=i.counter,o=r?jN(r):()=>!0;e.register(i.key,o)}}function Wd(t,e,n){for(let i of t){let r=i.props;if(!r)continue;let o=r.actions;if(o)for(let a of o)a.triggerWhen?.type==="rules"&&CE(a.triggerWhen,e)}if(n)for(let i of n){let r=i;r.triggerWhen?.type==="rules"&&CE(r.triggerWhen,e)}}var oi=null;function TE(t){oi&&oi!==t?t.appendChild(oi):oi=t;let e=t.getRootNode();e instanceof ShadowRoot&&PN(e)}function kE(){return oi||(oi=document.createElement("div"),oi.id="syntro-overlays",Object.assign(oi.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(oi)),oi}var AE=!1;function PN(t){if(AE)return;let e=`
114
114
  :host {
115
115
  --syntro-surface: var(--sc-overlay-background, #0f1318);
116
116
  --syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
@@ -369,7 +369,7 @@ Error generating stack: `+i.message+`
369
369
  .syntro-modal-btn-primary:hover {
370
370
  background: var(--syntro-accent-hover, #d44844);
371
371
  }
372
- `,n=document.createElement("style");n.setAttribute("data-syntro","base-overlay"),n.textContent=e,t.appendChild(n),oE=!0}var wE=X(To(),1);var Sm=class{constructor(e){j(this,"state");j(this,"listeners",new Set);let n=e?.open??!1;if(e?.open===void 0)try{let i=sessionStorage?.getItem("syntro:editor:panel-open");i!==null&&(n=JSON.parse(i))}catch{}this.state={open:n}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},lE=t=>new Sm(t);var Ud=X(Qe(),1),dE=X(Fe(),1),cE=(0,Ud.createContext)(null);function uE({shadowRoot:t,portalRoot:e,overlayContainer:n,children:i}){return(0,dE.jsx)(cE.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:n},children:i})}function as(){let t=(0,Ud.useContext)(cE);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Gt=X(Qe(),1);var Tt=X(Qe(),1),Fm=X(zs(),1);var xe={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",NOTIFICATION_SHOWN:"notification.shown",NOTIFICATION_CLICKED:"notification.clicked",NOTIFICATION_DISMISSED:"notification.dismissed",NOTIFICATION_DEEP_LINK:"notification.deep_link",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ss="1.0.0";function Zn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ss}}function CN(t){return Zn(xe.CANVAS_OPENED,{surface:t})}function AN(t){return Zn(xe.CANVAS_CLOSED,{surface:t})}function kN(t,e){return Zn(xe.TILE_VIEWED,{tileId:t,surface:e})}function TN(t,e){return Zn(xe.TILE_EXPANDED,{tileId:t,surface:e})}function RN(t,e){return Zn(xe.TILE_COLLAPSED,{tileId:t,surface:e})}function ON(t,e,n){return Zn(xe.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function MN(t,e){return Zn(xe.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function NN(t,e){return Zn(xe.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function DN(t,e,n){return Zn(xe.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function LN(t,e,n){return Zn(xe.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function IN(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return Zn(n,e)}var Wl={canvasOpened:CN,canvasClosed:AN,tileViewed:kN,tileExpanded:TN,tileCollapsed:RN,tileAction:ON,overlayStarted:MN,overlayCompleted:NN,overlayDismissed:DN,overlayStepViewed:LN,custom:IN};var Tn=X(Fe(),1),fE="syntro-toast-styles",HN=`
372
+ `,n=document.createElement("style");n.setAttribute("data-syntro","base-overlay"),n.textContent=e,t.appendChild(n),AE=!0}var PE=X(Ro(),1);var Om=class{constructor(e){j(this,"state");j(this,"listeners",new Set);let n=e?.open??!1;if(e?.open===void 0)try{let i=sessionStorage?.getItem("syntro:editor:panel-open");i!==null&&(n=JSON.parse(i))}catch{}this.state={open:n}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},RE=t=>new Om(t);var Xd=X(Qe(),1),NE=X($e(),1),OE=(0,Xd.createContext)(null);function ME({shadowRoot:t,portalRoot:e,overlayContainer:n,children:i}){return(0,NE.jsx)(OE.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:n},children:i})}function ss(){let t=(0,Xd.useContext)(OE);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Gt=X(Qe(),1);var kt=X(Qe(),1),Ym=X(Fs(),1);var Se={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",NOTIFICATION_SHOWN:"notification.shown",NOTIFICATION_CLICKED:"notification.clicked",NOTIFICATION_DISMISSED:"notification.dismissed",NOTIFICATION_DEEP_LINK:"notification.deep_link",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ls="1.0.0";function Zn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ls}}function qN(t){return Zn(Se.CANVAS_OPENED,{surface:t})}function ZN(t){return Zn(Se.CANVAS_CLOSED,{surface:t})}function GN(t,e){return Zn(Se.TILE_VIEWED,{tileId:t,surface:e})}function YN(t,e){return Zn(Se.TILE_EXPANDED,{tileId:t,surface:e})}function WN(t,e){return Zn(Se.TILE_COLLAPSED,{tileId:t,surface:e})}function XN(t,e,n){return Zn(Se.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function KN(t,e){return Zn(Se.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function QN(t,e){return Zn(Se.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function JN(t,e,n){return Zn(Se.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function eD(t,e,n){return Zn(Se.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function tD(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return Zn(n,e)}var Kl={canvasOpened:qN,canvasClosed:ZN,tileViewed:GN,tileExpanded:YN,tileCollapsed:WN,tileAction:XN,overlayStarted:KN,overlayCompleted:QN,overlayDismissed:JN,overlayStepViewed:eD,custom:tD};var kn=X($e(),1),DE="syntro-toast-styles",nD=`
373
373
  @keyframes syntro-toast-slide-in {
374
374
  from { opacity: 0; transform: translateY(12px); }
375
375
  to { opacity: 1; transform: translateY(0); }
@@ -387,21 +387,21 @@ Error generating stack: `+i.message+`
387
387
  .syntro-toast-progress.paused {
388
388
  animation-play-state: paused;
389
389
  }
390
- `;function zN(t){if(t.querySelector(`#${fE}`))return;let e=document.createElement("style");e.id=fE,e.textContent=HN,t.appendChild(e)}function wm({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=as();return zN(r),t.length===0?null:(0,Tn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Tn.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:a=>{a.currentTarget.style.transform="translateY(-1px)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:a=>{a.currentTarget.style.transform="translateY(0)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Tn.jsxs)("div",{onClick:()=>n(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Tn.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:"var(--sc-notification-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:o.icon??"\u{1F514}"}),(0,Tn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Tn.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--sc-notification-text-color)",lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.title}),o.body&&(0,Tn.jsx)("div",{style:{fontSize:"12px",color:"var(--sc-notification-text-secondary-color)",lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.body})]}),(0,Tn.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Tn.jsx)("div",{style:{height:"2px",background:"rgba(255, 255, 255, 0.06)"},children:(0,Tn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Gn=X(Qe(),1);var Em=3,Cm=8e3,Am=3e4;var BN=0;function Vd(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function $N(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function km(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!$N(t.name,r.on))continue;let o=Date.now(),a=r.ttl??8e3;return{notification:{id:`notif-${++BN}-${o}`,title:Vd(r.title,t.props),body:r.body?Vd(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?Vd(r.deepLink.itemId,t.props):void 0,expiresAt:o+a,createdAt:o,ttl:a},rule:r}}}return null}function Tm(t,e){let[n,i]=(0,Gn.useState)([]),r=(0,Gn.useRef)(new Map),o=(0,Gn.useRef)(new Map),a=(0,Gn.useCallback)(c=>{t?.publish(xe.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Gn.useCallback)(c=>{let u=setTimeout(()=>{i(d=>d.filter(p=>p.id!==c.id)),o.current.delete(c.id),a(c)},c.ttl);o.current.set(c.id,u)},[a]),l=(0,Gn.useCallback)(c=>{i(d=>{let p=d.find(g=>g.id===c);return p&&a(p),d.filter(g=>g.id!==c)});let u=o.current.get(c);u&&(clearTimeout(u),o.current.delete(c))},[a]);return(0,Gn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let d=km(u,e);if(!d)return;let{notification:p,rule:g}=d,_=`${p.tileId}:${u.name}`,b=r.current.get(_),x=Date.now(),f=g.cooldown??3e4;b!==void 0&&x-b<f||(r.current.set(_,x),i(h=>{if(p.itemId&&h.some(S=>S.tileId===p.tileId&&S.itemId===p.itemId))return h;let y=[...h,p];if(y.length>3){let m=y.shift(),S=o.current.get(m.id);S&&(clearTimeout(S),o.current.delete(m.id))}return y}),t.publish(xe.NOTIFICATION_SHOWN,{notificationId:p.id,tileId:p.tileId,itemId:p.itemId,title:p.title}),s(p))});return()=>{c();for(let u of o.current.values())clearTimeout(u);o.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var jd=X(Qe(),1);function FN(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],a=e.get(r)?.manifest.runtime?.notifyWatchers;a&&n.push(...a(i.props??{}))}return n}function Rm(t,e,n){let i=(0,jd.useRef)(new Map);(0,jd.useEffect)(()=>{if(!t?.events||!n)return;let r=FN(e,n);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&o.remove(s.id)}})},[t,e,n])}var Zt=X(Qe(),1),pE=X(Fe(),1),Om=(0,Zt.createContext)({runtime:null,context:null});function Mm({runtime:t,children:e}){let[n,i]=(0,Zt.useState)(t?t.context.get():null);(0,Zt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Zt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,pE.jsx)(Om.Provider,{value:r,children:e})}function Fi(){let{runtime:t}=(0,Zt.useContext)(Om);return t}function Pd(){let{context:t}=(0,Zt.useContext)(Om);return t}function Nm(){return Pd()?.page??null}function UN(){return Pd()?.session??null}function VN(){return Pd()?.viewport??null}function jN(t,e,n=[]){let i=Fi();(0,Zt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function PN(){return Fi()?.state??null}function qN(t,e){let n=Fi(),[i,r]=(0,Zt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Zt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(a=>{o||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),i}function se(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var ZN={colorPrimary:te[3],colorPrimaryHover:te[4],colorPrimaryMuted:te[0],colorBackground:se(A[1],.95),colorBackgroundElevated:se(A[3],.95),colorBackgroundSubtle:se(A[0],.2),colorSurface:se(A[4],.8),colorSurfaceHover:se(A[5],.8),colorText:Ii.primary,colorTextSecondary:Ii.secondary,colorTextMuted:Ii.tertiary,colorTextInverse:A[1],colorBorder:tm.primary,colorBorderSubtle:tm.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:xt[4],colorWarningMuted:xt[0],colorError:$e[4],colorErrorMuted:$e[0],colorInfo:un[4],colorInfoMuted:un[0],colorNotification:te[4],colorNotificationMuted:se(te[4],.4),glassBackground:se(A[1],.6),glassBackgroundHover:se(A[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},GN={colorPrimary:te[3],colorPrimaryHover:te[2],colorPrimaryMuted:se(te[5],.1),colorBackground:se(A[12],.95),colorBackgroundElevated:se(A[11],.95),colorBackgroundSubtle:se(A[0],.02),colorSurface:se(A[11],.6),colorSurfaceHover:se(A[10],.6),colorText:A[1],colorTextSecondary:A[6],colorTextMuted:A[8],colorTextInverse:A[12],colorBorder:se(A[0],.12),colorBorderSubtle:se(A[0],.06),colorSuccess:ke[4],colorSuccessMuted:se(ke[4],.12),colorWarning:xt[4],colorWarningMuted:se(xt[4],.12),colorError:$e[4],colorErrorMuted:se($e[4],.12),colorInfo:un[4],colorInfoMuted:se(un[4],.12),colorNotification:te[3],colorNotificationMuted:se(te[3],.4),glassBackground:se(A[12],.7),glassBackgroundHover:se(A[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function YN(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Dm={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:te[3],colorPrimaryHover:te[4],borderRadius:"12px",canvas:{position:"right",background:se(A[1],.6),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:bd.primary.backgroundDefault,backgroundHover:bd.primary.backgroundHover,color:bd.primary.icon,size:"56px",shadow:`0 8px 32px ${se(A[0],.6)}`},tile:{background:se(A[1],.6),backgroundHover:se(A[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:Ii.primary,textColor:Ii.secondary,iconBackground:`linear-gradient(135deg, ${te[3]} 0%, ${te[3]}cc 100%)`,iconShadow:`0 2px 8px ${te[3]}40`},overlay:{background:se(A[1],.6),textColor:Ii.primary,border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${te[3]}`},notification:{background:se(A[0],.95),textColor:Ii.primary,textSecondaryColor:Ii.secondary,border:`1px solid ${A[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:xt[4],errorColor:$e[4],iconBackground:se(te[3],.15),progressGradient:`linear-gradient(90deg, ${te[3]}, ${te[4]})`}},Lm={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:te[3],colorPrimaryHover:te[2],borderRadius:"12px",canvas:{position:"right",background:se(A[12],.7),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:te[3],backgroundHover:te[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)"},tile:{background:se(A[12],.7),backgroundHover:se(A[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:A[1],textColor:A[6],iconBackground:`linear-gradient(135deg, ${te[3]} 0%, ${te[3]}cc 100%)`,iconShadow:`0 2px 8px ${te[3]}40`},overlay:{background:se(A[12],.7),textColor:A[1],border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${te[3]}`},notification:{background:se(A[12],.95),textColor:A[1],textSecondaryColor:A[6],border:`1px solid ${se(A[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:xt[4],errorColor:$e[4],iconBackground:se(te[3],.1),progressGradient:`linear-gradient(90deg, ${te[3]}, ${te[2]})`}};function Im(t){let e=t.mode==="light"?Lm:Dm;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification}}}function Hm(t,e){let n=e.mode??t.mode??"dark",i=n==="light"?Lm:Dm;return{mode:n,fontFamily:e.fontFamily??t.fontFamily??i.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??i.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??i.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??i.borderRadius,canvas:{...i.canvas,...t.canvas,...e.canvas},launcher:{...i.launcher,...t.launcher,...e.launcher},tile:{...i.tile,...t.tile,...e.tile},overlay:{...i.overlay,...t.overlay,...e.overlay},notification:{...i.notification,...t.notification,...e.notification}}}var WN=["canvas","launcher","tile","overlay","notification"];function zm(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let n of WN){let i=t[n];if(i)for(let[r,o]of Object.entries(i))o!==void 0&&(e[`--sc-${n}-${YN(r)}`]=o)}return e}var Ui=X(Qe(),1);var gE=X(Fe(),1),hE=(0,Ui.createContext)(null);function Bm({children:t,themeConfig:e,workspaceTheme:n,shadowRoot:i}){let r=(0,Ui.useMemo)(()=>n?Hm(n,e??{}):Im(e??{}),[e,n]),o=(0,Ui.useMemo)(()=>zm(r),[r]);(0,Ui.useEffect)(()=>{if(!i)return;let s=i.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",i.insertBefore(s,i.firstChild));let l=Object.entries(o).map(([c,u])=>` ${c}: ${u};`).join(`
390
+ `;function iD(t){if(t.querySelector(`#${DE}`))return;let e=document.createElement("style");e.id=DE,e.textContent=nD,t.appendChild(e)}function Mm({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=ss();return iD(r),t.length===0?null:(0,kn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,kn.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:a=>{a.currentTarget.style.transform="translateY(-1px)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:a=>{a.currentTarget.style.transform="translateY(0)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,kn.jsxs)("div",{onClick:()=>n(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,kn.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:"var(--sc-notification-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:o.icon??"\u{1F514}"}),(0,kn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,kn.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--sc-notification-text-color)",lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.title}),o.body&&(0,kn.jsx)("div",{style:{fontSize:"12px",color:"var(--sc-notification-text-secondary-color)",lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.body})]}),(0,kn.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,kn.jsx)("div",{style:{height:"2px",background:"rgba(255, 255, 255, 0.06)"},children:(0,kn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Gn=X(Qe(),1);var Nm=3,Dm=8e3,Lm=3e4;var rD=0;function Kd(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function oD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Im(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!oD(t.name,r.on))continue;let o=Date.now(),a=r.ttl??8e3;return{notification:{id:`notif-${++rD}-${o}`,title:Kd(r.title,t.props),body:r.body?Kd(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?Kd(r.deepLink.itemId,t.props):void 0,expiresAt:o+a,createdAt:o,ttl:a},rule:r}}}return null}function Hm(t,e){let[n,i]=(0,Gn.useState)([]),r=(0,Gn.useRef)(new Map),o=(0,Gn.useRef)(new Map),a=(0,Gn.useCallback)(c=>{t?.publish(Se.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Gn.useCallback)(c=>{let u=setTimeout(()=>{i(d=>d.filter(h=>h.id!==c.id)),o.current.delete(c.id),a(c)},c.ttl);o.current.set(c.id,u)},[a]),l=(0,Gn.useCallback)(c=>{i(d=>{let h=d.find(g=>g.id===c);return h&&a(h),d.filter(g=>g.id!==c)});let u=o.current.get(c);u&&(clearTimeout(u),o.current.delete(c))},[a]);return(0,Gn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let d=Im(u,e);if(!d)return;let{notification:h,rule:g}=d,S=`${h.tileId}:${u.name}`,_=r.current.get(S),b=Date.now(),f=g.cooldown??3e4;_!==void 0&&b-_<f||(r.current.set(S,b),i(p=>{if(h.itemId&&p.some(w=>w.tileId===h.tileId&&w.itemId===h.itemId))return p;let v=[...p,h];if(v.length>3){let y=v.shift(),w=o.current.get(y.id);w&&(clearTimeout(w),o.current.delete(y.id))}return v}),t.publish(Se.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{c();for(let u of o.current.values())clearTimeout(u);o.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var Qd=X(Qe(),1);function aD(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],a=e.get(r)?.manifest.runtime?.notifyWatchers;a&&n.push(...a(i.props??{}))}return n}function zm(t,e,n){let i=(0,Qd.useRef)(new Map);(0,Qd.useEffect)(()=>{if(!t?.events||!n)return;let r=aD(e,n);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&o.remove(s.id)}})},[t,e,n])}var Zt=X(Qe(),1),LE=X($e(),1),Bm=(0,Zt.createContext)({runtime:null,context:null});function Fm({runtime:t,children:e}){let[n,i]=(0,Zt.useState)(t?t.context.get():null);(0,Zt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Zt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,LE.jsx)(Bm.Provider,{value:r,children:e})}function $i(){let{runtime:t}=(0,Zt.useContext)(Bm);return t}function Jd(){let{context:t}=(0,Zt.useContext)(Bm);return t}function $m(){return Jd()?.page??null}function sD(){return Jd()?.session??null}function lD(){return Jd()?.viewport??null}function cD(t,e,n=[]){let i=$i();(0,Zt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function uD(){return $i()?.state??null}function dD(t,e){let n=$i(),[i,r]=(0,Zt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Zt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(a=>{o||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),i}function se(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var fD={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:se(A[1],.95),colorBackgroundElevated:se(A[3],.95),colorBackgroundSubtle:se(A[0],.2),colorSurface:se(A[4],.8),colorSurfaceHover:se(A[5],.8),colorText:Ii.primary,colorTextSecondary:Ii.secondary,colorTextMuted:Ii.tertiary,colorTextInverse:A[1],colorBorder:cm.primary,colorBorderSubtle:cm.secondary,colorSuccess:Te[4],colorSuccessMuted:Te[0],colorWarning:St[4],colorWarningMuted:St[0],colorError:Fe[4],colorErrorMuted:Fe[0],colorInfo:un[4],colorInfoMuted:un[0],colorNotification:ne[4],colorNotificationMuted:se(ne[4],.4),glassBackground:se(A[1],.6),glassBackgroundHover:se(A[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},pD={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:se(ne[5],.1),colorBackground:se(A[12],.95),colorBackgroundElevated:se(A[11],.95),colorBackgroundSubtle:se(A[0],.02),colorSurface:se(A[11],.6),colorSurfaceHover:se(A[10],.6),colorText:A[1],colorTextSecondary:A[6],colorTextMuted:A[8],colorTextInverse:A[12],colorBorder:se(A[0],.12),colorBorderSubtle:se(A[0],.06),colorSuccess:Te[4],colorSuccessMuted:se(Te[4],.12),colorWarning:St[4],colorWarningMuted:se(St[4],.12),colorError:Fe[4],colorErrorMuted:se(Fe[4],.12),colorInfo:un[4],colorInfoMuted:se(un[4],.12),colorNotification:ne[3],colorNotificationMuted:se(ne[3],.4),glassBackground:se(A[12],.7),glassBackgroundHover:se(A[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function hD(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Um={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[4],borderRadius:"12px",canvas:{position:"right",background:se(A[1],.6),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:kd.primary.backgroundDefault,backgroundHover:kd.primary.backgroundHover,color:kd.primary.icon,size:"56px",shadow:`0 8px 32px ${se(A[0],.6)}`},tile:{background:se(A[1],.6),backgroundHover:se(A[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:Ii.primary,textColor:Ii.secondary,iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(A[1],.6),textColor:Ii.primary,border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(A[0],.95),textColor:Ii.primary,textSecondaryColor:Ii.secondary,border:`1px solid ${A[5]}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`}},Vm={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[2],borderRadius:"12px",canvas:{position:"right",background:se(A[12],.7),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:ne[3],backgroundHover:ne[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)"},tile:{background:se(A[12],.7),backgroundHover:se(A[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:A[1],textColor:A[6],iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(A[12],.7),textColor:A[1],border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(A[12],.95),textColor:A[1],textSecondaryColor:A[6],border:`1px solid ${se(A[0],.12)}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`}};function jm(t){let e=t.mode==="light"?Vm:Um;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification}}}function Pm(t,e){let n=e.mode??t.mode??"dark",i=n==="light"?Vm:Um;return{mode:n,fontFamily:e.fontFamily??t.fontFamily??i.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??i.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??i.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??i.borderRadius,canvas:{...i.canvas,...t.canvas,...e.canvas},launcher:{...i.launcher,...t.launcher,...e.launcher},tile:{...i.tile,...t.tile,...e.tile},overlay:{...i.overlay,...t.overlay,...e.overlay},notification:{...i.notification,...t.notification,...e.notification}}}var gD=["canvas","launcher","tile","overlay","notification"];function qm(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let n of gD){let i=t[n];if(i)for(let[r,o]of Object.entries(i))o!==void 0&&(e[`--sc-${n}-${hD(r)}`]=o)}return e}var Ui=X(Qe(),1);var HE=X($e(),1),IE=(0,Ui.createContext)(null);function Zm({children:t,themeConfig:e,workspaceTheme:n,shadowRoot:i}){let r=(0,Ui.useMemo)(()=>n?Pm(n,e??{}):jm(e??{}),[e,n]),o=(0,Ui.useMemo)(()=>qm(r),[r]);(0,Ui.useEffect)(()=>{if(!i)return;let s=i.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",i.insertBefore(s,i.firstChild));let l=Object.entries(o).map(([c,u])=>` ${c}: ${u};`).join(`
391
391
  `);s.textContent=`:host {
392
392
  ${l}
393
- }`},[i,o]);let a={config:r,mode:r.mode,cssVariables:o};return(0,gE.jsx)(hE.Provider,{value:a,children:t})}function $m(){let t=(0,Ui.useContext)(hE);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var It=X(Qe(),1);var Rn=X(Fe(),1);function XN({widgetId:t,props:e}){let n=Fi(),i=(0,It.useRef)(null),r=(0,It.useRef)(null),o=n?.widgets,a=o?.has(t)??!1,[,s]=(0,It.useReducer)(l=>l+1,0);return(0,It.useEffect)(()=>{if(!(!o||a))return o.subscribe(l=>{l.type==="registered"&&l.widgetId===t&&s()})},[o,t,a]),(0,It.useEffect)(()=>{if(!i.current||!o||!a)return;let l=o.mount(t,i.current,e);return r.current=l,()=>{l.unmount(),r.current=null}},[o,t,e,a]),!o||!o.has(t)?(0,Rn.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Rn.jsx)("div",{ref:i,style:{width:"100%",minHeight:"40px"}})}function Xl({config:t,surface:e,telemetry:n,style:i}){let{title:r,widget:o,props:a}=t,[,s]=(0,It.useState)(0),l=Fi();(0,It.useEffect)(()=>{l&&s(x=>x+1)},[l]);let[c,u]=(0,It.useState)(!1),d=(0,It.useCallback)(()=>u(!0),[]),p=(0,It.useCallback)(()=>u(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:c?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:c?"scale(1.01)":"scale(1)",...i},_={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:"72px"},b={width:"40px",height:"40px",borderRadius:"10px",background:"var(--sc-tile-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:"var(--sc-tile-icon-shadow)"};return(0,Rn.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:d,onMouseLeave:p,children:[(0,Rn.jsxs)("div",{style:_,children:[(0,Rn.jsx)("div",{style:b,children:"+"}),(0,Rn.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Rn.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r??o})})]}),(0,Rn.jsx)("div",{style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Rn.jsx)("div",{style:{paddingTop:"0.875rem"},children:(0,Rn.jsx)(XN,{widgetId:o,props:a})})})]})}var pe=X(Fe(),1),mE="syntro-launcher-styles";function KN(t,e){if(t.querySelector(`#${mE}`))return;let n=document.createElement("style");n.id=mE,n.textContent=e,t.appendChild(n)}function vE({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherAnimate:r=!1,launcherAnimationStyle:o="pulse",notificationCount:a,footerSlot:s,tiles:l,isLoading:c,error:u,canvasTitle:d,displayMode:p="standard"}){let[g,_]=(0,Tt.useState)(!1),[b,x]=(0,Tt.useState)(null),f=(0,Tt.useRef)(null),h=Fi(),{shadowRoot:y,portalRoot:m}=as(),{config:S}=$m(),{notifications:w,dismiss:C}=Tm(h?.events??null,l);Rm(h,l,h?.apps);let k=(0,Tt.useCallback)(ee=>{h&&h.events.publish(xe.NOTIFICATION_CLICKED,{notificationId:ee.id,tileId:ee.tileId,itemId:ee.itemId}),t||e(),h&&ee.tileId&&h.events.publish(xe.NOTIFICATION_DEEP_LINK,{tileId:ee.tileId,itemId:ee.itemId}),C(ee.id)},[h,t,e,C]),T=(0,Tt.useMemo)(()=>`
393
+ }`},[i,o]);let a={config:r,mode:r.mode,cssVariables:o};return(0,HE.jsx)(IE.Provider,{value:a,children:t})}function Gm(){let t=(0,Ui.useContext)(IE);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var It=X(Qe(),1);var Rn=X($e(),1);function mD({widgetId:t,props:e}){let n=$i(),i=(0,It.useRef)(null),r=(0,It.useRef)(null),o=n?.widgets,a=o?.has(t)??!1,[,s]=(0,It.useReducer)(l=>l+1,0);return(0,It.useEffect)(()=>{if(!(!o||a))return o.subscribe(l=>{l.type==="registered"&&l.widgetId===t&&s()})},[o,t,a]),(0,It.useEffect)(()=>{if(!i.current||!o||!a)return;let l=o.mount(t,i.current,e);return r.current=l,()=>{l.unmount(),r.current=null}},[o,t,e,a]),!o||!o.has(t)?(0,Rn.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Rn.jsx)("div",{ref:i,style:{width:"100%",minHeight:"40px"}})}function Ql({config:t,surface:e,telemetry:n,style:i}){let{title:r,widget:o,props:a}=t,[,s]=(0,It.useState)(0),l=$i();(0,It.useEffect)(()=>{l&&s(b=>b+1)},[l]);let[c,u]=(0,It.useState)(!1),d=(0,It.useCallback)(()=>u(!0),[]),h=(0,It.useCallback)(()=>u(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:c?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:c?"scale(1.01)":"scale(1)",...i},S={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:"72px"},_={width:"40px",height:"40px",borderRadius:"10px",background:"var(--sc-tile-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:"var(--sc-tile-icon-shadow)"};return(0,Rn.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:d,onMouseLeave:h,children:[(0,Rn.jsxs)("div",{style:S,children:[(0,Rn.jsx)("div",{style:_,children:"+"}),(0,Rn.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Rn.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r??o})})]}),(0,Rn.jsx)("div",{style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Rn.jsx)("div",{style:{paddingTop:"0.875rem"},children:(0,Rn.jsx)(mD,{widgetId:o,props:a})})})]})}var pe=X($e(),1),zE="syntro-launcher-styles";function vD(t,e){if(t.querySelector(`#${zE}`))return;let n=document.createElement("style");n.id=zE,n.textContent=e,t.appendChild(n)}function BE({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherAnimate:r=!1,launcherAnimationStyle:o="pulse",notificationCount:a,footerSlot:s,tiles:l,isLoading:c,error:u,canvasTitle:d,displayMode:h="standard"}){let[g,S]=(0,kt.useState)(!1),[_,b]=(0,kt.useState)(null),f=(0,kt.useRef)(null),p=$i(),{shadowRoot:v,portalRoot:y}=ss(),{config:w}=Gm(),{notifications:T,dismiss:x}=Hm(p?.events??null,l);zm(p,l,p?.apps);let k=(0,kt.useCallback)(J=>{p&&p.events.publish(Se.NOTIFICATION_CLICKED,{notificationId:J.id,tileId:J.tileId,itemId:J.itemId}),t||e(),p&&J.tileId&&p.events.publish(Se.NOTIFICATION_DEEP_LINK,{tileId:J.tileId,itemId:J.itemId}),x(J.id)},[p,t,e,x]),C=(0,kt.useMemo)(()=>`
394
394
  @keyframes syntro-launcher-pulse {
395
395
  0%, 100% {
396
- box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${S.colorPrimary}66;
396
+ box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${w.colorPrimary}66;
397
397
  }
398
398
  50% {
399
- box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${S.colorPrimary}00;
399
+ box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${w.colorPrimary}00;
400
400
  }
401
401
  }
402
402
  @keyframes syntro-launcher-glow {
403
403
  0%, 100% { border-color: rgba(255,255,255,0.1); }
404
- 50% { border-color: ${S.colorPrimaryHover}99; }
404
+ 50% { border-color: ${w.colorPrimaryHover}99; }
405
405
  }
406
406
  .syntro-launcher-animate {
407
407
  animation: syntro-launcher-pulse 2s ease-in-out infinite, syntro-launcher-glow 2s ease-in-out infinite;
@@ -412,8 +412,8 @@ ${l}
412
412
  75%, 100% { transform: scale(2.2); opacity: 0; }
413
413
  }
414
414
  @keyframes syntro-badge-glow {
415
- 0%, 100% { box-shadow: 0 0 8px 2px ${S.colorPrimaryHover}4d; }
416
- 50% { box-shadow: 0 0 20px 6px ${S.colorPrimaryHover}80; }
415
+ 0%, 100% { box-shadow: 0 0 8px 2px ${w.colorPrimaryHover}4d; }
416
+ 50% { box-shadow: 0 0 20px 6px ${w.colorPrimaryHover}80; }
417
417
  }
418
418
  @keyframes syntro-badge-bounce {
419
419
  0%, 100% { transform: translateY(0); }
@@ -423,8 +423,7 @@ ${l}
423
423
  .syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
424
424
  .syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
425
425
  .syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
426
- `,[S.colorPrimary,S.colorPrimaryHover]);(0,Tt.useEffect)(()=>{t&&l.forEach(ee=>{if(n?.trackRectangleViewed(ee.id,"overlay"),h){let me=Wl.tileViewed(ee.id,"overlay");h.events.publish(me.name,me.props,me.source)}})},[n,h,t,l]),(0,Tt.useEffect)(()=>{_(!0),KN(y,T)},[y,T]);let E=(0,Tt.useCallback)(()=>{let ee=!t;if(ee?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),h){let me=ee?Wl.canvasOpened("overlay"):Wl.canvasClosed("overlay");h.events.publish(me.name,me.props,me.source)}e()},[t,n,h,e]),M=(0,Tt.useCallback)(ee=>{let me=ee.currentTarget.getBoundingClientRect();f.current={startX:ee.clientX,startY:ee.clientY,startElX:me.left,startElY:me.top,dragged:!1},ee.currentTarget.setPointerCapture(ee.pointerId)},[]),N=(0,Tt.useCallback)(ee=>{let me=f.current;if(!me)return;let Ke=ee.clientX-me.startX,Mt=ee.clientY-me.startY;(Math.abs(Ke)>5||Math.abs(Mt)>5)&&(me.dragged=!0),me.dragged&&x({x:me.startElX+Ke,y:me.startElY+Mt})},[]),I=(0,Tt.useCallback)(ee=>{let me=f.current;f.current=null,me&&!me.dragged&&E()},[E]),H=p==="focused",q=S.canvas.position==="right",V=2147483600,ie={display:"flex",flexDirection:"column",width:H?"40vw":S.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:H?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:H?`${S.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:H?`${S.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...H?{}:{maskImage:q?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:q?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":q?"translateX(120%)":"translateX(-120%)"},Y=(0,pe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:V},children:(0,pe.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:q?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-container",style:ie,children:[H&&d&&(0,pe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,pe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:d})}),(0,pe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:H?"0":"1rem"},children:c?(0,pe.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:H?"1rem":"0"},children:"Loading..."}):u?(0,pe.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:H?"1rem":"0"},children:["Failed to load: ",u]}):H?l.length>0?(0,pe.jsx)(Xl,{config:l[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,pe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(ee=>(0,pe.jsx)(Xl,{config:ee,surface:"overlay",telemetry:n,style:{width:"100%"}},ee.id))})}),s]}),(0,pe.jsx)("div",{onClick:E,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return g?(0,pe.jsxs)(pe.Fragment,{children:[(0,Fm.createPortal)((0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:V+47},children:[(0,pe.jsx)(wm,{notifications:w,onDismiss:C,onClickNotification:k,position:S.canvas.position??"right"}),(0,pe.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...b?{top:b.y,left:b.x}:{bottom:"2.5rem",right:q?"2.5rem":void 0,left:q?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"9999px",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:f.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:f.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:M,onPointerMove:N,onPointerUp:I,onMouseEnter:ee=>{f.current?.dragged||(ee.currentTarget.style.backgroundColor=S.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:ee=>{f.current?.dragged||(ee.currentTarget.style.backgroundColor=S.launcher.background??"var(--sc-launcher-background)")},children:[(0,pe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M18 6L6 18"}),(0,pe.jsx)("path",{d:"M6 6l12 12"})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,pe.jsx)("path",{d:"M5 3v4"}),(0,pe.jsx)("path",{d:"M3 5h4"}),(0,pe.jsx)("path",{d:"M19 17v4"}),(0,pe.jsx)("path",{d:"M17 19h4"})]})}),!t&&w.length>0&&(0,pe.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,pe.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${S.colorPrimaryHover}66`}}),(0,pe.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,pe.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:S.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:w.length>99?"99+":w.length})]})]})]}),m),t?(0,Fm.createPortal)(Y,m):null]}):null}var ai=X(Qe(),1);var QN=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function yE({fetcher:t,experiments:e,runtime:n,pageUrl:i}){let[r,o]=(0,ai.useState)({tiles:[],actions:[],isLoading:!0}),a=(0,ai.useRef)("[]"),s=(0,ai.useCallback)(async()=>{try{o(g=>({...g,isLoading:!0,error:void 0}));let l=await t();G("SmartCanvas Config","Raw config response",l);let c=l.tiles||[];n?(c=await n.filterTiles(c),e&&(c=c.filter(g=>e.shouldRenderRectangle(g)))):e&&(c=c.filter(g=>e.shouldRenderRectangle(g))),G("SmartCanvas Config",`Tile count after filtering: ${c.length}`);let u=l.actions||[],d=JSON.stringify(u),p=d!==a.current;p&&(a.current=d),o(g=>({tiles:QN(c),actions:p?u:g.actions,isLoading:!1,fetchedAt:l.fetchedAt,canvasTitle:l.canvasTitle,configVersion:l.configVersion,theme:l.theme,launcher:l.launcher}))}catch(l){let c=l instanceof Error?l.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",c,l),o(u=>({...u,isLoading:!1,error:c}))}},[e,t,n]);return(0,ai.useEffect)(()=>{if(s(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>s())},[s,e,i]),(0,ai.useMemo)(()=>r,[r])}var ls=X(Fe(),1);function _E({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:p="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:_,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:h}){return c?(0,ls.jsx)(Mm,{runtime:c,children:(0,ls.jsx)(bE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:p,overlayFetchCredentials:g,footerSlot:_,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:h})}):(0,ls.jsx)(bE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:p,overlayFetchCredentials:g,footerSlot:_,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:h})}function bE({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:p="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:_,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:h}){let[y,m]=(0,Gt.useState)(t.getState().open),S=Nm(),[w,C]=(0,Gt.useState)(()=>typeof window<"u"?window.location.href:"/"),k=S?.url??w;(0,Gt.useEffect)(()=>{if(c||typeof window>"u")return;let V=()=>C(window.location.href);window.addEventListener("popstate",V),window.addEventListener("hashchange",V);let ie=history.pushState,D=history.replaceState;return history.pushState=function(...Y){ie.apply(this,Y),queueMicrotask(V)},history.replaceState=function(...Y){D.apply(this,Y),queueMicrotask(V)},()=>{window.removeEventListener("popstate",V),window.removeEventListener("hashchange",V),history.pushState=ie,history.replaceState=D}},[c]);let T=(0,Gt.useMemo)(()=>e||is({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:o}),[e,n,s,i,r,o]),E=yE({fetcher:T,experiments:s,runtime:c,pageUrl:k}),M=E.tiles.length>0&&!E.error;(0,Gt.useEffect)(()=>t.subscribe(V=>m(V.open)),[t]),(0,Gt.useEffect)(()=>{!E.isLoading&&!M&&t.getState().open&&t.setOpen(!1)},[t,M,E.isLoading]);let N=(0,Gt.useRef)(f??null),I=(0,Gt.useRef)(!!f);(0,Gt.useEffect)(()=>{if(!c?.actions)return;if(I.current){E.actions.length>0&&(I.current=!1);return}let V=!1;return(async()=>{if(N.current){console.log("[SmartCanvasApp] Reverting previous action batch before re-apply");try{await N.current.revertAll()}catch(D){console.error("[SmartCanvasApp] Failed to revert actions:",D)}N.current=null}if(!V&&E.actions.length>0){console.log(`[SmartCanvasApp] Applying ${E.actions.length} action(s):`,E.actions.map((D,Y)=>`[${Y}] ${D.kind}${D.anchorId?` anchor="${D.anchorId}"`:""}${D.label?` "${D.label}"`:""}`).join(", "));try{let D=await c.actions.applyBatch(E.actions);V?await D.revertAll():(N.current=D,console.log("[SmartCanvasApp] Action batch applied successfully"))}catch(D){V||console.error("[SmartCanvasApp] Failed to apply actions:",D,`
427
- Actions that failed:`,JSON.stringify(E.actions,null,2))}}})(),()=>{V=!0,N.current&&(console.log("[SmartCanvasApp] Cleanup: reverting action batch (actions changed or unmount)"),N.current.revertAll().catch(D=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",D)}),N.current=null)}},[c,E.actions,k]),(0,Gt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let{shadowRoot:H}=as(),q=E.theme;return!E.isLoading&&!M?null:(0,ls.jsx)(Bm,{themeConfig:q,workspaceTheme:h,shadowRoot:H,children:(0,ls.jsx)(vE,{tiles:E.tiles,isLoading:E.isLoading,error:E.error,canvasTitle:E.canvasTitle,telemetry:l,launcherLabel:b??E.launcher?.label,launcherAnimate:E.launcher?.animate,launcherAnimationStyle:E.launcher?.animationStyle,notificationCount:E.launcher?.notificationCount??E.tiles.length,footerSlot:_,isOpen:y,onToggle:()=>t.toggle(),displayMode:E.displayMode})})}var Vm=X(Fe(),1),xE="smart-canvas",SE=`
426
+ `,[w.colorPrimary,w.colorPrimaryHover]);(0,kt.useEffect)(()=>{t&&l.forEach(J=>{if(n?.trackRectangleViewed(J.id,"overlay"),p){let me=Kl.tileViewed(J.id,"overlay");p.events.publish(me.name,me.props,me.source)}})},[n,p,t,l]),(0,kt.useEffect)(()=>{S(!0),vD(v,C)},[v,C]);let E=(0,kt.useCallback)(()=>{let J=!t;if(J?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let me=J?Kl.canvasOpened("overlay"):Kl.canvasClosed("overlay");p.events.publish(me.name,me.props,me.source)}e()},[t,n,p,e]),M=(0,kt.useCallback)(J=>{let me=J.currentTarget.getBoundingClientRect();f.current={startX:J.clientX,startY:J.clientY,startElX:me.left,startElY:me.top,dragged:!1},J.currentTarget.setPointerCapture(J.pointerId)},[]),I=(0,kt.useCallback)(J=>{let me=f.current;if(!me)return;let Ke=J.clientX-me.startX,Mt=J.clientY-me.startY;(Math.abs(Ke)>5||Math.abs(Mt)>5)&&(me.dragged=!0),me.dragged&&b({x:me.startElX+Ke,y:me.startElY+Mt})},[]),N=(0,kt.useCallback)(J=>{let me=f.current;f.current=null,me&&!me.dragged&&E()},[E]),F=h==="focused",Y=w.canvas.position==="right",z=2147483600,te={display:"flex",flexDirection:"column",width:F?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:F?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:F?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:F?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...F?{}:{maskImage:Y?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:Y?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":Y?"translateX(120%)":"translateX(-120%)"},Z=(0,pe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:z},children:(0,pe.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:Y?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-container",style:te,children:[F&&d&&(0,pe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,pe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:d})}),(0,pe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,pe.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):u?(0,pe.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",u]}):F?l.length>0?(0,pe.jsx)(Ql,{config:l[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,pe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(J=>(0,pe.jsx)(Ql,{config:J,surface:"overlay",telemetry:n,style:{width:"100%"}},J.id))})}),s]}),(0,pe.jsx)("div",{onClick:E,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return g?(0,pe.jsxs)(pe.Fragment,{children:[(0,Ym.createPortal)((0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:z+47},children:[(0,pe.jsx)(Mm,{notifications:T,onDismiss:x,onClickNotification:k,position:w.canvas.position??"right"}),(0,pe.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",..._?{top:_.y,left:_.x}:{bottom:"2.5rem",right:Y?"2.5rem":void 0,left:Y?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"9999px",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:f.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:f.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:M,onPointerMove:I,onPointerUp:N,onMouseEnter:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[(0,pe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M18 6L6 18"}),(0,pe.jsx)("path",{d:"M6 6l12 12"})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,pe.jsx)("path",{d:"M5 3v4"}),(0,pe.jsx)("path",{d:"M3 5h4"}),(0,pe.jsx)("path",{d:"M19 17v4"}),(0,pe.jsx)("path",{d:"M17 19h4"})]})}),!t&&T.length>0&&(0,pe.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,pe.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,pe.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,pe.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:T.length>99?"99+":T.length})]})]})]}),y),t?(0,Ym.createPortal)(Z,y):null]}):null}var ai=X(Qe(),1);var yD=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function FE({fetcher:t,experiments:e,runtime:n,pageUrl:i}){let[r,o]=(0,ai.useState)({tiles:[],actions:[],isLoading:!0}),a=(0,ai.useRef)("[]"),s=(0,ai.useCallback)(async()=>{try{o(g=>({...g,isLoading:!0,error:void 0}));let l=await t();G("SmartCanvas Config","Raw config response",l);let c=l.tiles||[];n?(c=await n.filterTiles(c),e&&(c=c.filter(g=>e.shouldRenderRectangle(g)))):e&&(c=c.filter(g=>e.shouldRenderRectangle(g))),G("SmartCanvas Config",`Tile count after filtering: ${c.length}`);let u=l.actions||[],d=JSON.stringify(u),h=d!==a.current;h&&(a.current=d),o(g=>({tiles:yD(c),actions:h?u:g.actions,isLoading:!1,fetchedAt:l.fetchedAt,canvasTitle:l.canvasTitle,configVersion:l.configVersion,theme:l.theme,launcher:l.launcher}))}catch(l){let c=l instanceof Error?l.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",c,l),o(u=>({...u,isLoading:!1,error:c}))}},[e,t,n]);return(0,ai.useEffect)(()=>{if(s(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>s())},[s,e,i]),(0,ai.useMemo)(()=>r,[r])}var cs=X($e(),1);function UE({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){return c?(0,cs.jsx)(Fm,{runtime:c,children:(0,cs.jsx)($E,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}):(0,cs.jsx)($E,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}function $E({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){let[v,y]=(0,Gt.useState)(t.getState().open),w=$m(),[T,x]=(0,Gt.useState)(()=>typeof window<"u"?window.location.href:"/"),k=w?.url??T;(0,Gt.useEffect)(()=>{if(c||typeof window>"u")return;let z=()=>x(window.location.href);window.addEventListener("popstate",z),window.addEventListener("hashchange",z);let te=history.pushState,L=history.replaceState;return history.pushState=function(...Z){te.apply(this,Z),queueMicrotask(z)},history.replaceState=function(...Z){L.apply(this,Z),queueMicrotask(z)},()=>{window.removeEventListener("popstate",z),window.removeEventListener("hashchange",z),history.pushState=te,history.replaceState=L}},[c]);let C=(0,Gt.useMemo)(()=>e||rs({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:o}),[e,n,s,i,r,o]),E=FE({fetcher:C,experiments:s,runtime:c,pageUrl:k}),M=E.tiles.length>0&&!E.error;(0,Gt.useEffect)(()=>t.subscribe(z=>y(z.open)),[t]),(0,Gt.useEffect)(()=>{!E.isLoading&&!M&&t.getState().open&&t.setOpen(!1)},[t,M,E.isLoading]);let I=(0,Gt.useRef)(f??null),N=(0,Gt.useRef)(!!f);(0,Gt.useEffect)(()=>{if(!c?.actions)return;if(N.current){E.actions.length>0&&(N.current=!1);return}let z=!1;return(async()=>{if(I.current){try{await I.current.revertAll()}catch(L){console.error("[SmartCanvasApp] Failed to revert actions:",L)}I.current=null}if(!z&&E.actions.length>0)try{let L=await c.actions.applyBatch(E.actions);z?await L.revertAll():I.current=L}catch(L){z||console.error("[SmartCanvasApp] Failed to apply actions:",L)}})(),()=>{z=!0,I.current&&(I.current.revertAll().catch(L=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",L)}),I.current=null)}},[c,E.actions,k]),(0,Gt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let{shadowRoot:F}=ss(),Y=E.theme;return!E.isLoading&&!M?null:(0,cs.jsx)(Zm,{themeConfig:Y,workspaceTheme:p,shadowRoot:F,children:(0,cs.jsx)(BE,{tiles:E.tiles,isLoading:E.isLoading,error:E.error,canvasTitle:E.canvasTitle,telemetry:l,launcherLabel:_??E.launcher?.label,launcherAnimate:E.launcher?.animate,launcherAnimationStyle:E.launcher?.animationStyle,notificationCount:E.launcher?.notificationCount??E.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:E.displayMode})})}var Xm=X($e(),1),VE="smart-canvas",jE=`
428
427
  :host {
429
428
  font: inherit;
430
429
  color: inherit;
@@ -438,12 +437,12 @@ Actions that failed:`,JSON.stringify(E.actions,null,2))}}})(),()=>{V=!0,N.curren
438
437
  *, *::before, *::after {
439
438
  box-sizing: border-box;
440
439
  }
441
- `,On,$r,Fr,Vi,ji,Ur,Pi,Um=class extends HTMLElement{constructor(){super();ar(this,On);ar(this,$r);ar(this,Fr);ar(this,Vi);ar(this,ji);ar(this,Ur,null);ar(this,Pi,null);Kn(this,On,this.attachShadow({mode:"open",delegatesFocus:!0})),Kn(this,$r,document.createElement("div")),ge(this,$r).setAttribute("part","mount"),ge(this,On).appendChild(ge(this,$r)),Kn(this,Fr,document.createElement("div")),ge(this,Fr).id="portalRoot",ge(this,On).appendChild(ge(this,Fr)),Kn(this,Vi,document.createElement("div")),ge(this,Vi).id="overlayContainer",Object.assign(ge(this,Vi).style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),ge(this,On).appendChild(ge(this,Vi)),Kn(this,ji,lE()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Ur)?.unmount(),Kn(this,Ur,null)}getMountNode(){return ge(this,$r)}getController(){return ge(this,ji)}getPortalRoot(){return ge(this,Fr)}getOverlayContainer(){return ge(this,Vi)}getShadowRoot(){return ge(this,On)}open(){ge(this,ji).setOpen(!0)}close(){ge(this,ji).setOpen(!1)}toggle(){ge(this,ji).toggle()}setOverrideFetcher(n){ge(this,Pi)&&(Kn(this,Pi,{...ge(this,Pi),fetcher:n}),this.render())}mountReactApp(n){Kn(this,Pi,n),this.render()}render(){!this.isConnected||!ge(this,Pi)||(ge(this,Ur)||Kn(this,Ur,(0,wE.createRoot)(ge(this,$r))),ge(this,Ur).render((0,Vm.jsx)(uE,{shadowRoot:ge(this,On),portalRoot:ge(this,Fr),overlayContainer:ge(this,Vi),children:(0,Vm.jsx)(_E,{...ge(this,Pi),controller:ge(this,ji),canvasHost:this})})))}applyBaseStyles(){if(ge(this,On).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(SE),ge(this,On).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=SE,ge(this,On).appendChild(n)}}};On=new WeakMap,$r=new WeakMap,Fr=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Ur=new WeakMap,Pi=new WeakMap;var EE=()=>{typeof window>"u"||customElements.get(xE)||customElements.define(xE,Um)};var jm=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let x=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=Qw(x)}let n=null,i=null,r=null,{runtime:o}=t;async function a(x){!o?.actions||x.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(x))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();n=x,console.log("[SmartCanvas] Config fetched:",`tiles=${x.tiles?.length??0},`,`actions=${x.actions?.length??0},`,`theme=${x.theme?.mode??"default"}`),x.actions?.length&&console.log("[SmartCanvas] Actions to apply:",x.actions.map((f,h)=>`[${h}] ${f.kind}${f.anchorId?` anchor="${f.anchorId}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await a(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&Fd(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=iE();EE();let c=document.createElement("smart-canvas");if(aE(c.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))c.style.setProperty(x,f);let u=()=>{let x=t.target??document.body;x&&x.appendChild(c)};document.body?u():document.addEventListener("DOMContentLoaded",u,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),rE(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,p=t.integrations?.telemetry,g=t.fetcher??is({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=g);let _={fetcher:g,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:p,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:r,workspaceTheme:t.workspaceTheme};c.mountReactApp(_),t.defaultOpen&&c.open();let b={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{s(),c.remove()},setTokens:x=>{for(let[f,h]of Object.entries(x))c.style.setProperty(f,h)},getConfig:async()=>{if(i)try{let x=await i();return n=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return n??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?n&&await a(n.actions):await s()},setOverrideFetcher:x=>{i=x,c.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&Fd(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{p?.register?.(x)},getSessionId:()=>p?.getSessionId?.(),startSessionRecording:()=>{p?.startSessionRecording?.()},track:(x,f)=>p?.track?(p.track(x,f),!0):!1,runtime:o};if(typeof window<"u"){let x=window.SynOS;x&&(x.handle=b)}return b};typeof window<"u"&&(window.SmartCanvas={async create(t){return jm(t)}});var jr=X(Qe(),1);var Vr=X(Fe(),1);function Pz({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,jr.useState)(0),o=(0,jr.useMemo)(()=>[...t].sort((a,s)=>(a.priority??0)-(s.priority??0)),[t]);return(0,jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,jr.useEffect)(()=>{if(o.length<=1)return;let a=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(a)},[o,e]),(0,jr.useEffect)(()=>{let a=o[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,o,n]),o.length?(0,Vr.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:"var(--sc-tile-border)",background:"var(--sc-tile-background)",padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,Vr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${o.length*100}%`},children:o.map(a=>(0,Vr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Vr.jsx)(Xl,{config:a,surface:"wheel",telemetry:n})},a.id))}),(0,Vr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((a,s)=>(0,Vr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},a.id))})]}):null}function Kl(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function Gz(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",o=Kl(r),a=Kl(zr);return o.major>a.major&&e.push(`Config schema v${r} is newer than SDK v${zr}. Some features may not work. Update SDK to latest version.`),o.major<a.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${zr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:JN(i,r)}):{valid:!0,warnings:e,errors:n}}function JN(t,e){let n={...t};return Kl(e).major===1&&(n=eD(n)),n.schemaVersion=zr,n}function eD(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function Yz(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=Kl(n),r=Kl(zr);return i.major<r.major||!e.schemaVersion}var AE={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function kE(){return AE}function Pm(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Ql(t,e,n){return n===2?Pm(Pm(t+e)+"")%1e4/1e4:n===1?Pm(e+t)%1e3/1e3:null}function tD(t){return t<=0?[]:new Array(t).fill(1/t)}function qd(t,e){return t>=e[0]&&t<e[1]}function TE(t,e){let n=Ql("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function RE(t,e){for(let n=0;n<e.length;n++)if(qd(t,e[n]))return n;return-1}function Zm(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Zd(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let o=rD(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else n=!0,o&&(i=!0)}return i||!n}function nD(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function iD(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,o)=>{i.push([t.searchParams.get(o)||"",r,!1])}),!i.some(r=>!nD(r[0],r[1],r[2]))}catch{return!1}}function rD(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=Zm(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return iD(i,n);return!1}catch{return!1}}function OE(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=tD(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,s)=>s+a,0);(r<.99||r>1.01)&&(n=i);let o=0;return n.map(a=>{let s=o;return o+=a,[s,s+e*a]})}function ME(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function NE(t){try{return t()}catch(e){return console.error(e),!1}}var qm=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Ho(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||AE.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",qm(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:qm(r)},i,qm(o));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function Jl(t){return typeof t=="string"?t:JSON.stringify(t)}function pn(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function DE(){let t;try{t="1.6.4"}catch{t=""}return t}function LE(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,o)=>{i.searchParams.has(o)||i.searchParams.set(o,r)}),i.toString()}function CE(t){return typeof t=="object"&&t!==null}function Gd(t){return t.urlPatterns&&t.variations.some(e=>CE(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>CE(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Yd(t,e){return new Promise(n=>{let i=!1,r,o=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>o(),e)),t.then(a=>o(a)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},si=kE(),cs={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>si.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return si.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new si.EventSource(`${t}/sub/${e}`,{headers:n}):new si.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),sD()):document.visibilityState==="hidden"&&(t=window.setTimeout(aD,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(si.localStorage=globalThis.localStorage)}catch{}var us=new Map,IE=!1,qi=new Map,Wd=new Map,ds=new Map,fs=new Set;function zE(t){Object.assign(Rt,t),Rt.backgroundSync||Qm()}async function BE({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Rt.backgroundSync=!1),lD({instance:t,allowStale:i,timeout:e,skipCache:n})}function oD(t){let e=ec(t),n=us.get(e)||new Set;n.add(t),us.set(e,n)}function $E(t){us.forEach(e=>e.delete(t))}function aD(){ds.forEach(t=>{t&&(t.state="idle",Xm(t))})}function sD(){ds.forEach(t=>{t&&t.state==="idle"&&Km(t)})}async function HE(){try{if(!si.localStorage)return;await si.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(qi.entries())))}catch{}}async function lD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=ec(t),o=Ym(t),a=new Date,s=new Date(a.getTime()-Rt.maxAge+Rt.staleTTL);await cD();let l=!Rt.disableCache&&!i?qi.get(o):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>s?(l.sse&&fs.add(r),l.staleAt<a?Gm(t):Wm(t),{data:l.data,success:!0,source:"cache"}):await Yd(Gm(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function ec(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function Ym(t){let e=ec(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let o=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:a})}`}async function cD(){if(!IE){IE=!0;try{if(si.localStorage){let t=await si.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{qi.set(n,{...i,staleAt:new Date(i.staleAt)})}),FE()}}}catch{}if(!Rt.disableIdleStreams){let t=cs.startIdleListener();t&&(cs.stopIdleListener=t)}}}function FE(){let t=Array.from(qi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,qi.size-Rt.maxEntries),qi.size);for(let n=0;n<e;n++)qi.delete(t[n].key)}function UE(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:qi.get(e);if(o&&i&&o.version===i){o.staleAt=r,HE();return}Rt.disableCache||(qi.set(e,{data:n,version:i,staleAt:r,sse:fs.has(t)}),FE()),HE();let a=us.get(t);a&&a.forEach(s=>uD(s,n))}async function uD(t,e){await t.setPayload(e||t.getPayload())}async function Gm(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=ec(t),a=Ym(t),s=Wd.get(a);return s||(s=(r?cs.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):cs.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&fs.add(o),c.json()}).then(c=>(UE(o,a,c),Wm(t),Wd.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(Wd.delete(a),{data:null,source:"error",success:!1,error:c})),Wd.set(a,s)),s}function Wm(t,e=!1){let n=ec(t),i=Ym(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),a=t.getClientKey();if(e&&fs.add(n),Rt.backgroundSync&&fs.has(n)&&si.EventSource){if(ds.has(n))return;let s={src:null,host:r,clientKey:a,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=us.get(n);c&&c.forEach(u=>{Gm(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);UE(n,i,c)}s.errors=0}catch{VE(s)}},errors:0,state:"active"};ds.set(n,s),Km(s)}}function VE(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);Xm(t),setTimeout(()=>{["idle","active"].includes(t.state)||Km(t)},Math.min(e,3e5))}}function Xm(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Km(t){t.src=cs.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>VE(t),t.src.onopen=()=>{t.errors=0}}function dD(t,e){Xm(t),ds.delete(e)}function Qm(){fs.clear(),ds.forEach(dD),us.clear(),cs.stopIdleListener()}function Xd(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Wm(t,!0),oD(t)}}var fD=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,tv={revert:function(){}},ef=new Map,nv=new Set;function pD(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function tf(t){var e=ef.get(t);return e||(e={element:t,attributes:{}},ef.set(t,e)),e}function nf(t,e,n,i,r){var o=n(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&a._positionTimeout)){e==="position"&&(a._positionTimeout=setTimeout(function(){a._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===a.virtualValue.parentNode&&s.insertBeforeNode===a.virtualValue.insertBeforeNode||s!==a.virtualValue&&(a.originalValue=s,r(a))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,pD(e)),a}function rf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,jE()):t!==n&&(e.isDirty=!0,jE())}function hD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),rf(TD(e),t)}function gD(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),rf(Array.from(e).filter(Boolean).join(" "),t)}function mD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),rf(e,t)}function vD(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function yD(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=vD(i);e=r||e}),rf(e,t)}var bD=function(e){return e.innerHTML},_D=function(e,n){return e.innerHTML=n};function qE(t){var e=tf(t);return e.html||(e.html=nf(t,"html",bD,_D,hD)),e.html}var xD=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},SD=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function ZE(t){var e=tf(t);return e.position||(e.position=nf(t,"position",xD,SD,yD)),e.position}var wD=function(e,n){return n?e.className=n:e.removeAttribute("class")},ED=function(e){return e.className};function GE(t){var e=tf(t);return e.classes||(e.classes=nf(t,"class",ED,wD,gD)),e.classes}var CD=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},AD=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function YE(t,e){var n=tf(t);return n.attributes[e]||(n.attributes[e]=nf(t,e,CD(e),AD(e),mD)),n.attributes[e]}function kD(t,e){var n=ef.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var o,a;(o=n.classes)==null||(a=o.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,d;(c=n.attributes)==null||(u=c[e])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[e]}}var Kd;function TD(t){return Kd||(Kd=document.createElement("div")),Kd.innerHTML=t,Kd.innerHTML}function Qd(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||kD(t,e),n.setValue(t,i)}}function RD(t,e){t.html&&Qd(e,"html",t.html),t.classes&&Qd(e,"class",t.classes),t.position&&Qd(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){Qd(e,n,t.attributes[n])})}function jE(){ef.forEach(RD)}function OD(t,e){var n=null;t.kind==="html"?n=qE(e):t.kind==="class"?n=GE(e):t.kind==="attribute"?n=YE(e,t.attribute):t.kind==="position"&&(n=ZE(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function MD(t,e){var n=null;if(t.kind==="html"?n=qE(e):t.kind==="class"?n=GE(e):t.kind==="attribute"?n=YE(e,t.attribute):t.kind==="position"&&(n=ZE(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function WE(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),OD(t,i))})}}function ND(t){t.elements.forEach(function(e){return MD(t,e)}),t.elements.clear(),nv.delete(t)}function PE(){nv.forEach(WE)}var Jm;function DD(){typeof document>"u"||(Jm||(Jm=new MutationObserver(function(){PE()})),PE(),Jm.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}DD();function of(t){return typeof document>"u"?tv:(nv.add(t),WE(t),{revert:function(){ND(t)}})}function ev(t,e){return of({kind:"html",elements:new Set,mutate:e,selector:t})}function XE(t,e){return of({kind:"position",elements:new Set,mutate:e,selector:t})}function tc(t,e){return of({kind:"class",elements:new Set,mutate:e,selector:t})}function Jd(t,e,n){return fD.test(e)?e==="class"||e==="className"?tc(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return i.add(o)})}):of({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):tv}function LD(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return ev(e,function(s){return s+(i??"")});if(n==="set")return ev(e,function(){return i??""})}else if(r==="class"){if(n==="append")return tc(e,function(s){i&&s.add(i)});if(n==="remove")return tc(e,function(s){i&&s.delete(i)});if(n==="set")return tc(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&o)return XE(e,function(){return{insertBeforeSelector:a,parentSelector:o}})}else{if(n==="append")return Jd(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return Jd(e,r,function(){return i??""});if(n==="remove")return Jd(e,r,function(){return null})}return tv}var ID={html:ev,classes:tc,attribute:Jd,position:XE,declarative:LD},KE=ID;var iv={};function Pr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!eC(t,r,n))return!1;break;case"$nor":if(eC(t,r,n))return!1;break;case"$and":if(!FD(t,r,n))return!1;break;case"$not":if(Pr(t,r,n))return!1;break;default:if(!nc(r,HD(t,i),n))return!1}return!0}function HD(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function QE(t,e=!1){let n=`${t}${e?"/i":""}`;return iv[n]||(iv[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),iv[n]}function nc(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!tC(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!$D(r,e,t[r],n))return!1;return!0}function tC(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function zD(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function BD(t,e,n){if(!Array.isArray(t))return!1;let i=tC(e)?r=>nc(e,r,n):r=>Pr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function ps(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>i(r)===i(o))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function JE(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let a=0;a<t.length;a++)if(nc(e[r],t[a],n,i)){o=!0;break}if(!o)return!1}return!0}function $D(t,e,n,i){switch(t){case"$veq":return pn(e)===pn(n);case"$vne":return pn(e)!==pn(n);case"$vgt":return pn(e)>pn(n);case"$vgte":return pn(e)>=pn(n);case"$vlt":return pn(e)<pn(n);case"$vlte":return pn(e)<=pn(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?ps(e,n):!1;case"$ini":return Array.isArray(n)?ps(e,n,!0):!1;case"$inGroup":return ps(e,i[n]||[]);case"$notInGroup":return!ps(e,i[n]||[]);case"$nin":return Array.isArray(n)?!ps(e,n):!1;case"$nini":return Array.isArray(n)?!ps(e,n,!0):!1;case"$not":return!nc(n,e,i);case"$size":return Array.isArray(e)?nc(n,e.length,i):!1;case"$elemMatch":return BD(e,n,i);case"$all":return Array.isArray(n)?JE(e,n,i):!1;case"$alli":return Array.isArray(n)?JE(e,n,i,!0):!1;case"$regex":try{return QE(n).test(e)}catch{return!1}case"$regexi":try{return QE(n,!0).test(e)}catch{return!1}case"$type":return zD(e)===n;default:return console.error("Unknown operator: "+t),!1}}function eC(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Pr(t,e[i],n))return!0;return!1}function FD(t,e,n){for(let i=0;i<e.length;i++)if(!Pr(t,e[i],n))return!1;return!0}var UD="Feature Evaluated",VD="Experiment Viewed";function jD(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function PD(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function hs(t){try{await t()}catch{}}function nC(t,e,n){if(t.user.trackedExperiments){let r=lf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(hs(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(hs(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(hs(()=>r(VD,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function qD(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;hs(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;hs(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;hs(()=>i(UD,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function af(t,e){if(e.stack.evaluatedFeatures.has(t))return qr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=jD(e);if(n.has(t))return qr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return qr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of i.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=af(l.id,e);if(c.source==="cyclicPrerequisite")return qr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Pr(u,l.condition||{})){if(l.gate)return qr(e,t,null,"prerequisite");continue e}}if(o.filters&&oC(o.filters,e))continue;if("force"in o){if(o.condition&&!rC(o.condition,e)||!ZD(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!nC(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),qr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let a={variations:o.variations,key:o.key||t};"coverage"in o&&(a.coverage=o.coverage),o.weights&&(a.weights=o.weights),o.hashAttribute&&(a.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(a.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(a.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(a.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(a.minBucketVersion=o.minBucketVersion),o.namespace&&(a.namespace=o.namespace),o.meta&&(a.meta=o.meta),o.ranges&&(a.ranges=o.ranges),o.name&&(a.name=o.name),o.phase&&(a.phase=o.phase),o.seed&&(a.seed=o.seed),o.hashVersion&&(a.hashVersion=o.hashVersion),o.filters&&(a.filters=o.filters),o.condition&&(a.condition=o.condition);let{result:s}=sf(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,s),s.inExperiment&&!s.passthrough)return qr(e,t,s.value,"experiment",o.id,a,s)}}return qr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function sf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:je(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:je(n,t,-1,!1,e)};if(t=GD(t,n),t.urlPatterns&&!Zd(n.user.url||"",t.urlPatterns))return{result:je(n,t,-1,!1,e)};let o=ME(i,n.user.url||"",r);if(o!==null)return{result:je(n,t,o,!1,e)};let a=PD(n);if(i in a){let x=a[i];return{result:je(n,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:je(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=zo(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:je(n,t,-1,!1,e)};let c=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=XD({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=x>=0,c=x,d=!!f}if(!u){if(t.filters){if(oC(t.filters,n))return{result:je(n,t,-1,!1,e)}}else if(t.namespace&&!TE(l,t.namespace))return{result:je(n,t,-1,!1,e)};if(t.include&&!NE(t.include))return{result:je(n,t,-1,!1,e)};if(t.condition&&!rC(t.condition,n))return{result:je(n,t,-1,!1,e)};if(t.parentConditions){let x=new Set(n.stack.evaluatedFeatures);for(let f of t.parentConditions){n.stack.evaluatedFeatures=new Set(x);let h=af(f.id,n);if(h.source==="cyclicPrerequisite")return{result:je(n,t,-1,!1,e)};let y={value:h.value};if(!Pr(y,f.condition||{}))return{result:je(n,t,-1,!1,e)}}}if(t.groups&&!WD(t.groups,n))return{result:je(n,t,-1,!1,e)}}if(t.url&&!YD(t.url,n))return{result:je(n,t,-1,!1,e)};let p=Ql(t.seed||i,l,t.hashVersion||1);if(p===null)return{result:je(n,t,-1,!1,e)};if(!u){let x=t.ranges||OE(r,t.coverage===void 0?1:t.coverage,t.weights);c=RE(p,x)}if(d)return{result:je(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:je(n,t,-1,!1,e)};if("force"in t)return{result:je(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:je(n,t,-1,!1,e)};if(t.status==="stopped")return{result:je(n,t,-1,!1,e)};let g=je(n,t,c,!0,e,p,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:h}=QD(n,s,Jl(l),{[rv(t.key,t.bucketVersion)]:g.key});x&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[f]=h,n.user.saveStickyBucketAssignmentDoc(h))}let _=nC(n,t,g);_.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let b=_.length?_.length===1?_[0]:Promise.all(_).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:b}}function qr(t,e,n,i,r,o,a){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return o&&(s.experiment=o),a&&(s.experimentResult=a),i!=="override"&&qD(t,e,s),s}function iC(t){return{...t.user.attributes,...t.user.attributeOverrides}}function rC(t,e){return Pr(iC(e),t,e.global.savedGroups||{})}function oC(t,e){return t.some(n=>{let{hashValue:i}=zo(e,n.attribute);if(!i)return!0;let r=Ql(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(o=>qd(r,o))})}function ZD(t,e,n,i,r,o,a){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=zo(t,n,i);if(!s)return!1;let l=Ql(e,s,a||1);return l===null?!1:r?qd(l,r):o!==void 0?l<=o:!0}function je(t,e,n,i,r,o,a){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=zo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},d={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(d.name=u.name),o!==void 0&&(d.bucket=o),u.passthrough&&(d.passthrough=u.passthrough),d}function GD(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=Zm(t.url))),t}function zo(t,e,n){let i=e||"id",r="",o=iC(t);return o[i]&&(r=o[i]),!r&&n&&(o[n]&&(r=o[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function YD(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function WD(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function XD({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:a}){n=n||0,o=o||0,i=i||"id",a=a||[];let s=rv(e,n),l=KD(t,i,r);if(o>0)for(let d=0;d<o;d++){let p=rv(e,d);if(l[p]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=a.findIndex(d=>d.key===c);return u<0?{variation:-1}:{variation:u}}function rv(t,e){return e=e||0,`${t}__${e}`}function ov(t,e){return`${t}||${e}`}function KD(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=zo(t,e),o=ov(i,Jl(r)),{hashAttribute:a,hashValue:s}=zo(t,n),l=s?ov(a,Jl(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function QD(t,e,n,i){let r=ov(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...o,...i},s=JSON.stringify(o)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:s}}function JD(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(o=>{let a=i[o];if(a.rules)for(let s of a.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function aC(t,e,n){let i=av(t,n);return e.getAllAssignments(i)}function av(t,e){let n={};return JD(t,e).forEach(r=>{let{hashValue:o}=zo(t,r);n[r]=Jl(o)}),n}async function sC(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Ho(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Ho(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Ho(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function lC(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function lf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var gs=typeof window<"u"&&typeof document<"u",e4=DE(),ic=class{constructor(e){if(e=e||{},this.version=e4,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),gs&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await sC(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,Xd(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&zE(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Xd(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return Xd(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return lC(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return BE({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await Ho(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await Ho(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,$E(this),e.destroyAllStreams&&Qm(),this.logs=[],gs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=sf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),o,a;r?o=je(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:a}=sf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!n&&o.inExperiment&&i&&i.valueHash===s)return o;if(i&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Gd(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?LE(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Zd(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:d}=this._getNavigateFunction();if(u)if(gs)Promise.all([...a?[Yd(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(p=>window.setTimeout(p,this._options.navigateDelay??d))]).then(()=>{try{u(c)}catch(p){console.error(p)}});else try{u(c)}catch(p){console.error(p)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,o)=>{i.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of n){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&Gd(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return af(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[lf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(lf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(gs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Gd(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==i.protocol||o.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:gs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!gs)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(KE.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await aC(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=av(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var t4="https://experiment.syntrologie.com",sv=class{constructor(e={}){j(this,"gb");j(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new ic({...e,apiHost:e.apiHost??t4,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let n of this.featureListeners)n()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function lv(t={}){return new sv(t)}var cC="syntro_session_metrics",cf=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(cC);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(cC,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function cv(t={}){return new cf(t)}var v={};ZT(v,{BRAND:()=>k4,DIRTY:()=>Bo,EMPTY_PATH:()=>o4,INVALID:()=>W,NEVER:()=>d3,OK:()=>Ot,ParseStatus:()=>wt,Schema:()=>ae,ZodAny:()=>Yr,ZodArray:()=>Wi,ZodBigInt:()=>Fo,ZodBoolean:()=>Uo,ZodBranded:()=>oc,ZodCatch:()=>Qo,ZodDate:()=>Vo,ZodDefault:()=>Ko,ZodDiscriminatedUnion:()=>ff,ZodEffects:()=>Dn,ZodEnum:()=>Wo,ZodError:()=>Yt,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>hf,ZodIntersection:()=>Zo,ZodIssueCode:()=>L,ZodLazy:()=>Go,ZodLiteral:()=>Yo,ZodMap:()=>xs,ZodNaN:()=>ws,ZodNativeEnum:()=>Xo,ZodNever:()=>Yn,ZodNull:()=>Po,ZodNullable:()=>ui,ZodNumber:()=>$o,ZodObject:()=>Wt,ZodOptional:()=>Mn,ZodParsedType:()=>U,ZodPipeline:()=>ac,ZodPromise:()=>Wr,ZodReadonly:()=>Jo,ZodRecord:()=>pf,ZodSchema:()=>ae,ZodSet:()=>Ss,ZodString:()=>Gr,ZodSymbol:()=>bs,ZodTransformer:()=>Dn,ZodTuple:()=>ci,ZodType:()=>ae,ZodUndefined:()=>jo,ZodUnion:()=>qo,ZodUnknown:()=>Yi,ZodVoid:()=>_s,addIssueToContext:()=>z,any:()=>H4,array:()=>F4,bigint:()=>M4,boolean:()=>_C,coerce:()=>u3,custom:()=>vC,date:()=>N4,datetimeRegex:()=>gC,defaultErrorMap:()=>Zi,discriminatedUnion:()=>P4,effect:()=>n3,enum:()=>J4,function:()=>X4,getErrorMap:()=>ms,getParsedType:()=>li,instanceof:()=>R4,intersection:()=>q4,isAborted:()=>uf,isAsync:()=>vs,isDirty:()=>df,isValid:()=>Zr,late:()=>T4,lazy:()=>K4,literal:()=>Q4,makeIssue:()=>rc,map:()=>Y4,nan:()=>O4,nativeEnum:()=>e3,never:()=>B4,null:()=>I4,nullable:()=>r3,number:()=>bC,object:()=>U4,objectUtil:()=>uv,oboolean:()=>c3,onumber:()=>l3,optional:()=>i3,ostring:()=>s3,pipeline:()=>a3,preprocess:()=>o3,promise:()=>t3,quotelessJson:()=>n4,record:()=>G4,set:()=>W4,setErrorMap:()=>r4,strictObject:()=>V4,string:()=>yC,symbol:()=>D4,transformer:()=>n3,tuple:()=>Z4,undefined:()=>L4,union:()=>j4,unknown:()=>z4,util:()=>ue,void:()=>$4});var ue;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},t.find=(r,o)=>{for(let a of r)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ue||(ue={}));var uv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(uv||(uv={}));var U=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),li=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var L=ue.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"]),n4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Yt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Yt.create=t=>new Yt(t);var i4=(t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.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}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.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 L.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 L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},Zi=i4;var uC=Zi;function r4(t){uC=t}function ms(){return uC}var rc=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},o4=[];function z(t,e){let n=ms(),i=rc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Zi?void 0:Zi].filter(r=>!!r)});t.common.issues.push(i)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return W;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return W;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),Bo=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),uf=t=>t.status==="aborted",df=t=>t.status==="dirty",Zr=t=>t.status==="valid",vs=t=>typeof Promise<"u"&&t instanceof Promise;var Z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Z||(Z={}));var Nn=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},dC=(t,e)=>{if(Zr(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;let n=new Yt(t.common.issues);return this._error=n,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var ae=class{get description(){return this._def.description}_getType(e){return li(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(vs(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parseSync({data:e,path:i.path,parent:i});return dC(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Zr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Zr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(vs(r)?r:Promise.resolve(r));return dC(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=e(r),s=()=>o.addIssue({code:L.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Dn({schema:this,typeName:K.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 Mn.create(this,this._def)}nullable(){return ui.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wi.create(this)}promise(){return Wr.create(this,this._def)}or(e){return qo.create([this,e],this._def)}and(e){return Zo.create(this,e,this._def)}transform(e){return new Dn({...oe(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ko({...oe(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new oc({typeName:K.ZodBranded,type:this,...oe(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Qo({...oe(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ac.create(this,e)}readonly(){return Jo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},a4=/^c[^\s-]{8,}$/i,s4=/^[0-9a-z]+$/,l4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,c4=/^[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,u4=/^[a-z0-9_-]{21}$/i,d4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,f4=/^[-+]?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)?)??$/,p4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,h4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dv,g4=/^(?:(?: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])$/,m4=/^(?:(?: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])$/,v4=/^(([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]))$/,y4=/^(([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])$/,b4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pC="((\\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])))",x4=new RegExp(`^${pC}$`);function hC(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function S4(t){return new RegExp(`^${hC(t)}$`)}function gC(t){let e=`${pC}T${hC(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function w4(t,e){return!!((e==="v4"||!e)&&g4.test(t)||(e==="v6"||!e)&&v4.test(t))}function E4(t,e){if(!d4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function C4(t,e){return!!((e==="v4"||!e)&&m4.test(t)||(e==="v6"||!e)&&y4.test(t))}var Gr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:U.string,received:o.parsedType}),W}let i=new wt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?z(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&z(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")p4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"email",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")dv||(dv=new RegExp(h4,"u")),dv.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"emoji",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")c4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"uuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")u4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"nanoid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")a4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")s4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid2",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")l4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ulid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),z(r,{validation:"url",code:L.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"regex",code:L.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?gC(o).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?x4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?S4(o).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?f4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"duration",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?w4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ip",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?E4(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"jwt",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?C4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cidr",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?b4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?_4.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64url",code:L.invalid_string,message:o.message}),i.dirty()):ue.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:L.invalid_string,...Z.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.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,...Z.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,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Z.errToObj(n)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...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(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Gr.create=t=>new Gr({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...oe(t)});function A4(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}var $o=class t extends ae{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)!==U.number){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:U.number,received:o.parsedType}),W}let i,r=new wt;for(let o of this._def.checks)o.kind==="int"?ue.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?A4(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{code:L.not_finite,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let 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"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$o.create=t=>new $o({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Fo=class t extends ae{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)!==U.bigint)return this._getInvalidInput(e);let i,r=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),z(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return z(n,{code:L.invalid_type,expected:U.bigint,received:n.parsedType}),W}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Fo.create=t=>new Fo({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var Uo=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.boolean,received:i.parsedType}),W}return Ot(e.data)}};Uo.create=t=>new Uo({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Vo=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:U.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_date}),W}let i=new wt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ue.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(n)})}get minDate(){let e=null;for(let 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(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Vo.create=t=>new Vo({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...oe(t)});var bs=class extends ae{_parse(e){if(this._getType(e)!==U.symbol){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.symbol,received:i.parsedType}),W}return Ot(e.data)}};bs.create=t=>new bs({typeName:K.ZodSymbol,...oe(t)});var jo=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.undefined,received:i.parsedType}),W}return Ot(e.data)}};jo.create=t=>new jo({typeName:K.ZodUndefined,...oe(t)});var Po=class extends ae{_parse(e){if(this._getType(e)!==U.null){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.null,received:i.parsedType}),W}return Ot(e.data)}};Po.create=t=>new Po({typeName:K.ZodNull,...oe(t)});var Yr=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Yr.create=t=>new Yr({typeName:K.ZodAny,...oe(t)});var Yi=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};Yi.create=t=>new Yi({typeName:K.ZodUnknown,...oe(t)});var Yn=class extends ae{_parse(e){let n=this._getOrReturnCtx(e);return z(n,{code:L.invalid_type,expected:U.never,received:n.parsedType}),W}};Yn.create=t=>new Yn({typeName:K.ZodNever,...oe(t)});var _s=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.void,received:i.parsedType}),W}return Ot(e.data)}};_s.create=t=>new _s({typeName:K.ZodVoid,...oe(t)});var Wi=class t extends ae{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==U.array)return z(n,{code:L.invalid_type,expected:U.array,received:n.parsedType}),W;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(z(n,{code:a?L.too_big:L.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(z(n,{code:L.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(z(n,{code:L.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new Nn(n,a,n.path,s)))).then(a=>wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Nn(n,a,n.path,s)));return wt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};Wi.create=(t,e)=>new Wi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...oe(e)});function ys(t){if(t instanceof Wt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Mn.create(ys(i))}return new Wt({...t._def,shape:()=>e})}else return t instanceof Wi?new Wi({...t._def,type:ys(t.element)}):t instanceof Mn?Mn.create(ys(t.unwrap())):t instanceof ui?ui.create(ys(t.unwrap())):t instanceof ci?ci.create(t.items.map(e=>ys(e))):t}var Wt=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){let c=this._getOrReturnCtx(e);return z(c,{code:L.invalid_type,expected:U.object,received:c.parsedType}),W}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Yn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=o[c],d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Nn(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Yn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(z(r,{code:L.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Nn(r,d,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(i,c)):wt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:Z.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ue.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ue.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return ys(this)}partial(e){let n={};for(let i of ue.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ue.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Mn;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return mC(ue.objectKeys(this.shape))}};Wt.create=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.strictCreate=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strict",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.lazycreate=(t,e)=>new Wt({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});var qo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Yt(s.ctx.common.issues));return z(n,{code:L.invalid_union,unionErrors:a}),W}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Yt(l));return z(n,{code:L.invalid_union,unionErrors:s}),W}}get options(){return this._def.options}};qo.create=(t,e)=>new qo({options:t,typeName:K.ZodUnion,...oe(e)});var Gi=t=>t instanceof Go?Gi(t.schema):t instanceof Dn?Gi(t.innerType()):t instanceof Yo?[t.value]:t instanceof Wo?t.options:t instanceof Xo?ue.objectValues(t.enum):t instanceof Ko?Gi(t._def.innerType):t instanceof jo?[void 0]:t instanceof Po?[null]:t instanceof Mn?[void 0,...Gi(t.unwrap())]:t instanceof ui?[null,...Gi(t.unwrap())]:t instanceof oc||t instanceof Jo?Gi(t.unwrap()):t instanceof Qo?Gi(t._def.innerType):[],ff=class t extends ae{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return z(n,{code:L.invalid_type,expected:U.object,received:n.parsedType}),W;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(z(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let a=Gi(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...oe(i)})}};function fv(t,e){let n=li(t),i=li(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&i===U.object){let r=ue.objectKeys(e),o=ue.objectKeys(t).filter(s=>r.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=fv(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===U.array&&i===U.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=fv(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Zo=class extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,a)=>{if(uf(o)||uf(a))return W;let s=fv(o.value,a.value);return s.valid?((df(o)||df(a))&&n.dirty(),{status:n.value,value:s.data}):(z(i,{code:L.invalid_intersection_types}),W)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Zo.create=(t,e,n)=>new Zo({left:t,right:e,typeName:K.ZodIntersection,...oe(n)});var ci=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.array)return z(i,{code:L.invalid_type,expected:U.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return z(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(z(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Nn(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>wt.mergeArray(n,a)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ci.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:t,typeName:K.ZodTuple,rest:null,...oe(e)})};var pf=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.object)return z(i,{code:L.invalid_type,expected:U.object,received:i.parsedType}),W;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Nn(i,s,i.path,s)),value:a._parse(new Nn(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?wt.mergeObjectAsync(n,r):wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ae?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...oe(i)}):new t({keyType:Gr.create(),valueType:e,typeName:K.ZodRecord,...oe(n)})}},xs=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.map)return z(i,{code:L.invalid_type,expected:U.map,received:i.parsedType}),W;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new Nn(i,s,i.path,[c,"key"])),value:o._parse(new Nn(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};xs.create=(t,e,n)=>new xs({valueType:e,keyType:t,typeName:K.ZodMap,...oe(n)});var Ss=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.set)return z(i,{code:L.invalid_type,expected:U.set,received:i.parsedType}),W;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(z(i,{code:L.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(z(i,{code:L.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return W;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>o._parse(new Nn(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ss.create=(t,e)=>new Ss({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...oe(e)});var hf=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.function)return z(n,{code:L.invalid_type,expected:U.function,received:n.parsedType}),W;function i(s,l){return rc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ms(),Zi].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function r(s,l){return rc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ms(),Zi].filter(c=>!!c),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Wr){let s=this;return Ot(async function(...l){let c=new Yt([]),u=await s._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(i(l,g)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(g=>{throw c.addIssue(r(d,g)),c})})}else{let s=this;return Ot(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new Yt([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Yt([r(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ci.create(e).rest(Yi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||ci.create([]).rest(Yi.create()),returns:n||Yi.create(),typeName:K.ZodFunction,...oe(i)})}},Go=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Go.create=(t,e)=>new Go({getter:t,typeName:K.ZodLazy,...oe(e)});var Yo=class extends ae{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Yo.create=(t,e)=>new Yo({value:t,typeName:K.ZodLiteral,...oe(e)});function mC(t,e){return new Wo({values:t,typeName:K.ZodEnum,...oe(e)})}var Wo=class t extends ae{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return z(n,{expected:ue.joinValues(i),received:n.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return z(n,{received:n.data,code:L.invalid_enum_value,options:i}),W}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Wo.create=mC;var Xo=class extends ae{_parse(e){let n=ue.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==U.string&&i.parsedType!==U.number){let r=ue.objectValues(n);return z(i,{expected:ue.joinValues(r),received:i.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ue.objectValues(n);return z(i,{received:i.data,code:L.invalid_enum_value,options:r}),W}return Ot(e.data)}get enum(){return this._def.values}};Xo.create=(t,e)=>new Xo({values:t,typeName:K.ZodNativeEnum,...oe(e)});var Wr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return z(n,{code:L.invalid_type,expected:U.promise,received:n.parsedType}),W;let i=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return Ot(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Wr.create=(t,e)=>new Wr({type:t,typeName:K.ZodPromise,...oe(e)});var Dn=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{z(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return W;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"?Bo(l.value):n.value==="dirty"?Bo(l.value):l});{if(n.value==="aborted")return W;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?W:s.status==="dirty"?Bo(s.value):n.value==="dirty"?Bo(s.value):s}}if(r.type==="refinement"){let a=s=>{let l=r.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Zr(a))return W;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Zr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):W);ue.assertNever(r)}};Dn.create=(t,e,n)=>new Dn({schema:t,typeName:K.ZodEffects,effect:e,...oe(n)});Dn.createWithPreprocess=(t,e,n)=>new Dn({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...oe(n)});var Mn=class extends ae{_parse(e){return this._getType(e)===U.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mn.create=(t,e)=>new Mn({innerType:t,typeName:K.ZodOptional,...oe(e)});var ui=class extends ae{_parse(e){return this._getType(e)===U.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ui.create=(t,e)=>new ui({innerType:t,typeName:K.ZodNullable,...oe(e)});var Ko=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ko.create=(t,e)=>new Ko({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var Qo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return vs(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Qo.create=(t,e)=>new Qo({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var ws=class extends ae{_parse(e){if(this._getType(e)!==U.nan){let i=this._getOrReturnCtx(e);return z(i,{code:L.invalid_type,expected:U.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};ws.create=t=>new ws({typeName:K.ZodNaN,...oe(t)});var k4=Symbol("zod_brand"),oc=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},ac=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?W:o.status==="dirty"?(n.dirty(),Bo(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?W:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},Jo=class extends ae{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Zr(r)&&(r.value=Object.freeze(r.value)),r);return vs(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Jo.create=(t,e)=>new Jo({innerType:t,typeName:K.ZodReadonly,...oe(e)});function fC(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function vC(t,e={},n){return t?Yr.create().superRefine((i,r)=>{let o=t(i);if(o instanceof Promise)return o.then(a=>{if(!a){let s=fC(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=fC(e,i),s=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:s})}}):Yr.create()}var T4={object:Wt.lazycreate},K;(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"})(K||(K={}));var R4=(t,e={message:`Input not instance of ${t.name}`})=>vC(n=>n instanceof t,e),yC=Gr.create,bC=$o.create,O4=ws.create,M4=Fo.create,_C=Uo.create,N4=Vo.create,D4=bs.create,L4=jo.create,I4=Po.create,H4=Yr.create,z4=Yi.create,B4=Yn.create,$4=_s.create,F4=Wi.create,U4=Wt.create,V4=Wt.strictCreate,j4=qo.create,P4=ff.create,q4=Zo.create,Z4=ci.create,G4=pf.create,Y4=xs.create,W4=Ss.create,X4=hf.create,K4=Go.create,Q4=Yo.create,J4=Wo.create,e3=Xo.create,t3=Wr.create,n3=Dn.create,i3=Mn.create,r3=ui.create,o3=Dn.createWithPreprocess,a3=ac.create,s3=()=>yC().optional(),l3=()=>bC().optional(),c3=()=>_C().optional(),u3={string:(t=>Gr.create({...t,coerce:!0})),number:(t=>$o.create({...t,coerce:!0})),boolean:(t=>Uo.create({...t,coerce:!0})),bigint:(t=>Fo.create({...t,coerce:!0})),date:(t=>Vo.create({...t,coerce:!0}))};var d3=W;var xC=v.union([v.object({type:v.literal("data"),key:v.string(),value:v.string().optional()}),v.object({type:v.literal("css"),value:v.string()}),v.object({type:v.literal("aria"),role:v.string().optional(),label:v.string().optional()}),v.object({type:v.literal("shadow-css"),value:v.string()}),v.object({type:v.literal("ref"),el:v.any()})]),f3=v.object({kind:v.literal("tooltip"),id:v.string(),anchor:xC,content:v.object({title:v.string().optional(),body:v.string()}),placement:v.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:v.number().optional(),blocking:v.boolean().optional(),trigger:v.enum(["immediate","hover","click"]).optional(),dismiss:v.object({onEsc:v.boolean().optional(),closeButton:v.boolean().optional(),timeoutMs:v.number().optional()}).optional()}),p3=v.object({kind:v.literal("highlight"),id:v.string(),anchor:xC,copy:v.string().optional(),ring:v.object({paddingPx:v.number().optional(),radiusPx:v.number().optional()}).optional(),scrim:v.object({opacity:v.number().optional()}).optional(),ringColor:v.string().optional(),blocking:v.boolean().optional(),dismiss:v.object({onClickOutside:v.boolean().optional(),onEsc:v.boolean().optional(),timeoutMs:v.number().optional()}).optional()}),pv=v.object({id:v.string(),version:v.number(),routes:v.array(v.string()).optional(),steps:v.array(v.union([f3,p3]))});function WB(t){return pv.parse(t)}var JB=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=xm({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:i});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let a=await o.json();return pv.parse(a)};var gf=X(Qe(),1),SC=X(zs(),1);function t$({element:t,children:e}){let[n,i]=(0,gf.useState)(null);return(0,gf.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,SC.createPortal)(e,n):null}function h3(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var hv=class{constructor(){j(this,"sessionId");this.sessionId=h3(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function gv(){return new hv}var R=typeof window<"u"?window:void 0,Ct=typeof globalThis<"u"?globalThis:R;typeof self>"u"&&(Ct.self=Ct),typeof File>"u"&&(Ct.File=function(){});var yA=Array.prototype,wC=yA.forEach,EC=yA.indexOf,hn=Ct?.navigator,$=Ct?.document,Kt=Ct?.location,Mv=Ct?.fetch,Nv=Ct!=null&&Ct.XMLHttpRequest&&"withCredentials"in new Ct.XMLHttpRequest?Ct.XMLHttpRequest:void 0,CC=Ct?.AbortController,Xt=hn?.userAgent,J=R??{},Ki={DEBUG:!1,LIB_VERSION:"1.302.2"};function AC(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function kC(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(l){AC(o,i,r,a,s,"next",l)}function s(l){AC(o,i,r,a,s,"throw",l)}a(void 0)}))}}function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},P.apply(null,arguments)}function bA(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var g3=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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"],TC=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return g3.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},m3=["$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"];function de(t,e){return t.indexOf(e)!==-1}var Gf=function(t){return t.trim()},Dv=function(t){return t.replace(/^\$/,"")},v3=Array.isArray,_A=Object.prototype,xA=_A.hasOwnProperty,Yf=_A.toString,Te=v3||function(t){return Yf.call(t)==="[object Array]"},to=t=>typeof t=="function",pt=t=>t===Object(t)&&!Te(t),ks=t=>{if(pt(t)){for(var e in t)if(xA.call(t,e))return!1;return!0}return!1},B=t=>t===void 0,lt=t=>Yf.call(t)=="[object String]",Lv=t=>lt(t)&&t.trim().length===0,tr=t=>t===null,Ce=t=>B(t)||tr(t),hi=t=>Yf.call(t)=="[object Number]",no=t=>Yf.call(t)==="[object Boolean]",y3=t=>t instanceof FormData,b3=t=>de(m3,t);function Iv(t){return t===null||typeof t!="object"}function Af(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function SA(t){return!B(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var _3=[!0,"true",1,"1","yes"],mv=t=>de(_3,t),x3=[!1,"false",0,"0","no"];function di(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),hi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),di(r||n,e,n,i))}var Hv=class{constructor(e){this.t={},this.i=e.i,this.o=di(e.bucketSize,0,100,e.h),this.m=di(e.refillRate,0,this.o,e.h),this.S=di(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,i):(o={tokens:this.o,lastAccess:i},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},mf,RC,vv,S3=t=>t instanceof Error;function w3(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return vv&&n.length===RC||(RC=n.length,vv=n.reduce(((i,r)=>{mf||(mf={});var o=mf[r];if(o)i[o[0]]=o[1];else for(var a=t(r),s=a.length-1;s>=0;s--){var l=a[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,mf[r]=[c,u];break}}return i}),{})),vv}}var zv=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(),a=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return kC((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Te(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),P({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return kC((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,o,a={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,P({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:w3(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(o,a)=>{if(a<=4){var s=this.buildCoercingContext(e,n,a);return this.applyCoercers(o,s)}};return P({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:o=>r(o,i),next:o=>r(o,i+1)})}},Ms="?";function Bv(t,e,n,i,r){var o={platform:t,filename:e,function:n==="<anonymous>"?Ms:n,in_app:!0};return B(i)||(o.lineno=i),B(r)||(o.colno=r),o}var wA=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Ms,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},E3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,C3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,A3=/\((\S*)(?::(\d+))(?::(\d+))\)/,k3=(t,e)=>{var n=E3.exec(t);if(n){var[,i,r,o]=n;return Bv(e,i,Ms,+r,+o)}var a=C3.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var s=A3.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[l,c]=wA(a[1]||Ms,a[2]);return Bv(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},T3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,R3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,O3=(t,e)=>{var n=T3.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=R3.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],o=n[1]||Ms;return[o,r]=wA(o,r),Bv(e,r,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},OC=/\(error: (.*)\)/,MC=50;function M3(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
442
- `),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=OC.test(c)?c.replace(OC,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var p=d(u,t);if(p){a.push(p);break}}if(a.length>=MC)break}}}return(function(g){if(!g.length)return[];var _=Array.from(g);return _.reverse(),_.slice(0,MC).map((b=>{return P({},b,{filename:b.filename||(x=_,x[x.length-1]||{}).filename,function:b.function||Ms});var x}))})(a)}}var $v=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?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){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Af(e,"DOMException")}isDOMError(e){return Af(e,"DOMError")}},Fv=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},Uv=class{constructor(){}match(e){return Af(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},N3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Vv=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(N3);return r&&(n=r[1],i=r[2]),[n,i]}},D3=["fatal","error","warning","log","info","debug"];function EA(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var jv=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return SA(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+EA(e)}isSeverityLevel(e){return lt(e)&&!Lv(e)&&D3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(S3(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Pv=class{match(e){return SA(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+EA(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},qv=class{match(e){return Iv(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Zv=class{match(e){return Af(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return Iv(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(Iv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},CA=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(R&&(Ki.DEBUG||J.POSTHOG_DEBUG||n)&&!B(R.console)&&R.console){for(var o=("__rrweb_original__"in R.console[r])?R.console[r].__rrweb_original__:R.console[r],a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];console.error(t,...o)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>CA(t+" "+r,o)};return i},F=CA("[PostHog.js]"),ct=F.createLogger,L3=ct("[ExternalScriptsLoader]"),NC=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return L3.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=$?.querySelectorAll("script");if(i){for(var r,o=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},a=0;a<i.length;a++)if(r=o())return r.v}var s=()=>{if(!$)return n("document not found");var l=$.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=$.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):$.body.appendChild(l)};$!=null&&$.body?s():$?.addEventListener("DOMContentLoaded",s)};J.__PosthogExtensions__=J.__PosthogExtensions__||{},J.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",i);NC(t,o,n)},J.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);NC(t,i,n)};var kf={};function io(t,e,n){if(Te(t)){if(wC&&t.forEach===wC)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===kf)return}}}function Me(t,e,n){if(!Ce(t)){if(Te(t))return io(t,e,n);if(y3(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===kf)return}else for(var r in t)if(xA.call(t,r)&&e.call(n,t[r],r)===kf)return}}var Xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Ls=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){io(r,(function(o){t.push(o)}))})),t};function wf(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var DC=function(t){try{return t()}catch{return}},I3=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){F.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),F.critical(r)}}},Uy=function(t){var e={};return Me(t,(function(n,i){(lt(n)&&n.length>0||hi(n))&&(e[i]=n)})),e};function H3(t,e){return n=t,i=o=>lt(o)&&!tr(e)?o.slice(0,e):o,r=new Set,(function o(a,s){return a!==Object(a)?i?i(a,s):a:r.has(a)?void 0:(r.add(a),Te(a)?(l=[],io(a,(c=>{l.push(o(c))}))):(l={},Me(a,((c,u)=>{r.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,i,r}var z3=["herokuapp.com","vercel.app","netlify.app"];function B3(t){var e=t?.hostname;if(!lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of z3)if(n===i)return!1;return!0}function AA(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function rt(t,e,n,i){var{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}var kA="$people_distinct_id",mc="__alias",vc="__timers",LC="$autocapture_disabled_server_side",Gv="$heatmaps_enabled_server_side",IC="$exception_capture_enabled_server_side",Yv="$error_tracking_suppression_rules",HC="$error_tracking_capture_extension_exceptions",zC="$web_vitals_enabled_server_side",TA="$dead_clicks_enabled_server_side",BC="$web_vitals_allowed_metrics",yv="$session_recording_remote_config",Tf="$sesid",RA="$session_is_sampled",Ts="$enabled_feature_flags",yc="$early_access_features",Wv="$feature_flag_details",bc="$stored_person_properties",na="$stored_group_properties",Xv="$surveys",vf="$surveys_activated",Rf="$flag_call_reported",Qi="$user_state",Kv="$client_session_props",Qv="$capture_rate_limit",Jv="$initial_campaign_params",ey="$initial_referrer_info",Of="$initial_person_info",Mf="$epp",OA="__POSTHOG_TOOLBAR__",sc="$posthog_cookieless",$3=[kA,mc,"__cmpns",vc,"$session_recording_enabled_server_side",Gv,Tf,Ts,Yv,Qi,yc,Wv,na,bc,Xv,Rf,Kv,Qv,Jv,ey,Mf,Of];function $C(t){return t instanceof Element&&(t.id===OA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Wf(t){return!!t&&t.nodeType===1}function ro(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function MA(t){return!!t&&t.nodeType===3}function NA(t){return!!t&&t.nodeType===11}function Vy(t){return t?Gf(t).split(/\s+/):[]}function FC(t){var e=R?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Nf(t){var 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 Vy(e)}function DA(t){return Ce(t)?null:Gf(t).split(/(\s+)/).filter((e=>Ac(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Nc(t){var e="";return ty(t)&&!BA(t)&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;MA(n)&&n.textContent&&(e+=(i=DA(n.textContent))!==null&&i!==void 0?i:"")})),Gf(e)}function LA(t){return B(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var jy=["a","button","form","input","select","textarea","label"];function IA(t,e){if(B(e))return!0;var n,i=function(o){if(e.some((a=>o.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function HA(t){var e=t.parentNode;return!(!e||!Wf(e))&&e}var F3=["next","previous","prev",">","<"],UC=10,VC=[".ph-no-rageclick",".ph-no-capture"];function U3(t,e){if(!R||Py(t))return!1;var n,i,r;if(no(e)?(n=!!e&&VC,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:VC,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=zA(t,!1);return!(function(a,s){if(a===!1||B(a))return!1;var l;if(a===!0)l=F3;else{if(!Te(a))return!1;if(a.length>UC)return F.error("[PostHog] content_ignorelist array cannot exceed "+UC+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((p=>u.includes(p)||d.includes(p)))}))})(i,o.map((a=>{var s;return{safeText:Nc(a).toLowerCase(),ariaLabel:((s=a.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!IA(o,n)}var Py=t=>!t||ro(t,"html")||!Wf(t),zA=(t,e)=>{if(!R||Py(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!ro(r,"body");)if(NA(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var o=HA(r);if(!o)break;if(e||jy.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var a=R.getComputedStyle(o);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function V3(t,e,n,i,r){var o,a,s,l;if(n===void 0&&(n=void 0),!R||Py(t)||(o=n)!=null&&o.url_allowlist&&!FC(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&FC(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((_=>e.type===_)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=zA(t,i);if(!(function(_,b){var x=b?.element_allowlist;if(B(x))return!0;var f,h=function(m){if(x.some((S=>m.tagName.toLowerCase()===S)))return{v:!0}};for(var y of _)if(f=h(y))return f.v;return!1})(d,n)||!IA(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var p=R.getComputedStyle(t);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(jy.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function ty(t){for(var e=t;e.parentNode&&!ro(e,"body");e=e.parentNode){var n=Nf(e);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(Nf(t),"ph-include"))return!0;var i=t.type||"";if(lt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(lt(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function BA(t){return!!(ro(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ro(t,"select")||ro(t,"textarea")||t.getAttribute("contenteditable")==="true")}var $A="(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})",j3=new RegExp("^(?:"+$A+")$"),P3=new RegExp($A),FA="\\d{3}-?\\d{2}-?\\d{4}",q3=new RegExp("^("+FA+")$"),Z3=new RegExp("("+FA+")");function Ac(t,e){return e===void 0&&(e=!0),!(Ce(t)||lt(t)&&(t=Gf(t),(e?j3:P3).test((t||"").replace(/[- ]/g,""))||(e?q3:Z3).test(t)))}function UA(t){var e=Nc(t);return Ac(e=(e+" "+VA(t)).trim())?e:""}function VA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Nc(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+VA(n)).trim())}catch(o){F.error("[AutoCapture]",o)}})),e}function G3(t){return(function(e){var n=e.map((i=>{var r,o,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))a+="."+s.replace(/"/g,"");var l=P({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=i.nth_of_type)!==null&&o!==void 0?o:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return wf(l).sort(((u,d)=>{var[p]=u,[g]=d;return p.localeCompare(g)})).forEach((u=>{var[d,p]=u;return c[jC(d.toString())]=jC(p.toString())})),a+=":",a+=wf(c).map((u=>{var[d,p]=u;return d+'="'+p+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,o={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:Y3(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return wf(n).filter((a=>{var[s]=a;return s.indexOf("attr__")===0})).forEach((a=>{var[s,l]=a;return o.attributes[s]=l})),o}))})(t))}function jC(t){return t.replace(/"|\\"/g,'\\"')}function Y3(t){var e=t.attr__class;return e?Te(e)?e:Vy(e):void 0}var Df=class{constructor(e){this.disabled=e===!1;var n=pt(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,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},bv="$copy_autocapture",er=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Lf=t=>{var e=$?.createElement("a");return B(e)?null:(e.href=t,e)},W3=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Me(t,(function(o,a){B(o)||B(a)||a==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},If=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===e){n=o;break}}if(!Te(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{F.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Dc=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",o=i[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var p=c[d].split("=");Te(p)&&(e.includes(p[0])?u.push(p[0]+"="+n):u.push(c[d]))}var g=l;return s!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},Hf=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},PC=ct("[AutoCapture]");function _v(t,e){return e.length>t?e.slice(0,t)+"...":e}function X3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Wf(e));return e}function K3(t,e,n,i){var r=t.tagName.toLowerCase(),o={tag_name:r};jy.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=_v(1024,UA(t)):o.$el_text=_v(1024,Nc(t)));var a=Nf(t);a.length>0&&(o.classes=a.filter((function(u){return u!==""}))),Me(t.attributes,(function(u){var d;if((!BA(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&Ac(u.value)&&(d=u.name,!lt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var p=u.value;u.name==="class"&&(p=Vy(p).join(" ")),o["attr__"+u.name]=_v(1024,p)}}));for(var s=1,l=1,c=t;c=X3(c);)s++,c.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function Q3(t,e){for(var n,i,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!ro(u,"body");)NA(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,p=[],g={},_=!1,b=!1;if(Me(c,(m=>{var S=ty(m);m.tagName.toLowerCase()==="a"&&(_=m.getAttribute("href"),_=S&&_&&Ac(_)&&_),de(Nf(m),"ph-no-capture")&&(b=!0),p.push(K3(m,o,a,s));var w=(function(C){if(!ty(C))return{};var k={};return Me(C.attributes,(function(T){if(T.name&&T.name.indexOf("data-ph-capture-attribute")===0){var E=T.name.replace("data-ph-capture-attribute-",""),M=T.value;E&&M&&Ac(M)&&(k[E]=M)}})),k})(m);Xe(g,w)})),b)return{props:{},explicitNoCapture:b};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?p[0].$el_text=UA(t):p[0].$el_text=Nc(t)),_){var x,f;p[0].attr__href=_;var h=(x=Lf(_))==null?void 0:x.host,y=R==null||(f=R.location)==null?void 0:f.host;h&&y&&h!==y&&(d=_)}return{props:Xe({$event_type:r.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:G3(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(i=p[0])==null?void 0:i.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},g)}}var ny=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Df(e.config.rageclick),this.I=null}get F(){var e,n,i=pt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(R&&$){var e=i=>{i=i||R?.event;try{this.M(i)}catch(r){PC.error("Failed to capture event",r)}};if(rt($,"submit",e,{capture:!0}),rt($,"change",e,{capture:!0}),rt($,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||R?.event,this.M(i,bv)};rt($,"copy",n,{capture:!0}),rt($,"cut",n,{capture:!0})}}}else PC.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[LC]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var o=$?.querySelectorAll(r);o?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[LC],r=this.T;if(tr(r)&&!no(i)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=LA(e);MA(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&U3(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===bv;if(r&&V3(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=Q3(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===bv){var c,u=DA(R==null||(c=R.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return to($?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return hi(t)&&isFinite(t)&&Math.floor(t)===t});var qC="0123456789abcdef",iy=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+qC.charAt(this.bytes[n]>>>4)+qC.charAt(15&this.bytes[n]),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 t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},ry=class{constructor(){this.A=0,this.D=0,this.j=new oy}generate(){var e=this.generateOrAbort();if(B(e)){this.A=0;var n=this.generateOrAbort();if(B(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return iy.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},ZC,jA=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};R&&!B(R.crypto)&&crypto.getRandomValues&&(jA=t=>crypto.getRandomValues(t));var oy=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(jA(this.N),this.U=0),this.N[this.U++]}},eo=()=>J3().toString(),J3=()=>(ZC||(ZC=new ry)).generate(),lc="",eL=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tL(t,e){if(e){var n=(function(r,o){if(o===void 0&&(o=$),lc)return lc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+eo();!lc&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",lc=c)}return lc})(t);if(!n){var i=(r=>{var o=r.match(eL);return o?o[0]:""})(t);i!==n&&F.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var pi={H:()=>!!$,B:function(t){F.error("cookieStore error: "+t)},q:function(t){if($){try{for(var e=t+"=",n=$.cookie.split(";").filter((o=>o.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(pi.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if($)try{var o="",a="",s=tL($.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&F.warn("cookieStore warning: large cookie, len="+c.length),$.cookie=c,c}catch{return}},V:function(t,e){if($!=null&&$.cookie)try{pi.G(t,"",-1,e)}catch{return}}},xv=null,qe={H:function(){if(!tr(xv))return xv;var t=!0;if(B(R))t=!1;else try{var e="__mplssupport__";qe.G(e,"xyz"),qe.q(e)!=='"xyz"'&&(t=!1),qe.V(e)}catch{t=!1}return t||F.error("localStorage unsupported; falling back to cookie store"),xv=t,t},B:function(t){F.error("localStorage error: "+t)},q:function(t){try{return R?.localStorage.getItem(t)}catch(e){qe.B(e)}return null},W:function(t){try{return JSON.parse(qe.q(t))||{}}catch{}return null},G:function(t,e){try{R?.localStorage.setItem(t,JSON.stringify(e))}catch(n){qe.B(n)}},V:function(t){try{R?.localStorage.removeItem(t)}catch(e){qe.B(e)}}},nL=["distinct_id",Tf,RA,Mf,Of],yf=P({},qe,{W:function(t){try{var e={};try{e=pi.W(t)||{}}catch{}var n=Xe(e,JSON.parse(qe.q(t)||"{}"));return qe.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,o){try{qe.G(t,e,void 0,void 0,o);var a={};nL.forEach((s=>{e[s]&&(a[s]=e[s])})),Object.keys(a).length&&pi.G(t,a,n,i,r,o)}catch(s){qe.B(s)}},V:function(t,e){try{R?.localStorage.removeItem(t),pi.V(t,e)}catch(n){qe.B(n)}}}),bf={},iL={H:function(){return!0},B:function(t){F.error("memoryStorage error: "+t)},q:function(t){return bf[t]||null},W:function(t){return bf[t]||null},G:function(t,e){bf[t]=e},V:function(t){delete bf[t]}},ea=null,Et={H:function(){if(!tr(ea))return ea;if(ea=!0,B(R))ea=!1;else try{var t="__support__";Et.G(t,"xyz"),Et.q(t)!=='"xyz"'&&(ea=!1),Et.V(t)}catch{ea=!1}return ea},B:function(t){F.error("sessionStorage error: ",t)},q:function(t){try{return R?.sessionStorage.getItem(t)}catch(e){Et.B(e)}return null},W:function(t){try{return JSON.parse(Et.q(t))||null}catch{}return null},G:function(t,e){try{R?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Et.B(n)}},V:function(t){try{R?.sessionStorage.removeItem(t)}catch(e){Et.B(e)}}},Ji=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),ay=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Ji.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Ji.DENIED||this.consent===Ji.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ji.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return mv(e)?Ji.GRANTED:de(x3,e)?Ji.DENIED:Ji.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?qe:pi;var n=e==="localStorage"?pi:qe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(mv(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!AA([hn?.doNotTrack,hn?.msDoNotTrack,J.doNotTrack],(e=>mv(e)))}},_f=ct("[Dead Clicks]"),rL=()=>!0,oL=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(TA)),i=t.instance.config.capture_dead_clicks;return no(i)?i:!!pt(i)||n},zf=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[TA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?_f.error("failed to load script",r):e()}))}et(){var e;if($){if(!this.tt&&(e=J.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=pt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=J.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start($),_f.info("starting...")}}else _f.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,_f.info("stopping..."))}},cc=ct("[ExceptionAutocapture]"),sy=class{constructor(e){var n,i,r;this.rt=()=>{var o;if(R&&this.isEnabled&&(o=J.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=J.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=J.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=J.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){cc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[IC]),this.F=this.ht(),this.vt=new Hv({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:cc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return pt(e)?n=P({},n,e):(B(e)?this.ut:e)&&(n=P({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(cc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return cc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[IC]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?cc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function GC(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return to(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var ly=class{constructor(e){var n;this._instance=e,this.dt=(R==null||(n=R.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(F.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,F.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(R&&R.history){var i=this;(e=R.history.pushState)!=null&&e.__posthog_wrapped__||GC(R.history,"pushState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("pushState")})),(n=R.history.replaceState)!=null&&n.__posthog_wrapped__||GC(R.history,"replaceState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=R==null||(n=R.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){F.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};rt(R,"popstate",e),this.ct=()=>{R&&R.removeEventListener("popstate",e)}}}},Sv=ct("[SegmentIntegration]");function aL(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var o=i.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||eo();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Qi,"identified")),r()},s=o.user();"then"in s&&to(s.then)?s.then((l=>a(l))):a(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||Sv.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===i.get_distinct_id()||(Sv.info("No userId set, resetting PostHog"),i.reset()),o.event.userId&&o.event.userId!==i.get_distinct_id()&&(Sv.info("UserId set, identifying with PostHog"),i.identify(o.event.userId));var s=i.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var PA="posthog-js";function qA(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return s=>{var l,c,u,d,p;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var _=((l=s.exception)==null?void 0:l.values)||[],b=_.map((f=>P({},f,{stacktrace:f.stacktrace?P({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((h=>P({},h,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((c=_[0])==null?void 0:c.value)||s.message,$exception_type:(u=_[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:b,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=_[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(p=_[0])==null?void 0:p.type,$sentry_tags:s.tags};return n&&i&&(x.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),a&&t.exceptions.sendExceptionEvent(x),s}}var cy=class{constructor(e,n,i,r,o,a){this.name=PA,this.setupOnce=function(s){s(qA(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:a==null||a}))}}},sL=R!=null&&R.location?Hf(R.location.hash,"__posthog")||Hf(location.hash,"state"):null,YC="_postHogToolbarParams",WC=ct("[Toolbar]"),Jr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Jr||{}),uy=class{constructor(e){this.instance=e}_t(e){J.ph_toolbar_state=e}yt(){var e;return(e=J.ph_toolbar_state)!==null&&e!==void 0?e:Jr.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!R||!$)return!1;e=e??R.location,i=i??R.history;try{if(!n){try{R.localStorage.setItem("test","test"),R.localStorage.removeItem("test")}catch{return!1}n=R?.localStorage}var r,o=sL||Hf(e.hash,"__posthog")||Hf(e.hash,"state"),a=o?DC((()=>JSON.parse(atob(decodeURIComponent(o)))))||DC((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(YC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=J.ph_load_toolbar||J.ph_load_editor;!Ce(n)&&to(n)?n(e,this.instance):WC.warn("No toolbar load function found")}loadToolbar(e){var n=!($==null||!$.getElementById(OA));if(!R||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=P({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(R.localStorage.setItem(YC,JSON.stringify(P({},r,{source:void 0}))),this.yt()===Jr.LOADED)this.bt(r);else if(this.yt()===Jr.UNINITIALIZED){var o;this._t(Jr.LOADING),(o=J.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return WC.error("[Toolbar] Failed to load",a),void this._t(Jr.UNINITIALIZED);this._t(Jr.LOADED),this.bt(r)})),rt(R,"turbolinks:load",(()=>{this._t(Jr.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},lL=ct("[TracingHeaders]"),dy=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;B(this.xt)&&((n=J.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),B(this.St)&&((i=J.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return lL.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Ln="Mobile",Bf="iOS",fi="Android",kc="Tablet",ZA=fi+" "+kc,GA="iPad",YA="Apple",WA=YA+" Watch",Tc="Safari",Ns="BlackBerry",XA="Samsung",KA=XA+"Browser",QA=XA+" Internet",ia="Chrome",cL=ia+" OS",JA=ia+" "+Bf,qy="Internet Explorer",ek=qy+" "+Ln,Zy="Opera",uL=Zy+" Mini",Gy="Edge",tk="Microsoft "+Gy,Rs="Firefox",nk=Rs+" "+Bf,Rc="Nintendo",Oc="PlayStation",Os="Xbox",ik=fi+" "+Ln,rk=Ln+" "+Tc,_c="Windows",fy=_c+" Phone",XC="Nokia",py="Ouya",ok="Generic",dL=ok+" "+Ln.toLowerCase(),ak=ok+" "+kc.toLowerCase(),hy="Konqueror",Ht="(\\d+(\\.\\d+)?)",wv=new RegExp("Version/"+Ht),fL=new RegExp(Os,"i"),pL=new RegExp(Oc+" \\w+","i"),hL=new RegExp(Rc+" \\w+","i"),Yy=new RegExp(Ns+"|PlayBook|BB10","i"),gL={"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"},mL=(t,e)=>e&&de(e,YA)||(function(n){return de(n,Tc)&&!de(n,ia)&&!de(n,fi)})(t),sk=function(t,e){return e=e||"",de(t," OPR/")&&de(t,"Mini")?uL:de(t," OPR/")?Zy:Yy.test(t)?Ns:de(t,"IE"+Ln)||de(t,"WPDesktop")?ek:de(t,KA)?QA:de(t,Gy)||de(t,"Edg/")?tk:de(t,"FBIOS")?"Facebook "+Ln:de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?JA:de(t,"CrMo")||de(t,ia)?ia:de(t,fi)&&de(t,Tc)?ik:de(t,"FxiOS")?nk:de(t.toLowerCase(),hy.toLowerCase())?hy:mL(t,e)?de(t,Ln)?rk:Tc:de(t,Rs)?Rs:de(t,"MSIE")||de(t,"Trident/")?qy:de(t,"Gecko")?Rs:""},vL={[ek]:[new RegExp("rv:"+Ht)],[tk]:[new RegExp(Gy+"?\\/"+Ht)],[ia]:[new RegExp("("+ia+"|CrMo)\\/"+Ht)],[JA]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Tc]:[wv],[rk]:[wv],[Zy]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Rs]:[new RegExp(Rs+"\\/"+Ht)],[nk]:[new RegExp("FxiOS\\/"+Ht)],[hy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Ns]:[new RegExp(Ns+" "+Ht),wv],[ik]:[new RegExp("android\\s"+Ht,"i")],[QA]:[new RegExp(KA+"\\/"+Ht)],[qy]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},yL=function(t,e){var n=sk(t,e),i=vL[n];if(B(i))return null;for(var r=0;r<i.length;r++){var o=i[r],a=t.match(o);if(a)return parseFloat(a[a.length-2])}return null},KC=[[new RegExp(Os+"; "+Os+" (.*?)[);]","i"),t=>[Os,t&&t[1]||""]],[new RegExp(Rc,"i"),[Rc,""]],[new RegExp(Oc,"i"),[Oc,""]],[Yy,[Ns,""]],[new RegExp(_c,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[fy,""];if(new RegExp(Ln).test(e)&&!/IEMobile\b/.test(e))return[_c+" "+Ln,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=gL[i]||"";return/arm/i.test(e)&&(r="RT"),[_c,r]}return[_c,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Bf,e.join(".")]}return[Bf,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=B(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+fi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[fi,e.join(".")]}return[fi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cL,""]],[/Linux|debian/i,["Linux",""]]],QC=function(t){return hL.test(t)?Rc:pL.test(t)?Oc:fL.test(t)?Os:new RegExp(py,"i").test(t)?py:new RegExp("("+fy+"|WPDesktop)","i").test(t)?fy:/iPad/.test(t)?GA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?WA:Yy.test(t)?Ns:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(XC,"i").test(t)?XC:/(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(Ln).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)?fi:ZA:fi:new RegExp("(pda|"+Ln+")","i").test(t)?dL:new RegExp(kc,"i").test(t)&&!new RegExp(kc+" pc","i").test(t)?ak:""},xf="https?://(.*)",Is=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],bL=Ls(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Is),Lc="<masked>",_L=["li_fat_id"];function lk(t,e,n){if(!$)return{};var i,r=e?Ls([],Is,n||[]):[],o=ck(Dc($.URL,r,Lc),t),a=(i={},Me(_L,(function(s){var l=pi.q(s);i[s]=l||null})),i);return Xe(a,o)}function ck(t,e){var n=bL.concat(e||[]),i={};return Me(n,(function(r){var o=If(t,r);i[r]=o||null})),i}function uk(t){var e=(function(o){return o?o.search(xf+"google.([^/?]*)")===0?"google":o.search(xf+"bing.com")===0?"bing":o.search(xf+"yahoo.com")===0?"yahoo":o.search(xf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!tr(e)){i.$search_engine=e;var r=$?If($.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function JC(){return navigator.language||navigator.userLanguage}function dk(){return $?.referrer||"$direct"}function fk(t,e){var n=t?Ls([],Is,e||[]):[],i=Kt?.href.substring(0,1e3);return{r:dk().substring(0,1e3),u:i?Dc(i,n,Lc):void 0}}function pk(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Lf(n))==null?void 0:e.host};if(i){r.$current_url=i;var o=Lf(i);r.$host=o?.host,r.$pathname=o?.pathname;var a=ck(i);Xe(r,a)}if(n){var s=uk(n);Xe(r,s)}return r}function hk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function xL(){try{return new Date().getTimezoneOffset()}catch{return}}function SL(t,e){if(!Xt)return{};var n,i,r,o=t?Ls([],Is,e||[]):[],[a,s]=(function(l){for(var c=0;c<KC.length;c++){var[u,d]=KC[c],p=u.exec(l),g=p&&(to(d)?d(p,l):d);if(g)return g}return["",""]})(Xt);return Xe(Uy({$os:a,$os_version:s,$browser:sk(Xt,navigator.vendor),$device:QC(Xt),$device_type:(i=Xt,r=QC(i),r===GA||r===ZA||r==="Kobo"||r==="Kindle Fire"||r===ak?kc:r===Rc||r===Os||r===Oc||r===py?"Console":r===WA?"Wearable":r?Ln:"Desktop"),$timezone:hk(),$timezone_offset:xL()}),{$current_url:Dc(Kt?.href,o,Lc),$host:Kt?.host,$pathname:Kt?.pathname,$raw_user_agent:Xt.length>1e3?Xt.substring(0,997)+"...":Xt,$browser_version:yL(Xt,navigator.vendor),$browser_language:JC(),$browser_language_prefix:(n=JC(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:R?.screen.height,$screen_width:R?.screen.width,$viewport_height:R?.innerHeight,$viewport_width:R?.innerWidth,$lib:"web",$lib_version:Ki.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Xr=ct("[Web Vitals]"),eA=9e5,gy=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>P({},i,{["$web_vitals_"+r.name+"_event"]:P({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(B(o))Xr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();B(a)||(Ce(i?.name)||Ce(i?.value)?Xr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Xr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),B(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=B(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(P({},i,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,o,a,s=J.__PosthogExtensions__;B(s)||B(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),i&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Xr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[zC]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=pt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return B(i)?((n=this._instance.persistence)==null?void 0:n.props[BC])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=pt(this._instance.config.capture_performance)&&hi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:eA;return 0<e&&e<=6e4?eA:e}get isEnabled(){var e=Kt?.protocol;if(e!=="http:"&&e!=="https:")return Xr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:no(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return no(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Xr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=pt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=pt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[zC]:n}),this._instance.persistence.register({[BC]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Xr.error("failed to load script",r):e()}))}Tt(){var e=R?R.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Ls([],Is,i||[]):[];return Dc(e,r,Lc)}Xr.error("Could not determine current URL")}},wL=ct("[Heatmaps]");function tA(t){return pt(t)&&"clientX"in t&&"clientY"in t&&hi(t.clientX)&&hi(t.clientY)}var my=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[Gv]),this.rageclicks=new Df(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return pt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return B(this.instance.config.capture_heatmaps)?B(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;wL.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Gv]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})($)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){R&&$&&(this.jt=this.Dt.bind(this),rt(R,"beforeunload",this.jt),this.Lt=e=>this.At(e||R?.event),rt($,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||R?.event),rt($,"mousemove",this.Nt,{capture:!0}),this.zt=new zf(this.instance,rL,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),rt($,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;R&&$&&(this.jt&&R.removeEventListener("beforeunload",this.jt),this.Lt&&$.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&$.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&$.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=(function(s,l,c){for(var u=s;u&&Wf(u)&&!ro(u,"body");){if(u===c)return!1;if(de(l,R?.getComputedStyle(u).position))return!0;u=HA(u)}return!1})(LA(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!$C(e.target)&&tA(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(P({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!$C(e.target)&&tA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(R){var n=R.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=i?Ls([],Is,r||[]):[],a=Dc(n,o,Lc);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!ks(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},vy=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=R?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!(B(a)||B(s)||B(l)||B(c)||B(u)||B(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var p=a<=1?1:di(s/a,0,1,F),g=a<=1?1:di(l/a,0,1,F),_=c<=1?1:di(u/c,0,1,F),b=c<=1?1:di(d/c,0,1,F);r=Xe(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},In=Uint8Array,zt=Uint16Array,Ds=Uint32Array,Wy=new In([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]),Xy=new In([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]),nA=new In([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gk=function(t,e){for(var n=new zt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Ds(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},mk=gk(Wy,2),EL=mk[0],yy=mk[1];EL[28]=258,yy[258]=28;for(by=gk(Xy,0)[1],$f=new zt(32768),Ne=0;Ne<32768;++Ne)Kr=(43690&Ne)>>>1|(21845&Ne)<<1,Kr=(61680&(Kr=(52428&Kr)>>>2|(13107&Kr)<<2))>>>4|(3855&Kr)<<4,$f[Ne]=((65280&Kr)>>>8|(255&Kr)<<8)>>>1;var Kr,by,$f,Ne,wc=function(t,e,n){for(var i=t.length,r=0,o=new zt(e);r<i;++r)++o[t[r]-1];var a,s=new zt(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(n){a=new zt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=s[t[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[$f[d]>>>l]=c}else for(a=new zt(i),r=0;r<i;++r)a[r]=$f[s[t[r]-1]++]>>>15-t[r];return a},ra=new In(288);for(Ne=0;Ne<144;++Ne)ra[Ne]=8;for(Ne=144;Ne<256;++Ne)ra[Ne]=9;for(Ne=256;Ne<280;++Ne)ra[Ne]=7;for(Ne=280;Ne<288;++Ne)ra[Ne]=8;var Ff=new In(32);for(Ne=0;Ne<32;++Ne)Ff[Ne]=5;var CL=wc(ra,9,0),AL=wc(Ff,5,0),vk=function(t){return(t/8>>0)+(7&t&&1)},yk=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof zt?zt:t instanceof Ds?Ds:In)(n-e);return i.set(t.subarray(e,n)),i},Xi=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},uc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Ev=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new In(0),0];if(r==1){var a=new In(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(S,w){return S.f-w.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var p=o[0].s;for(i=1;i<r;++i)o[i].s>p&&(p=o[i].s);var g=new zt(p+1),_=_y(n[u-1],g,0);if(_>e){i=0;var b=0,x=_-e,f=1<<x;for(o.sort((function(S,w){return g[w.s]-g[S.s]||S.f-w.f}));i<r;++i){var h=o[i].s;if(!(g[h]>e))break;b+=f-(1<<_-g[h]),g[h]=e}for(b>>>=x;b>0;){var y=o[i].s;g[y]<e?b-=1<<e-g[y]++-1:++i}for(;i>=0&&b;--i){var m=o[i].s;g[m]==e&&(--g[m],++b)}_=e}return[new In(g),_]},_y=function(t,e,n){return t.s==-1?Math.max(_y(t.l,e,n+1),_y(t.r,e,n+1)):e[t.s]=n},iA=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zt(++e),i=0,r=t[0],o=1,a=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=t[s]}return[n.subarray(0,i),e]},dc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},xy=function(t,e,n){var i=n.length,r=vk(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<i;++o)t[r+o+4]=n[o];return 8*(r+4+i)},rA=function(t,e,n,i,r,o,a,s,l,c,u){Xi(e,u++,n),++r[256];for(var d=Ev(r,15),p=d[0],g=d[1],_=Ev(o,15),b=_[0],x=_[1],f=iA(p),h=f[0],y=f[1],m=iA(b),S=m[0],w=m[1],C=new zt(19),k=0;k<h.length;++k)C[31&h[k]]++;for(k=0;k<S.length;++k)C[31&S[k]]++;for(var T=Ev(C,7),E=T[0],M=T[1],N=19;N>4&&!E[nA[N-1]];--N);var I,H,q,V,ie=c+5<<3,D=dc(r,ra)+dc(o,Ff)+a,Y=dc(r,p)+dc(o,b)+a+14+3*N+dc(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(ie<=D&&ie<=Y)return xy(e,u,t.subarray(l,l+c));if(Xi(e,u,1+(Y<D)),u+=2,Y<D){I=wc(p,g,0),H=p,q=wc(b,x,0),V=b;var ee=wc(E,M,0);for(Xi(e,u,y-257),Xi(e,u+5,w-1),Xi(e,u+10,N-4),u+=14,k=0;k<N;++k)Xi(e,u+3*k,E[nA[k]]);u+=3*N;for(var me=[h,S],Ke=0;Ke<2;++Ke){var Mt=me[Ke];for(k=0;k<Mt.length;++k){var Qt=31&Mt[k];Xi(e,u,ee[Qt]),u+=E[Qt],Qt>15&&(Xi(e,u,Mt[k]>>>5&127),u+=Mt[k]>>>12)}}}else I=CL,H=ra,q=AL,V=Ff;for(k=0;k<s;++k)if(i[k]>255){Qt=i[k]>>>18&31,uc(e,u,I[Qt+257]),u+=H[Qt+257],Qt>7&&(Xi(e,u,i[k]>>>23&31),u+=Wy[Qt]);var oa=31&i[k];uc(e,u,q[oa]),u+=V[oa],oa>3&&(uc(e,u,i[k]>>>5&8191),u+=Xy[oa])}else uc(e,u,I[i[k]]),u+=H[i[k]];return uc(e,u,I[256]),u+H[256]},kL=new Ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),TL=(function(){for(var t=new Ds(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),RL=function(t,e,n,i,r){return(function(o,a,s,l,c,u){var d=o.length,p=new In(l+d+5*(1+Math.floor(d/7e3))+c),g=p.subarray(l,p.length-c),_=0;if(!a||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?_=xy(g,_,o.subarray(b,x)):(g[b]=u,_=xy(g,_,o.subarray(b,d)))}else{for(var f=kL[a-1],h=f>>>13,y=8191&f,m=(1<<s)-1,S=new zt(32768),w=new zt(m+1),C=Math.ceil(s/3),k=2*C,T=function(cp){return(o[cp]^o[cp+1]<<C^o[cp+2]<<k)&m},E=new Ds(25e3),M=new zt(288),N=new zt(32),I=0,H=0,q=(b=0,0),V=0,ie=0;b<d;++b){var D=T(b),Y=32767&b,ee=w[D];if(S[Y]=ee,w[D]=Y,V<=b){var me=d-b;if((I>7e3||q>24576)&&me>423){_=rA(o,g,0,E,M,N,H,q,ie,b-ie,_),q=I=H=0,ie=b;for(var Ke=0;Ke<286;++Ke)M[Ke]=0;for(Ke=0;Ke<30;++Ke)N[Ke]=0}var Mt=2,Qt=0,oa=y,rr=Y-ee&32767;if(me>2&&D==T(b-rr))for(var HT=Math.min(h,me)-1,zT=Math.min(32767,b),BT=Math.min(258,me);rr<=zT&&--oa&&Y!=ee;){if(o[b+Mt]==o[b+Mt-rr]){for(var or=0;or<BT&&o[b+or]==o[b+or-rr];++or);if(or>Mt){if(Mt=or,Qt=rr,or>HT)break;var $T=Math.min(rr,or-2),Lb=0;for(Ke=0;Ke<$T;++Ke){var lp=b-rr+Ke+32768&32767,Ib=lp-S[lp]+32768&32767;Ib>Lb&&(Lb=Ib,ee=lp)}}}rr+=(Y=ee)-(ee=S[Y])+32768&32767}if(Qt){E[q++]=268435456|yy[Mt]<<18|by[Qt];var Hb=31&yy[Mt],zb=31&by[Qt];H+=Wy[Hb]+Xy[zb],++M[257+Hb],++N[zb],V=b+Mt,++I}else E[q++]=o[b],++M[o[b]]}}_=rA(o,g,u,E,M,N,H,q,ie,b-ie,_)}return yk(p,0,l+vk(_)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},Cv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function OL(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=TL[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,o=RL(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=o.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Cv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(o,e),Cv(o,a-8,n.d()),Cv(o,a-4,i),o}var ML=function(t){var e,n,i,r,o="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
440
+ `,On,Fr,$r,Vi,ji,Ur,Pi,Wm=class extends HTMLElement{constructor(){super();ar(this,On);ar(this,Fr);ar(this,$r);ar(this,Vi);ar(this,ji);ar(this,Ur,null);ar(this,Pi,null);Kn(this,On,this.attachShadow({mode:"open",delegatesFocus:!0})),Kn(this,Fr,document.createElement("div")),ge(this,Fr).setAttribute("part","mount"),ge(this,On).appendChild(ge(this,Fr)),Kn(this,$r,document.createElement("div")),ge(this,$r).id="portalRoot",ge(this,On).appendChild(ge(this,$r)),Kn(this,Vi,document.createElement("div")),ge(this,Vi).id="overlayContainer",Object.assign(ge(this,Vi).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,On).appendChild(ge(this,Vi)),Kn(this,ji,RE()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Ur)?.unmount(),Kn(this,Ur,null)}getMountNode(){return ge(this,Fr)}getController(){return ge(this,ji)}getPortalRoot(){return ge(this,$r)}getOverlayContainer(){return ge(this,Vi)}getShadowRoot(){return ge(this,On)}open(){ge(this,ji).setOpen(!0)}close(){ge(this,ji).setOpen(!1)}toggle(){ge(this,ji).toggle()}setOverrideFetcher(n){ge(this,Pi)&&(Kn(this,Pi,{...ge(this,Pi),fetcher:n}),this.render())}mountReactApp(n){Kn(this,Pi,n),this.render()}render(){!this.isConnected||!ge(this,Pi)||(ge(this,Ur)||Kn(this,Ur,(0,PE.createRoot)(ge(this,Fr))),ge(this,Ur).render((0,Xm.jsx)(ME,{shadowRoot:ge(this,On),portalRoot:ge(this,$r),overlayContainer:ge(this,Vi),children:(0,Xm.jsx)(UE,{...ge(this,Pi),controller:ge(this,ji),canvasHost:this})})))}applyBaseStyles(){if(ge(this,On).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(jE),ge(this,On).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=jE,ge(this,On).appendChild(n)}}};On=new WeakMap,Fr=new WeakMap,$r=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Ur=new WeakMap,Pi=new WeakMap;var qE=()=>{typeof window>"u"||customElements.get(VE)||customElements.define(VE,Wm)};var Km=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let b=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=vE(b)}let n=null,i=null,r=null,{runtime:o}=t;async function a(b){!o?.actions||b.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(b))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();n=b,console.log("[SmartCanvas] Config fetched:",`tiles=${b.tiles?.length??0},`,`actions=${b.actions?.length??0},`,`theme=${b.theme?.mode??"default"}`),b.actions?.length&&console.log("[SmartCanvas] Actions to apply:",b.actions.map((f,p)=>`[${p}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await a(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&Wd(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=xE();qE();let c=document.createElement("smart-canvas");if(TE(c.getOverlayContainer()),t.tokens)for(let[b,f]of Object.entries(t.tokens))c.style.setProperty(b,f);let u=()=>{let b=t.target??document.body;b&&b.appendChild(c)};document.body?u():document.addEventListener("DOMContentLoaded",u,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),wE(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,g=t.fetcher??rs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=g);let S={fetcher:g,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:h,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:r,workspaceTheme:t.workspaceTheme};c.mountReactApp(S),t.defaultOpen&&c.open();let _={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{s(),c.remove()},setTokens:b=>{for(let[f,p]of Object.entries(b))c.style.setProperty(f,p)},getConfig:async()=>{if(i)try{let b=await i();return n=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return n??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?n&&await a(n.actions):await s()},setOverrideFetcher:b=>{i=b,c.setOverrideFetcher(b),o?.accumulator&&b().then(f=>{f?.tiles&&Wd(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{h?.register?.(b)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(b,f)=>h?.track?(h.track(b,f),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=_)}return _};typeof window<"u"&&(window.SmartCanvas={async create(t){return Km(t)}});var jr=X(Qe(),1);var Vr=X($e(),1);function nB({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,jr.useState)(0),o=(0,jr.useMemo)(()=>[...t].sort((a,s)=>(a.priority??0)-(s.priority??0)),[t]);return(0,jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,jr.useEffect)(()=>{if(o.length<=1)return;let a=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(a)},[o,e]),(0,jr.useEffect)(()=>{let a=o[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,o,n]),o.length?(0,Vr.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:"var(--sc-tile-border)",background:"var(--sc-tile-background)",padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,Vr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${o.length*100}%`},children:o.map(a=>(0,Vr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Vr.jsx)(Ql,{config:a,surface:"wheel",telemetry:n})},a.id))}),(0,Vr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((a,s)=>(0,Vr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},a.id))})]}):null}function Jl(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function oB(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",o=Jl(r),a=Jl(zr);return o.major>a.major&&e.push(`Config schema v${r} is newer than SDK v${zr}. Some features may not work. Update SDK to latest version.`),o.major<a.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${zr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:bD(i,r)}):{valid:!0,warnings:e,errors:n}}function bD(t,e){let n={...t};return Jl(e).major===1&&(n=_D(n)),n.schemaVersion=zr,n}function _D(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function aB(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=Jl(n),r=Jl(zr);return i.major<r.major||!e.schemaVersion}var GE={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function YE(){return GE}function Qm(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function ec(t,e,n){return n===2?Qm(Qm(t+e)+"")%1e4/1e4:n===1?Qm(e+t)%1e3/1e3:null}function SD(t){return t<=0?[]:new Array(t).fill(1/t)}function ef(t,e){return t>=e[0]&&t<e[1]}function WE(t,e){let n=ec("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function XE(t,e){for(let n=0;n<e.length;n++)if(ef(t,e[n]))return n;return-1}function ev(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function tf(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let o=ED(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else n=!0,o&&(i=!0)}return i||!n}function xD(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function wD(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,o)=>{i.push([t.searchParams.get(o)||"",r,!1])}),!i.some(r=>!xD(r[0],r[1],r[2]))}catch{return!1}}function ED(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=ev(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return wD(i,n);return!1}catch{return!1}}function KE(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=SD(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,s)=>s+a,0);(r<.99||r>1.01)&&(n=i);let o=0;return n.map(a=>{let s=o;return o+=a,[s,s+e*a]})}function QE(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function JE(t){try{return t()}catch(e){return console.error(e),!1}}var Jm=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function zo(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||GE.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",Jm(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:Jm(r)},i,Jm(o));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function tc(t){return typeof t=="string"?t:JSON.stringify(t)}function pn(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function eC(){let t;try{t="1.6.4"}catch{t=""}return t}function tC(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,o)=>{i.searchParams.has(o)||i.searchParams.set(o,r)}),i.toString()}function ZE(t){return typeof t=="object"&&t!==null}function nf(t){return t.urlPatterns&&t.variations.some(e=>ZE(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>ZE(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function rf(t,e){return new Promise(n=>{let i=!1,r,o=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>o(),e)),t.then(a=>o(a)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},si=YE(),us={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>si.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return si.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new si.EventSource(`${t}/sub/${e}`,{headers:n}):new si.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),TD()):document.visibilityState==="hidden"&&(t=window.setTimeout(AD,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(si.localStorage=globalThis.localStorage)}catch{}var ds=new Map,nC=!1,qi=new Map,of=new Map,fs=new Map,ps=new Set;function rC(t){Object.assign(Rt,t),Rt.backgroundSync||av()}async function oC({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Rt.backgroundSync=!1),kD({instance:t,allowStale:i,timeout:e,skipCache:n})}function CD(t){let e=nc(t),n=ds.get(e)||new Set;n.add(t),ds.set(e,n)}function aC(t){ds.forEach(e=>e.delete(t))}function AD(){fs.forEach(t=>{t&&(t.state="idle",rv(t))})}function TD(){fs.forEach(t=>{t&&t.state==="idle"&&ov(t)})}async function iC(){try{if(!si.localStorage)return;await si.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(qi.entries())))}catch{}}async function kD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=nc(t),o=nv(t),a=new Date,s=new Date(a.getTime()-Rt.maxAge+Rt.staleTTL);await RD();let l=!Rt.disableCache&&!i?qi.get(o):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>s?(l.sse&&ps.add(r),l.staleAt<a?tv(t):iv(t),{data:l.data,success:!0,source:"cache"}):await rf(tv(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function nc(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function nv(t){let e=nc(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let o=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:a})}`}async function RD(){if(!nC){nC=!0;try{if(si.localStorage){let t=await si.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{qi.set(n,{...i,staleAt:new Date(i.staleAt)})}),sC()}}}catch{}if(!Rt.disableIdleStreams){let t=us.startIdleListener();t&&(us.stopIdleListener=t)}}}function sC(){let t=Array.from(qi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,qi.size-Rt.maxEntries),qi.size);for(let n=0;n<e;n++)qi.delete(t[n].key)}function lC(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:qi.get(e);if(o&&i&&o.version===i){o.staleAt=r,iC();return}Rt.disableCache||(qi.set(e,{data:n,version:i,staleAt:r,sse:ps.has(t)}),sC()),iC();let a=ds.get(t);a&&a.forEach(s=>OD(s,n))}async function OD(t,e){await t.setPayload(e||t.getPayload())}async function tv(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=nc(t),a=nv(t),s=of.get(a);return s||(s=(r?us.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):us.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&ps.add(o),c.json()}).then(c=>(lC(o,a,c),iv(t),of.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(of.delete(a),{data:null,source:"error",success:!1,error:c})),of.set(a,s)),s}function iv(t,e=!1){let n=nc(t),i=nv(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),a=t.getClientKey();if(e&&ps.add(n),Rt.backgroundSync&&ps.has(n)&&si.EventSource){if(fs.has(n))return;let s={src:null,host:r,clientKey:a,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=ds.get(n);c&&c.forEach(u=>{tv(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);lC(n,i,c)}s.errors=0}catch{cC(s)}},errors:0,state:"active"};fs.set(n,s),ov(s)}}function cC(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);rv(t),setTimeout(()=>{["idle","active"].includes(t.state)||ov(t)},Math.min(e,3e5))}}function rv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function ov(t){t.src=us.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>cC(t),t.src.onopen=()=>{t.errors=0}}function MD(t,e){rv(t),fs.delete(e)}function av(){ps.clear(),fs.forEach(MD),ds.clear(),us.stopIdleListener()}function af(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&iv(t,!0),CD(t)}}var ND=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,cv={revert:function(){}},uf=new Map,uv=new Set;function DD(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function df(t){var e=uf.get(t);return e||(e={element:t,attributes:{}},uf.set(t,e)),e}function ff(t,e,n,i,r){var o=n(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&a._positionTimeout)){e==="position"&&(a._positionTimeout=setTimeout(function(){a._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===a.virtualValue.parentNode&&s.insertBeforeNode===a.virtualValue.insertBeforeNode||s!==a.virtualValue&&(a.originalValue=s,r(a))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,DD(e)),a}function pf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,uC()):t!==n&&(e.isDirty=!0,uC())}function LD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),pf(YD(e),t)}function ID(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),pf(Array.from(e).filter(Boolean).join(" "),t)}function HD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),pf(e,t)}function zD(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function BD(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=zD(i);e=r||e}),pf(e,t)}var FD=function(e){return e.innerHTML},$D=function(e,n){return e.innerHTML=n};function fC(t){var e=df(t);return e.html||(e.html=ff(t,"html",FD,$D,LD)),e.html}var UD=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},VD=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function pC(t){var e=df(t);return e.position||(e.position=ff(t,"position",UD,VD,BD)),e.position}var jD=function(e,n){return n?e.className=n:e.removeAttribute("class")},PD=function(e){return e.className};function hC(t){var e=df(t);return e.classes||(e.classes=ff(t,"class",PD,jD,ID)),e.classes}var qD=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},ZD=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function gC(t,e){var n=df(t);return n.attributes[e]||(n.attributes[e]=ff(t,e,qD(e),ZD(e),HD)),n.attributes[e]}function GD(t,e){var n=uf.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var o,a;(o=n.classes)==null||(a=o.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,d;(c=n.attributes)==null||(u=c[e])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[e]}}var sf;function YD(t){return sf||(sf=document.createElement("div")),sf.innerHTML=t,sf.innerHTML}function lf(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||GD(t,e),n.setValue(t,i)}}function WD(t,e){t.html&&lf(e,"html",t.html),t.classes&&lf(e,"class",t.classes),t.position&&lf(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){lf(e,n,t.attributes[n])})}function uC(){uf.forEach(WD)}function XD(t,e){var n=null;t.kind==="html"?n=fC(e):t.kind==="class"?n=hC(e):t.kind==="attribute"?n=gC(e,t.attribute):t.kind==="position"&&(n=pC(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function KD(t,e){var n=null;if(t.kind==="html"?n=fC(e):t.kind==="class"?n=hC(e):t.kind==="attribute"?n=gC(e,t.attribute):t.kind==="position"&&(n=pC(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function mC(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),XD(t,i))})}}function QD(t){t.elements.forEach(function(e){return KD(t,e)}),t.elements.clear(),uv.delete(t)}function dC(){uv.forEach(mC)}var sv;function JD(){typeof document>"u"||(sv||(sv=new MutationObserver(function(){dC()})),dC(),sv.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}JD();function hf(t){return typeof document>"u"?cv:(uv.add(t),mC(t),{revert:function(){QD(t)}})}function lv(t,e){return hf({kind:"html",elements:new Set,mutate:e,selector:t})}function vC(t,e){return hf({kind:"position",elements:new Set,mutate:e,selector:t})}function ic(t,e){return hf({kind:"class",elements:new Set,mutate:e,selector:t})}function cf(t,e,n){return ND.test(e)?e==="class"||e==="className"?ic(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return i.add(o)})}):hf({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):cv}function e4(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return lv(e,function(s){return s+(i??"")});if(n==="set")return lv(e,function(){return i??""})}else if(r==="class"){if(n==="append")return ic(e,function(s){i&&s.add(i)});if(n==="remove")return ic(e,function(s){i&&s.delete(i)});if(n==="set")return ic(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&o)return vC(e,function(){return{insertBeforeSelector:a,parentSelector:o}})}else{if(n==="append")return cf(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return cf(e,r,function(){return i??""});if(n==="remove")return cf(e,r,function(){return null})}return cv}var t4={html:lv,classes:ic,attribute:cf,position:vC,declarative:e4},yC=t4;var dv={};function Pr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!SC(t,r,n))return!1;break;case"$nor":if(SC(t,r,n))return!1;break;case"$and":if(!a4(t,r,n))return!1;break;case"$not":if(Pr(t,r,n))return!1;break;default:if(!rc(r,n4(t,i),n))return!1}return!0}function n4(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function bC(t,e=!1){let n=`${t}${e?"/i":""}`;return dv[n]||(dv[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),dv[n]}function rc(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!xC(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!o4(r,e,t[r],n))return!1;return!0}function xC(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function i4(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function r4(t,e,n){if(!Array.isArray(t))return!1;let i=xC(e)?r=>rc(e,r,n):r=>Pr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function hs(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>i(r)===i(o))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function _C(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let a=0;a<t.length;a++)if(rc(e[r],t[a],n,i)){o=!0;break}if(!o)return!1}return!0}function o4(t,e,n,i){switch(t){case"$veq":return pn(e)===pn(n);case"$vne":return pn(e)!==pn(n);case"$vgt":return pn(e)>pn(n);case"$vgte":return pn(e)>=pn(n);case"$vlt":return pn(e)<pn(n);case"$vlte":return pn(e)<=pn(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?hs(e,n):!1;case"$ini":return Array.isArray(n)?hs(e,n,!0):!1;case"$inGroup":return hs(e,i[n]||[]);case"$notInGroup":return!hs(e,i[n]||[]);case"$nin":return Array.isArray(n)?!hs(e,n):!1;case"$nini":return Array.isArray(n)?!hs(e,n,!0):!1;case"$not":return!rc(n,e,i);case"$size":return Array.isArray(e)?rc(n,e.length,i):!1;case"$elemMatch":return r4(e,n,i);case"$all":return Array.isArray(n)?_C(e,n,i):!1;case"$alli":return Array.isArray(n)?_C(e,n,i,!0):!1;case"$regex":try{return bC(n).test(e)}catch{return!1}case"$regexi":try{return bC(n,!0).test(e)}catch{return!1}case"$type":return i4(e)===n;default:return console.error("Unknown operator: "+t),!1}}function SC(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Pr(t,e[i],n))return!0;return!1}function a4(t,e,n){for(let i=0;i<e.length;i++)if(!Pr(t,e[i],n))return!1;return!0}var s4="Feature Evaluated",l4="Experiment Viewed";function c4(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function u4(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function gs(t){try{await t()}catch{}}function wC(t,e,n){if(t.user.trackedExperiments){let r=vf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(gs(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(gs(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(gs(()=>r(l4,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function d4(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;gs(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;gs(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;gs(()=>i(s4,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function gf(t,e){if(e.stack.evaluatedFeatures.has(t))return qr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=c4(e);if(n.has(t))return qr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return qr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of i.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=gf(l.id,e);if(c.source==="cyclicPrerequisite")return qr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Pr(u,l.condition||{})){if(l.gate)return qr(e,t,null,"prerequisite");continue e}}if(o.filters&&AC(o.filters,e))continue;if("force"in o){if(o.condition&&!CC(o.condition,e)||!f4(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!wC(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),qr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let a={variations:o.variations,key:o.key||t};"coverage"in o&&(a.coverage=o.coverage),o.weights&&(a.weights=o.weights),o.hashAttribute&&(a.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(a.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(a.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(a.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(a.minBucketVersion=o.minBucketVersion),o.namespace&&(a.namespace=o.namespace),o.meta&&(a.meta=o.meta),o.ranges&&(a.ranges=o.ranges),o.name&&(a.name=o.name),o.phase&&(a.phase=o.phase),o.seed&&(a.seed=o.seed),o.hashVersion&&(a.hashVersion=o.hashVersion),o.filters&&(a.filters=o.filters),o.condition&&(a.condition=o.condition);let{result:s}=mf(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,s),s.inExperiment&&!s.passthrough)return qr(e,t,s.value,"experiment",o.id,a,s)}}return qr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function mf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:je(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:je(n,t,-1,!1,e)};if(t=p4(t,n),t.urlPatterns&&!tf(n.user.url||"",t.urlPatterns))return{result:je(n,t,-1,!1,e)};let o=QE(i,n.user.url||"",r);if(o!==null)return{result:je(n,t,o,!1,e)};let a=u4(n);if(i in a){let b=a[i];return{result:je(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:je(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Bo(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:je(n,t,-1,!1,e)};let c=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:f}=m4({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=b>=0,c=b,d=!!f}if(!u){if(t.filters){if(AC(t.filters,n))return{result:je(n,t,-1,!1,e)}}else if(t.namespace&&!WE(l,t.namespace))return{result:je(n,t,-1,!1,e)};if(t.include&&!JE(t.include))return{result:je(n,t,-1,!1,e)};if(t.condition&&!CC(t.condition,n))return{result:je(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let f of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let p=gf(f.id,n);if(p.source==="cyclicPrerequisite")return{result:je(n,t,-1,!1,e)};let v={value:p.value};if(!Pr(v,f.condition||{}))return{result:je(n,t,-1,!1,e)}}}if(t.groups&&!g4(t.groups,n))return{result:je(n,t,-1,!1,e)}}if(t.url&&!h4(t.url,n))return{result:je(n,t,-1,!1,e)};let h=ec(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:je(n,t,-1,!1,e)};if(!u){let b=t.ranges||KE(r,t.coverage===void 0?1:t.coverage,t.weights);c=XE(h,b)}if(d)return{result:je(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:je(n,t,-1,!1,e)};if("force"in t)return{result:je(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:je(n,t,-1,!1,e)};if(t.status==="stopped")return{result:je(n,t,-1,!1,e)};let g=je(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:f,doc:p}=y4(n,s,tc(l),{[fv(t.key,t.bucketVersion)]:g.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[f]=p,n.user.saveStickyBucketAssignmentDoc(p))}let S=wC(n,t,g);S.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let _=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:_}}function qr(t,e,n,i,r,o,a){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return o&&(s.experiment=o),a&&(s.experimentResult=a),i!=="override"&&d4(t,e,s),s}function EC(t){return{...t.user.attributes,...t.user.attributeOverrides}}function CC(t,e){return Pr(EC(e),t,e.global.savedGroups||{})}function AC(t,e){return t.some(n=>{let{hashValue:i}=Bo(e,n.attribute);if(!i)return!0;let r=ec(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(o=>ef(r,o))})}function f4(t,e,n,i,r,o,a){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=Bo(t,n,i);if(!s)return!1;let l=ec(e,s,a||1);return l===null?!1:r?ef(l,r):o!==void 0?l<=o:!0}function je(t,e,n,i,r,o,a){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=Bo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},d={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(d.name=u.name),o!==void 0&&(d.bucket=o),u.passthrough&&(d.passthrough=u.passthrough),d}function p4(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=ev(t.url))),t}function Bo(t,e,n){let i=e||"id",r="",o=EC(t);return o[i]&&(r=o[i]),!r&&n&&(o[n]&&(r=o[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function h4(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function g4(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function m4({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:a}){n=n||0,o=o||0,i=i||"id",a=a||[];let s=fv(e,n),l=v4(t,i,r);if(o>0)for(let d=0;d<o;d++){let h=fv(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=a.findIndex(d=>d.key===c);return u<0?{variation:-1}:{variation:u}}function fv(t,e){return e=e||0,`${t}__${e}`}function pv(t,e){return`${t}||${e}`}function v4(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Bo(t,e),o=pv(i,tc(r)),{hashAttribute:a,hashValue:s}=Bo(t,n),l=s?pv(a,tc(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function y4(t,e,n,i){let r=pv(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...o,...i},s=JSON.stringify(o)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:s}}function b4(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(o=>{let a=i[o];if(a.rules)for(let s of a.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function TC(t,e,n){let i=hv(t,n);return e.getAllAssignments(i)}function hv(t,e){let n={};return b4(t,e).forEach(r=>{let{hashValue:o}=Bo(t,r);n[r]=tc(o)}),n}async function kC(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await zo(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await zo(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await zo(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function RC(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function vf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var ms=typeof window<"u"&&typeof document<"u",_4=eC(),oc=class{constructor(e){if(e=e||{},this.version=_4,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),ms&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await kC(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,af(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&rC(e.cacheSettings),e.payload)return await this.setPayload(e.payload),af(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return af(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return RC(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return oC({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await zo(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await zo(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,aC(this),e.destroyAllStreams&&av(),this.logs=[],ms&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=mf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),o,a;r?o=je(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:a}=mf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!n&&o.inExperiment&&i&&i.valueHash===s)return o;if(i&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=nf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?tC(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(tf(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:d}=this._getNavigateFunction();if(u)if(ms)Promise.all([...a?[rf(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,o)=>{i.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of n){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&nf(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return gf(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[vf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(vf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(ms?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=nf(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==i.protocol||o.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:ms?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!ms)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(yC.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await TC(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=hv(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var S4="https://experiment.syntrologie.com",gv=class{constructor(e={}){j(this,"gb");j(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new oc({...e,apiHost:e.apiHost??S4,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let n of this.featureListeners)n()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function mv(t={}){return new gv(t)}var OC="syntro_session_metrics",yf=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(OC);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(OC,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function vv(t={}){return new yf(t)}var m={};cR(m,{BRAND:()=>G4,DIRTY:()=>Fo,EMPTY_PATH:()=>C4,INVALID:()=>W,NEVER:()=>M3,OK:()=>Ot,ParseStatus:()=>wt,Schema:()=>ae,ZodAny:()=>Yr,ZodArray:()=>Wi,ZodBigInt:()=>Uo,ZodBoolean:()=>Vo,ZodBranded:()=>sc,ZodCatch:()=>Jo,ZodDate:()=>jo,ZodDefault:()=>Qo,ZodDiscriminatedUnion:()=>Sf,ZodEffects:()=>Dn,ZodEnum:()=>Xo,ZodError:()=>Yt,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>wf,ZodIntersection:()=>Go,ZodIssueCode:()=>D,ZodLazy:()=>Yo,ZodLiteral:()=>Wo,ZodMap:()=>xs,ZodNaN:()=>Es,ZodNativeEnum:()=>Ko,ZodNever:()=>Yn,ZodNull:()=>qo,ZodNullable:()=>ui,ZodNumber:()=>$o,ZodObject:()=>Wt,ZodOptional:()=>Mn,ZodParsedType:()=>V,ZodPipeline:()=>lc,ZodPromise:()=>Wr,ZodReadonly:()=>ea,ZodRecord:()=>xf,ZodSchema:()=>ae,ZodSet:()=>ws,ZodString:()=>Gr,ZodSymbol:()=>_s,ZodTransformer:()=>Dn,ZodTuple:()=>ci,ZodType:()=>ae,ZodUndefined:()=>Po,ZodUnion:()=>Zo,ZodUnknown:()=>Yi,ZodVoid:()=>Ss,addIssueToContext:()=>H,any:()=>n3,array:()=>a3,bigint:()=>K4,boolean:()=>UC,coerce:()=>O3,custom:()=>BC,date:()=>Q4,datetimeRegex:()=>HC,defaultErrorMap:()=>Zi,discriminatedUnion:()=>u3,effect:()=>x3,enum:()=>b3,function:()=>m3,getErrorMap:()=>vs,getParsedType:()=>li,instanceof:()=>W4,intersection:()=>d3,isAborted:()=>bf,isAsync:()=>ys,isDirty:()=>_f,isValid:()=>Zr,late:()=>Y4,lazy:()=>v3,literal:()=>y3,makeIssue:()=>ac,map:()=>h3,nan:()=>X4,nativeEnum:()=>_3,never:()=>r3,null:()=>t3,nullable:()=>E3,number:()=>$C,object:()=>s3,objectUtil:()=>yv,oboolean:()=>R3,onumber:()=>k3,optional:()=>w3,ostring:()=>T3,pipeline:()=>A3,preprocess:()=>C3,promise:()=>S3,quotelessJson:()=>x4,record:()=>p3,set:()=>g3,setErrorMap:()=>E4,strictObject:()=>l3,string:()=>FC,symbol:()=>J4,transformer:()=>x3,tuple:()=>f3,undefined:()=>e3,union:()=>c3,unknown:()=>i3,util:()=>ue,void:()=>o3});var ue;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},t.find=(r,o)=>{for(let a of r)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ue||(ue={}));var yv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yv||(yv={}));var V=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),li=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}};var D=ue.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"]),x4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Yt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Yt.create=t=>new Yt(t);var w4=(t,e)=>{let n;switch(t.code){case D.invalid_type:t.received===V.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case D.invalid_union:n="Invalid input";break;case D.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case D.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:n="Invalid function arguments";break;case D.invalid_return_type:n="Invalid function return type";break;case D.invalid_date:n="Invalid date";break;case D.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}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case D.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 D.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 D.custom:n="Invalid input";break;case D.invalid_intersection_types:n="Intersection results could not be merged";break;case D.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},Zi=w4;var MC=Zi;function E4(t){MC=t}function vs(){return MC}var ac=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},C4=[];function H(t,e){let n=vs(),i=ac({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Zi?void 0:Zi].filter(r=>!!r)});t.common.issues.push(i)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return W;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return W;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),Fo=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),bf=t=>t.status==="aborted",_f=t=>t.status==="dirty",Zr=t=>t.status==="valid",ys=t=>typeof Promise<"u"&&t instanceof Promise;var q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(q||(q={}));var Nn=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},NC=(t,e)=>{if(Zr(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;let n=new Yt(t.common.issues);return this._error=n,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var ae=class{get description(){return this._def.description}_getType(e){return li(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ys(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parseSync({data:e,path:i.path,parent:i});return NC(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Zr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Zr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(ys(r)?r:Promise.resolve(r));return NC(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=e(r),s=()=>o.addIssue({code:D.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Dn({schema:this,typeName:K.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 Mn.create(this,this._def)}nullable(){return ui.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wi.create(this)}promise(){return Wr.create(this,this._def)}or(e){return Zo.create([this,e],this._def)}and(e){return Go.create(this,e,this._def)}transform(e){return new Dn({...oe(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Qo({...oe(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new sc({typeName:K.ZodBranded,type:this,...oe(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Jo({...oe(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return lc.create(this,e)}readonly(){return ea.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},A4=/^c[^\s-]{8,}$/i,T4=/^[0-9a-z]+$/,k4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,R4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,O4=/^[a-z0-9_-]{21}$/i,M4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N4=/^[-+]?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)?)??$/,D4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,L4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",bv,I4=/^(?:(?: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])$/,H4=/^(?:(?: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])$/,z4=/^(([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]))$/,B4=/^(([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])$/,F4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,LC="((\\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])))",U4=new RegExp(`^${LC}$`);function IC(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function V4(t){return new RegExp(`^${IC(t)}$`)}function HC(t){let e=`${LC}T${IC(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function j4(t,e){return!!((e==="v4"||!e)&&I4.test(t)||(e==="v6"||!e)&&z4.test(t))}function P4(t,e){if(!M4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function q4(t,e){return!!((e==="v4"||!e)&&H4.test(t)||(e==="v6"||!e)&&B4.test(t))}var Gr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return H(o,{code:D.invalid_type,expected:V.string,received:o.parsedType}),W}let i=new wt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?H(r,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(r,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")D4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"email",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")bv||(bv=new RegExp(L4,"u")),bv.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"emoji",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")R4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"uuid",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")O4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"nanoid",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")A4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")T4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid2",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")k4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ulid",code:D.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),H(r,{validation:"url",code:D.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"regex",code:D.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?HC(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?U4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?V4(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:D.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?N4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"duration",code:D.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?j4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ip",code:D.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?P4(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"jwt",code:D.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?q4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cidr",code:D.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?F4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64",code:D.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?$4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64url",code:D.invalid_string,message:o.message}),i.dirty()):ue.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:D.invalid_string,...q.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...q.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,...q.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,...q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...q.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...q.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...q.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...q.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...q.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...q.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...q.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...q.errToObj(n)})}nonempty(e){return this.min(1,q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...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(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Gr.create=t=>new Gr({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...oe(t)});function Z4(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}var $o=class t extends ae{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)!==V.number){let o=this._getOrReturnCtx(e);return H(o,{code:D.invalid_type,expected:V.number,received:o.parsedType}),W}let i,r=new wt;for(let o of this._def.checks)o.kind==="int"?ue.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:D.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Z4(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:D.not_finite,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,q.toString(n))}gt(e,n){return this.setLimit("min",e,!1,q.toString(n))}lte(e,n){return this.setLimit("max",e,!0,q.toString(n))}lt(e,n){return this.setLimit("max",e,!1,q.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:q.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let 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"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$o.create=t=>new $o({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Uo=class t extends ae{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)!==V.bigint)return this._getInvalidInput(e);let i,r=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:D.invalid_type,expected:V.bigint,received:n.parsedType}),W}gte(e,n){return this.setLimit("min",e,!0,q.toString(n))}gt(e,n){return this.setLimit("min",e,!1,q.toString(n))}lte(e,n){return this.setLimit("max",e,!0,q.toString(n))}lt(e,n){return this.setLimit("max",e,!1,q.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:q.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Uo.create=t=>new Uo({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var Vo=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.boolean,received:i.parsedType}),W}return Ot(e.data)}};Vo.create=t=>new Vo({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var jo=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return H(o,{code:D.invalid_type,expected:V.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:D.invalid_date}),W}let i=new wt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:D.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:D.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ue.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:q.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:q.toString(n)})}get minDate(){let e=null;for(let 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(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};jo.create=t=>new jo({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...oe(t)});var _s=class extends ae{_parse(e){if(this._getType(e)!==V.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.symbol,received:i.parsedType}),W}return Ot(e.data)}};_s.create=t=>new _s({typeName:K.ZodSymbol,...oe(t)});var Po=class extends ae{_parse(e){if(this._getType(e)!==V.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.undefined,received:i.parsedType}),W}return Ot(e.data)}};Po.create=t=>new Po({typeName:K.ZodUndefined,...oe(t)});var qo=class extends ae{_parse(e){if(this._getType(e)!==V.null){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.null,received:i.parsedType}),W}return Ot(e.data)}};qo.create=t=>new qo({typeName:K.ZodNull,...oe(t)});var Yr=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Yr.create=t=>new Yr({typeName:K.ZodAny,...oe(t)});var Yi=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};Yi.create=t=>new Yi({typeName:K.ZodUnknown,...oe(t)});var Yn=class extends ae{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:D.invalid_type,expected:V.never,received:n.parsedType}),W}};Yn.create=t=>new Yn({typeName:K.ZodNever,...oe(t)});var Ss=class extends ae{_parse(e){if(this._getType(e)!==V.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.void,received:i.parsedType}),W}return Ot(e.data)}};Ss.create=t=>new Ss({typeName:K.ZodVoid,...oe(t)});var Wi=class t extends ae{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==V.array)return H(n,{code:D.invalid_type,expected:V.array,received:n.parsedType}),W;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(H(n,{code:a?D.too_big:D.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(H(n,{code:D.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(H(n,{code:D.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new Nn(n,a,n.path,s)))).then(a=>wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Nn(n,a,n.path,s)));return wt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:q.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:q.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:q.toString(n)}})}nonempty(e){return this.min(1,e)}};Wi.create=(t,e)=>new Wi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...oe(e)});function bs(t){if(t instanceof Wt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Mn.create(bs(i))}return new Wt({...t._def,shape:()=>e})}else return t instanceof Wi?new Wi({...t._def,type:bs(t.element)}):t instanceof Mn?Mn.create(bs(t.unwrap())):t instanceof ui?ui.create(bs(t.unwrap())):t instanceof ci?ci.create(t.items.map(e=>bs(e))):t}var Wt=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==V.object){let c=this._getOrReturnCtx(e);return H(c,{code:D.invalid_type,expected:V.object,received:c.parsedType}),W}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Yn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=o[c],d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Nn(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Yn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(H(r,{code:D.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Nn(r,d,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(i,c)):wt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:q.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ue.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ue.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return bs(this)}partial(e){let n={};for(let i of ue.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ue.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Mn;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return zC(ue.objectKeys(this.shape))}};Wt.create=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.strictCreate=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strict",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.lazycreate=(t,e)=>new Wt({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});var Zo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Yt(s.ctx.common.issues));return H(n,{code:D.invalid_union,unionErrors:a}),W}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Yt(l));return H(n,{code:D.invalid_union,unionErrors:s}),W}}get options(){return this._def.options}};Zo.create=(t,e)=>new Zo({options:t,typeName:K.ZodUnion,...oe(e)});var Gi=t=>t instanceof Yo?Gi(t.schema):t instanceof Dn?Gi(t.innerType()):t instanceof Wo?[t.value]:t instanceof Xo?t.options:t instanceof Ko?ue.objectValues(t.enum):t instanceof Qo?Gi(t._def.innerType):t instanceof Po?[void 0]:t instanceof qo?[null]:t instanceof Mn?[void 0,...Gi(t.unwrap())]:t instanceof ui?[null,...Gi(t.unwrap())]:t instanceof sc||t instanceof ea?Gi(t.unwrap()):t instanceof Jo?Gi(t._def.innerType):[],Sf=class t extends ae{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return H(n,{code:D.invalid_type,expected:V.object,received:n.parsedType}),W;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let a=Gi(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...oe(i)})}};function _v(t,e){let n=li(t),i=li(e);if(t===e)return{valid:!0,data:t};if(n===V.object&&i===V.object){let r=ue.objectKeys(e),o=ue.objectKeys(t).filter(s=>r.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=_v(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===V.array&&i===V.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=_v(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===V.date&&i===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Go=class extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,a)=>{if(bf(o)||bf(a))return W;let s=_v(o.value,a.value);return s.valid?((_f(o)||_f(a))&&n.dirty(),{status:n.value,value:s.data}):(H(i,{code:D.invalid_intersection_types}),W)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Go.create=(t,e,n)=>new Go({left:t,right:e,typeName:K.ZodIntersection,...oe(n)});var ci=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==V.array)return H(i,{code:D.invalid_type,expected:V.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return H(i,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Nn(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>wt.mergeArray(n,a)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ci.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:t,typeName:K.ZodTuple,rest:null,...oe(e)})};var xf=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==V.object)return H(i,{code:D.invalid_type,expected:V.object,received:i.parsedType}),W;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Nn(i,s,i.path,s)),value:a._parse(new Nn(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?wt.mergeObjectAsync(n,r):wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ae?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...oe(i)}):new t({keyType:Gr.create(),valueType:e,typeName:K.ZodRecord,...oe(n)})}},xs=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==V.map)return H(i,{code:D.invalid_type,expected:V.map,received:i.parsedType}),W;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new Nn(i,s,i.path,[c,"key"])),value:o._parse(new Nn(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};xs.create=(t,e,n)=>new xs({valueType:e,keyType:t,typeName:K.ZodMap,...oe(n)});var ws=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==V.set)return H(i,{code:D.invalid_type,expected:V.set,received:i.parsedType}),W;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(H(i,{code:D.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(H(i,{code:D.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return W;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>o._parse(new Nn(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:q.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:q.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ws.create=(t,e)=>new ws({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...oe(e)});var wf=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.function)return H(n,{code:D.invalid_type,expected:V.function,received:n.parsedType}),W;function i(s,l){return ac({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),Zi].filter(c=>!!c),issueData:{code:D.invalid_arguments,argumentsError:l}})}function r(s,l){return ac({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),Zi].filter(c=>!!c),issueData:{code:D.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Wr){let s=this;return Ot(async function(...l){let c=new Yt([]),u=await s._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(i(l,g)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(g=>{throw c.addIssue(r(d,g)),c})})}else{let s=this;return Ot(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new Yt([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Yt([r(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ci.create(e).rest(Yi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||ci.create([]).rest(Yi.create()),returns:n||Yi.create(),typeName:K.ZodFunction,...oe(i)})}},Yo=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Yo.create=(t,e)=>new Yo({getter:t,typeName:K.ZodLazy,...oe(e)});var Wo=class extends ae{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:D.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Wo.create=(t,e)=>new Wo({value:t,typeName:K.ZodLiteral,...oe(e)});function zC(t,e){return new Xo({values:t,typeName:K.ZodEnum,...oe(e)})}var Xo=class t extends ae{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return H(n,{expected:ue.joinValues(i),received:n.parsedType,code:D.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return H(n,{received:n.data,code:D.invalid_enum_value,options:i}),W}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Xo.create=zC;var Ko=class extends ae{_parse(e){let n=ue.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==V.string&&i.parsedType!==V.number){let r=ue.objectValues(n);return H(i,{expected:ue.joinValues(r),received:i.parsedType,code:D.invalid_type}),W}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ue.objectValues(n);return H(i,{received:i.data,code:D.invalid_enum_value,options:r}),W}return Ot(e.data)}get enum(){return this._def.values}};Ko.create=(t,e)=>new Ko({values:t,typeName:K.ZodNativeEnum,...oe(e)});var Wr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.promise&&n.common.async===!1)return H(n,{code:D.invalid_type,expected:V.promise,received:n.parsedType}),W;let i=n.parsedType===V.promise?n.data:Promise.resolve(n.data);return Ot(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Wr.create=(t,e)=>new Wr({type:t,typeName:K.ZodPromise,...oe(e)});var Dn=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{H(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return W;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"?Fo(l.value):n.value==="dirty"?Fo(l.value):l});{if(n.value==="aborted")return W;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?W:s.status==="dirty"?Fo(s.value):n.value==="dirty"?Fo(s.value):s}}if(r.type==="refinement"){let a=s=>{let l=r.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Zr(a))return W;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Zr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):W);ue.assertNever(r)}};Dn.create=(t,e,n)=>new Dn({schema:t,typeName:K.ZodEffects,effect:e,...oe(n)});Dn.createWithPreprocess=(t,e,n)=>new Dn({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...oe(n)});var Mn=class extends ae{_parse(e){return this._getType(e)===V.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mn.create=(t,e)=>new Mn({innerType:t,typeName:K.ZodOptional,...oe(e)});var ui=class extends ae{_parse(e){return this._getType(e)===V.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ui.create=(t,e)=>new ui({innerType:t,typeName:K.ZodNullable,...oe(e)});var Qo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===V.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Qo.create=(t,e)=>new Qo({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var Jo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ys(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Jo.create=(t,e)=>new Jo({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var Es=class extends ae{_parse(e){if(this._getType(e)!==V.nan){let i=this._getOrReturnCtx(e);return H(i,{code:D.invalid_type,expected:V.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};Es.create=t=>new Es({typeName:K.ZodNaN,...oe(t)});var G4=Symbol("zod_brand"),sc=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},lc=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?W:o.status==="dirty"?(n.dirty(),Fo(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?W:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},ea=class extends ae{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Zr(r)&&(r.value=Object.freeze(r.value)),r);return ys(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};ea.create=(t,e)=>new ea({innerType:t,typeName:K.ZodReadonly,...oe(e)});function DC(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function BC(t,e={},n){return t?Yr.create().superRefine((i,r)=>{let o=t(i);if(o instanceof Promise)return o.then(a=>{if(!a){let s=DC(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=DC(e,i),s=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:s})}}):Yr.create()}var Y4={object:Wt.lazycreate},K;(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"})(K||(K={}));var W4=(t,e={message:`Input not instance of ${t.name}`})=>BC(n=>n instanceof t,e),FC=Gr.create,$C=$o.create,X4=Es.create,K4=Uo.create,UC=Vo.create,Q4=jo.create,J4=_s.create,e3=Po.create,t3=qo.create,n3=Yr.create,i3=Yi.create,r3=Yn.create,o3=Ss.create,a3=Wi.create,s3=Wt.create,l3=Wt.strictCreate,c3=Zo.create,u3=Sf.create,d3=Go.create,f3=ci.create,p3=xf.create,h3=xs.create,g3=ws.create,m3=wf.create,v3=Yo.create,y3=Wo.create,b3=Xo.create,_3=Ko.create,S3=Wr.create,x3=Dn.create,w3=Mn.create,E3=ui.create,C3=Dn.createWithPreprocess,A3=lc.create,T3=()=>FC().optional(),k3=()=>$C().optional(),R3=()=>UC().optional(),O3={string:(t=>Gr.create({...t,coerce:!0})),number:(t=>$o.create({...t,coerce:!0})),boolean:(t=>Vo.create({...t,coerce:!0})),bigint:(t=>Uo.create({...t,coerce:!0})),date:(t=>jo.create({...t,coerce:!0}))};var M3=W;var VC=m.union([m.object({type:m.literal("data"),key:m.string(),value:m.string().optional()}),m.object({type:m.literal("css"),value:m.string()}),m.object({type:m.literal("aria"),role:m.string().optional(),label:m.string().optional()}),m.object({type:m.literal("shadow-css"),value:m.string()}),m.object({type:m.literal("ref"),el:m.any()})]),N3=m.object({kind:m.literal("tooltip"),id:m.string(),anchor:VC,content:m.object({title:m.string().optional(),body:m.string()}),placement:m.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:m.number().optional(),blocking:m.boolean().optional(),trigger:m.enum(["immediate","hover","click"]).optional(),dismiss:m.object({onEsc:m.boolean().optional(),closeButton:m.boolean().optional(),timeoutMs:m.number().optional()}).optional()}),D3=m.object({kind:m.literal("highlight"),id:m.string(),anchor:VC,copy:m.string().optional(),ring:m.object({paddingPx:m.number().optional(),radiusPx:m.number().optional()}).optional(),scrim:m.object({opacity:m.number().optional()}).optional(),ringColor:m.string().optional(),blocking:m.boolean().optional(),dismiss:m.object({onClickOutside:m.boolean().optional(),onEsc:m.boolean().optional(),timeoutMs:m.number().optional()}).optional()}),Sv=m.object({id:m.string(),version:m.number(),routes:m.array(m.string()).optional(),steps:m.array(m.union([N3,D3]))});function sF(t){return Sv.parse(t)}var dF=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=Rm({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:i});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let a=await o.json();return Sv.parse(a)};var Ef=X(Qe(),1),jC=X(Fs(),1);function pF({element:t,children:e}){let[n,i]=(0,Ef.useState)(null);return(0,Ef.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,jC.createPortal)(e,n):null}function L3(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var xv=class{constructor(){j(this,"sessionId");this.sessionId=L3(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function wv(){return new xv}var R=typeof window<"u"?window:void 0,Ct=typeof globalThis<"u"?globalThis:R;typeof self>"u"&&(Ct.self=Ct),typeof File>"u"&&(Ct.File=function(){});var FA=Array.prototype,PC=FA.forEach,qC=FA.indexOf,hn=Ct?.navigator,$=Ct?.document,Kt=Ct?.location,Fv=Ct?.fetch,$v=Ct!=null&&Ct.XMLHttpRequest&&"withCredentials"in new Ct.XMLHttpRequest?Ct.XMLHttpRequest:void 0,ZC=Ct?.AbortController,Xt=hn?.userAgent,ee=R??{},Ki={DEBUG:!1,LIB_VERSION:"1.302.2"};function GC(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function YC(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(l){GC(o,i,r,a,s,"next",l)}function s(l){GC(o,i,r,a,s,"throw",l)}a(void 0)}))}}function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},P.apply(null,arguments)}function $A(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var I3=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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"],WC=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return I3.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},H3=["$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"];function de(t,e){return t.indexOf(e)!==-1}var np=function(t){return t.trim()},Uv=function(t){return t.replace(/^\$/,"")},z3=Array.isArray,UA=Object.prototype,VA=UA.hasOwnProperty,ip=UA.toString,ke=z3||function(t){return ip.call(t)==="[object Array]"},to=t=>typeof t=="function",pt=t=>t===Object(t)&&!ke(t),ks=t=>{if(pt(t)){for(var e in t)if(VA.call(t,e))return!1;return!0}return!1},B=t=>t===void 0,lt=t=>ip.call(t)=="[object String]",Vv=t=>lt(t)&&t.trim().length===0,tr=t=>t===null,Ce=t=>B(t)||tr(t),hi=t=>ip.call(t)=="[object Number]",no=t=>ip.call(t)==="[object Boolean]",B3=t=>t instanceof FormData,F3=t=>de(H3,t);function jv(t){return t===null||typeof t!="object"}function If(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function jA(t){return!B(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var $3=[!0,"true",1,"1","yes"],Ev=t=>de($3,t),U3=[!1,"false",0,"0","no"];function di(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),hi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),di(r||n,e,n,i))}var Pv=class{constructor(e){this.t={},this.i=e.i,this.o=di(e.bucketSize,0,100,e.h),this.m=di(e.refillRate,0,this.o,e.h),this.S=di(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,i):(o={tokens:this.o,lastAccess:i},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},Cf,XC,Cv,V3=t=>t instanceof Error;function j3(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Cv&&n.length===XC||(XC=n.length,Cv=n.reduce(((i,r)=>{Cf||(Cf={});var o=Cf[r];if(o)i[o[0]]=o[1];else for(var a=t(r),s=a.length-1;s>=0;s--){var l=a[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,Cf[r]=[c,u];break}}return i}),{})),Cv}}var qv=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(),a=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return YC((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&ke(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),P({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return YC((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,o,a={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,P({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:j3(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(o,a)=>{if(a<=4){var s=this.buildCoercingContext(e,n,a);return this.applyCoercers(o,s)}};return P({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:o=>r(o,i),next:o=>r(o,i+1)})}},Ns="?";function Zv(t,e,n,i,r){var o={platform:t,filename:e,function:n==="<anonymous>"?Ns:n,in_app:!0};return B(i)||(o.lineno=i),B(r)||(o.colno=r),o}var PA=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Ns,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},P3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,q3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Z3=/\((\S*)(?::(\d+))(?::(\d+))\)/,G3=(t,e)=>{var n=P3.exec(t);if(n){var[,i,r,o]=n;return Zv(e,i,Ns,+r,+o)}var a=q3.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var s=Z3.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[l,c]=PA(a[1]||Ns,a[2]);return Zv(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Y3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,W3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,X3=(t,e)=>{var n=Y3.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=W3.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],o=n[1]||Ns;return[o,r]=PA(o,r),Zv(e,r,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},KC=/\(error: (.*)\)/,QC=50;function K3(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
441
+ `),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=KC.test(c)?c.replace(KC,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var h=d(u,t);if(h){a.push(h);break}}if(a.length>=QC)break}}}return(function(g){if(!g.length)return[];var S=Array.from(g);return S.reverse(),S.slice(0,QC).map((_=>{return P({},_,{filename:_.filename||(b=S,b[b.length-1]||{}).filename,function:_.function||Ns});var b}))})(a)}}var Gv=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?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){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return If(e,"DOMException")}isDOMError(e){return If(e,"DOMError")}},Yv=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},Wv=class{constructor(){}match(e){return If(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Q3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Xv=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(Q3);return r&&(n=r[1],i=r[2]),[n,i]}},J3=["fatal","error","warning","log","info","debug"];function qA(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var Kv=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return jA(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+qA(e)}isSeverityLevel(e){return lt(e)&&!Vv(e)&&J3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(V3(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Qv=class{match(e){return jA(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+qA(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Jv=class{match(e){return jv(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},ey=class{match(e){return If(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return jv(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(jv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},ZA=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(R&&(Ki.DEBUG||ee.POSTHOG_DEBUG||n)&&!B(R.console)&&R.console){for(var o=("__rrweb_original__"in R.console[r])?R.console[r].__rrweb_original__:R.console[r],a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];console.error(t,...o)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>ZA(t+" "+r,o)};return i},U=ZA("[PostHog.js]"),ct=U.createLogger,eL=ct("[ExternalScriptsLoader]"),JC=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return eL.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=$?.querySelectorAll("script");if(i){for(var r,o=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},a=0;a<i.length;a++)if(r=o())return r.v}var s=()=>{if(!$)return n("document not found");var l=$.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=$.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):$.body.appendChild(l)};$!=null&&$.body?s():$?.addEventListener("DOMContentLoaded",s)};ee.__PosthogExtensions__=ee.__PosthogExtensions__||{},ee.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",i);JC(t,o,n)},ee.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);JC(t,i,n)};var Hf={};function io(t,e,n){if(ke(t)){if(PC&&t.forEach===PC)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===Hf)return}}}function Oe(t,e,n){if(!Ce(t)){if(ke(t))return io(t,e,n);if(B3(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===Hf)return}else for(var r in t)if(VA.call(t,r)&&e.call(n,t[r],r)===Hf)return}}var Xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Is=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){io(r,(function(o){t.push(o)}))})),t};function Nf(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var eA=function(t){try{return t()}catch{return}},tL=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){U.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),U.critical(r)}}},Wy=function(t){var e={};return Oe(t,(function(n,i){(lt(n)&&n.length>0||hi(n))&&(e[i]=n)})),e};function nL(t,e){return n=t,i=o=>lt(o)&&!tr(e)?o.slice(0,e):o,r=new Set,(function o(a,s){return a!==Object(a)?i?i(a,s):a:r.has(a)?void 0:(r.add(a),ke(a)?(l=[],io(a,(c=>{l.push(o(c))}))):(l={},Oe(a,((c,u)=>{r.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,i,r}var iL=["herokuapp.com","vercel.app","netlify.app"];function rL(t){var e=t?.hostname;if(!lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of iL)if(n===i)return!1;return!0}function GA(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function it(t,e,n,i){var{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}var YA="$people_distinct_id",yc="__alias",bc="__timers",tA="$autocapture_disabled_server_side",ty="$heatmaps_enabled_server_side",nA="$exception_capture_enabled_server_side",ny="$error_tracking_suppression_rules",iA="$error_tracking_capture_extension_exceptions",rA="$web_vitals_enabled_server_side",WA="$dead_clicks_enabled_server_side",oA="$web_vitals_allowed_metrics",Av="$session_recording_remote_config",zf="$sesid",XA="$session_is_sampled",Rs="$enabled_feature_flags",_c="$early_access_features",iy="$feature_flag_details",Sc="$stored_person_properties",ia="$stored_group_properties",ry="$surveys",Af="$surveys_activated",Bf="$flag_call_reported",Qi="$user_state",oy="$client_session_props",ay="$capture_rate_limit",sy="$initial_campaign_params",ly="$initial_referrer_info",Ff="$initial_person_info",$f="$epp",KA="__POSTHOG_TOOLBAR__",cc="$posthog_cookieless",oL=[YA,yc,"__cmpns",bc,"$session_recording_enabled_server_side",ty,zf,Rs,ny,Qi,_c,iy,ia,Sc,ry,Bf,oy,ay,sy,ly,$f,Ff];function aA(t){return t instanceof Element&&(t.id===KA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function rp(t){return!!t&&t.nodeType===1}function ro(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function QA(t){return!!t&&t.nodeType===3}function JA(t){return!!t&&t.nodeType===11}function Xy(t){return t?np(t).split(/\s+/):[]}function sA(t){var e=R?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Uf(t){var 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 Xy(e)}function eT(t){return Ce(t)?null:np(t).split(/(\s+)/).filter((e=>kc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Lc(t){var e="";return cy(t)&&!oT(t)&&t.childNodes&&t.childNodes.length&&Oe(t.childNodes,(function(n){var i;QA(n)&&n.textContent&&(e+=(i=eT(n.textContent))!==null&&i!==void 0?i:"")})),np(e)}function tT(t){return B(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Ky=["a","button","form","input","select","textarea","label"];function nT(t,e){if(B(e))return!0;var n,i=function(o){if(e.some((a=>o.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function iT(t){var e=t.parentNode;return!(!e||!rp(e))&&e}var aL=["next","previous","prev",">","<"],lA=10,cA=[".ph-no-rageclick",".ph-no-capture"];function sL(t,e){if(!R||Qy(t))return!1;var n,i,r;if(no(e)?(n=!!e&&cA,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:cA,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=rT(t,!1);return!(function(a,s){if(a===!1||B(a))return!1;var l;if(a===!0)l=aL;else{if(!ke(a))return!1;if(a.length>lA)return U.error("[PostHog] content_ignorelist array cannot exceed "+lA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((h=>u.includes(h)||d.includes(h)))}))})(i,o.map((a=>{var s;return{safeText:Lc(a).toLowerCase(),ariaLabel:((s=a.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!nT(o,n)}var Qy=t=>!t||ro(t,"html")||!rp(t),rT=(t,e)=>{if(!R||Qy(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!ro(r,"body");)if(JA(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var o=iT(r);if(!o)break;if(e||Ky.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var a=R.getComputedStyle(o);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function lL(t,e,n,i,r){var o,a,s,l;if(n===void 0&&(n=void 0),!R||Qy(t)||(o=n)!=null&&o.url_allowlist&&!sA(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&sA(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=rT(t,i);if(!(function(S,_){var b=_?.element_allowlist;if(B(b))return!0;var f,p=function(y){if(b.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var v of S)if(f=p(v))return f.v;return!1})(d,n)||!nT(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=R.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Ky.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function cy(t){for(var e=t;e.parentNode&&!ro(e,"body");e=e.parentNode){var n=Uf(e);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(Uf(t),"ph-include"))return!0;var i=t.type||"";if(lt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(lt(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function oT(t){return!!(ro(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ro(t,"select")||ro(t,"textarea")||t.getAttribute("contenteditable")==="true")}var aT="(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})",cL=new RegExp("^(?:"+aT+")$"),uL=new RegExp(aT),sT="\\d{3}-?\\d{2}-?\\d{4}",dL=new RegExp("^("+sT+")$"),fL=new RegExp("("+sT+")");function kc(t,e){return e===void 0&&(e=!0),!(Ce(t)||lt(t)&&(t=np(t),(e?cL:uL).test((t||"").replace(/[- ]/g,""))||(e?dL:fL).test(t)))}function lT(t){var e=Lc(t);return kc(e=(e+" "+cT(t)).trim())?e:""}function cT(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Oe(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Lc(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+cT(n)).trim())}catch(o){U.error("[AutoCapture]",o)}})),e}function pL(t){return(function(e){var n=e.map((i=>{var r,o,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))a+="."+s.replace(/"/g,"");var l=P({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=i.nth_of_type)!==null&&o!==void 0?o:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Nf(l).sort(((u,d)=>{var[h]=u,[g]=d;return h.localeCompare(g)})).forEach((u=>{var[d,h]=u;return c[uA(d.toString())]=uA(h.toString())})),a+=":",a+=Nf(c).map((u=>{var[d,h]=u;return d+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,o={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:hL(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Nf(n).filter((a=>{var[s]=a;return s.indexOf("attr__")===0})).forEach((a=>{var[s,l]=a;return o.attributes[s]=l})),o}))})(t))}function uA(t){return t.replace(/"|\\"/g,'\\"')}function hL(t){var e=t.attr__class;return e?ke(e)?e:Xy(e):void 0}var Vf=class{constructor(e){this.disabled=e===!1;var n=pt(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,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},Tv="$copy_autocapture",er=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var jf=t=>{var e=$?.createElement("a");return B(e)?null:(e.href=t,e)},gL=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Oe(t,(function(o,a){B(o)||B(a)||a==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},Pf=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===e){n=o;break}}if(!ke(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{U.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ic=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",o=i[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");ke(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var g=l;return s!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},qf=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},dA=ct("[AutoCapture]");function kv(t,e){return e.length>t?e.slice(0,t)+"...":e}function mL(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!rp(e));return e}function vL(t,e,n,i){var r=t.tagName.toLowerCase(),o={tag_name:r};Ky.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=kv(1024,lT(t)):o.$el_text=kv(1024,Lc(t)));var a=Uf(t);a.length>0&&(o.classes=a.filter((function(u){return u!==""}))),Oe(t.attributes,(function(u){var d;if((!oT(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&kc(u.value)&&(d=u.name,!lt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=Xy(h).join(" ")),o["attr__"+u.name]=kv(1024,h)}}));for(var s=1,l=1,c=t;c=mL(c);)s++,c.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function yL(t,e){for(var n,i,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!ro(u,"body");)JA(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],g={},S=!1,_=!1;if(Oe(c,(y=>{var w=cy(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=w&&S&&kc(S)&&S),de(Uf(y),"ph-no-capture")&&(_=!0),h.push(vL(y,o,a,s));var T=(function(x){if(!cy(x))return{};var k={};return Oe(x.attributes,(function(C){if(C.name&&C.name.indexOf("data-ph-capture-attribute")===0){var E=C.name.replace("data-ph-capture-attribute-",""),M=C.value;E&&M&&kc(M)&&(k[E]=M)}})),k})(y);Xe(g,T)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=lT(t):h[0].$el_text=Lc(t)),S){var b,f;h[0].attr__href=S;var p=(b=jf(S))==null?void 0:b.host,v=R==null||(f=R.location)==null?void 0:f.host;p&&v&&p!==v&&(d=S)}return{props:Xe({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:pL(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},g)}}var uy=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Vf(e.config.rageclick),this.I=null}get F(){var e,n,i=pt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(R&&$){var e=i=>{i=i||R?.event;try{this.M(i)}catch(r){dA.error("Failed to capture event",r)}};if(it($,"submit",e,{capture:!0}),it($,"change",e,{capture:!0}),it($,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||R?.event,this.M(i,Tv)};it($,"copy",n,{capture:!0}),it($,"cut",n,{capture:!0})}}}else dA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var o=$?.querySelectorAll(r);o?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[tA],r=this.T;if(tr(r)&&!no(i)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=tT(e);QA(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&sL(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===Tv;if(r&&lL(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=yL(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===Tv){var c,u=eT(R==null||(c=R.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return to($?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return hi(t)&&isFinite(t)&&Math.floor(t)===t});var fA="0123456789abcdef",dy=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+fA.charAt(this.bytes[n]>>>4)+fA.charAt(15&this.bytes[n]),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 t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},fy=class{constructor(){this.A=0,this.D=0,this.j=new py}generate(){var e=this.generateOrAbort();if(B(e)){this.A=0;var n=this.generateOrAbort();if(B(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return dy.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},pA,uT=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};R&&!B(R.crypto)&&crypto.getRandomValues&&(uT=t=>crypto.getRandomValues(t));var py=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(uT(this.N),this.U=0),this.N[this.U++]}},eo=()=>bL().toString(),bL=()=>(pA||(pA=new fy)).generate(),uc="",_L=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function SL(t,e){if(e){var n=(function(r,o){if(o===void 0&&(o=$),uc)return uc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+eo();!uc&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",uc=c)}return uc})(t);if(!n){var i=(r=>{var o=r.match(_L);return o?o[0]:""})(t);i!==n&&U.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var pi={H:()=>!!$,B:function(t){U.error("cookieStore error: "+t)},q:function(t){if($){try{for(var e=t+"=",n=$.cookie.split(";").filter((o=>o.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(pi.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if($)try{var o="",a="",s=SL($.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&U.warn("cookieStore warning: large cookie, len="+c.length),$.cookie=c,c}catch{return}},V:function(t,e){if($!=null&&$.cookie)try{pi.G(t,"",-1,e)}catch{return}}},Rv=null,qe={H:function(){if(!tr(Rv))return Rv;var t=!0;if(B(R))t=!1;else try{var e="__mplssupport__";qe.G(e,"xyz"),qe.q(e)!=='"xyz"'&&(t=!1),qe.V(e)}catch{t=!1}return t||U.error("localStorage unsupported; falling back to cookie store"),Rv=t,t},B:function(t){U.error("localStorage error: "+t)},q:function(t){try{return R?.localStorage.getItem(t)}catch(e){qe.B(e)}return null},W:function(t){try{return JSON.parse(qe.q(t))||{}}catch{}return null},G:function(t,e){try{R?.localStorage.setItem(t,JSON.stringify(e))}catch(n){qe.B(n)}},V:function(t){try{R?.localStorage.removeItem(t)}catch(e){qe.B(e)}}},xL=["distinct_id",zf,XA,$f,Ff],Tf=P({},qe,{W:function(t){try{var e={};try{e=pi.W(t)||{}}catch{}var n=Xe(e,JSON.parse(qe.q(t)||"{}"));return qe.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,o){try{qe.G(t,e,void 0,void 0,o);var a={};xL.forEach((s=>{e[s]&&(a[s]=e[s])})),Object.keys(a).length&&pi.G(t,a,n,i,r,o)}catch(s){qe.B(s)}},V:function(t,e){try{R?.localStorage.removeItem(t),pi.V(t,e)}catch(n){qe.B(n)}}}),kf={},wL={H:function(){return!0},B:function(t){U.error("memoryStorage error: "+t)},q:function(t){return kf[t]||null},W:function(t){return kf[t]||null},G:function(t,e){kf[t]=e},V:function(t){delete kf[t]}},ta=null,Et={H:function(){if(!tr(ta))return ta;if(ta=!0,B(R))ta=!1;else try{var t="__support__";Et.G(t,"xyz"),Et.q(t)!=='"xyz"'&&(ta=!1),Et.V(t)}catch{ta=!1}return ta},B:function(t){U.error("sessionStorage error: ",t)},q:function(t){try{return R?.sessionStorage.getItem(t)}catch(e){Et.B(e)}return null},W:function(t){try{return JSON.parse(Et.q(t))||null}catch{}return null},G:function(t,e){try{R?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Et.B(n)}},V:function(t){try{R?.sessionStorage.removeItem(t)}catch(e){Et.B(e)}}},Ji=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),hy=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Ji.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Ji.DENIED||this.consent===Ji.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ji.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Ev(e)?Ji.GRANTED:de(U3,e)?Ji.DENIED:Ji.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?qe:pi;var n=e==="localStorage"?pi:qe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Ev(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!GA([hn?.doNotTrack,hn?.msDoNotTrack,ee.doNotTrack],(e=>Ev(e)))}},Rf=ct("[Dead Clicks]"),EL=()=>!0,CL=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(WA)),i=t.instance.config.capture_dead_clicks;return no(i)?i:!!pt(i)||n},Zf=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[WA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Rf.error("failed to load script",r):e()}))}et(){var e;if($){if(!this.tt&&(e=ee.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=pt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=ee.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start($),Rf.info("starting...")}}else Rf.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Rf.info("stopping..."))}},dc=ct("[ExceptionAutocapture]"),gy=class{constructor(e){var n,i,r;this.rt=()=>{var o;if(R&&this.isEnabled&&(o=ee.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=ee.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=ee.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ee.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){dc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[nA]),this.F=this.ht(),this.vt=new Pv({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:dc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return pt(e)?n=P({},n,e):(B(e)?this.ut:e)&&(n=P({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(dc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return dc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[nA]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?dc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function hA(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return to(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var my=class{constructor(e){var n;this._instance=e,this.dt=(R==null||(n=R.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(U.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,U.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(R&&R.history){var i=this;(e=R.history.pushState)!=null&&e.__posthog_wrapped__||hA(R.history,"pushState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("pushState")})),(n=R.history.replaceState)!=null&&n.__posthog_wrapped__||hA(R.history,"replaceState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=R==null||(n=R.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){U.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};it(R,"popstate",e),this.ct=()=>{R&&R.removeEventListener("popstate",e)}}}},Ov=ct("[SegmentIntegration]");function AL(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var o=i.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||eo();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Qi,"identified")),r()},s=o.user();"then"in s&&to(s.then)?s.then((l=>a(l))):a(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||Ov.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===i.get_distinct_id()||(Ov.info("No userId set, resetting PostHog"),i.reset()),o.event.userId&&o.event.userId!==i.get_distinct_id()&&(Ov.info("UserId set, identifying with PostHog"),i.identify(o.event.userId));var s=i.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var dT="posthog-js";function fT(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return s=>{var l,c,u,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],_=S.map((f=>P({},f,{stacktrace:f.stacktrace?P({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((p=>P({},p,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=S[0])==null?void 0:c.value)||s.message,$exception_type:(u=S[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:_,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(h=S[0])==null?void 0:h.type,$sentry_tags:s.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),a&&t.exceptions.sendExceptionEvent(b),s}}var vy=class{constructor(e,n,i,r,o,a){this.name=dT,this.setupOnce=function(s){s(fT(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:a==null||a}))}}},TL=R!=null&&R.location?qf(R.location.hash,"__posthog")||qf(location.hash,"state"):null,gA="_postHogToolbarParams",mA=ct("[Toolbar]"),Jr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Jr||{}),yy=class{constructor(e){this.instance=e}_t(e){ee.ph_toolbar_state=e}yt(){var e;return(e=ee.ph_toolbar_state)!==null&&e!==void 0?e:Jr.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!R||!$)return!1;e=e??R.location,i=i??R.history;try{if(!n){try{R.localStorage.setItem("test","test"),R.localStorage.removeItem("test")}catch{return!1}n=R?.localStorage}var r,o=TL||qf(e.hash,"__posthog")||qf(e.hash,"state"),a=o?eA((()=>JSON.parse(atob(decodeURIComponent(o)))))||eA((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(gA)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=ee.ph_load_toolbar||ee.ph_load_editor;!Ce(n)&&to(n)?n(e,this.instance):mA.warn("No toolbar load function found")}loadToolbar(e){var n=!($==null||!$.getElementById(KA));if(!R||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=P({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(R.localStorage.setItem(gA,JSON.stringify(P({},r,{source:void 0}))),this.yt()===Jr.LOADED)this.bt(r);else if(this.yt()===Jr.UNINITIALIZED){var o;this._t(Jr.LOADING),(o=ee.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return mA.error("[Toolbar] Failed to load",a),void this._t(Jr.UNINITIALIZED);this._t(Jr.LOADED),this.bt(r)})),it(R,"turbolinks:load",(()=>{this._t(Jr.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},kL=ct("[TracingHeaders]"),by=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;B(this.xt)&&((n=ee.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),B(this.St)&&((i=ee.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return kL.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Ln="Mobile",Gf="iOS",fi="Android",Rc="Tablet",pT=fi+" "+Rc,hT="iPad",gT="Apple",mT=gT+" Watch",Oc="Safari",Ds="BlackBerry",vT="Samsung",yT=vT+"Browser",bT=vT+" Internet",ra="Chrome",RL=ra+" OS",_T=ra+" "+Gf,Jy="Internet Explorer",ST=Jy+" "+Ln,eb="Opera",OL=eb+" Mini",tb="Edge",xT="Microsoft "+tb,Os="Firefox",wT=Os+" "+Gf,Mc="Nintendo",Nc="PlayStation",Ms="Xbox",ET=fi+" "+Ln,CT=Ln+" "+Oc,xc="Windows",_y=xc+" Phone",vA="Nokia",Sy="Ouya",AT="Generic",ML=AT+" "+Ln.toLowerCase(),TT=AT+" "+Rc.toLowerCase(),xy="Konqueror",Ht="(\\d+(\\.\\d+)?)",Mv=new RegExp("Version/"+Ht),NL=new RegExp(Ms,"i"),DL=new RegExp(Nc+" \\w+","i"),LL=new RegExp(Mc+" \\w+","i"),nb=new RegExp(Ds+"|PlayBook|BB10","i"),IL={"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"},HL=(t,e)=>e&&de(e,gT)||(function(n){return de(n,Oc)&&!de(n,ra)&&!de(n,fi)})(t),kT=function(t,e){return e=e||"",de(t," OPR/")&&de(t,"Mini")?OL:de(t," OPR/")?eb:nb.test(t)?Ds:de(t,"IE"+Ln)||de(t,"WPDesktop")?ST:de(t,yT)?bT:de(t,tb)||de(t,"Edg/")?xT:de(t,"FBIOS")?"Facebook "+Ln:de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?_T:de(t,"CrMo")||de(t,ra)?ra:de(t,fi)&&de(t,Oc)?ET:de(t,"FxiOS")?wT:de(t.toLowerCase(),xy.toLowerCase())?xy:HL(t,e)?de(t,Ln)?CT:Oc:de(t,Os)?Os:de(t,"MSIE")||de(t,"Trident/")?Jy:de(t,"Gecko")?Os:""},zL={[ST]:[new RegExp("rv:"+Ht)],[xT]:[new RegExp(tb+"?\\/"+Ht)],[ra]:[new RegExp("("+ra+"|CrMo)\\/"+Ht)],[_T]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Oc]:[Mv],[CT]:[Mv],[eb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Os]:[new RegExp(Os+"\\/"+Ht)],[wT]:[new RegExp("FxiOS\\/"+Ht)],[xy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Ds]:[new RegExp(Ds+" "+Ht),Mv],[ET]:[new RegExp("android\\s"+Ht,"i")],[bT]:[new RegExp(yT+"\\/"+Ht)],[Jy]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},BL=function(t,e){var n=kT(t,e),i=zL[n];if(B(i))return null;for(var r=0;r<i.length;r++){var o=i[r],a=t.match(o);if(a)return parseFloat(a[a.length-2])}return null},yA=[[new RegExp(Ms+"; "+Ms+" (.*?)[);]","i"),t=>[Ms,t&&t[1]||""]],[new RegExp(Mc,"i"),[Mc,""]],[new RegExp(Nc,"i"),[Nc,""]],[nb,[Ds,""]],[new RegExp(xc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_y,""];if(new RegExp(Ln).test(e)&&!/IEMobile\b/.test(e))return[xc+" "+Ln,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=IL[i]||"";return/arm/i.test(e)&&(r="RT"),[xc,r]}return[xc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Gf,e.join(".")]}return[Gf,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=B(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+fi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[fi,e.join(".")]}return[fi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[RL,""]],[/Linux|debian/i,["Linux",""]]],bA=function(t){return LL.test(t)?Mc:DL.test(t)?Nc:NL.test(t)?Ms:new RegExp(Sy,"i").test(t)?Sy:new RegExp("("+_y+"|WPDesktop)","i").test(t)?_y:/iPad/.test(t)?hT:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?mT:nb.test(t)?Ds:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(vA,"i").test(t)?vA:/(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(Ln).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)?fi:pT:fi:new RegExp("(pda|"+Ln+")","i").test(t)?ML:new RegExp(Rc,"i").test(t)&&!new RegExp(Rc+" pc","i").test(t)?TT:""},Of="https?://(.*)",Hs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],FL=Is(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hs),Hc="<masked>",$L=["li_fat_id"];function RT(t,e,n){if(!$)return{};var i,r=e?Is([],Hs,n||[]):[],o=OT(Ic($.URL,r,Hc),t),a=(i={},Oe($L,(function(s){var l=pi.q(s);i[s]=l||null})),i);return Xe(a,o)}function OT(t,e){var n=FL.concat(e||[]),i={};return Oe(n,(function(r){var o=Pf(t,r);i[r]=o||null})),i}function MT(t){var e=(function(o){return o?o.search(Of+"google.([^/?]*)")===0?"google":o.search(Of+"bing.com")===0?"bing":o.search(Of+"yahoo.com")===0?"yahoo":o.search(Of+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!tr(e)){i.$search_engine=e;var r=$?Pf($.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function _A(){return navigator.language||navigator.userLanguage}function NT(){return $?.referrer||"$direct"}function DT(t,e){var n=t?Is([],Hs,e||[]):[],i=Kt?.href.substring(0,1e3);return{r:NT().substring(0,1e3),u:i?Ic(i,n,Hc):void 0}}function LT(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=jf(n))==null?void 0:e.host};if(i){r.$current_url=i;var o=jf(i);r.$host=o?.host,r.$pathname=o?.pathname;var a=OT(i);Xe(r,a)}if(n){var s=MT(n);Xe(r,s)}return r}function IT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function UL(){try{return new Date().getTimezoneOffset()}catch{return}}function VL(t,e){if(!Xt)return{};var n,i,r,o=t?Is([],Hs,e||[]):[],[a,s]=(function(l){for(var c=0;c<yA.length;c++){var[u,d]=yA[c],h=u.exec(l),g=h&&(to(d)?d(h,l):d);if(g)return g}return["",""]})(Xt);return Xe(Wy({$os:a,$os_version:s,$browser:kT(Xt,navigator.vendor),$device:bA(Xt),$device_type:(i=Xt,r=bA(i),r===hT||r===pT||r==="Kobo"||r==="Kindle Fire"||r===TT?Rc:r===Mc||r===Ms||r===Nc||r===Sy?"Console":r===mT?"Wearable":r?Ln:"Desktop"),$timezone:IT(),$timezone_offset:UL()}),{$current_url:Ic(Kt?.href,o,Hc),$host:Kt?.host,$pathname:Kt?.pathname,$raw_user_agent:Xt.length>1e3?Xt.substring(0,997)+"...":Xt,$browser_version:BL(Xt,navigator.vendor),$browser_language:_A(),$browser_language_prefix:(n=_A(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:R?.screen.height,$screen_width:R?.screen.width,$viewport_height:R?.innerHeight,$viewport_width:R?.innerWidth,$lib:"web",$lib_version:Ki.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Xr=ct("[Web Vitals]"),SA=9e5,wy=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>P({},i,{["$web_vitals_"+r.name+"_event"]:P({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(B(o))Xr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();B(a)||(Ce(i?.name)||Ce(i?.value)?Xr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Xr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),B(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=B(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(P({},i,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,o,a,s=ee.__PosthogExtensions__;B(s)||B(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),i&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Xr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[rA]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=pt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return B(i)?((n=this._instance.persistence)==null?void 0:n.props[oA])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=pt(this._instance.config.capture_performance)&&hi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:SA;return 0<e&&e<=6e4?SA:e}get isEnabled(){var e=Kt?.protocol;if(e!=="http:"&&e!=="https:")return Xr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:no(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return no(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Xr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=pt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=pt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rA]:n}),this._instance.persistence.register({[oA]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Xr.error("failed to load script",r):e()}))}Tt(){var e=R?R.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Is([],Hs,i||[]):[];return Ic(e,r,Hc)}Xr.error("Could not determine current URL")}},jL=ct("[Heatmaps]");function xA(t){return pt(t)&&"clientX"in t&&"clientY"in t&&hi(t.clientX)&&hi(t.clientY)}var Ey=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[ty]),this.rageclicks=new Vf(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return pt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return B(this.instance.config.capture_heatmaps)?B(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;jL.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ty]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})($)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){R&&$&&(this.jt=this.Dt.bind(this),it(R,"beforeunload",this.jt),this.Lt=e=>this.At(e||R?.event),it($,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||R?.event),it($,"mousemove",this.Nt,{capture:!0}),this.zt=new Zf(this.instance,EL,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),it($,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;R&&$&&(this.jt&&R.removeEventListener("beforeunload",this.jt),this.Lt&&$.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&$.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&$.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=(function(s,l,c){for(var u=s;u&&rp(u)&&!ro(u,"body");){if(u===c)return!1;if(de(l,R?.getComputedStyle(u).position))return!0;u=iT(u)}return!1})(tT(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!aA(e.target)&&xA(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(P({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!aA(e.target)&&xA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(R){var n=R.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=i?Is([],Hs,r||[]):[],a=Ic(n,o,Hc);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!ks(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Cy=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=R?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!(B(a)||B(s)||B(l)||B(c)||B(u)||B(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var h=a<=1?1:di(s/a,0,1,U),g=a<=1?1:di(l/a,0,1,U),S=c<=1?1:di(u/c,0,1,U),_=c<=1?1:di(d/c,0,1,U);r=Xe(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},In=Uint8Array,zt=Uint16Array,Ls=Uint32Array,ib=new In([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]),rb=new In([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]),wA=new In([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HT=function(t,e){for(var n=new zt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Ls(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},zT=HT(ib,2),PL=zT[0],Ay=zT[1];PL[28]=258,Ay[258]=28;for(Ty=HT(rb,0)[1],Yf=new zt(32768),Me=0;Me<32768;++Me)Kr=(43690&Me)>>>1|(21845&Me)<<1,Kr=(61680&(Kr=(52428&Kr)>>>2|(13107&Kr)<<2))>>>4|(3855&Kr)<<4,Yf[Me]=((65280&Kr)>>>8|(255&Kr)<<8)>>>1;var Kr,Ty,Yf,Me,Cc=function(t,e,n){for(var i=t.length,r=0,o=new zt(e);r<i;++r)++o[t[r]-1];var a,s=new zt(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(n){a=new zt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=s[t[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)a[Yf[d]>>>l]=c}else for(a=new zt(i),r=0;r<i;++r)a[r]=Yf[s[t[r]-1]++]>>>15-t[r];return a},oa=new In(288);for(Me=0;Me<144;++Me)oa[Me]=8;for(Me=144;Me<256;++Me)oa[Me]=9;for(Me=256;Me<280;++Me)oa[Me]=7;for(Me=280;Me<288;++Me)oa[Me]=8;var Wf=new In(32);for(Me=0;Me<32;++Me)Wf[Me]=5;var qL=Cc(oa,9,0),ZL=Cc(Wf,5,0),BT=function(t){return(t/8>>0)+(7&t&&1)},FT=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof zt?zt:t instanceof Ls?Ls:In)(n-e);return i.set(t.subarray(e,n)),i},Xi=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},fc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Nv=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new In(0),0];if(r==1){var a=new In(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(w,T){return w.f-T.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(i=1;i<r;++i)o[i].s>h&&(h=o[i].s);var g=new zt(h+1),S=ky(n[u-1],g,0);if(S>e){i=0;var _=0,b=S-e,f=1<<b;for(o.sort((function(w,T){return g[T.s]-g[w.s]||w.f-T.f}));i<r;++i){var p=o[i].s;if(!(g[p]>e))break;_+=f-(1<<S-g[p]),g[p]=e}for(_>>>=b;_>0;){var v=o[i].s;g[v]<e?_-=1<<e-g[v]++-1:++i}for(;i>=0&&_;--i){var y=o[i].s;g[y]==e&&(--g[y],++_)}S=e}return[new In(g),S]},ky=function(t,e,n){return t.s==-1?Math.max(ky(t.l,e,n+1),ky(t.r,e,n+1)):e[t.s]=n},EA=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zt(++e),i=0,r=t[0],o=1,a=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=t[s]}return[n.subarray(0,i),e]},pc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},Ry=function(t,e,n){var i=n.length,r=BT(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<i;++o)t[r+o+4]=n[o];return 8*(r+4+i)},CA=function(t,e,n,i,r,o,a,s,l,c,u){Xi(e,u++,n),++r[256];for(var d=Nv(r,15),h=d[0],g=d[1],S=Nv(o,15),_=S[0],b=S[1],f=EA(h),p=f[0],v=f[1],y=EA(_),w=y[0],T=y[1],x=new zt(19),k=0;k<p.length;++k)x[31&p[k]]++;for(k=0;k<w.length;++k)x[31&w[k]]++;for(var C=Nv(x,7),E=C[0],M=C[1],I=19;I>4&&!E[wA[I-1]];--I);var N,F,Y,z,te=c+5<<3,L=pc(r,oa)+pc(o,Wf)+a,Z=pc(r,h)+pc(o,_)+a+14+3*I+pc(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(te<=L&&te<=Z)return Ry(e,u,t.subarray(l,l+c));if(Xi(e,u,1+(Z<L)),u+=2,Z<L){N=Cc(h,g,0),F=h,Y=Cc(_,b,0),z=_;var J=Cc(E,M,0);for(Xi(e,u,v-257),Xi(e,u+5,T-1),Xi(e,u+10,I-4),u+=14,k=0;k<I;++k)Xi(e,u+3*k,E[wA[k]]);u+=3*I;for(var me=[p,w],Ke=0;Ke<2;++Ke){var Mt=me[Ke];for(k=0;k<Mt.length;++k){var Qt=31&Mt[k];Xi(e,u,J[Qt]),u+=E[Qt],Qt>15&&(Xi(e,u,Mt[k]>>>5&127),u+=Mt[k]>>>12)}}}else N=qL,F=oa,Y=ZL,z=Wf;for(k=0;k<s;++k)if(i[k]>255){Qt=i[k]>>>18&31,fc(e,u,N[Qt+257]),u+=F[Qt+257],Qt>7&&(Xi(e,u,i[k]>>>23&31),u+=ib[Qt]);var aa=31&i[k];fc(e,u,Y[aa]),u+=z[aa],aa>3&&(fc(e,u,i[k]>>>5&8191),u+=rb[aa])}else fc(e,u,N[i[k]]),u+=F[i[k]];return fc(e,u,N[256]),u+F[256]},GL=new Ls([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),YL=(function(){for(var t=new Ls(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),WL=function(t,e,n,i,r){return(function(o,a,s,l,c,u){var d=o.length,h=new In(l+d+5*(1+Math.floor(d/7e3))+c),g=h.subarray(l,h.length-c),S=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var b=_+65535;b<d?S=Ry(g,S,o.subarray(_,b)):(g[_]=u,S=Ry(g,S,o.subarray(_,d)))}else{for(var f=GL[a-1],p=f>>>13,v=8191&f,y=(1<<s)-1,w=new zt(32768),T=new zt(y+1),x=Math.ceil(s/3),k=2*x,C=function(vp){return(o[vp]^o[vp+1]<<x^o[vp+2]<<k)&y},E=new Ls(25e3),M=new zt(288),I=new zt(32),N=0,F=0,Y=(_=0,0),z=0,te=0;_<d;++_){var L=C(_),Z=32767&_,J=T[L];if(w[Z]=J,T[L]=Z,z<=_){var me=d-_;if((N>7e3||Y>24576)&&me>423){S=CA(o,g,0,E,M,I,F,Y,te,_-te,S),Y=N=F=0,te=_;for(var Ke=0;Ke<286;++Ke)M[Ke]=0;for(Ke=0;Ke<30;++Ke)I[Ke]=0}var Mt=2,Qt=0,aa=v,rr=Z-J&32767;if(me>2&&L==C(_-rr))for(var Jk=Math.min(p,me)-1,eR=Math.min(32767,_),tR=Math.min(258,me);rr<=eR&&--aa&&Z!=J;){if(o[_+Mt]==o[_+Mt-rr]){for(var or=0;or<tR&&o[_+or]==o[_+or-rr];++or);if(or>Mt){if(Mt=or,Qt=rr,or>Jk)break;var nR=Math.min(rr,or-2),Jb=0;for(Ke=0;Ke<nR;++Ke){var mp=_-rr+Ke+32768&32767,e0=mp-w[mp]+32768&32767;e0>Jb&&(Jb=e0,J=mp)}}}rr+=(Z=J)-(J=w[Z])+32768&32767}if(Qt){E[Y++]=268435456|Ay[Mt]<<18|Ty[Qt];var t0=31&Ay[Mt],n0=31&Ty[Qt];F+=ib[t0]+rb[n0],++M[257+t0],++I[n0],z=_+Mt,++N}else E[Y++]=o[_],++M[o[_]]}}S=CA(o,g,u,E,M,I,F,Y,te,_-te,S)}return FT(h,0,l+BT(S)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},Dv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function XL(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=YL[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,o=WL(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=o.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Dv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(o,e),Dv(o,a-8,n.d()),Dv(o,a-4,i),o}var KL=function(t){var e,n,i,r,o="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
443
442
  `).replace(/\r/g,`
444
- `)).length,r=0;r<i;r++){var a=t.charCodeAt(r),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),tr(s)||(n>e&&(o+=t.substring(e,n)),o+=s,e=n=r+1)}return n>e&&(o+=t.substring(e,t.length)),o},NL=!!Nv||!!Mv,oA="text/plain",Uf=function(t,e,n){var i;n===void 0&&(n=!0);var[r,o]=t.split("?"),a=P({},e),s=(i=o?.split("&").map((c=>{var u,[d,p]=c.split("="),g=n&&(u=a[d])!==null&&u!==void 0?u:p;return delete a[d],d+"="+g})))!==null&&i!==void 0?i:[],l=W3(a);return l&&s.push(l),r+"?"+s.join("&")},xc=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),Av=t=>{var{data:e,compression:n}=t;if(e){if(n===er.GZipJS){var i=OL((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new In(l.length+(l.length>>>1)),p=0,g=function(f){d[p++]=f},_=0;_<u;++_){if(p+5>d.length){var b=new In(p+8+(u-_<<1));b.set(d),d=b}var x=l.charCodeAt(_);x<128||c?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++_))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return yk(d,0,p)})(xc(e)),{mtime:0}),r=new Blob([i],{type:oA});return{contentType:oA,body:r,estimatedSize:r.size}}if(n===er.Base64){var o=(function(l){var c,u,d,p,g,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",h=[];if(!l)return l;l=ML(l);do c=(g=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,u=g>>12&63,d=g>>6&63,p=63&g,h[x++]=_.charAt(c)+_.charAt(u)+_.charAt(d)+_.charAt(p);while(b<l.length);switch(f=h.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(xc(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:xc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=xc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Ef=[];Mv&&Ef.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:o}=(e=Av(t))!==null&&e!==void 0?e:{},a=new Headers;Me(t.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var s=t.url,l=null;if(CC){var c=new CC;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Mv(s,P({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((d=>{var p={statusCode:u.status,text:d};if(u.status===200)try{p.json=JSON.parse(d)}catch(g){F.error(g)}t.callback==null||t.callback(p)})))).catch((u=>{F.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Nv&&Ef.push({transport:"XHR",method:t=>{var e,n=new Nv;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=Av(t))!==null&&e!==void 0?e:{};Me(t.headers,(function(o,a){n.setRequestHeader(a,o)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(r)}}),hn!=null&&hn.sendBeacon&&Ef.push({transport:"sendBeacon",method:t=>{var e=Uf(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=Av(t))!==null&&n!==void 0?n:{},o=typeof r=="string"?new Blob([r],{type:i}):r;hn.sendBeacon(e,o)}catch{}}});var Vf=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function aA(t,e,n){return xc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var bk={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Vf(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Vf(n,i))))),icontains:(t,e)=>e.map(Sf).some((n=>t.map(Sf).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(Sf).every((n=>t.map(Sf).every((i=>!n.includes(i)))))},Sf=t=>t.toLowerCase();function _k(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,o=e?.[i];if(B(o)||tr(o))return!1;var a=[String(o)],s=bk[r.operator];return!!s&&s(r.values,a)}))}var kv=ct("[Error tracking]"),Sy=class{constructor(e){var n,i;this.Jt=[],this.Kt=new zv([new $v,new Zv,new Uv,new Fv,new Pv,new jv,new Vv,new qv],M3("web:javascript",k3,O3)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(Yv))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,o=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[Yv]:this.Jt,[HC]:a})}get Yt(){var e,n=!!this._instance.get_property(HC),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void kv.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void kv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void kv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((i,r)=>{var{type:o,value:a}=r;return lt(o)&&o.length>0&&i.$exception_types.push(o),lt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((o=>{var a,s=bk[o.operator],l=Te(o.value)?o.value:[o.value],c=(a=n[o.key])!==null&&a!==void 0?a:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,o,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=a[a.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ce(e)&&Te(e)}},Wn=ct("[FeatureFlags]"),fc=ct("[FeatureFlags]",{debugEnabled:!0}),Tv="$active_feature_flags",Es="$override_feature_flags",sA="$feature_flag_payloads",pc="$override_feature_flag_payloads",lA="$feature_flag_request_id",cA="$feature_flag_evaluated_at",uA=t=>{var e={};for(var[n,i]of wf(t||{}))i&&(e[n]=i);return e},DL=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Wn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},LL=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),wy=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Wn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Wv),n=this._instance.get_property(Es),i=this._instance.get_property(pc);if(!i&&!n)return e||{};var r=Xe({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of o){var s,l,c=r[a],u=n?.[a],d=B(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,p=B(u)?c.variant:typeof u=="string"?u:void 0,g=i?.[a],_=P({},c,{enabled:d,variant:d?p??c?.variant:void 0});d!==c?.enabled&&(_.original_enabled=c?.enabled),p!==c?.variant&&(_.original_variant=c?.variant),g&&(_.metadata=P({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=_}return this.ii||(Wn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Ts),n=this._instance.get_property(Es);if(!n)return e||{};for(var i=Xe({},e),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(sA),n=this._instance.get_property(pc);if(!n)return e||{};for(var i=Xe({},e||{}),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:P({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(bc)||{}),group_properties:this._instance.get_property(na)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+a);r&&(i.timezone=hk()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(LL.FeatureFlags))Wn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var p;i.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,o=this._instance.get_property(lA)||void 0,a=this._instance.get_property(cA)||void 0,s=this._instance.get_property(Rf)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,d,p,g,_,b,x;Te(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[Rf]:s});var f=this.getFeatureFlagDetails(e),h={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};B(f==null||(d=f.metadata)==null?void 0:d.version)||(h.$feature_flag_version=f.metadata.version);var y,m=(p=f==null||(g=f.reason)==null?void 0:g.description)!==null&&p!==void 0?p:f==null||(_=f.reason)==null?void 0:_.code;m&&(h.$feature_flag_reason=m),f!=null&&(b=f.metadata)!=null&&b.id&&(h.$feature_flag_id=f.metadata.id),B(f?.original_variant)&&B(f?.original_enabled)||(h.$feature_flag_original_response=B(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(h.$feature_flag_original_payload=f==null||(y=f.metadata)==null?void 0:y.original_payload),this._instance.capture("$feature_flag_called",h)}return i}Wn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,s=(a=o.json)==null?void 0:a.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return B(i)?void 0:!!i}Wn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=DL(a),p=d.flags,g=d.featureFlags,_=d.featureFlagPayloads;if(g){var b=a.requestId,x=a.evaluatedAt;if(Te(g)){Wn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(g)for(var h=0;h<g.length;h++)f[g[h]]=!0;s&&s.register({[Tv]:g,[Ts]:f})}else{var y=g,m=_,S=p;a.errorsWhileComputingFlags&&(y=P({},l,y),m=P({},c,m),S=P({},u,S)),s&&s.register(P({[Tv]:Object.keys(uA(y)),[Ts]:y||{},[sA]:m||{},[Wv]:S||{}},b?{[lA]:b}:{},x?{[cA]:x}:{}))}}})(e,this._instance.persistence,i,r,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Wn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Wn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Es),this._instance.persistence.unregister(pc),this.pi(),fc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Es),fc.info("Flag overrides cleared");else if(i.flags){if(Te(i.flags)){for(var r={},o=0;o<i.flags.length;o++)r[i.flags[o]]=!0;this._instance.persistence.register({[Es]:r})}else this._instance.persistence.register({[Es]:i.flags});fc.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(pc),fc.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[pc]:i.payloads}),fc.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,o=(this._instance.get_property(yc)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:a};o&&(s.$early_access_feature_name=o.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var l=P({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Tv]:Object.keys(uA(l)),[Ts]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(yc),o=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s,l;if(a.json){var c=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(yc),(l=this._instance.persistence)==null||l.register({[yc]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(bc)||{};this._instance.register({[bc]:P({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(bc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(na)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=P({},i[r],e[r]),delete e[r]})),this._instance.register({[na]:P({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(na)||{};this._instance.register({[na]:P({},n,{[e]:{}})})}else this._instance.unregister(na)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},IL=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ec=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var 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.Y=this.bi(e),this.load(),e.debug&&F.info("Persistence loaded",e.persistence,P({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){IL.indexOf(e.persistence.toLowerCase())===-1&&(F.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&qe.H()?qe:n==="localstorage+cookie"&&yf.H()?yf:n==="sessionstorage"&&Et.H()?Et:n==="memory"?iL:n==="cookie"?pi:yf.H()?yf:pi}properties(){var e={};return Me(this.props,(function(n,i){if(i===Ts&&pt(n))for(var r=Object.keys(n),o=0;o<r.length;o++)e["$feature/"+r[o]]=n[r[o]];else s=i,l=!1,(tr(a=$3)?l:EC&&a.indexOf===EC?a.indexOf(s)!=-1:(Me(a,(function(c){if(l||(l=c===s))return kf})),l))||(e[i]=n);var a,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Xe({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(pt(e)){B(n)&&(n="None"),this.xi=B(i)?this.$i:i;var r=!1;if(Me(e,((o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(pt(e)){this.xi=B(n)?this.$i:n;var i=!1;if(Me(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=lk(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);ks(Uy(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=$?.referrer)?uk(e):{})}update_referrer_info(){var e;this.register_once({$referrer:dk(),$referring_domain:$!=null&&$.referrer&&((e=Lf($.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Jv]||this.props[ey]||this.register_once({[Of]:fk(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Me([ey,Jv],(a=>{var s=this.props[a];s&&Me(s,(function(l,c){e["$initial_"+Dv(c)]=l}))}));var n,i,r=this.props[Of];if(r){var o=(n=pk(r),i={},Me(n,(function(a,s){i["$initial_"+Dv(s)]=a})),i);Xe(e,o)}return e}safe_merge(e){return Me(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var i=this.props[vc]||{};i[e]=n,this.props[vc]=i,this.save()}remove_event_timer(e){var n=(this.props[vc]||{})[e];return B(n)||(delete this.props[vc][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},hc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),o$=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),a$=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),s$=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Rv=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),l$=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),c$=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),u$=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Cf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),dA=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),xk=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Mc=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function Cs(t,e,n){if(Ce(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Ey=class{constructor(e){this.Pi=new Mc,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!B((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!B((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var s,l;(s=this.Oi)==null||s.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,o=new Set;e.forEach((a=>{var s;(s=a.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!Cs(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>Cs(s.href,n.href,n.href_matching||"exact")));var o,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&Cs((o=a.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>Cs(c.text,n.text,n.text_matching||"exact")||Cs(c.$el_text,n.text,n.text_matching||"exact")));var o,a,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,d=[],p=/(?::|")text="(.*?)"/g;!Ce(u=p.exec(c));)d.includes(u[1])||d.push(u[1]);return d})(l),a=n.text,s=n.text_matching||"exact",o.some((c=>Cs(c,a,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var o=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||_k(n.properties.reduce(((i,r)=>{var o=Te(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:o,operator:r.operator||"exact"},i}),{}),e?.properties)}},Se=ct("[Surveys]"),Cy="seenSurvey_",HL=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},fA=t=>{var e=""+Cy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Cy+t.id+"_"+t.current_iteration),e},zL=[Rv.Popover,Rv.Widget,Rv.API],BL={ignoreConditions:!1,ignoreDelay:!1,displayType:xk.Popover},Ay=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&_k(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((a=>{if(a!=null&&a.name){var s=i.get(a.name)||[];s.push(r.id),i.set(a.name,s)}}))})),i}Vi(e,n,i){var r,o=(i===hc.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((s=>{a=s.filter((l=>o?.includes(l.id)))})),a.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;B((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,o;return((r=i.conditions)==null?void 0:r.actions)&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Ey(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,o,a,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(o=i.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((o,a)=>{this.onEvent(o,a)})),this.Hi=this.Gi(e,hc.Activation),this.Bi=this.Gi(e,hc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[vf])||[];if(Cf.SHOWN===e&&n&&r.length>0){var o;Se.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,hc.Cancellation);l.length>0&&(Se.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var d,p=r.indexOf(u.id);p>=0&&r.splice(p,1),(d=this._instance)==null||d.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){Se.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,hc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[vf])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;Se.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[vf]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[vf];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},ky=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ce(n))return Se.warn("Flags not loaded yet. Not loading surveys.");var i=Te(n);this.Zi=i?n.length>0:n,Se.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(Cy)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Se.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Se.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Se.info("Not loading surveys in cookieless mode without consent.");else{var e=J?.__PosthogExtensions__;if(e){if(!B(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else Se.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new Ay(this._instance),Se.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){Se.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Se.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Xv);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return Se.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((d=>(function(p){return!(!p.start_date||p.end_date)})(d)&&((function(p){var g;return!((g=p.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(d)||(function(p){var g;return!((g=p.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(d))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Xv]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){Se.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ce(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);Se.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ce(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ce(this._surveyManager))return Se.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ce(this._surveyManager)?(Se.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var o,a=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(a){var s=this.ae(a);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ce(this._surveyManager))Se.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(zL.includes(r.type)){var o=$?.querySelector(n);if(o)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(Se.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,s;Se.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),Se.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);Se.warn("Survey element not found")}else Se.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Se.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ce(this._surveyManager))Se.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=P({},r,{appearance:P({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void Se.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==xk.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else Se.warn("Survey not found")}}cancelPendingSurvey(e){Ce(this._surveyManager)?Se.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},pA=ct("[RateLimiter]"),Ty=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((a=>{pA.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void pA.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(Qv))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(Qv,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},ta=ct("[RemoteConfig]"),Ry=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=J._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(ta.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return ta.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void ta.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return ta.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){ta.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):ta.info("__preview_remote_config is disabled. Logging config instead",e):ta.error("Failed to fetch remote config from PostHog.")}},Oy=3e3,My=class{constructor(e,n){this.he=!0,this.ve=[],this.de=di(n?.flush_interval_ms||Oy,250,5e3,F.createLogger("flush interval"),Oy),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(P({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var o=n[r],a=new Date().getTime();o.data&&Te(o.data)&&Me(o.data,(s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp})),e.ce(o)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Me(this.ve,(n=>{var i,r=n,o=(r?r.batchKey:null)||r.url;B(e[o])&&(e[o]=P({},r,{data:[]})),(i=e[o].data)==null||i.push(r.data)})),this.ve=[],e}},$L=["retriesPerformedSoFar"],Ny=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!B(R)&&"onLine"in R.navigator&&(this.be=R.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},rt(R,"online",this.we),rt(R,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=bA(e,$L);hi(n)&&n>0&&(i.url=Uf(i.url,{retry_count:n})),this._instance.ci(P({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(P({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),F.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],i=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,B(R)||(this.we&&(R.removeEventListener("online",this.we),this.we=void 0),this.xe&&(R.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(P({},e,{transport:"sendBeacon"}))}catch(n){F.error(n)}this.ve=[]}},Dy=class{constructor(e){this.ke=()=>{var n,i,r,o;this.Pe||(this.Pe={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){rt(R,"scroll",this.ke,{capture:!0}),rt(R,"scrollend",this.ke,{capture:!0}),rt(R,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return R?.document.documentElement;var e=Te(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=R?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return R&&(R.scrollY||R.pageYOffset||R.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return R&&(R.scrollX||R.pageXOffset||R.document.documentElement.scrollLeft)||0}},FL=t=>fk(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),jf=class{constructor(e,n,i,r){this.Te=o=>{var a=this.Re();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Kv]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||FL,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Kv]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?pk(n):{$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(){var e={};return Me(Uy(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Dv(i)]=n})),e}},Ov=ct("[SessionId]"),Pf=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Mc,this.De=(u,d)=>Math.abs(u-d)>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.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||eo,this.Ue=i||eo;var o=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*di(a,60,36e3,Ov.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Et.W(this.He),l=Et.W(this.Be);s&&!l?this.je=s:Et.V(this.He),Et.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Ov.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return B(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Et.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Et.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Et.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[Tf]:[n,e,i]}))}Ke(){var e=this.Fe.props[Tf];return Te(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&R&&(R.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Et.V(this.Be)},rt(R,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,o,a]=this.Ke(),s=this.Je(),l=hi(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!o,d=!u&&!e&&this.De(i,r);u||d||l?(o=this.Ne(),s=this.Ue(),Ov.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):s||(s=this.Ue(),c=!0);var p=r===0||!e||l?i:r,g=a===0?new Date().getTime():a;return this.Ve(s),this.We(o,p,g),e||this.ze(),c&&this.Oe.forEach((_=>_(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},UL=["$set_once","$set"],Qr=ct("[SiteApps]"),Ly=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=J._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[p,g]of Object.entries(d))c[p]={id:u[p],type:p,properties:g};var{$set_once:_,$set:b}=e;return{event:P({},bA(e,UL),{properties:P({},e.properties,b?{$set:P({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},b)}:{},_?{$set_once:P({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(Qr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{n.errored=!s,n.loaded=!0,Qr.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(n.processEvent=a),r=!0}catch(s){Qr.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&n.loaded)try{i()}catch(s){Qr.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){Qr.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;J["__$$ph_site_app_"+c]=o._instance,(u=J.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(d=>{if(d)return Qr.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:s,url:l}of e.siteApps)a(s)}else Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Sk=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&TC(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>TC(r?.brand,e))))return!0}catch{}return!!t.webdriver},Sc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),hA="i.posthog.com",Iy=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+hA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Sc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Sc.EU:this.er[this.apiHost]=Sc.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Sc.CUSTOM)return this.apiHost+n;var i=hA+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},VL={icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!R&&Vf(e.href,t),not_regex:(t,e)=>!!R&&!Vf(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Hy=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n.sr)==null||a.set(o.feature_flag_key,o));var s=n._instance.getFeatureFlag(o.feature_flag_key);lt(s)&&o.variants[s]&&n.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ce(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,o=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);o&&a!=null&&a.variants[o]&&this.nr(a.name,o,a.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=If(e?.search,"__experiment_id"),i=If(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ce(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.url))return!0;var i,r,o,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||VL[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return R?.location}static hr(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.utm))return!0;var i=lk();if(i.utm_source){var r,o,a,s,l,c,u,d,p=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==i.utm_campaign,g=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,_=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,b=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return p&&_&&b&&g}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];F.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return hn&&this._instance?Sk(hn,this._instance.config.custom_blocked_useragents):void 0}},jL=ct("[PostHog ExternalIntegrations]"),PL={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},zy=class{constructor(e){this._instance=e}it(e,n){var i;(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return jL.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var s,l,c;!r||(s=J.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.it(PL[a],(()=>{var u;(u=J.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=J.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=J.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(i)}}},By="[SessionRecording]",gc=ct(By),qf=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw gc.error("started without valid sessionManager"),new Error(By+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(By+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(yv))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return R&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!B(Object.assign)&&!B(Array.from);this.cr&&i?(this.gr(e),gc.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(J!=null&&(n=J.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=J.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=J.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return gc.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(RA)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,o=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,s=a?.sampleRate,l=Ce(s)?null:parseFloat(s);Ce(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[yv]:P({enabled:!!a},a,{networkPayloadCapture:P({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:B(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:gc.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):gc.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(yv);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=J.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=J.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},Cc={},$y=()=>{},As="posthog",wk=!NL&&Xt?.indexOf("MSIE")===-1&&Xt?.indexOf("Mozilla")===-1,gA=t=>{var e;return P({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:B3($?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:$y,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,debug:Kt&&lt(Kt?.search)&&Kt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(R==null||(e=R.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;F.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Oy},error_tracking:{},_onCapture:$y,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},mA=t=>{var e={};B(t.process_person)||(e.person_profiles=t.process_person),B(t.xhr_headers)||(e.request_headers=t.xhr_headers),B(t.cookie_name)||(e.persistence_name=t.cookie_name),B(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),B(t.store_google)||(e.save_campaign_params=t.store_google),B(t.verbose)||(e.debug=t.verbose);var n=Xe({},e,t);return Te(t.property_blacklist)&&(B(t.property_denylist)?n.property_denylist=t.property_blacklist:Te(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:F.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Fy=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){F.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Zf=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Fy,this.Sr=!1,this.version=Ki.LIB_VERSION,this.Er=new Mc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gA(),this.SentryIntegration=cy,this.sentryIntegration=e=>(function(n,i){var r=qA(n,i);return{name:PA,processEvent:o=>r(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new wy(this),this.toolbar=new uy(this),this.scrollManager=new Dy(this),this.pageViewManager=new vy(this),this.surveys=new ky(this),this.experiments=new Hy(this),this.exceptions=new Sy(this),this.rateLimiter=new Ty(this),this.requestRouter=new Iy(this),this.consent=new ay(this),this.externalIntegrations=new zy(this),this.people={set:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>F.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==As){var r,o=(r=Cc[i])!==null&&r!==void 0?r:new t;return o._init(e,n,i),Cc[i]=o,Cc[As][i]=o,o}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),B(e)||Lv(e))return F.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Xe({},gA(n.defaults),mA(n),{name:i,token:e})),this.config.on_xhr_error&&F.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:er.GZipJS;var o=this.Cr();this.persistence=new Ec(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ec(P({},this.config,{persistence:"sessionStorage"}),o);var a=P({},this.persistence.props),s=P({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new My((h=>this.Or(h)),this.config.request_queue_config),this.Ar=new Ny(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Pf(this),this.sessionPropsManager=new jf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(F.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(F.info("Initializing extensions synchronously"),this.Dr(l)),Ki.DEBUG=Ki.DEBUG||this.config.debug,Ki.DEBUG&&F.info("Starting in debug mode",{this:this,config:n,thisC:P({},this.config),p:a,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,d=this.config.get_device_id(eo()),p=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(Qi,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:p})}if(this.jr()){var g,_,b=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((h=>{var y;return!((y=n.bootstrap)==null||(y=y.featureFlags)==null||!y[h])})).reduce(((h,y)=>{var m;return h[y]=((m=n.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[y])||!1,h}),{}),x=Object.keys(((_=n.bootstrap)==null?void 0:_.featureFlagPayloads)||{}).filter((h=>b[h])).reduce(((h,y)=>{var m,S;return(m=n.bootstrap)!=null&&(m=m.featureFlagPayloads)!=null&&m[y]&&(h[y]=(S=n.bootstrap)==null||(S=S.featureFlagPayloads)==null?void 0:S[y]),h}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:sc,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(eo());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Qi,"anonymous")}return rt(R,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?aL(this,(()=>this.Lr())):this.Lr(),to(this.config._onCapture)&&this.config._onCapture!==$y&&(F.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(h=>this.config._onCapture(h.event,h)))),this.config.ip&&F.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}Dr(e){var n=performance.now();this.historyAutocapture=new ly(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new dy(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Ly(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new qf(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new ny(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new my(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new gy(this)})),i.push((()=>{this.exceptionObserver=new sy(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new zf(this,oL),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(o){F.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&F.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,o,a,s,l,c;if(!$||!$.body)return F.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=de(e.supportedCompression,er.GZipJS)?er.GZipJS:de(e.supportedCompression,er.Base64)?er.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){F.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Ry(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&io(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(wk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Uf(e.url,{ip:this.config.ip?1:0}),e.headers=P({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,o,a=P({},n);a.timeout=a.timeout||6e4,a.url=Uf(a.url,{_:new Date().getTime().toString(),ver:Ki.LIB_VERSION,compression:a.compression});var s=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Ef.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(o=AA(l,(u=>u.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(P({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],o=[];io(e,(s=>{s&&(n=s[0],Te(n)?o.push(s):to(s)?s.call(this):Te(s)&&n==="alias"?i.push(s):Te(s)&&n.indexOf("capture")!==-1&&to(this[n])?o.push(s):r.push(s))}));var a=function(s,l){io(s,(function(c){if(Te(c[0])){var u=l;Me(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!B(e)&&lt(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!lt(n?.$current_url)&&(F.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=eo(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var d,p=this.qr(i?.$set_once);if(p&&(u.$set_once=p),(u=H3(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,B(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===Cf.DISMISSED||e===Cf.SENT){var g=n?.[dA.SURVEY_ID],_=n?.[dA.SURVEY_ITERATION];d={id:g,current_iteration:_},localStorage.getItem(fA(d))||localStorage.setItem(fA(d),"true"),u.$set=P({},u.$set,{[HL({id:g,current_iteration:_},e===Cf.SENT?"responded":"dismissed")]:!0})}var b=P({},u.properties.$set,u.$set);if(ks(b)||this.setPersonPropertiesForFlags(b),!Ce(this.config.before_send)){var x=this.Wr(u);if(!x)return;u=x}this.Er.emit("eventCaptured",u);var f={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(f):this.Mr.enqueue(f),u}F.critical("This capture call is ignored due to client rate limiting.")}}else F.error("No event name provided to posthog.capture")}else F.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=o?void 0:this.persistence.remove_event_timer(e),s=P({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=P({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!lt(s.distinct_id)&&!hi(s.distinct_id)||Lv(s.distinct_id))&&F.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=SL(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());s.$session_id=d,s.$window_id=p}this.sessionPropsManager&&Xe(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Xe(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Sc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Xe(s,c),e==="$pageview"&&$&&(s.title=$.title),!B(a)){var _=i.getTime()-a;s.$duration=parseFloat((_/1e3).toFixed(3))}Xt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Xe({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Te(this.config.property_denylist)?Me(this.config.property_denylist,(function(f){delete s[f]})):F.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(F.error("sanitize_properties is deprecated. Use before_send instead"),s=b(s,e));var x=this.Gr();return s.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Xe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(F.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.Sr=!0,ks(o)?void 0:o}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=BL),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return F.uninitializedWarning("posthog.identify");if(hi(e)&&(e=e.toString(),F.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))F.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==sc){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(mc)&&(this.unregister(mc),this.register({distinct_id:e}));var a=(this.persistence.get_property(Qi)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(Qi,"identified"),this.setPersonPropertiesForFlags(P({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=aA(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Rf))}}else F.critical('The string "'+sc+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else F.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=aA(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(P({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):F.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:P({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else F.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,o;if(F.info("reset"),!this.__loaded)return F.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(Qi,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:sc,$device_id:null},"");else{var s=this.config.get_device_id(eo());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(kA)?(F.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(B(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(mc,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(F.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=P({},this.config);if(pt(e)){var i,r,o,a,s;Xe(this.config,mA(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ec(P({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);no(c)&&(this.config.debug=c),no(this.config.debug)&&(this.config.debug?(Ki.DEBUG=!0,qe.H()&&qe.G("ph_debug","true"),F.info("set_config",{config:e,oldConfig:n,newConfig:P({},this.config)})):(Ki.DEBUG=!1,qe.H()&&qe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(P({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:As;return n!==As&&(n=As+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Qi))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Qi))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[mc])&&((n=this.persistence)==null||(n=n.props)==null||!n[Mf]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(F.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Mf,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new Pf(this),this.persistence&&(this.sessionPropsManager=new jf(this,this.sessionManager,this.persistence)),this.sessionRecording=new qf(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(B(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else F.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:sc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):F.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Ji.GRANTED?"granted":e===Ji.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return hn?Sk(hn,this.config.custom_blocked_useragents):void 0}Hr(){$&&($.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:$.title},{send_instantly:!0}),this.kr&&($.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),rt($,"visibilitychange",this.kr)))}debug(e){e===!1?(R?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(R?.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}))}O(){var e,n,i,r,o,a,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(F.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):(i="advanced_disable_decide",r=!1,o=F,a=(n="advanced_disable_flags")in(e=l)&&!B(e[n]),s=i in e&&!B(e[i]),a?e[n]:s?(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ce(this.config.before_send))return e;var n=Te(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ce(i)){var o="Event '"+e.event+"' was rejected in beforeSend function";return b3(e.event)?F.warn(o+". This can cause unexpected behavior."):F.info(o),null}i.properties&&!ks(i.properties)||F.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=no(e)&&!e,i=qe.H()&&qe.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=I3(t.prototype[e[n]])})(Zf,["identify"]);var vA,Ek=(vA=Cc[As]=new Zf,(function(){function t(){t.done||(t.done=!0,wk=!1,Me(Cc,(function(e){e._dom_loaded()})))}$!=null&&$.addEventListener?$.readyState==="complete"?t():rt($,"DOMContentLoaded",t,{capture:!1}):R&&F.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),vA);var Ky=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");j(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=Ek.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let a=this.getAllFeatureFlags();a&&this.featureFlagsCallback&&this.featureFlagsCallback(a)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let a=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof a=="string"&&this.captureCallback?.(a,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Qy(t={}){return new Ky(t)}var Jy=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},eb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let o=await Promise.allSettled(i);for(let a of o)a.status==="fulfilled"&&a.value!==r&&n.push(a.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},tb=async(t,e)=>{let n,i,r=!1,o={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(a=>{n=e.subscribeEvent(t.event,()=>{r||a()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||a()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(a=>{i=setTimeout(()=>{r||a()},t.durationMs)}),o};var Xf=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of Xg)this.registerCore(e,n);for(let{kind:e,executor:n}of lm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",Jy),this.registerCore("core:parallel",eb),this.registerCore("core:wait",tb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let a of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:a.message,field:a.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},nr=new Xf;function qL(t){return nr.get(t)}function nb(t){return nr.has(t)}var ZL=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Ck=5e4,Ak=50;function ao(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!nb(i)&&i!=="core:mountWidget"){let r=nr.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":oo(t,e,n);break;case"overlays:badge":oo(t,e,n),GL(t,e,n);break;case"overlays:tooltip":oo(t,e,n),YL(t,e,n);break;case"overlays:modal":o5(t,e,n);break;case"content:insertHtml":oo(t,e,n),WL(t,e,n);break;case"content:setText":oo(t,e,n),XL(t,e,n);break;case"content:setAttr":oo(t,e,n),KL(t,e,n);break;case"content:addClass":case"content:removeClass":oo(t,e,n),QL(t,e,n);break;case"content:setStyle":oo(t,e,n),JL(t,e,n);break;case"core:mountWidget":e5(t,e,n);break;case"core:wait":t5(t,e,n);break;case"core:sequence":n5(t,e,n);break;case"core:parallel":i5(t,e,n);break;case"core:tour":a5(t,e,n);break;case"navigation:navigate":r5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function oo(t,e,n){let i=t.anchorId;if(!i||typeof i!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!i.selector||typeof i.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):i.selector.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),i.route===void 0||i.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let r=Array.isArray(i.route)?i.route:[i.route];for(let o of r)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function GL(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function YL(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function WL(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>Ck&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Ck}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function XL(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function KL(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(ZL.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function QL(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function JL(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>Ak&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${Ak}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function e5(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function t5(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function n5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function i5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function r5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function o5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function a5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),i.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let a=ao(o.action);for(let s of a.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of a.warnings)n.push(s)}if(o.onAction)for(let[a,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function ib(t){let e=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=ao(t[i]);if(!r.valid){let o=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(a=>`${a.code}: ${a.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${i}].${o.field}`:`[${i}]`});for(let o of r.warnings)n.push({...o,suggestion:o.suggestion?`Action ${i}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var s5=0;function rb(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,adaptiveId:o,executorRegistry:a=nr,subscribeNavigation:s,runtime:l}=t,c=new Map,u=new Map;function d(){return`action-${++s5}`}function p(w,C){n&&n.publish(w,C)}function g(){return{overlayRoot:e,resolveAnchor:r,generateId:d,publishEvent:p,adaptiveId:o,applyAction:f,subscribeEvent:n?(w,C)=>n.subscribe({names:[w]},k=>C(k.props)):void 0,subscribeNavigation:s}}async function _(w,C){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let k=i.mount(w.slot,{type:"widget",widgetId:w.widget.widgetId,config:w.widget.props},{priority:w.widget.priority});return C.publishEvent("action.applied",{id:C.generateId(),kind:"core:mountWidget",slot:w.slot,widgetId:w.widget.widgetId}),{cleanup:()=>{k.unmount()},updateFn:T=>{if("widget"in T&&T.widget){let E=T.widget;E.props&&k.update({type:"widget",widgetId:w.widget.widgetId,config:E.props})}}}}async function b(w,C){if(w.kind==="core:mountWidget")return _(w,C);let k=a.get(w.kind);if(!k){let T="list"in a?a.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${w.kind}".`,`Registered: [${T}]`),new Error(`No executor for action kind: ${w.kind}`)}return k(w,C)}function x(w,C,k,T){if(!l)return;let E=[],M=async()=>{let N=c.get(w);if(!N)return;let H=l.evaluateSync(k).value;if(N.state==="applied"&&!H){try{await N.cleanup()}catch(q){console.error(`[ActionEngine] Error reverting conditional action ${w}:`,q)}N.state="deferred",N.cleanup=()=>{},N.updateFn=void 0,p("action.deferred",{id:w,kind:C.kind})}else if(N.state==="deferred"&&H)try{let q=g(),V=await b(C,q);N.state="applied",N.cleanup=V.cleanup,N.updateFn=V.updateFn,N.appliedTs=Date.now(),p("action.applied",{id:w,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0})}catch(q){console.error(`[ActionEngine] Error applying deferred action ${w}:`,q),N.state="failed"}};l.context&&E.push(l.context.subscribe(M)),l.accumulator&&E.push(l.accumulator.subscribe(M)),u.set(w,E)}async function f(w){let C=ao(w);if(!C.valid){let H=C.errors.map(q=>q.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${w?.kind}":`,H,w),new Error(`Action validation failed: ${H}`)}let k=d(),T=w.triggerWhen;if(T&&l&&!l.evaluateSync(T).value){let q={id:k,action:w,adaptiveId:o,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(k,q);let V={id:k,action:w,async revert(){let ie=c.get(k);if(!ie)return;let D=u.get(k);if(D){for(let Y of D)Y();u.delete(k)}ie.state="reverted",c.delete(k)},isApplied(){return c.get(k)?.state==="applied"},async update(ie){let D=c.get(k);if(!D||D.state!=="applied")throw new Error("Cannot update action that is not applied");if(D.updateFn)await D.updateFn(ie);else throw new Error(`Action kind ${w.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return x(k,w,T,V),V}let E=g(),M=await b(w,E),N={id:k,action:w,adaptiveId:o,appliedTs:Date.now(),state:"applied",cleanup:M.cleanup,updateFn:M.updateFn};c.set(k,N),p("action.applied",{id:k,kind:w.kind,anchorId:"anchorId"in w?w.anchorId:void 0});let I={id:k,action:w,async revert(){let H=c.get(k);if(!H||H.state!=="applied")return;let q=u.get(k);if(q){for(let V of q)V();u.delete(k)}try{await H.cleanup(),H.state="reverted",p("action.reverted",{id:k,kind:w.kind})}catch(V){throw H.state="failed",p("action.failed",{id:k,kind:w.kind,error:String(V)}),V}finally{c.delete(k)}},isApplied(){return c.get(k)?.state==="applied"},async update(H){let q=c.get(k);if(!q||q.state!=="applied")throw new Error("Cannot update action that is not applied");if(q.updateFn)await q.updateFn(H);else throw new Error(`Action kind ${w.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return T&&l&&x(k,w,T,I),I}async function h(w){console.log(`[ActionEngine] applyBatch: ${w.length} action(s)`,w.map(N=>N.kind).join(", "));let C=ib(w);if(!C.valid){let N=C.errors.map(I=>I.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${w.length} action(s):`,N,`
445
- Actions:`,w.map((I,H)=>` [${H}] ${I.kind} ${I.anchorId?`anchor="${I.anchorId}"`:""} ${I.label?`label="${I.label}"`:""}`).join(`
446
- `)),new Error(`Batch validation failed: ${N}`)}let k=d(),T=[],E=[];try{for(let N of w){let I=await f(N);T.push(I),E.push(I)}}catch(N){console.error(`[ActionEngine] Batch apply FAILED at action ${E.length+1}/${w.length}.`,`Successfully applied: ${E.length}. Rolling back...`,N);for(let I of E)try{await I.revert()}catch{}throw N}return{id:k,handles:T,async revertAll(){for(let N=T.length-1;N>=0;N--)try{await T[N].revert()}catch(I){console.error(`[ActionEngine] Error reverting action ${T[N].id}:`,I)}},isApplied(){return T.every(N=>N.isApplied())}}}function y(w){return ao(w)}function m(){return Array.from(c.values()).map(w=>({id:w.id,action:w.action,adaptiveId:w.adaptiveId,appliedTs:w.appliedTs,state:w.state}))}function S(){for(let w of u.values())for(let C of w)try{C()}catch{}u.clear();for(let w of c.values())if(w.state==="applied")try{w.cleanup()}catch(C){console.error("[ActionEngine] Error during cleanup:",C)}c.clear()}return{apply:f,applyBatch:h,validate:y,getActive:m,destroy:S}}var l5=v.object({type:v.literal("page_url"),url:v.string()}),c5=v.object({type:v.literal("route"),routeId:v.string()}),u5=v.object({type:v.literal("anchor_visible"),anchorId:v.string(),state:v.enum(["visible","present","absent"])}),d5=v.object({type:v.literal("event_occurred"),eventName:v.string(),withinMs:v.number().optional()}),f5=v.object({type:v.literal("state_equals"),key:v.string(),value:v.unknown()}),p5=v.object({type:v.literal("viewport"),minWidth:v.number().optional(),maxWidth:v.number().optional(),minHeight:v.number().optional(),maxHeight:v.number().optional()}),h5=v.object({type:v.literal("session_metric"),key:v.string(),operator:v.enum(["gte","lte","eq","gt","lt"]),threshold:v.number()}),g5=v.object({type:v.literal("dismissed"),key:v.string(),inverted:v.boolean().optional()}),m5=v.object({type:v.literal("cooldown_active"),key:v.string(),inverted:v.boolean().optional()}),v5=v.object({type:v.literal("frequency_limit"),key:v.string(),limit:v.number(),inverted:v.boolean().optional()}),y5=v.object({type:v.literal("event_count"),key:v.string(),operator:v.enum(["gte","lte","eq","gt","lt"]),count:v.number().int().min(0),withinMs:v.number().positive().optional()}),ob=v.discriminatedUnion("type",[l5,c5,u5,d5,f5,p5,h5,g5,m5,v5,y5]),kk=v.object({conditions:v.array(ob),value:v.unknown()}),Tk=v.object({type:v.literal("rules"),rules:v.array(kk),default:v.unknown()}),Rk=v.object({type:v.literal("score"),field:v.string(),threshold:v.number(),above:v.unknown(),below:v.unknown()}),Ok=v.object({type:v.literal("model"),modelId:v.string(),inputs:v.array(v.string()),outputMapping:v.record(v.string(),v.unknown()),default:v.unknown()}),Mk=v.object({type:v.literal("external"),endpoint:v.string(),method:v.enum(["GET","POST"]).optional(),default:v.unknown(),timeoutMs:v.number().optional()}),Kf=v.discriminatedUnion("type",[Tk,Rk,Ok,Mk]),Nk=v.object({include:v.array(v.string()).optional(),exclude:v.array(v.string()).optional()}),Qf=v.object({routes:Nk,strategy:Kf.optional()});function D$(t){return ob.safeParse(t)}function L$(t){return Kf.safeParse(t)}function I$(t){return Qf.safeParse(t)}var H$=[{defName:"activationConfig",schema:Qf},{defName:"routeFilter",schema:Nk},{defName:"ruleStrategy",schema:Tk},{defName:"scoreStrategy",schema:Rk},{defName:"modelStrategy",schema:Ok},{defName:"externalStrategy",schema:Mk},{defName:"rule",schema:kk},{defName:"condition",schema:ob}];var ht={activation:Qf.optional(),triggerWhen:Kf.nullable().optional()},Hn=v.object({selector:v.string(),route:v.union([v.string(),v.array(v.string())])}).strict(),Dk=v.object({color:v.string().optional(),scrimOpacity:v.number().min(0).max(1).optional(),paddingPx:v.number().optional(),radiusPx:v.number().optional()}).strict(),Lk=v.enum(["top-left","top-right","bottom-left","bottom-right"]),Ik=v.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),sb=v.object({label:v.string(),actionId:v.string(),primary:v.boolean().optional()}).strict(),Hk=v.object({title:v.string().optional(),body:v.string(),ctaButtons:v.array(sb).optional()}).strict(),zk=v.object({title:v.string().optional(),body:v.string()}).strict(),Bk=v.enum(["before","after","prepend","append","replace"]),$k=v.enum(["immediate","hover","click"]),Fk=v.object({widgetId:v.string(),props:v.record(v.unknown()).optional(),priority:v.number().optional()}).strict(),Uk=v.object({id:v.string(),action:v.any(),route:v.string().optional(),onAction:v.record(v.string()).optional()}).passthrough(),Vk=v.enum(["auto","smooth","instant"]),ab=v.enum(["start","center","end","nearest"]),jk=v.object({kind:v.literal("content:setText"),anchorId:Hn,text:v.string(),label:v.string().optional()}).extend(ht).strict(),Pk=v.object({kind:v.literal("content:setAttr"),anchorId:Hn,attr:v.string(),value:v.string(),label:v.string().optional()}).extend(ht).strict(),qk=v.object({kind:v.literal("content:addClass"),anchorId:Hn,className:v.string(),label:v.string().optional()}).extend(ht).strict(),Zk=v.object({kind:v.literal("content:removeClass"),anchorId:Hn,className:v.string(),label:v.string().optional()}).extend(ht).strict(),Gk=v.object({kind:v.literal("content:setStyle"),anchorId:Hn,styles:v.record(v.string()),label:v.string().optional()}).extend(ht).strict(),Yk=v.object({kind:v.literal("content:insertHtml"),anchorId:Hn,html:v.string(),position:Bk,label:v.string().optional()}).extend(ht).strict(),Wk=v.object({kind:v.literal("overlays:highlight"),anchorId:Hn,style:Dk.optional(),duration:v.number().optional(),label:v.string().optional()}).extend(ht).strict(),Xk=v.object({kind:v.literal("overlays:pulse"),anchorId:Hn,duration:v.number().optional(),label:v.string().optional()}).extend(ht).strict(),Kk=v.object({kind:v.literal("overlays:badge"),anchorId:Hn,content:v.string(),position:Lk.optional(),label:v.string().optional()}).extend(ht).strict(),Qk=v.object({kind:v.literal("overlays:tooltip"),anchorId:Hn,content:Hk,trigger:$k.optional(),placement:Ik.optional(),waitFor:v.string().optional(),label:v.string().optional()}).extend(ht).strict(),Jk=v.object({kind:v.literal("overlays:modal"),content:zk,size:v.enum(["sm","md","lg"]).optional(),blocking:v.boolean().optional(),scrim:v.object({opacity:v.number().min(0).max(1).optional()}).strict().optional(),dismiss:v.object({onEsc:v.boolean().optional(),closeButton:v.boolean().optional(),timeoutMs:v.number().min(0).optional()}).strict().optional(),ctaButtons:v.array(sb).optional(),waitFor:v.string().optional(),label:v.string().optional()}).extend(ht).strict(),eT=v.object({kind:v.literal("navigation:scrollTo"),anchorId:Hn,behavior:Vk.optional(),block:ab.optional(),inline:ab.optional(),label:v.string().optional()}).extend(ht).strict(),tT=v.object({kind:v.literal("navigation:navigate"),url:v.string(),target:v.enum(["_self","_blank"]).optional(),label:v.string().optional()}).extend(ht).strict(),nT=v.object({kind:v.literal("core:mountWidget"),slot:v.string(),widget:Fk,label:v.string().optional()}).extend(ht).strict(),iT=v.object({kind:v.literal("core:wait"),durationMs:v.number().min(0).optional(),event:v.string().optional(),label:v.string().optional()}).extend(ht).strict(),rT=v.object({kind:v.literal("core:sequence"),actions:v.array(v.any()),label:v.string().optional()}).extend(ht).strict(),oT=v.object({kind:v.literal("core:parallel"),actions:v.array(v.any()),waitFor:v.enum(["all","any"]).optional(),label:v.string().optional()}).extend(ht).strict(),aT=v.object({kind:v.literal("core:tour"),tourId:v.string(),steps:v.array(Uk).min(1),startStep:v.string().optional(),autoStart:v.boolean().optional(),label:v.string().optional()}).extend(ht).passthrough(),b5=[{defName:"setText",schema:jk},{defName:"setAttr",schema:Pk},{defName:"addClass",schema:qk},{defName:"removeClass",schema:Zk},{defName:"setStyle",schema:Gk},{defName:"insertHtml",schema:Yk},{defName:"highlight",schema:Wk},{defName:"pulse",schema:Xk},{defName:"badge",schema:Kk},{defName:"tooltip",schema:Qk},{defName:"modal",schema:Jk},{defName:"scrollTo",schema:eT},{defName:"navigate",schema:tT},{defName:"mountWidget",schema:nT},{defName:"wait",schema:iT},{defName:"sequence",schema:rT},{defName:"parallel",schema:oT},{defName:"tour",schema:aT}];function _5(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function lb(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(sT(n,i))return}if(e.include){for(let i of e.include)if(sT(n,i))return i;return}return n}function sT(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var Jf=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"navigation");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=_5(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=lb(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=lb(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),queueMicrotask(()=>this.updatePage())},history.replaceState=(...a)=>{o(...a),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=lb(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function cb(t={}){return new Jf(t)}var x5=v.object({url:v.string(),routeId:v.string().optional(),title:v.string().optional(),locale:v.string().optional()}),S5=v.object({url:v.string(),ts:v.number()}),w5=v.object({sessionId:v.string(),startTs:v.number(),pageHistory:v.array(S5).optional()}),E5=v.object({width:v.number(),height:v.number()}),C5=v.object({x:v.number(),y:v.number(),w:v.number(),h:v.number()}),A5=v.object({anchorId:v.string(),present:v.boolean(),visible:v.boolean().optional(),boundingBox:C5.optional()}),k5=v.record(v.string(),v.union([v.number(),v.string(),v.boolean(),v.undefined()])),T5=v.object({page:x5,session:w5,viewport:E5,anchors:v.array(A5).optional(),augmented:k5.optional()});function W$(t){return T5.safeParse(t)}function lT(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,a=n.page.url,s=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${s}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=n.anchors?.find(a=>a.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:a}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let o=i.getSessionMetric(t.key),{operator:a,threshold:s}=t;switch(a){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let o=i.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!i)return t.inverted??!1;let o=i.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}case"event_count":{if(!e.accumulator)return!1;let o=t,a=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return a>=o.count;case"lte":return a<=o.count;case"eq":return a===o.count;case"gt":return a>o.count;case"lt":return a<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function cT(t,e){let n=[];for(let i of t.conditions){let r=lT(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function ep(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:o}=cT(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function tp(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function uT(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:o}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0,accumulator:o?{getCount:(a,s)=>o.getCount(a,s)}:void 0}}async function dT(t,e,n={}){let i=uT(e,n);switch(t.type){case"rules":return ep(t,i);case"score":return tp(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function fT(t,e,n={}){let i=uT(e,n);switch(t.type){case"rules":return ep(t,i);case"score":return tp(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function ub(t){return{evaluate:(e,n)=>dT(e,n,t),evaluateSync:(e,n)=>fT(e,n,t)}}function db(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,o=null,a=n.ns("accumulator");function s(c){let u=!1;for(let d of i.values()){if(!d.predicate(c))continue;let p=a.get(d.stateKey)||{count:0};p.count++,d.needsTimestamps&&(p.timestamps||(p.timestamps=[]),p.timestamps.push(c.ts),p.timestamps.length>200&&(p.timestamps=p.timestamps.slice(-200))),a.set(d.stateKey,p),u=!0}if(u)for(let d of r)try{d()}catch(p){console.error("[EventAccumulator] Subscriber error:",p)}}function l(){o||i.size===0||(o=e.subscribe(s))}return{register(c,u,d=!1){let p=`ev:${c}`,g=i.get(p);if(g){d&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}i.set(p,{stateKey:p,needsTimestamps:d,predicate:u}),l()},getCount(c,u){let d=`ev:${c}`,p=a.get(d);if(!p)return 0;if(u===void 0||!p.timestamps)return p.count;let g=Date.now()-u;return p.timestamps.filter(_=>_>=g).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){o&&(o(),o=null),i.clear(),r.clear()}}}function fb(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var np=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let o={filter:i,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:ss};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(fb(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>fb(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=r&&(i===void 0||o.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>fb(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(o=>o.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Ic(t={}){return new np(t)}var pT={$autocapture:"ui.click",$click:xe.UI_CLICK,$scroll:xe.UI_SCROLL,$input:xe.UI_INPUT,$change:xe.UI_CHANGE,$submit:xe.UI_SUBMIT,$pageview:xe.NAV_PAGE_VIEW,$pageleave:xe.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function R5(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(pT[e])return pT[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?xe.UI_SUBMIT:i==="change"?xe.UI_CHANGE:n==="input"||n==="textarea"?xe.UI_INPUT:xe.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function O5(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function hT(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:R5(t),source:"posthog",props:O5(t),schemaVersion:ss}}function gT(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function pb(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(gT(i)){let r=hT(i);t(r)}}}var mT=v.enum(["posthog","canvas","derived"]),M5=v.object({ts:v.number(),name:v.string(),source:mT,props:v.record(v.string(),v.unknown()).optional(),schemaVersion:v.string()}),N5=v.object({names:v.array(v.string()).optional(),patterns:v.array(v.string()).optional(),sources:v.array(mT).optional()});function b8(t){return M5.safeParse(t)}function _8(t){return N5.safeParse(t)}var Hc=class{constructor(){j(this,"listeners",new Set);j(this,"capturedPushState");j(this,"capturedReplaceState");j(this,"wasNative");j(this,"destroyed",!1);j(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var hb="cooldown:";function vT(t){return{set(e,n){let i=hb+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=hb+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=hb+e;t.remove(n)}}}var zc="dismissed:";function yT(t,e){return{mark(n,i=!1){let r=zc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=zc+n;return t.has(i)||e.has(i)},clear(n){let i=zc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(zc)&&t.remove(n);for(let n of e.keys())n.startsWith(zc)&&e.remove(n)}}}var gb="freq:";function bT(t){function e(n){let i=gb+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=gb+n,o=e(n),a=(o?.count??0)+1,s={count:a,resetAt:o?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),a},count(n){return e(n)?.count??0},reset(n){let i=gb+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var D5="syntro";function mb(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+i);return}return o.value}catch{return}},set(i,r,o){if(t)try{let a={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(n+i,JSON.stringify(a))}catch(a){console.warn("[StateStore] Failed to save:",a)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(n)&&i.push(o.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function vb(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,o){e.set(n+i,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var ip=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??D5,typeof window<"u"?(this.session=mb(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=mb(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=vb(this.namespace),this.user=vb(this.namespace)),this.dismissals=yT(this.session,this.user),this.cooldowns=vT(this.user),this.frequency=bT(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?mb(sessionStorage,n):vb(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function yb(t={}){return new ip(t)}function Bc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function rp(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var _T={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},$c={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},xT={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function bb(t,e,n){let i=_T[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function _b(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[Od(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(Nd()),n.shift!==!1&&r.push(Md({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Rd(e,t,async()=>{let{x:a,y:s,strategy:l}=await Dd(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${s}px`})})}function xb(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function Sb(t,e){return e==="none"||$c[e].length===0?null:t.animate($c[e],xT)}function wb(t,e){if(e==="none"||$c[e].length===0)return Promise.resolve();let n=[...$c[e]].reverse(),i=t.animate(n,xT);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function Eb(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function Cb(t){switch(Bc(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function ST(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),a=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){a.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),d=c.value.trim().toLowerCase(),p=u.startsWith("on"),g=(u==="href"||u==="src")&&d.startsWith("javascript:");(p||g)&&s.removeAttribute(c.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var L5=0;function Ab(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:o}=t,a=new Map,s=new Map,l=new Map;function c(){return`mount-${++L5}`}function u(m,S){n&&n.publish(m,S)}function d(m){let S=l.get(m);if(S){let w=x(m);for(let C of S)try{C(w)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let p=new Map;function g(m,S,w){switch(S.type){case"html":m.innerHTML=ST(S.content);return;case"widget":{if(o?.has(S.widgetId)){let C=o.mount(S.widgetId,m,S.config);return w&&p.set(w,C),()=>{C.unmount(),w&&p.delete(w)}}console.warn(`[Surfaces] Widget not found: ${S.widgetId}`),m.innerHTML=`<div data-widget-id="${S.widgetId}" data-widget-missing="true">Widget: ${S.widgetId}</div>`;return}case"custom":return S.mount(m);case"react":m.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function _(m,S,w){let C=c(),k=Bc(m),T=w?.priority??0,E=w?.animation??r,M=w?.exclusive??!0,N=a.get(m);if(N&&M){if(N.options.priority>T)throw new Error(`Slot ${m} is occupied by higher priority content (${N.options.priority} > ${T})`);b(N)}let I=Eb(m,C);I.style.zIndex=String(Cb(m));let H;if(k==="static")bb(I,m,w?.constraints),e.appendChild(I);else if(k==="inline"){let D=rp(m);if(!D)throw new Error(`Invalid inline slot: ${m}`);if(!i)throw new Error("Anchor resolver required for inline slots");let Y=i({selector:D,route:"**"});if(!Y)throw new Error(`Anchor not found for inline slot: ${D}`);H=xb(I,Y)}else if(k==="adjacent"){let D=rp(m);if(!D)throw new Error(`Invalid adjacent slot: ${m}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let Y=i({selector:D,route:"**"});if(!Y)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(I),H=_b(I,Y,w?.position??{placement:"bottom"})}let q=g(I,S,C);Sb(I,E);let V={id:C,slot:m,content:S,options:{priority:T,exclusive:M,animation:E,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:I,cleanup:()=>{H?.(),q?.()},mountedAt:Date.now()};return a.set(m,V),s.set(m,(s.get(m)??0)+1),u("surface.mounted",{slot:m,id:C,adaptiveId:w?.adaptiveId}),d(m),{id:C,update(D){let Y=a.get(m);if(!Y||Y.id!==C)throw new Error("Mount no longer active");let ee=p.get(C);if(ee){if(D.type==="widget"){ee.update(D.config),Y.content=D;return}ee.unmount(),p.delete(C)}Y.container.innerHTML="";let me=g(Y.container,D,C);if(Y.content=D,me){let Ke=Y.cleanup;Y.cleanup=()=>{Ke?.(),me()}}},setOptions(D){let Y=a.get(m);if(!Y||Y.id!==C)throw new Error("Mount no longer active");D.priority!==void 0&&(Y.options.priority=D.priority),D.animation!==void 0&&(Y.options.animation=D.animation),D.constraints&&k==="static"&&(D.constraints.maxWidth&&(Y.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(Y.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(Y.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(Y.container.style.minHeight=D.constraints.minHeight)),d(m)},async unmount(){let D=a.get(m);!D||D.id!==C||await b(D)},isMounted(){return a.get(m)?.id===C},getContainer(){let D=a.get(m);return D?.id===C?D.container:null}}}async function b(m){await wb(m.container,m.options.animation),m.cleanup?.(),m.container.remove(),a.delete(m.slot),u("surface.unmounted",{slot:m.slot,id:m.id}),d(m.slot)}function x(m){let S=a.get(m);return{slot:m,occupied:!!S,currentPriority:S?.options.priority,currentAdaptiveId:S?.options.adaptiveId,mountCount:s.get(m)??0,currentMountId:S?.id}}function f(m,S){let w=l.get(m);return w||(w=new Set,l.set(m,w)),w.add(S),()=>{w?.delete(S),w?.size===0&&l.delete(m)}}function h(m,S){let w=a.get(m);return w?S!==void 0?S>=w.options.priority:!1:!0}function y(){for(let m of a.values())try{m.cleanup?.(),m.container.remove()}catch(S){console.error("[Surfaces] Error during cleanup:",S)}a.clear(),l.clear()}return{mount:_,getState:x,onStateChange:f,canMount:h,destroy:y}}var op=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0);j(this,"runtimeRef");j(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let a={...i,runtime:this.runtimeRef},s=r.widget.mount(n,a);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(o);c&&(c.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let d={...c,runtime:this.runtimeRef},p=r.widget.mount(n,d);u.cleanup=p??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},kb=new op;var wT="2.0.0";function I5(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(Tb(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(Tb(i,r))return!0;return!1}return!0}function Tb(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function H5(t){let{selector:e,route:n}=t,r=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";if(!(Array.isArray(n)?n:[n]).some(s=>Tb(r,s)))return null;try{return document.querySelector(e)}catch{return null}}function Rb(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:o}=t,a=t.widgets??kb,s=t.executors??nr,l=t.apps??Zl,c=new Hc,u=cb({telemetry:e,routes:i,navigation:c}),d=t.events??Ic(),p=yb({namespace:o}),g=db({eventBus:d,stateStore:p}),_=ub({state:p,events:d,sessionMetrics:n,accumulator:g}),b=sE(),x=m=>H5(m),f=Ab({overlayRoot:b,eventBus:d,anchorResolver:x,widgetRegistry:a}),h=rb({overlayRoot:b,eventBus:d,surfaces:f,anchorResolver:x,executorRegistry:s,subscribeNavigation:m=>c.subscribe(m),runtime:{evaluateSync:m=>_.evaluateSync(m,u.get()),context:u,accumulator:g}}),y={telemetry:e,context:u,events:d,state:p,sessionMetrics:n,actions:h,surfaces:f,widgets:a,executors:s,apps:l,accumulator:g,navigation:c,version:wT,mode:r,async evaluate(m){return _.evaluate(m,u.get())},evaluateSync(m){return _.evaluateSync(m,u.get())},async filterTiles(m){let S=u.get().page.url,w=[];for(let C of m){let k=C.activation;if(!k){w.push(C);continue}if(!I5(S,k.routes))continue;if(!k.strategy){w.push(C);continue}(await this.evaluate(k.strategy)).value&&w.push(C)}return w},setRoutes(m){u.setRoutes(m)},destroy(){l.unbind().catch(m=>{console.error("[Runtime] Error unbinding apps registry:",m)}),g.destroy(),c.destroy(),u.destroy(),h.destroy(),f.destroy()}};return l.bind(y),a.bindRuntime(y),y}var z5=v.object({value:v.unknown(),expiresAt:v.number().optional()}),B5=v.object({count:v.number(),resetAt:v.number().optional()});function SF(t){return z5.safeParse(t)}function wF(t){return B5.safeParse(t)}var ET={growthbook:t=>lv({...t,autoInit:!0})};function CT(t,e){let n=ET[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(ET).join(", ")}`);return n(e)}var $5=["cdn.syntrologie.com","localhost","127.0.0.1"];function F5(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):$5.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var Ob=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!F5(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await U5(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),o=performance.now()-e,a=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:a?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function U5(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function AT(t){return new Ob(t)}var V5="syntro_exp",j5="syntro_var",Mb=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");j(this,"manifestKey");j(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),o=r.get(V5),a=r.get(j5);if(o&&a!==null&&this.client.setForcedVariations){let s=parseInt(a,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Bd(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function kT(t){return new Mb(t)}var P5="https://cdn.syntrologie.com/configs",TT={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return AT({baseUrl:t.baseUrl??P5,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return kT({featureKey:t.featureKey})}};function RT(t,e={}){let n=TT[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(TT).join(", ")}`);return n(e)}var OT={posthog:t=>Qy(t),noop:()=>gv()};function MT(t,e){let n=OT[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(OT).join(", ")}`);return n(e)}var Nb="syn_";function ap(t){if(!t.startsWith(Nb))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Nb.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Db(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Nb+n}function ir(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function q5(){if(typeof window>"u")return G("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Io(),n=!!(Br()?.token&&t?.mode==="editor");return G("Syntro Bootstrap","isEditorMode:",n),n}function Z5(){if(typeof window>"u")return G("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Io(),n=!!(Br()?.token&&t?.mode==="audit");return G("Syntro Bootstrap","isAuditMode:",n),n}function G5(){if(typeof window>"u")return G("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Io(),n=!!(Br()?.token&&t?.mode==="review");return G("Syntro Bootstrap","isReviewMode:",n),n}var NT="syntro_segment_attributes";function Y5(){if(typeof window>"u")return{};try{let t=localStorage.getItem(NT);if(t){let e=JSON.parse(t);return G("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){fn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function W5(t){if(!(typeof window>"u"))try{localStorage.setItem(NT,JSON.stringify(t)),G("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){fn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function X5(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function K5(t){bm(),G("Syntro Bootstrap","====== INIT ======"),G("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=q5(),n=Z5(),i=G5(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",Br()),console.log("[DIAG] editorConf:",Io()),G("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,M=!!window.__SYNTRO_AUDIT_LEGEND__,N=!!window.__SYNTRO_REVIEW_DATA__;if(E||M||N){let I=[E&&"__SYNTRO_EDITOR_PARAMS__",M&&"__SYNTRO_AUDIT_LEGEND__",N&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${I.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&r){let M=Io()?.syntro_token;M?.startsWith("syn_")&&(o=M,G("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let a;if(o)if(o.startsWith("syn_"))G("Syntro Bootstrap","Token starts with syn_, decoding..."),a=ap(o),bm(a.d);else if(r)G("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw $d("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),$d("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)G("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw $d("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=ir("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ir("VITE_SYNTRO_EXPERIMENT_HOST")||a?.eh,l=ir("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ir("VITE_SYNTRO_TELEMETRY_HOST")||a?.th,c=ir("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ir("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=Y5();G("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let d,p=Ic();console.log("[Syntro Bootstrap] EventBus created");let g=pb(E=>{p.publishEvent(E)}),_=E=>{G("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let M=X5(E);if(G("Syntro Bootstrap","Segment flags from PostHog:",M),W5(M),d){let I={...x?.getAll?.()??{},...M};G("Syntro Bootstrap","Updating GrowthBook with attributes:",I),d.setAttributes?.(I)}},b;if(a?.t){let E=a.t==="noop"?"noop":"posthog";b=MT(E,{apiKey:a.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:_,onCapture:g}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`)}let x;a?.e&&(d=CT("growthbook",{clientKey:a.e,apiHost:s,attributes:u,onExperimentViewed:b?.trackExperiment?(E,M,N)=>{b.trackExperiment(E,M,N)}:void 0})),t.enableSessionMetrics&&(x=cv({experiments:d,onMetricChange:(E,M)=>{G("Syntro Bootstrap",`Session metric changed: ${E} = ${M}`)}}),G("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":n?f="audit":ir("NODE_ENV")==="development"&&(f="development");let h=Rb({telemetry:b,sessionMetrics:x,mode:f,events:p});G("Syntro Bootstrap","Runtime created:",{version:h.version,mode:h.mode,hasContext:!!h.context,hasEvents:!!h.events,hasState:!!h.state}),G("Syntro Bootstrap","Core app executors already registered");let y=t.cdnBase||ir("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ir("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",m=pm({cdnBase:y,registry:h.apps,onLoadStart:E=>{G("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,M,N)=>{M?G("Syntro Bootstrap",`App loaded successfully: ${E}`):fn("Syntro Bootstrap",`Failed to load app: ${E}`,N)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:h.apps,runtime:h,version:h.version},G("Syntro Bootstrap","Global SynOS object exposed"));let S=h.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${S.length} apps in registry:`,S.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of S)if(E.state==="registered")try{await h.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${h.widgets.list().join(", ")}]`)}catch(M){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,M),fn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,M)}if(console.log(`[DIAG] Activation complete. Total widgets: [${h.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),G("Syntro Bootstrap","GrowthBook features loaded")}catch(E){fn("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let w;if(t.fetcher)w=t.fetcher;else if(a?.f){let E=RT(a.f,a.o??{});w=async()=>{let M=await E.fetch();return{...M.config,tiles:M.config.tiles??[]}}}else d&&(w=is({experiments:d}));let C=new Set,k=w?async()=>{let E=await w();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((I,H)=>`[${H}] ${I.kind}${I.anchorId?` anchor="${I.anchorId}"`:""}${I.label?` "${I.label}"`:""}`).join(", "));let M=E,N=m.getRequiredApps(M);return N.length>0?console.log("[Syntro Bootstrap] Required external apps:",N.join(", ")):G("Syntro Bootstrap","No external apps required (all executors are built-in)"),N.length>0&&await m.loadAppsForConfig(M).then(async H=>{let q=H.filter(D=>D.success),V=H.filter(D=>!D.success);q.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${q.map(D=>D.appId).join(", ")}`);let ie=V.filter(D=>!C.has(D.appId));ie.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",ie.map(D=>`${D.appId} (${D.error})`).join(", ")),ie.forEach(D=>C.add(D.appId)));for(let D of N)if(h.apps.has(D))try{await h.apps.activate(D),console.log(`[Syntro Bootstrap] App activated: ${D}`)}catch(Y){console.error(`[Syntro Bootstrap] Failed to activate app: ${D}`,Y)}else console.error(`[Syntro Bootstrap] App "${D}" required by config but NOT registered.`,`Available apps: [${Array.from(h.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await jm({...t.canvas,fetcher:k,integrations:{experiments:d,telemetry:b},editorUrl:c,runtime:h}),runtime:h,experiments:d,telemetry:b,sessionMetrics:x,appLoader:m}}var DT={init:K5,encodeToken:Db,decodeToken:ap};typeof window<"u"&&(window.Syntro=DT);var LT="2026-03-02T04:34:50.784Z (e2b9f4ec1d)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${LT}`);let t=window.SynOS,e=t?.appRegistry||Zl;window.SynOS={...t,appRegistry:e,_runtimeBuild:LT,React:IT.default,ReactDOM:{...Q5,createPortal:sp.createPortal,flushSync:sp.flushSync}},Xw(e)}export{$c as ANIMATION_KEYFRAMES,Qf as ActivationConfigZ,qk as AddClassZ,Hn as AnchorIdZ,A5 as AnchorStateZ,u5 as AnchorVisibleConditionZ,Id as AppRegistry,k5 as AugmentationZ,Lk as BadgePositionZ,Kk as BadgeZ,C5 as BoundingBoxZ,Wl as CanvasEvents,pv as CanvasRecipeZ,ob as ConditionZ,Jf as ContextManager,m5 as CooldownActiveConditionZ,sb as CtaButtonZ,Am as DEFAULT_COOLDOWN,Cm as DEFAULT_TTL,Kf as DecisionStrategyZ,g5 as DismissedConditionZ,ss as EVENT_SCHEMA_VERSION,np as EventBus,y5 as EventCountConditionZ,N5 as EventFilterZ,d5 as EventOccurredConditionZ,mT as EventSourceZ,Xf as ExecutorRegistry,Mk as ExternalStrategyZ,B5 as FrequencyEntryZ,v5 as FrequencyLimitConditionZ,p3 as HighlightStepZ,Dk as HighlightStyleZ,Wk as HighlightZ,Yk as InsertHtmlZ,Bk as InsertPositionZ,Em as MAX_VISIBLE_TOASTS,zk as ModalContentZ,Jk as ModalZ,Ok as ModelStrategyZ,nT as MountWidgetZ,tT as NavigateZ,Hc as NavigationMonitor,M5 as NormalizedEventZ,wm as NotificationToastStack,x5 as PageContextZ,S5 as PageHistoryEntryZ,l5 as PageUrlConditionZ,oT as ParallelZ,Ik as PlacementZ,Xk as PulseZ,LT as RUNTIME_SDK_BUILD,wT as RUNTIME_VERSION,Zk as RemoveClassZ,c5 as RouteConditionZ,Nk as RouteFilterZ,Tk as RuleStrategyZ,kk as RuleZ,T5 as RuntimeContextZ,Mm as RuntimeProvider,zr as SDK_SCHEMA_VERSION,_m as SDK_VERSION,_T as STATIC_SLOT_STYLES,Rk as ScoreStrategyZ,Vk as ScrollBehaviorZ,ab as ScrollLogicalPositionZ,eT as ScrollToZ,xC as SelectorZ,rT as SequenceZ,w5 as SessionContextZ,h5 as SessionMetricConditionZ,cf as SessionMetricTracker,Pk as SetAttrZ,Gk as SetStyleZ,jk as SetTextZ,vE as ShadowCanvasOverlay,uE as ShadowRootProvider,_E as SmartCanvasApp,Sm as SmartCanvasController,Um as SmartCanvasElement,t$ as SmartCanvasPortal,xe as StandardEvents,f5 as StateEqualsConditionZ,ip as StateStore,z5 as StoredValueZ,DT as Syntro,Xl as TileCard,Pz as TileWheel,Hk as TooltipContentZ,f3 as TooltipStepZ,$k as TooltipTriggerZ,Qk as TooltipZ,Uk as TourStepForSchemaZ,aT as TourZ,p5 as ViewportConditionZ,E5 as ViewportContextZ,iT as WaitZ,Fk as WidgetConfigZ,op as WidgetRegistry,Zl as appRegistry,bb as applyStaticSlotStyles,dm as cleanupAppContext,Kg as contentRuntime,b5 as coreActionStepSchemas,rb as createActionEngine,um as createAppContext,pm as createAppLoader,is as createCanvasConfigFetcher,cb as createContextManager,ub as createDecisionEngine,db as createEventAccumulator,Ic as createEventBus,lv as createGrowthBookClient,gv as createNoopClient,JB as createOverlayRecipeFetcher,Qy as createPostHogClient,pb as createPostHogNormalizer,cv as createSessionMetricTracker,jm as createSmartCanvas,lE as createSmartCanvasController,Rb as createSmartCanvasRuntime,yb as createStateStore,Eb as createSurfaceContainer,Ab as createSurfaces,H$ as decisionSchemas,ap as decodeToken,Db as encodeToken,dT as evaluate,lT as evaluateCondition,cT as evaluateRule,ep as evaluateRuleStrategy,tp as evaluateScoreStrategy,fT as evaluateSync,nr as executorRegistry,dN as getAntiFlickerSnippet,Iw as getAppIdFromActionKind,fm as getAppIdFromWidgetId,qL as getExecutor,rp as getSlotAnchorId,Bc as getSlotType,Cb as getSlotZIndex,nb as hasExecutor,Vd as interpolateTemplate,Lw as isCoreActionKind,km as matchEvent,Yz as needsMigration,hT as normalizePostHogEvent,cm as overlaysRuntime,Kl as parseVersion,Sb as playEnterAnimation,wb as playExitAnimation,Fd as registerConfigPredicates,EE as registerSmartCanvasElement,xm as resolveConfigUri,_b as setupAdjacentPositioning,xb as setupInlinePositioning,gT as shouldNormalizeEvent,qN as useDecision,Tm as useNotifications,Rm as useNotifyWatcher,Nm as usePageContext,Fi as useRuntime,Pd as useRuntimeContext,jN as useRuntimeEvents,PN as useRuntimeState,UN as useSessionContext,yE as useShadowCanvasConfig,as as useShadowRoot,VN as useViewportContext,ao as validateAction,ib as validateActions,I$ as validateActivationConfig,D$ as validateCondition,Gz as validateConfig,_8 as validateEventFilter,wF as validateFrequencyEntry,b8 as validateNormalizedEvent,WB as validateRecipe,W$ as validateRuntimeContext,SF as validateStoredValue,L$ as validateStrategy,kb as widgetRegistry};
443
+ `)).length,r=0;r<i;r++){var a=t.charCodeAt(r),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),tr(s)||(n>e&&(o+=t.substring(e,n)),o+=s,e=n=r+1)}return n>e&&(o+=t.substring(e,t.length)),o},QL=!!$v||!!Fv,AA="text/plain",Xf=function(t,e,n){var i;n===void 0&&(n=!0);var[r,o]=t.split("?"),a=P({},e),s=(i=o?.split("&").map((c=>{var u,[d,h]=c.split("="),g=n&&(u=a[d])!==null&&u!==void 0?u:h;return delete a[d],d+"="+g})))!==null&&i!==void 0?i:[],l=gL(a);return l&&s.push(l),r+"?"+s.join("&")},wc=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),Lv=t=>{var{data:e,compression:n}=t;if(e){if(n===er.GZipJS){var i=XL((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new In(l.length+(l.length>>>1)),h=0,g=function(f){d[h++]=f},S=0;S<u;++S){if(h+5>d.length){var _=new In(h+8+(u-S<<1));_.set(d),d=_}var b=l.charCodeAt(S);b<128||c?g(b):b<2048?(g(192|b>>>6),g(128|63&b)):b>55295&&b<57344?(g(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),g(128|b>>>12&63),g(128|b>>>6&63),g(128|63&b)):(g(224|b>>>12),g(128|b>>>6&63),g(128|63&b))}return FT(d,0,h)})(wc(e)),{mtime:0}),r=new Blob([i],{type:AA});return{contentType:AA,body:r,estimatedSize:r.size}}if(n===er.Base64){var o=(function(l){var c,u,d,h,g,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,f="",p=[];if(!l)return l;l=KL(l);do c=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=g>>12&63,d=g>>6&63,h=63&g,p[b++]=S.charAt(c)+S.charAt(u)+S.charAt(d)+S.charAt(h);while(_<l.length);switch(f=p.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(wc(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:wc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=wc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Df=[];Fv&&Df.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:o}=(e=Lv(t))!==null&&e!==void 0?e:{},a=new Headers;Oe(t.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var s=t.url,l=null;if(ZC){var c=new ZC;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Fv(s,P({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((d=>{var h={statusCode:u.status,text:d};if(u.status===200)try{h.json=JSON.parse(d)}catch(g){U.error(g)}t.callback==null||t.callback(h)})))).catch((u=>{U.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),$v&&Df.push({transport:"XHR",method:t=>{var e,n=new $v;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=Lv(t))!==null&&e!==void 0?e:{};Oe(t.headers,(function(o,a){n.setRequestHeader(a,o)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(r)}}),hn!=null&&hn.sendBeacon&&Df.push({transport:"sendBeacon",method:t=>{var e=Xf(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=Lv(t))!==null&&n!==void 0?n:{},o=typeof r=="string"?new Blob([r],{type:i}):r;hn.sendBeacon(e,o)}catch{}}});var Kf=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function TA(t,e,n){return wc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var $T={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Kf(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Kf(n,i))))),icontains:(t,e)=>e.map(Mf).some((n=>t.map(Mf).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(Mf).every((n=>t.map(Mf).every((i=>!n.includes(i)))))},Mf=t=>t.toLowerCase();function UT(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,o=e?.[i];if(B(o)||tr(o))return!1;var a=[String(o)],s=$T[r.operator];return!!s&&s(r.values,a)}))}var Iv=ct("[Error tracking]"),Oy=class{constructor(e){var n,i;this.Jt=[],this.Kt=new qv([new Gv,new ey,new Wv,new Yv,new Qv,new Kv,new Xv,new Jv],K3("web:javascript",G3,X3)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(ny))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,o=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[ny]:this.Jt,[iA]:a})}get Yt(){var e,n=!!this._instance.get_property(iA),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Iv.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Iv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void Iv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((i,r)=>{var{type:o,value:a}=r;return lt(o)&&o.length>0&&i.$exception_types.push(o),lt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((o=>{var a,s=$T[o.operator],l=ke(o.value)?o.value:[o.value],c=(a=n[o.key])!==null&&a!==void 0?a:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,o,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=a[a.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ce(e)&&ke(e)}},Wn=ct("[FeatureFlags]"),hc=ct("[FeatureFlags]",{debugEnabled:!0}),Hv="$active_feature_flags",Cs="$override_feature_flags",kA="$feature_flag_payloads",gc="$override_feature_flag_payloads",RA="$feature_flag_request_id",OA="$feature_flag_evaluated_at",MA=t=>{var e={};for(var[n,i]of Nf(t||{}))i&&(e[n]=i);return e},JL=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Wn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},e5=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),My=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Wn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(iy),n=this._instance.get_property(Cs),i=this._instance.get_property(gc);if(!i&&!n)return e||{};var r=Xe({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of o){var s,l,c=r[a],u=n?.[a],d=B(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,h=B(u)?c.variant:typeof u=="string"?u:void 0,g=i?.[a],S=P({},c,{enabled:d,variant:d?h??c?.variant:void 0});d!==c?.enabled&&(S.original_enabled=c?.enabled),h!==c?.variant&&(S.original_variant=c?.variant),g&&(S.metadata=P({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=S}return this.ii||(Wn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Rs),n=this._instance.get_property(Cs);if(!n)return e||{};for(var i=Xe({},e),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(kA),n=this._instance.get_property(gc);if(!n)return e||{};for(var i=Xe({},e||{}),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:P({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Sc)||{}),group_properties:this._instance.get_property(ia)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+a);r&&(i.timezone=IT()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(e5.FeatureFlags))Wn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,o=this._instance.get_property(RA)||void 0,a=this._instance.get_property(OA)||void 0,s=this._instance.get_property(Bf)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,d,h,g,S,_,b;ke(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[Bf]:s});var f=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};B(f==null||(d=f.metadata)==null?void 0:d.version)||(p.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(g=f.reason)==null?void 0:g.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(p.$feature_flag_reason=y),f!=null&&(_=f.metadata)!=null&&_.id&&(p.$feature_flag_id=f.metadata.id),B(f?.original_variant)&&B(f?.original_enabled)||(p.$feature_flag_original_response=B(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(b=f.metadata)!=null&&b.original_payload&&(p.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",p)}return i}Wn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,s=(a=o.json)==null?void 0:a.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return B(i)?void 0:!!i}Wn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=JL(a),h=d.flags,g=d.featureFlags,S=d.featureFlagPayloads;if(g){var _=a.requestId,b=a.evaluatedAt;if(ke(g)){Wn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(g)for(var p=0;p<g.length;p++)f[g[p]]=!0;s&&s.register({[Hv]:g,[Rs]:f})}else{var v=g,y=S,w=h;a.errorsWhileComputingFlags&&(v=P({},l,v),y=P({},c,y),w=P({},u,w)),s&&s.register(P({[Hv]:Object.keys(MA(v)),[Rs]:v||{},[kA]:y||{},[iy]:w||{}},_?{[RA]:_}:{},b?{[OA]:b}:{}))}}})(e,this._instance.persistence,i,r,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Wn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Wn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Cs),this._instance.persistence.unregister(gc),this.pi(),hc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Cs),hc.info("Flag overrides cleared");else if(i.flags){if(ke(i.flags)){for(var r={},o=0;o<i.flags.length;o++)r[i.flags[o]]=!0;this._instance.persistence.register({[Cs]:r})}else this._instance.persistence.register({[Cs]:i.flags});hc.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(gc),hc.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[gc]:i.payloads}),hc.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,o=(this._instance.get_property(_c)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:a};o&&(s.$early_access_feature_name=o.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var l=P({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Hv]:Object.keys(MA(l)),[Rs]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(_c),o=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s,l;if(a.json){var c=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(_c),(l=this._instance.persistence)==null||l.register({[_c]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Sc)||{};this._instance.register({[Sc]:P({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Sc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(ia)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=P({},i[r],e[r]),delete e[r]})),this._instance.register({[ia]:P({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(ia)||{};this._instance.register({[ia]:P({},n,{[e]:{}})})}else this._instance.unregister(ia)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},t5=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ac=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var 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.Y=this.bi(e),this.load(),e.debug&&U.info("Persistence loaded",e.persistence,P({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){t5.indexOf(e.persistence.toLowerCase())===-1&&(U.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&qe.H()?qe:n==="localstorage+cookie"&&Tf.H()?Tf:n==="sessionstorage"&&Et.H()?Et:n==="memory"?wL:n==="cookie"?pi:Tf.H()?Tf:pi}properties(){var e={};return Oe(this.props,(function(n,i){if(i===Rs&&pt(n))for(var r=Object.keys(n),o=0;o<r.length;o++)e["$feature/"+r[o]]=n[r[o]];else s=i,l=!1,(tr(a=oL)?l:qC&&a.indexOf===qC?a.indexOf(s)!=-1:(Oe(a,(function(c){if(l||(l=c===s))return Hf})),l))||(e[i]=n);var a,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Xe({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(pt(e)){B(n)&&(n="None"),this.xi=B(i)?this.$i:i;var r=!1;if(Oe(e,((o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(pt(e)){this.xi=B(n)?this.$i:n;var i=!1;if(Oe(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=RT(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);ks(Wy(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=$?.referrer)?MT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:NT(),$referring_domain:$!=null&&$.referrer&&((e=jf($.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[sy]||this.props[ly]||this.register_once({[Ff]:DT(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Oe([ly,sy],(a=>{var s=this.props[a];s&&Oe(s,(function(l,c){e["$initial_"+Uv(c)]=l}))}));var n,i,r=this.props[Ff];if(r){var o=(n=LT(r),i={},Oe(n,(function(a,s){i["$initial_"+Uv(s)]=a})),i);Xe(e,o)}return e}safe_merge(e){return Oe(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var i=this.props[bc]||{};i[e]=n,this.props[bc]=i,this.save()}remove_event_timer(e){var n=(this.props[bc]||{})[e];return B(n)||(delete this.props[bc][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},mc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),vF=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),yF=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),bF=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),zv=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),_F=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),SF=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),xF=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Lf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),NA=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),VT=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Dc=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function As(t,e,n){if(Ce(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Ny=class{constructor(e){this.Pi=new Dc,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!B((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!B((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var s,l;(s=this.Oi)==null||s.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,o=new Set;e.forEach((a=>{var s;(s=a.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!As(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>As(s.href,n.href,n.href_matching||"exact")));var o,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&As((o=a.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>As(c.text,n.text,n.text_matching||"exact")||As(c.$el_text,n.text,n.text_matching||"exact")));var o,a,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,d=[],h=/(?::|")text="(.*?)"/g;!Ce(u=h.exec(c));)d.includes(u[1])||d.push(u[1]);return d})(l),a=n.text,s=n.text_matching||"exact",o.some((c=>As(c,a,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var o=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||UT(n.properties.reduce(((i,r)=>{var o=ke(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:o,operator:r.operator||"exact"},i}),{}),e?.properties)}},xe=ct("[Surveys]"),Dy="seenSurvey_",n5=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},DA=t=>{var e=""+Dy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Dy+t.id+"_"+t.current_iteration),e},i5=[zv.Popover,zv.Widget,zv.API],r5={ignoreConditions:!1,ignoreDelay:!1,displayType:VT.Popover},Ly=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&UT(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((a=>{if(a!=null&&a.name){var s=i.get(a.name)||[];s.push(r.id),i.set(a.name,s)}}))})),i}Vi(e,n,i){var r,o=(i===mc.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((s=>{a=s.filter((l=>o?.includes(l.id)))})),a.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;B((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,o;return((r=i.conditions)==null?void 0:r.actions)&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Ny(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,o,a,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(o=i.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((o,a)=>{this.onEvent(o,a)})),this.Hi=this.Gi(e,mc.Activation),this.Bi=this.Gi(e,mc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Af])||[];if(Lf.SHOWN===e&&n&&r.length>0){var o;xe.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,mc.Cancellation);l.length>0&&(xe.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var d,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){xe.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,mc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Af])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;xe.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Af]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Af];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Iy=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ce(n))return xe.warn("Flags not loaded yet. Not loading surveys.");var i=ke(n);this.Zi=i?n.length>0:n,xe.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(Dy)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)xe.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)xe.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())xe.info("Not loading surveys in cookieless mode without consent.");else{var e=ee?.__PosthogExtensions__;if(e){if(!B(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else xe.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new Ly(this._instance),xe.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){xe.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return xe.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(ry);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return xe.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(d)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(d))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[ry]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){xe.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ce(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);xe.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ce(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ce(this._surveyManager))return xe.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ce(this._surveyManager)?(xe.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var o,a=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(a){var s=this.ae(a);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(i5.includes(r.type)){var o=$?.querySelector(n);if(o)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(xe.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,s;xe.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),xe.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);xe.warn("Survey element not found")}else xe.warn("Surveys of type "+r.type+" cannot be rendered in the app");else xe.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=P({},r,{appearance:P({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void xe.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==VT.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else xe.warn("Survey not found")}}cancelPendingSurvey(e){Ce(this._surveyManager)?xe.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},LA=ct("[RateLimiter]"),Hy=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((a=>{LA.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void LA.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(ay))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(ay,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},na=ct("[RemoteConfig]"),zy=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(na.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return na.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void na.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return na.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){na.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):na.info("__preview_remote_config is disabled. Logging config instead",e):na.error("Failed to fetch remote config from PostHog.")}},By=3e3,Fy=class{constructor(e,n){this.he=!0,this.ve=[],this.de=di(n?.flush_interval_ms||By,250,5e3,U.createLogger("flush interval"),By),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(P({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var o=n[r],a=new Date().getTime();o.data&&ke(o.data)&&Oe(o.data,(s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp})),e.ce(o)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Oe(this.ve,(n=>{var i,r=n,o=(r?r.batchKey:null)||r.url;B(e[o])&&(e[o]=P({},r,{data:[]})),(i=e[o].data)==null||i.push(r.data)})),this.ve=[],e}},o5=["retriesPerformedSoFar"],$y=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!B(R)&&"onLine"in R.navigator&&(this.be=R.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},it(R,"online",this.we),it(R,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=$A(e,o5);hi(n)&&n>0&&(i.url=Xf(i.url,{retry_count:n})),this._instance.ci(P({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(P({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),U.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],i=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,B(R)||(this.we&&(R.removeEventListener("online",this.we),this.we=void 0),this.xe&&(R.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(P({},e,{transport:"sendBeacon"}))}catch(n){U.error(n)}this.ve=[]}},Uy=class{constructor(e){this.ke=()=>{var n,i,r,o;this.Pe||(this.Pe={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){it(R,"scroll",this.ke,{capture:!0}),it(R,"scrollend",this.ke,{capture:!0}),it(R,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return R?.document.documentElement;var e=ke(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=R?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return R&&(R.scrollY||R.pageYOffset||R.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return R&&(R.scrollX||R.pageXOffset||R.document.documentElement.scrollLeft)||0}},a5=t=>DT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Qf=class{constructor(e,n,i,r){this.Te=o=>{var a=this.Re();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[oy]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||a5,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[oy]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?LT(n):{$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(){var e={};return Oe(Wy(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Uv(i)]=n})),e}},Bv=ct("[SessionId]"),Jf=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Dc,this.De=(u,d)=>Math.abs(u-d)>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.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||eo,this.Ue=i||eo;var o=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*di(a,60,36e3,Bv.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Et.W(this.He),l=Et.W(this.Be);s&&!l?this.je=s:Et.V(this.He),Et.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Bv.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return B(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Et.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Et.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Et.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[zf]:[n,e,i]}))}Ke(){var e=this.Fe.props[zf];return ke(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&R&&(R.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Et.V(this.Be)},it(R,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,o,a]=this.Ke(),s=this.Je(),l=hi(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!o,d=!u&&!e&&this.De(i,r);u||d||l?(o=this.Ne(),s=this.Ue(),Bv.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):s||(s=this.Ue(),c=!0);var h=r===0||!e||l?i:r,g=a===0?new Date().getTime():a;return this.Ve(s),this.We(o,h,g),e||this.ze(),c&&this.Oe.forEach((S=>S(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},s5=["$set_once","$set"],Qr=ct("[SiteApps]"),Vy=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(d))c[h]={id:u[h],type:h,properties:g};var{$set_once:S,$set:_}=e;return{event:P({},$A(e,s5),{properties:P({},e.properties,_?{$set:P({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},S?{$set_once:P({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},S)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(Qr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{n.errored=!s,n.loaded=!0,Qr.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(n.processEvent=a),r=!0}catch(s){Qr.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&n.loaded)try{i()}catch(s){Qr.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){Qr.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;ee["__$$ph_site_app_"+c]=o._instance,(u=ee.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(d=>{if(d)return Qr.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:s,url:l}of e.siteApps)a(s)}else Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},jT=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&WC(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>WC(r?.brand,e))))return!0}catch{}return!!t.webdriver},Ec=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),IA="i.posthog.com",jy=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+IA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ec.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ec.EU:this.er[this.apiHost]=Ec.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Ec.CUSTOM)return this.apiHost+n;var i=IA+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},l5={icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!R&&Kf(e.href,t),not_regex:(t,e)=>!!R&&!Kf(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Py=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n.sr)==null||a.set(o.feature_flag_key,o));var s=n._instance.getFeatureFlag(o.feature_flag_key);lt(s)&&o.variants[s]&&n.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ce(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,o=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);o&&a!=null&&a.variants[o]&&this.nr(a.name,o,a.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Pf(e?.search,"__experiment_id"),i=Pf(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ce(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.url))return!0;var i,r,o,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||l5[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return R?.location}static hr(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.utm))return!0;var i=RT();if(i.utm_source){var r,o,a,s,l,c,u,d,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==i.utm_campaign,g=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return h&&S&&_&&g}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];U.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return hn&&this._instance?jT(hn,this._instance.config.custom_blocked_useragents):void 0}},c5=ct("[PostHog ExternalIntegrations]"),u5={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},qy=class{constructor(e){this._instance=e}it(e,n){var i;(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return c5.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var s,l,c;!r||(s=ee.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.it(u5[a],(()=>{var u;(u=ee.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=ee.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=ee.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(i)}}},Zy="[SessionRecording]",vc=ct(Zy),ep=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw vc.error("started without valid sessionManager"),new Error(Zy+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Zy+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(Av))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return R&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!B(Object.assign)&&!B(Array.from);this.cr&&i?(this.gr(e),vc.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(ee!=null&&(n=ee.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=ee.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return vc.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(XA)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,o=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,s=a?.sampleRate,l=Ce(s)?null:parseFloat(s);Ce(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[Av]:P({enabled:!!a},a,{networkPayloadCapture:P({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:B(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:vc.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):vc.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Av);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=ee.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=ee.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},Tc={},Gy=()=>{},Ts="posthog",PT=!QL&&Xt?.indexOf("MSIE")===-1&&Xt?.indexOf("Mozilla")===-1,HA=t=>{var e;return P({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:rL($?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Gy,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,debug:Kt&&lt(Kt?.search)&&Kt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(R==null||(e=R.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;U.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:By},error_tracking:{},_onCapture:Gy,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},zA=t=>{var e={};B(t.process_person)||(e.person_profiles=t.process_person),B(t.xhr_headers)||(e.request_headers=t.xhr_headers),B(t.cookie_name)||(e.persistence_name=t.cookie_name),B(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),B(t.store_google)||(e.save_campaign_params=t.store_google),B(t.verbose)||(e.debug=t.verbose);var n=Xe({},e,t);return ke(t.property_blacklist)&&(B(t.property_denylist)?n.property_denylist=t.property_blacklist:ke(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:U.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Yy=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},tp=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Yy,this.Sr=!1,this.version=Ki.LIB_VERSION,this.Er=new Dc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=HA(),this.SentryIntegration=vy,this.sentryIntegration=e=>(function(n,i){var r=fT(n,i);return{name:dT,processEvent:o=>r(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new My(this),this.toolbar=new yy(this),this.scrollManager=new Uy(this),this.pageViewManager=new Cy(this),this.surveys=new Iy(this),this.experiments=new Py(this),this.exceptions=new Oy(this),this.rateLimiter=new Hy(this),this.requestRouter=new jy(this),this.consent=new hy(this),this.externalIntegrations=new qy(this),this.people={set:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>U.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ts){var r,o=(r=Tc[i])!==null&&r!==void 0?r:new t;return o._init(e,n,i),Tc[i]=o,Tc[Ts][i]=o,o}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),B(e)||Vv(e))return U.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Xe({},HA(n.defaults),zA(n),{name:i,token:e})),this.config.on_xhr_error&&U.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:er.GZipJS;var o=this.Cr();this.persistence=new Ac(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ac(P({},this.config,{persistence:"sessionStorage"}),o);var a=P({},this.persistence.props),s=P({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Fy((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new $y(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Jf(this),this.sessionPropsManager=new Qf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(U.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(U.info("Initializing extensions synchronously"),this.Dr(l)),Ki.DEBUG=Ki.DEBUG||this.config.debug,Ki.DEBUG&&U.info("Starting in debug mode",{this:this,config:n,thisC:P({},this.config),p:a,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,d=this.config.get_device_id(eo()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(Qi,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,S,_=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var v;return!((v=n.bootstrap)==null||(v=v.featureFlags)==null||!v[p])})).reduce(((p,v)=>{var y;return p[v]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,p}),{}),b=Object.keys(((S=n.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,v)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(p[v]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[v]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:cc,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(eo());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Qi,"anonymous")}return it(R,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?AL(this,(()=>this.Lr())):this.Lr(),to(this.config._onCapture)&&this.config._onCapture!==Gy&&(U.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&U.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}Dr(e){var n=performance.now();this.historyAutocapture=new my(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new by(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Vy(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new ep(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new uy(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Ey(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new wy(this)})),i.push((()=>{this.exceptionObserver=new gy(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Zf(this,CL),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(o){U.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&U.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,o,a,s,l,c;if(!$||!$.body)return U.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=de(e.supportedCompression,er.GZipJS)?er.GZipJS:de(e.supportedCompression,er.Base64)?er.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){U.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new zy(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&io(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(PT?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Xf(e.url,{ip:this.config.ip?1:0}),e.headers=P({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,o,a=P({},n);a.timeout=a.timeout||6e4,a.url=Xf(a.url,{_:new Date().getTime().toString(),ver:Ki.LIB_VERSION,compression:a.compression});var s=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Df.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(o=GA(l,(u=>u.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(P({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],o=[];io(e,(s=>{s&&(n=s[0],ke(n)?o.push(s):to(s)?s.call(this):ke(s)&&n==="alias"?i.push(s):ke(s)&&n.indexOf("capture")!==-1&&to(this[n])?o.push(s):r.push(s))}));var a=function(s,l){io(s,(function(c){if(ke(c[0])){var u=l;Oe(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!B(e)&&lt(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!lt(n?.$current_url)&&(U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=eo(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var d,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=nL(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,B(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===Lf.DISMISSED||e===Lf.SENT){var g=n?.[NA.SURVEY_ID],S=n?.[NA.SURVEY_ITERATION];d={id:g,current_iteration:S},localStorage.getItem(DA(d))||localStorage.setItem(DA(d),"true"),u.$set=P({},u.$set,{[n5({id:g,current_iteration:S},e===Lf.SENT?"responded":"dismissed")]:!0})}var _=P({},u.properties.$set,u.$set);if(ks(_)||this.setPersonPropertiesForFlags(_),!Ce(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var f={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(f):this.Mr.enqueue(f),u}U.critical("This capture call is ignored due to client rate limiting.")}}else U.error("No event name provided to posthog.capture")}else U.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=o?void 0:this.persistence.remove_event_timer(e),s=P({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=P({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!lt(s.distinct_id)&&!hi(s.distinct_id)||Vv(s.distinct_id))&&U.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=VL(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Xe(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Xe(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Ec.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Xe(s,c),e==="$pageview"&&$&&(s.title=$.title),!B(a)){var S=i.getTime()-a;s.$duration=parseFloat((S/1e3).toFixed(3))}Xt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Xe({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),ke(this.config.property_denylist)?Oe(this.config.property_denylist,(function(f){delete s[f]})):U.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(U.error("sanitize_properties is deprecated. Use before_send instead"),s=_(s,e));var b=this.Gr();return s.$process_person_profile=b,b&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Xe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(U.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.Sr=!0,ks(o)?void 0:o}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=r5),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return U.uninitializedWarning("posthog.identify");if(hi(e)&&(e=e.toString(),U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))U.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==cc){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(yc)&&(this.unregister(yc),this.register({distinct_id:e}));var a=(this.persistence.get_property(Qi)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(Qi,"identified"),this.setPersonPropertiesForFlags(P({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=TA(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Bf))}}else U.critical('The string "'+cc+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else U.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=TA(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(P({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):U.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:P({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else U.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,o;if(U.info("reset"),!this.__loaded)return U.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(Qi,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:cc,$device_id:null},"");else{var s=this.config.get_device_id(eo());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(YA)?(U.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(B(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(yc,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(U.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=P({},this.config);if(pt(e)){var i,r,o,a,s;Xe(this.config,zA(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ac(P({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);no(c)&&(this.config.debug=c),no(this.config.debug)&&(this.config.debug?(Ki.DEBUG=!0,qe.H()&&qe.G("ph_debug","true"),U.info("set_config",{config:e,oldConfig:n,newConfig:P({},this.config)})):(Ki.DEBUG=!1,qe.H()&&qe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(P({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ts;return n!==Ts&&(n=Ts+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Qi))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Qi))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[yc])&&((n=this.persistence)==null||(n=n.props)==null||!n[$f]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(U.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr($f,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new Jf(this),this.persistence&&(this.sessionPropsManager=new Qf(this,this.sessionManager,this.persistence)),this.sessionRecording=new ep(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(B(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else U.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:cc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):U.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Ji.GRANTED?"granted":e===Ji.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return hn?jT(hn,this.config.custom_blocked_useragents):void 0}Hr(){$&&($.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:$.title},{send_instantly:!0}),this.kr&&($.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),it($,"visibilitychange",this.kr)))}debug(e){e===!1?(R?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(R?.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}))}O(){var e,n,i,r,o,a,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(U.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):(i="advanced_disable_decide",r=!1,o=U,a=(n="advanced_disable_flags")in(e=l)&&!B(e[n]),s=i in e&&!B(e[i]),a?e[n]:s?(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ce(this.config.before_send))return e;var n=ke(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ce(i)){var o="Event '"+e.event+"' was rejected in beforeSend function";return F3(e.event)?U.warn(o+". This can cause unexpected behavior."):U.info(o),null}i.properties&&!ks(i.properties)||U.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=no(e)&&!e,i=qe.H()&&qe.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=tL(t.prototype[e[n]])})(tp,["identify"]);var BA,qT=(BA=Tc[Ts]=new tp,(function(){function t(){t.done||(t.done=!0,PT=!1,Oe(Tc,(function(e){e._dom_loaded()})))}$!=null&&$.addEventListener?$.readyState==="complete"?t():it($,"DOMContentLoaded",t,{capture:!1}):R&&U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),BA);var ob=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");j(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=qT.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let a=this.getAllFeatureFlags();a&&this.featureFlagsCallback&&this.featureFlagsCallback(a)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let a=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof a=="string"&&this.captureCallback?.(a,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function ab(t={}){return new ob(t)}var sb=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},lb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let o=await Promise.allSettled(i);for(let a of o)a.status==="fulfilled"&&a.value!==r&&n.push(a.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},cb=async(t,e)=>{let n,i,r=!1,o={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(a=>{n=e.subscribeEvent(t.event,()=>{r||a()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||a()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(a=>{i=setTimeout(()=>{r||a()},t.durationMs)}),o};var op=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of rm)this.registerCore(e,n);for(let{kind:e,executor:n}of mm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",sb),this.registerCore("core:parallel",lb),this.registerCore("core:wait",cb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let a of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:a.message,field:a.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},nr=new op;function d5(t){return nr.get(t)}function ub(t){return nr.has(t)}var f5=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),ZT=5e4,GT=50;function ao(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!ub(i)&&i!=="core:mountWidget"){let r=nr.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":oo(t,e,n);break;case"overlays:badge":oo(t,e,n),p5(t,e,n);break;case"overlays:tooltip":oo(t,e,n),h5(t,e,n);break;case"overlays:modal":C5(t,e,n);break;case"content:insertHtml":oo(t,e,n),g5(t,e,n);break;case"content:setText":oo(t,e,n),m5(t,e,n);break;case"content:setAttr":oo(t,e,n),v5(t,e,n);break;case"content:addClass":case"content:removeClass":oo(t,e,n),y5(t,e,n);break;case"content:setStyle":oo(t,e,n),b5(t,e,n);break;case"core:mountWidget":_5(t,e,n);break;case"core:wait":S5(t,e,n);break;case"core:sequence":x5(t,e,n);break;case"core:parallel":w5(t,e,n);break;case"core:tour":A5(t,e,n);break;case"navigation:navigate":E5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function oo(t,e,n){let i=t.anchorId;if(!i||typeof i!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!i.selector||typeof i.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):i.selector.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),i.route===void 0||i.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let r=Array.isArray(i.route)?i.route:[i.route];for(let o of r)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function p5(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function h5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function g5(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>ZT&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${ZT}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function m5(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function v5(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(f5.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function y5(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function b5(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>GT&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${GT}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function _5(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function S5(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function x5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function w5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function E5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function C5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function A5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),i.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let a=ao(o.action);for(let s of a.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of a.warnings)n.push(s)}if(o.onAction)for(let[a,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function db(t){let e=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=ao(t[i]);if(!r.valid){let o=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(a=>`${a.code}: ${a.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${i}].${o.field}`:`[${i}]`});for(let o of r.warnings)n.push({...o,suggestion:o.suggestion?`Action ${i}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var T5=0;function fb(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,waitForAnchor:o,adaptiveId:a,executorRegistry:s=nr,subscribeNavigation:l,runtime:c}=t,u=new Map,d=new Map;function h(){return`action-${++T5}`}function g(x,k){n&&n.publish(x,k)}function S(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:h,publishEvent:g,adaptiveId:a,applyAction:p,subscribeEvent:n?(x,k)=>n.subscribe({names:[x]},C=>k(C.props)):void 0,subscribeNavigation:l}}async function _(x,k){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let C=i.mount(x.slot,{type:"widget",widgetId:x.widget.widgetId,config:x.widget.props},{priority:x.widget.priority});return k.publishEvent("action.applied",{id:k.generateId(),kind:"core:mountWidget",slot:x.slot,widgetId:x.widget.widgetId}),{cleanup:()=>{C.unmount()},updateFn:E=>{if("widget"in E&&E.widget){let M=E.widget;M.props&&C.update({type:"widget",widgetId:x.widget.widgetId,config:M.props})}}}}async function b(x,k){if(x.kind==="core:mountWidget")return _(x,k);let C=s.get(x.kind);if(!C){let E="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${x.kind}".`,`Registered: [${E}]`),new Error(`No executor for action kind: ${x.kind}`)}return C(x,k)}function f(x,k,C,E){if(!c)return;let M=[],I=async()=>{let N=u.get(x);if(!N)return;let Y=c.evaluateSync(C).value;if(N.state==="applied"&&!Y){try{await N.cleanup()}catch(z){console.error(`[ActionEngine] Error reverting conditional action ${x}:`,z)}N.state="deferred",N.cleanup=()=>{},N.updateFn=void 0,g("action.deferred",{id:x,kind:k.kind})}else if(N.state==="deferred"&&Y)try{let z=S(),te=await b(k,z);N.state="applied",N.cleanup=te.cleanup,N.updateFn=te.updateFn,N.appliedTs=Date.now(),g("action.applied",{id:x,kind:k.kind,anchorId:"anchorId"in k?k.anchorId:void 0})}catch(z){console.error(`[ActionEngine] Error applying deferred action ${x}:`,z),N.state="failed"}};c.context&&M.push(c.context.subscribe(I)),c.accumulator&&M.push(c.accumulator.subscribe(I)),d.set(x,M)}async function p(x){let k=ao(x);if(!k.valid){let Y=k.errors.map(z=>z.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${x?.kind}":`,Y,x),new Error(`Action validation failed: ${Y}`)}let C=h(),E=x.triggerWhen;if(E&&c&&!c.evaluateSync(E).value){let z={id:C,action:x,adaptiveId:a,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};u.set(C,z);let te={id:C,action:x,async revert(){let L=u.get(C);if(!L)return;let Z=d.get(C);if(Z){for(let J of Z)J();d.delete(C)}L.state="reverted",u.delete(C)},isApplied(){return u.get(C)?.state==="applied"},async update(L){let Z=u.get(C);if(!Z||Z.state!=="applied")throw new Error("Cannot update action that is not applied");if(Z.updateFn)await Z.updateFn(L);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(C)?.state??"reverted"}};return f(C,x,E,te),te}let M=S(),I=await b(x,M),N={id:C,action:x,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:I.cleanup,updateFn:I.updateFn};u.set(C,N),g("action.applied",{id:C,kind:x.kind,anchorId:"anchorId"in x?x.anchorId:void 0});let F={id:C,action:x,async revert(){let Y=u.get(C);if(!Y||Y.state!=="applied")return;let z=d.get(C);if(z){for(let te of z)te();d.delete(C)}try{await Y.cleanup(),Y.state="reverted",g("action.reverted",{id:C,kind:x.kind})}catch(te){throw Y.state="failed",g("action.failed",{id:C,kind:x.kind,error:String(te)}),te}finally{u.delete(C)}},isApplied(){return u.get(C)?.state==="applied"},async update(Y){let z=u.get(C);if(!z||z.state!=="applied")throw new Error("Cannot update action that is not applied");if(z.updateFn)await z.updateFn(Y);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(C)?.state??"reverted"}};return E&&c&&f(C,x,E,F),F}async function v(x){console.log(`[ActionEngine] applyBatch: ${x.length} action(s)`,x.map(N=>N.kind).join(", "));let k=db(x);if(!k.valid){let N=k.errors.map(F=>F.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${x.length} action(s):`,N,`
444
+ Actions:`,x.map((F,Y)=>` [${Y}] ${F.kind} ${F.anchorId?`anchor="${typeof F.anchorId=="string"?F.anchorId:F.anchorId.selector}"`:""} ${F.label?`label="${F.label}"`:""}`).join(`
445
+ `)),new Error(`Batch validation failed: ${N}`)}let C=h(),E=[],M=[];try{for(let N of x){let F=await p(N);E.push(F),M.push(F)}}catch(N){console.error(`[ActionEngine] Batch apply FAILED at action ${M.length+1}/${x.length}.`,`Successfully applied: ${M.length}. Rolling back...`,N);for(let F of M)try{await F.revert()}catch{}throw N}return{id:C,handles:E,async revertAll(){for(let N=E.length-1;N>=0;N--)try{await E[N].revert()}catch(F){console.error(`[ActionEngine] Error reverting action ${E[N].id}:`,F)}},isApplied(){return E.every(N=>N.isApplied())}}}function y(x){return ao(x)}function w(){return Array.from(u.values()).map(x=>({id:x.id,action:x.action,adaptiveId:x.adaptiveId,appliedTs:x.appliedTs,state:x.state}))}function T(){for(let x of d.values())for(let k of x)try{k()}catch{}d.clear();for(let x of u.values())if(x.state==="applied")try{x.cleanup()}catch(k){console.error("[ActionEngine] Error during cleanup:",k)}u.clear()}return{apply:p,applyBatch:v,validate:y,getActive:w,destroy:T}}var k5=m.object({selector:m.string(),route:m.union([m.string(),m.array(m.string())])}).strict(),pb=m.object({type:m.literal("page_url"),url:m.string()}),hb=m.object({type:m.literal("route"),routeId:m.string()}),gb=m.object({type:m.literal("anchor_visible"),anchorId:m.string(),state:m.enum(["visible","present","absent"])}),mb=m.object({type:m.literal("event_occurred"),eventName:m.string(),withinMs:m.number().optional()}),vb=m.object({type:m.literal("state_equals"),key:m.string(),value:m.unknown()}),yb=m.object({type:m.literal("viewport"),minWidth:m.number().optional(),maxWidth:m.number().optional(),minHeight:m.number().optional(),maxHeight:m.number().optional()}),bb=m.object({type:m.literal("session_metric"),key:m.string(),operator:m.enum(["gte","lte","eq","gt","lt"]),threshold:m.number()}),_b=m.object({type:m.literal("dismissed"),key:m.string(),inverted:m.boolean().optional()}),Sb=m.object({type:m.literal("cooldown_active"),key:m.string(),inverted:m.boolean().optional()}),xb=m.object({type:m.literal("frequency_limit"),key:m.string(),limit:m.number(),inverted:m.boolean().optional()}),zc=m.object({equals:m.union([m.string(),m.number(),m.boolean()]).optional(),contains:m.string().optional()}),Bc=m.object({events:m.array(m.string()).min(1),match:m.record(m.string(),zc).optional()}),wb=m.object({type:m.literal("event_count"),key:m.string(),operator:m.enum(["gte","lte","eq","gt","lt"]),count:m.number().int().min(0),withinMs:m.number().positive().optional(),counter:Bc.optional()}),zs=m.discriminatedUnion("type",[pb,hb,gb,mb,vb,yb,bb,_b,Sb,xb,wb]),Fc=m.object({conditions:m.array(zs),value:m.unknown()}),$c=m.object({type:m.literal("rules"),rules:m.array(Fc),default:m.unknown()}),Uc=m.object({type:m.literal("score"),field:m.string(),threshold:m.number(),above:m.unknown(),below:m.unknown()}),Vc=m.object({type:m.literal("model"),modelId:m.string(),inputs:m.array(m.string()),outputMapping:m.record(m.string(),m.unknown()),default:m.unknown()}),jc=m.object({type:m.literal("external"),endpoint:m.string(),method:m.enum(["GET","POST"]).optional(),default:m.unknown(),timeoutMs:m.number().optional()}),so=m.discriminatedUnion("type",[$c,Uc,Vc,jc]),R5=so.nullable().optional(),O5=m.object({events:m.array(m.string()),urlContains:m.string().optional(),props:m.record(m.union([m.string(),m.number(),m.boolean()])).optional()}),M5=m.object({title:m.string().optional(),body:m.string().optional(),icon:m.string().optional()}).nullable().optional();var YT=m.object({include:m.array(m.string()).optional(),exclude:m.array(m.string()).optional()}),ap=m.object({routes:YT,strategy:so.optional()});function XF(t){return zs.safeParse(t)}function KF(t){return so.safeParse(t)}function QF(t){return ap.safeParse(t)}var JF=[{defName:"matchOp",schema:zc},{defName:"counterDef",schema:Bc},{defName:"activationConfig",schema:ap},{defName:"routeFilter",schema:YT},{defName:"ruleStrategy",schema:$c},{defName:"scoreStrategy",schema:Uc},{defName:"modelStrategy",schema:Vc},{defName:"externalStrategy",schema:jc},{defName:"rule",schema:Fc},{defName:"condition",schema:zs}];var ht={activation:ap.optional(),triggerWhen:so.nullable().optional()},Hn=m.object({selector:m.string(),route:m.union([m.string(),m.array(m.string())])}).strict(),WT=m.object({color:m.string().optional(),scrimOpacity:m.number().min(0).max(1).optional(),paddingPx:m.number().optional(),radiusPx:m.number().optional()}).strict(),XT=m.enum(["top-left","top-right","bottom-left","bottom-right"]),KT=m.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Cb=m.object({label:m.string(),actionId:m.string(),primary:m.boolean().optional()}).strict(),QT=m.object({title:m.string().optional(),body:m.string(),ctaButtons:m.array(Cb).optional()}).strict(),JT=m.object({title:m.string().optional(),body:m.string()}).strict(),ek=m.enum(["before","after","prepend","append","replace"]),tk=m.enum(["immediate","hover","click"]),nk=m.object({widgetId:m.string(),props:m.record(m.unknown()).optional(),priority:m.number().optional()}).strict(),ik=m.object({id:m.string(),action:m.any(),route:m.string().optional(),onAction:m.record(m.string()).optional()}).passthrough(),rk=m.enum(["auto","smooth","instant"]),Eb=m.enum(["start","center","end","nearest"]),ok=m.object({kind:m.literal("content:setText"),anchorId:Hn,text:m.string(),label:m.string().optional()}).extend(ht).strict(),ak=m.object({kind:m.literal("content:setAttr"),anchorId:Hn,attr:m.string(),value:m.string(),label:m.string().optional()}).extend(ht).strict(),sk=m.object({kind:m.literal("content:addClass"),anchorId:Hn,className:m.string(),label:m.string().optional()}).extend(ht).strict(),lk=m.object({kind:m.literal("content:removeClass"),anchorId:Hn,className:m.string(),label:m.string().optional()}).extend(ht).strict(),ck=m.object({kind:m.literal("content:setStyle"),anchorId:Hn,styles:m.record(m.string()),label:m.string().optional()}).extend(ht).strict(),uk=m.object({kind:m.literal("content:insertHtml"),anchorId:Hn,html:m.string(),position:ek,label:m.string().optional()}).extend(ht).strict(),dk=m.object({kind:m.literal("overlays:highlight"),anchorId:Hn,style:WT.optional(),duration:m.number().optional(),label:m.string().optional()}).extend(ht).strict(),fk=m.object({kind:m.literal("overlays:pulse"),anchorId:Hn,duration:m.number().optional(),label:m.string().optional()}).extend(ht).strict(),pk=m.object({kind:m.literal("overlays:badge"),anchorId:Hn,content:m.string(),position:XT.optional(),label:m.string().optional()}).extend(ht).strict(),hk=m.object({kind:m.literal("overlays:tooltip"),anchorId:Hn,content:QT,trigger:tk.optional(),placement:KT.optional(),waitFor:m.string().optional(),label:m.string().optional()}).extend(ht).strict(),gk=m.object({kind:m.literal("overlays:modal"),content:JT,size:m.enum(["sm","md","lg"]).optional(),blocking:m.boolean().optional(),scrim:m.object({opacity:m.number().min(0).max(1).optional()}).strict().optional(),dismiss:m.object({onEsc:m.boolean().optional(),closeButton:m.boolean().optional(),timeoutMs:m.number().min(0).optional()}).strict().optional(),ctaButtons:m.array(Cb).optional(),waitFor:m.string().optional(),label:m.string().optional()}).extend(ht).strict(),mk=m.object({kind:m.literal("navigation:scrollTo"),anchorId:Hn,behavior:rk.optional(),block:Eb.optional(),inline:Eb.optional(),label:m.string().optional()}).extend(ht).strict(),vk=m.object({kind:m.literal("navigation:navigate"),url:m.string(),target:m.enum(["_self","_blank"]).optional(),label:m.string().optional()}).extend(ht).strict(),yk=m.object({kind:m.literal("core:mountWidget"),slot:m.string(),widget:nk,label:m.string().optional()}).extend(ht).strict(),bk=m.object({kind:m.literal("core:wait"),durationMs:m.number().min(0).optional(),event:m.string().optional(),label:m.string().optional()}).extend(ht).strict(),_k=m.object({kind:m.literal("core:sequence"),actions:m.array(m.any()),label:m.string().optional()}).extend(ht).strict(),Sk=m.object({kind:m.literal("core:parallel"),actions:m.array(m.any()),waitFor:m.enum(["all","any"]).optional(),label:m.string().optional()}).extend(ht).strict(),xk=m.object({kind:m.literal("core:tour"),tourId:m.string(),steps:m.array(ik).min(1),startStep:m.string().optional(),autoStart:m.boolean().optional(),label:m.string().optional()}).extend(ht).passthrough(),N5=[{defName:"setText",schema:ok},{defName:"setAttr",schema:ak},{defName:"addClass",schema:sk},{defName:"removeClass",schema:lk},{defName:"setStyle",schema:ck},{defName:"insertHtml",schema:uk},{defName:"highlight",schema:dk},{defName:"pulse",schema:fk},{defName:"badge",schema:pk},{defName:"tooltip",schema:hk},{defName:"modal",schema:gk},{defName:"scrollTo",schema:mk},{defName:"navigate",schema:vk},{defName:"mountWidget",schema:yk},{defName:"wait",schema:bk},{defName:"sequence",schema:_k},{defName:"parallel",schema:Sk},{defName:"tour",schema:xk}];function Ab(t){let e=t?.root??(typeof document<"u"?document.body:null),n=t?.defaultTimeoutMs??5e3,i=new Map,r=new Map,o=null,a=!1;function s(b){if(!e)return null;try{return e.querySelector(b)}catch{return null}}function l(){for(let[b,f]of i){let p=s(b);if(p){for(let v of f)clearTimeout(v.timer),v.resolve(p);i.delete(b)}}for(let[b,f]of r){let p=s(b);if(p){for(let v of f)v.cancelled||v.cb(p);r.delete(b)}}i.size===0&&r.size===0&&u()}function c(){o||a||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function u(){o&&(o.disconnect(),o=null)}function d(b,f){let p=i.get(b);p&&(p.delete(f),p.size===0&&i.delete(b)),i.size===0&&r.size===0&&u()}function h(b,f){if(a)return Promise.reject(new Error("AnchorResolver destroyed"));let p=s(b);if(p)return Promise.resolve(p);let v=f??n;return new Promise((y,w)=>{let T={resolve:y,reject:w,timer:setTimeout(()=>{d(b,T),w(new Error(`waitFor("${b}") timed out after ${v}ms`))},v)},x=i.get(b);x||(x=new Set,i.set(b,x)),x.add(T),c()})}function g(b,f){if(a)return()=>{};let p=s(b);if(p)return f(p),()=>{};let v={cb:f,cancelled:!1},y=r.get(b);return y||(y=new Set,r.set(b,y)),y.add(v),c(),()=>{v.cancelled=!0;let w=r.get(b);w&&(w.delete(v),w.size===0&&r.delete(b)),i.size===0&&r.size===0&&u()}}function S(){let b=0;for(let f of i.values())b+=f.size;return b}function _(){a=!0,u();let b=new Error("AnchorResolver destroyed");for(let f of i.values())for(let p of f)clearTimeout(p.timer),p.reject(b);i.clear(),r.clear()}return{resolve:s,waitFor:h,onAppear:g,pendingCount:S,destroy:_}}function D5(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function Tb(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(wk(n,i))return}if(e.include){for(let i of e.include)if(wk(n,i))return i;return}return n}function wk(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var sp=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"navigation");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=D5(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Tb(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=Tb(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),queueMicrotask(()=>this.updatePage())},history.replaceState=(...a)=>{o(...a),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=Tb(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function kb(t={}){return new sp(t)}var L5=m.object({url:m.string(),routeId:m.string().optional(),title:m.string().optional(),locale:m.string().optional()}),I5=m.object({url:m.string(),ts:m.number()}),H5=m.object({sessionId:m.string(),startTs:m.number(),pageHistory:m.array(I5).optional()}),z5=m.object({width:m.number(),height:m.number()}),B5=m.object({x:m.number(),y:m.number(),w:m.number(),h:m.number()}),F5=m.object({anchorId:m.string(),present:m.boolean(),visible:m.boolean().optional(),boundingBox:B5.optional()}),$5=m.record(m.string(),m.union([m.number(),m.string(),m.boolean(),m.undefined()])),U5=m.object({page:L5,session:H5,viewport:z5,anchors:m.array(F5).optional(),augmented:$5.optional()});function m8(t){return U5.safeParse(t)}function Ek(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,a=n.page.url,s=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${s}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",a=n.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:a}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let o=i.getSessionMetric(t.key),{operator:a,threshold:s}=t;switch(a){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let o=i.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!i)return t.inverted??!1;let o=i.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}case"event_count":{if(!e.accumulator)return!1;let o=t,a=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return a>=o.count;case"lte":return a<=o.count;case"eq":return a===o.count;case"gt":return a>o.count;case"lt":return a<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Ck(t,e){let n=[];for(let i of t.conditions){let r=Ek(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function lp(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:o}=Ck(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function cp(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function Ak(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:o}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0,accumulator:o?{getCount:(a,s)=>o.getCount(a,s)}:void 0}}async function Tk(t,e,n={}){let i=Ak(e,n);switch(t.type){case"rules":return lp(t,i);case"score":return cp(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function kk(t,e,n={}){let i=Ak(e,n);switch(t.type){case"rules":return lp(t,i);case"score":return cp(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Rb(t){return{evaluate:(e,n)=>Tk(e,n,t),evaluateSync:(e,n)=>kk(e,n,t)}}function Ob(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,o=null,a=n.ns("accumulator");function s(c){let u=!1;for(let d of i.values()){if(!d.predicate(c))continue;let h=a.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(c.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),a.set(d.stateKey,h),u=!0}if(u)for(let d of r)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||i.size===0||(o=e.subscribe(s))}return{register(c,u,d=!1){let h=`ev:${c}`,g=i.get(h);if(g){d&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}i.set(h,{stateKey:h,needsTimestamps:d,predicate:u}),l()},getCount(c,u){let d=`ev:${c}`,h=a.get(d);if(!h)return 0;if(u===void 0||!h.timestamps)return h.count;let g=Date.now()-u;return h.timestamps.filter(S=>S>=g).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){o&&(o(),o=null),i.clear(),r.clear()}}}function Mb(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var up=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let o={filter:i,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:ls};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Mb(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>Mb(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=r&&(i===void 0||o.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>Mb(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(o=>o.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Pc(t={}){return new up(t)}var Rk={$autocapture:"ui.click",$click:Se.UI_CLICK,$scroll:Se.UI_SCROLL,$input:Se.UI_INPUT,$change:Se.UI_CHANGE,$submit:Se.UI_SUBMIT,$pageview:Se.NAV_PAGE_VIEW,$pageleave:Se.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function V5(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(Rk[e])return Rk[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?Se.UI_SUBMIT:i==="change"?Se.UI_CHANGE:n==="input"||n==="textarea"?Se.UI_INPUT:Se.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function j5(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function Ok(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:V5(t),source:"posthog",props:j5(t),schemaVersion:ls}}function Mk(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function Nb(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(Mk(i)){let r=Ok(i);t(r)}}}var Nk=m.enum(["posthog","canvas","derived"]),P5=m.object({ts:m.number(),name:m.string(),source:Nk,props:m.record(m.string(),m.unknown()).optional(),schemaVersion:m.string()}),q5=m.object({names:m.array(m.string()).optional(),patterns:m.array(m.string()).optional(),sources:m.array(Nk).optional()});function $8(t){return P5.safeParse(t)}function U8(t){return q5.safeParse(t)}var qc=class{constructor(){j(this,"listeners",new Set);j(this,"capturedPushState");j(this,"capturedReplaceState");j(this,"wasNative");j(this,"destroyed",!1);j(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var Db="cooldown:";function Dk(t){return{set(e,n){let i=Db+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Db+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=Db+e;t.remove(n)}}}var Zc="dismissed:";function Lk(t,e){return{mark(n,i=!1){let r=Zc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=Zc+n;return t.has(i)||e.has(i)},clear(n){let i=Zc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(Zc)&&t.remove(n);for(let n of e.keys())n.startsWith(Zc)&&e.remove(n)}}}var Lb="freq:";function Ik(t){function e(n){let i=Lb+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=Lb+n,o=e(n),a=(o?.count??0)+1,s={count:a,resetAt:o?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),a},count(n){return e(n)?.count??0},reset(n){let i=Lb+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var Z5="syntro";function Ib(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+i);return}return o.value}catch{return}},set(i,r,o){if(t)try{let a={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(n+i,JSON.stringify(a))}catch(a){console.warn("[StateStore] Failed to save:",a)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(n)&&i.push(o.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function Hb(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,o){e.set(n+i,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var dp=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??Z5,typeof window<"u"?(this.session=Ib(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Ib(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Hb(this.namespace),this.user=Hb(this.namespace)),this.dismissals=Lk(this.session,this.user),this.cooldowns=Dk(this.user),this.frequency=Ik(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?Ib(sessionStorage,n):Hb(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function zb(t={}){return new dp(t)}function Gc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function fp(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var Hk={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},Yc={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},zk={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Bb(t,e,n){let i=Hk[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function Fb(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[Fd(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(Ud()),n.shift!==!1&&r.push($d({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Bd(e,t,async()=>{let{x:a,y:s,strategy:l}=await Vd(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${s}px`})})}function $b(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function Ub(t,e){return e==="none"||Yc[e].length===0?null:t.animate(Yc[e],zk)}function Vb(t,e){if(e==="none"||Yc[e].length===0)return Promise.resolve();let n=[...Yc[e]].reverse(),i=t.animate(n,zk);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function jb(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function Pb(t){switch(Gc(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function Bk(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),a=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){a.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),d=c.value.trim().toLowerCase(),h=u.startsWith("on"),g=(u==="href"||u==="src")&&d.startsWith("javascript:");(h||g)&&s.removeAttribute(c.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var G5=0;function qb(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:o}=t,a=new Map,s=new Map,l=new Map;function c(){return`mount-${++G5}`}function u(y,w){n&&n.publish(y,w)}function d(y){let w=l.get(y);if(w){let T=b(y);for(let x of w)try{x(T)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let h=new Map;function g(y,w,T){switch(w.type){case"html":y.innerHTML=Bk(w.content);return;case"widget":{if(o?.has(w.widgetId)){let x=o.mount(w.widgetId,y,w.config);return T&&h.set(T,x),()=>{x.unmount(),T&&h.delete(T)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,w,T){let x=c(),k=Gc(y),C=T?.priority??0,E=T?.animation??r,M=T?.exclusive??!0,I=a.get(y);if(I&&M){if(I.options.priority>C)throw new Error(`Slot ${y} is occupied by higher priority content (${I.options.priority} > ${C})`);_(I)}let N=jb(y,x);N.style.zIndex=String(Pb(y));let F;if(k==="static")Bb(N,y,T?.constraints),e.appendChild(N);else if(k==="inline"){let L=fp(y);if(!L)throw new Error(`Invalid inline slot: ${y}`);if(!i)throw new Error("Anchor resolver required for inline slots");let Z=i({selector:L,route:"**"});if(!Z)throw new Error(`Anchor not found for inline slot: ${L}`);F=$b(N,Z)}else if(k==="adjacent"){let L=fp(y);if(!L)throw new Error(`Invalid adjacent slot: ${y}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let Z=i({selector:L,route:"**"});if(!Z)throw new Error(`Anchor not found for adjacent slot: ${L}`);e.appendChild(N),F=Fb(N,Z,T?.position??{placement:"bottom"})}let Y=g(N,w,x);Ub(N,E);let z={id:x,slot:y,content:w,options:{priority:C,exclusive:M,animation:E,position:T?.position??{placement:"auto"},constraints:T?.constraints??{},adaptiveId:T?.adaptiveId,autoUnmountOnRouteChange:T?.autoUnmountOnRouteChange??!0},container:N,cleanup:()=>{F?.(),Y?.()},mountedAt:Date.now()};return a.set(y,z),s.set(y,(s.get(y)??0)+1),u("surface.mounted",{slot:y,id:x,adaptiveId:T?.adaptiveId}),d(y),{id:x,update(L){let Z=a.get(y);if(!Z||Z.id!==x)throw new Error("Mount no longer active");let J=h.get(x);if(J){if(L.type==="widget"){J.update(L.config),Z.content=L;return}J.unmount(),h.delete(x)}Z.container.innerHTML="";let me=g(Z.container,L,x);if(Z.content=L,me){let Ke=Z.cleanup;Z.cleanup=()=>{Ke?.(),me()}}},setOptions(L){let Z=a.get(y);if(!Z||Z.id!==x)throw new Error("Mount no longer active");L.priority!==void 0&&(Z.options.priority=L.priority),L.animation!==void 0&&(Z.options.animation=L.animation),L.constraints&&k==="static"&&(L.constraints.maxWidth&&(Z.container.style.maxWidth=L.constraints.maxWidth),L.constraints.maxHeight&&(Z.container.style.maxHeight=L.constraints.maxHeight),L.constraints.minWidth&&(Z.container.style.minWidth=L.constraints.minWidth),L.constraints.minHeight&&(Z.container.style.minHeight=L.constraints.minHeight)),d(y)},async unmount(){let L=a.get(y);!L||L.id!==x||await _(L)},isMounted(){return a.get(y)?.id===x},getContainer(){let L=a.get(y);return L?.id===x?L.container:null}}}async function _(y){await Vb(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),a.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function b(y){let w=a.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:w?.id}}function f(y,w){let T=l.get(y);return T||(T=new Set,l.set(y,T)),T.add(w),()=>{T?.delete(w),T?.size===0&&l.delete(y)}}function p(y,w){let T=a.get(y);return T?w!==void 0?w>=T.options.priority:!1:!0}function v(){for(let y of a.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}a.clear(),l.clear()}return{mount:S,getState:b,onStateChange:f,canMount:p,destroy:v}}var pp=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0);j(this,"runtimeRef");j(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let a={...i,runtime:this.runtimeRef},s=r.widget.mount(n,a);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(o);c&&(c.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let d={...c,runtime:this.runtimeRef},h=r.widget.mount(n,d);u.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Zb=new pp;var $k="2.0.0";function Y5(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(Gb(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(Gb(i,r))return!0;return!1}return!0}function Gb(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function Fk(t){let n=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>Gb(n,r))}function Yb(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:o}=t,a=t.widgets??Zb,s=t.executors??nr,l=t.apps??Yl,c=new qc,u=kb({telemetry:e,routes:i,navigation:c}),d=t.events??Pc(),h=zb({namespace:o}),g=Ob({eventBus:d,stateStore:h}),S=Rb({state:h,events:d,sessionMetrics:n,accumulator:g}),_=kE(),b=Ab(),f=T=>Fk(T)?b.resolve(T.selector):null,p=async(T,x)=>{if(!Fk(T))return null;try{return await b.waitFor(T.selector,x)}catch{return null}},v=qb({overlayRoot:_,eventBus:d,anchorResolver:f,widgetRegistry:a}),y=fb({overlayRoot:_,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:p,executorRegistry:s,subscribeNavigation:T=>c.subscribe(T),runtime:{evaluateSync:T=>S.evaluateSync(T,u.get()),context:u,accumulator:g}}),w={telemetry:e,context:u,events:d,state:h,sessionMetrics:n,actions:y,surfaces:v,widgets:a,executors:s,apps:l,accumulator:g,anchorResolver:b,navigation:c,version:$k,mode:r,async evaluate(T){return S.evaluate(T,u.get())},evaluateSync(T){return S.evaluateSync(T,u.get())},async filterTiles(T){let x=u.get().page.url,k=[];for(let C of T){let E=C.activation;if(!E){k.push(C);continue}if(!Y5(x,E.routes))continue;if(!E.strategy){k.push(C);continue}(await this.evaluate(E.strategy)).value&&k.push(C)}return k},setRoutes(T){u.setRoutes(T)},destroy(){l.unbind().catch(T=>{console.error("[Runtime] Error unbinding apps registry:",T)}),b.destroy(),g.destroy(),c.destroy(),u.destroy(),y.destroy(),v.destroy()}};return l.bind(w),a.bindRuntime(w),w}var W5=m.object({value:m.unknown(),expiresAt:m.number().optional()}),X5=m.object({count:m.number(),resetAt:m.number().optional()});function P$(t){return W5.safeParse(t)}function q$(t){return X5.safeParse(t)}var Uk={growthbook:t=>mv({...t,autoInit:!0})};function Vk(t,e){let n=Uk[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(Uk).join(", ")}`);return n(e)}var K5=["cdn.syntrologie.com","localhost","127.0.0.1"];function Q5(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):K5.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var Wb=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!Q5(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await J5(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),o=performance.now()-e,a=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:a?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function J5(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function jk(t){return new Wb(t)}var eI="syntro_exp",tI="syntro_var",Xb=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");j(this,"manifestKey");j(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),o=r.get(eI),a=r.get(tI);if(o&&a!==null&&this.client.setForcedVariations){let s=parseInt(a,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Gd(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function Pk(t){return new Xb(t)}var nI="https://cdn.syntrologie.com/configs",qk={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return jk({baseUrl:t.baseUrl??nI,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return Pk({featureKey:t.featureKey})}};function Zk(t,e={}){let n=qk[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(qk).join(", ")}`);return n(e)}var Gk={posthog:t=>ab(t),noop:()=>wv()};function Yk(t,e){let n=Gk[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(Gk).join(", ")}`);return n(e)}var Kb="syn_";function hp(t){if(!t.startsWith(Kb))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Kb.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Qb(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Kb+n}function ir(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function iI(){if(typeof window>"u")return G("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="editor");return G("Syntro Bootstrap","isEditorMode:",n),n}function rI(){if(typeof window>"u")return G("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="audit");return G("Syntro Bootstrap","isAuditMode:",n),n}function oI(){if(typeof window>"u")return G("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="review");return G("Syntro Bootstrap","isReviewMode:",n),n}var Wk="syntro_segment_attributes";function aI(){if(typeof window>"u")return{};try{let t=localStorage.getItem(Wk);if(t){let e=JSON.parse(t);return G("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){fn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function sI(t){if(!(typeof window>"u"))try{localStorage.setItem(Wk,JSON.stringify(t)),G("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){fn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function lI(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function cI(t){Tm(),G("Syntro Bootstrap","====== INIT ======"),G("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=iI(),n=rI(),i=oI(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",Br()),console.log("[DIAG] editorConf:",Ho()),G("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,M=!!window.__SYNTRO_AUDIT_LEGEND__,I=!!window.__SYNTRO_REVIEW_DATA__;if(E||M||I){let N=[E&&"__SYNTRO_EDITOR_PARAMS__",M&&"__SYNTRO_AUDIT_LEGEND__",I&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${N.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&r){let M=Ho()?.syntro_token;M?.startsWith("syn_")&&(o=M,G("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let a;if(o)if(o.startsWith("syn_"))G("Syntro Bootstrap","Token starts with syn_, decoding..."),a=hp(o),Tm(a.d);else if(r)G("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw Yd("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),Yd("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)G("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw Yd("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=ir("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ir("VITE_SYNTRO_EXPERIMENT_HOST")||a?.eh,l=ir("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ir("VITE_SYNTRO_TELEMETRY_HOST")||a?.th,c=ir("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ir("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=aI();G("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let d,h=Pc();console.log("[Syntro Bootstrap] EventBus created");let g=Nb(E=>{h.publishEvent(E)}),S=E=>{G("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let M=lI(E);if(G("Syntro Bootstrap","Segment flags from PostHog:",M),sI(M),d){let N={...b?.getAll?.()??{},...M};G("Syntro Bootstrap","Updating GrowthBook with attributes:",N),d.setAttributes?.(N)}},_;if(a?.t){let E=a.t==="noop"?"noop":"posthog";_=Yk(E,{apiKey:a.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:S,onCapture:g}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`)}let b;a?.e&&(d=Vk("growthbook",{clientKey:a.e,apiHost:s,attributes:u,onExperimentViewed:_?.trackExperiment?(E,M,I)=>{_.trackExperiment(E,M,I)}:void 0})),t.enableSessionMetrics&&(b=vv({experiments:d,onMetricChange:(E,M)=>{G("Syntro Bootstrap",`Session metric changed: ${E} = ${M}`)}}),G("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":n?f="audit":ir("NODE_ENV")==="development"&&(f="development");let p=Yb({telemetry:_,sessionMetrics:b,mode:f,events:h});G("Syntro Bootstrap","Runtime created:",{version:p.version,mode:p.mode,hasContext:!!p.context,hasEvents:!!p.events,hasState:!!p.state}),G("Syntro Bootstrap","Core app executors already registered");let v=t.cdnBase||ir("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ir("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=Sm({cdnBase:v,registry:p.apps,onLoadStart:E=>{G("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,M,I)=>{M?G("Syntro Bootstrap",`App loaded successfully: ${E}`):fn("Syntro Bootstrap",`Failed to load app: ${E}`,I)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:p.apps,runtime:p,version:p.version},G("Syntro Bootstrap","Global SynOS object exposed"));let w=p.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${w.length} apps in registry:`,w.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of w)if(E.state==="registered")try{await p.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${p.widgets.list().join(", ")}]`)}catch(M){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,M),fn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,M)}if(console.log(`[DIAG] Activation complete. Total widgets: [${p.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),G("Syntro Bootstrap","GrowthBook features loaded")}catch(E){fn("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let T;if(t.fetcher)T=t.fetcher;else if(a?.f){let E=Zk(a.f,a.o??{});T=async()=>{let M=await E.fetch();return{...M.config,tiles:M.config.tiles??[]}}}else d&&(T=rs({experiments:d}));let x=new Set,k=T?async()=>{let E=await T();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((N,F)=>`[${F}] ${N.kind}${N.anchorId?` anchor="${typeof N.anchorId=="string"?N.anchorId:N.anchorId.selector}"`:""}${N.label?` "${N.label}"`:""}`).join(", "));let M=E,I=y.getRequiredApps(M);return I.length>0?console.log("[Syntro Bootstrap] Required external apps:",I.join(", ")):G("Syntro Bootstrap","No external apps required (all executors are built-in)"),I.length>0&&await y.loadAppsForConfig(M).then(async F=>{let Y=F.filter(L=>L.success),z=F.filter(L=>!L.success);Y.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${Y.map(L=>L.appId).join(", ")}`);let te=z.filter(L=>!x.has(L.appId));te.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",te.map(L=>`${L.appId} (${L.error})`).join(", ")),te.forEach(L=>x.add(L.appId)));for(let L of I)if(p.apps.has(L))try{await p.apps.activate(L),console.log(`[Syntro Bootstrap] App activated: ${L}`)}catch(Z){console.error(`[Syntro Bootstrap] Failed to activate app: ${L}`,Z)}else console.error(`[Syntro Bootstrap] App "${L}" required by config but NOT registered.`,`Available apps: [${Array.from(p.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await Km({...t.canvas,fetcher:k,integrations:{experiments:d,telemetry:_},editorUrl:c,runtime:p}),runtime:p,experiments:d,telemetry:_,sessionMetrics:b,appLoader:y}}var Xk={init:cI,encodeToken:Qb,decodeToken:hp};typeof window<"u"&&(window.Syntro=Xk);var Kk="2026-03-02T18:34:22.502Z (6c75590b5e)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${Kk}`);let t=window.SynOS,e=t?.appRegistry||Yl;window.SynOS={...t,appRegistry:e,_runtimeBuild:Kk,React:Qk.default,ReactDOM:{...uI,createPortal:gp.createPortal,flushSync:gp.flushSync}},gE(e)}export{Yc as ANIMATION_KEYFRAMES,ap as ActivationConfigZ,sk as AddClassZ,Hn as AnchorIdZ,F5 as AnchorStateZ,gb as AnchorVisibleConditionZ,Pd as AppRegistry,$5 as AugmentationZ,XT as BadgePositionZ,pk as BadgeZ,B5 as BoundingBoxZ,Kl as CanvasEvents,Sv as CanvasRecipeZ,zs as ConditionZ,sp as ContextManager,Sb as CooldownActiveConditionZ,Bc as CounterDefZ,Cb as CtaButtonZ,Lm as DEFAULT_COOLDOWN,Dm as DEFAULT_TTL,so as DecisionStrategyZ,_b as DismissedConditionZ,ls as EVENT_SCHEMA_VERSION,up as EventBus,wb as EventCountConditionZ,q5 as EventFilterZ,mb as EventOccurredConditionZ,Nk as EventSourceZ,op as ExecutorRegistry,jc as ExternalStrategyZ,X5 as FrequencyEntryZ,xb as FrequencyLimitConditionZ,D3 as HighlightStepZ,WT as HighlightStyleZ,dk as HighlightZ,uk as InsertHtmlZ,ek as InsertPositionZ,Nm as MAX_VISIBLE_TOASTS,zc as MatchOpZ,JT as ModalContentZ,gk as ModalZ,Vc as ModelStrategyZ,yk as MountWidgetZ,vk as NavigateZ,qc as NavigationMonitor,P5 as NormalizedEventZ,Mm as NotificationToastStack,L5 as PageContextZ,I5 as PageHistoryEntryZ,pb as PageUrlConditionZ,Sk as ParallelZ,KT as PlacementZ,fk as PulseZ,Kk as RUNTIME_SDK_BUILD,$k as RUNTIME_VERSION,lk as RemoveClassZ,hb as RouteConditionZ,YT as RouteFilterZ,$c as RuleStrategyZ,Fc as RuleZ,U5 as RuntimeContextZ,Fm as RuntimeProvider,zr as SDK_SCHEMA_VERSION,km as SDK_VERSION,Hk as STATIC_SLOT_STYLES,Uc as ScoreStrategyZ,rk as ScrollBehaviorZ,Eb as ScrollLogicalPositionZ,mk as ScrollToZ,VC as SelectorZ,_k as SequenceZ,H5 as SessionContextZ,bb as SessionMetricConditionZ,yf as SessionMetricTracker,ak as SetAttrZ,ck as SetStyleZ,ok as SetTextZ,BE as ShadowCanvasOverlay,ME as ShadowRootProvider,UE as SmartCanvasApp,Om as SmartCanvasController,Wm as SmartCanvasElement,pF as SmartCanvasPortal,Se as StandardEvents,vb as StateEqualsConditionZ,dp as StateStore,W5 as StoredValueZ,Xk as Syntro,Ql as TileCard,nB as TileWheel,QT as TooltipContentZ,N3 as TooltipStepZ,tk as TooltipTriggerZ,hk as TooltipZ,ik as TourStepForSchemaZ,xk as TourZ,yb as ViewportConditionZ,z5 as ViewportContextZ,bk as WaitZ,nk as WidgetConfigZ,pp as WidgetRegistry,Yl as appRegistry,Bb as applyStaticSlotStyles,bm as cleanupAppContext,om as contentRuntime,N5 as coreActionStepSchemas,fb as createActionEngine,Ab as createAnchorResolver,ym as createAppContext,Sm as createAppLoader,rs as createCanvasConfigFetcher,kb as createContextManager,Rb as createDecisionEngine,Ob as createEventAccumulator,Pc as createEventBus,mv as createGrowthBookClient,wv as createNoopClient,dF as createOverlayRecipeFetcher,ab as createPostHogClient,Nb as createPostHogNormalizer,vv as createSessionMetricTracker,Km as createSmartCanvas,RE as createSmartCanvasController,Yb as createSmartCanvasRuntime,zb as createStateStore,jb as createSurfaceContainer,qb as createSurfaces,JF as decisionSchemas,hp as decodeToken,Qb as encodeToken,Tk as evaluate,Ek as evaluateCondition,Ck as evaluateRule,lp as evaluateRuleStrategy,cp as evaluateScoreStrategy,kk as evaluateSync,nr as executorRegistry,kN as getAntiFlickerSnippet,eE as getAppIdFromActionKind,_m as getAppIdFromWidgetId,d5 as getExecutor,fp as getSlotAnchorId,Gc as getSlotType,Pb as getSlotZIndex,ub as hasExecutor,Kd as interpolateTemplate,J1 as isCoreActionKind,Im as matchEvent,aB as needsMigration,Ok as normalizePostHogEvent,vm as overlaysRuntime,Jl as parseVersion,Ub as playEnterAnimation,Vb as playExitAnimation,Wd as registerConfigPredicates,qE as registerSmartCanvasElement,Rm as resolveConfigUri,Fb as setupAdjacentPositioning,$b as setupInlinePositioning,Mk as shouldNormalizeEvent,dD as useDecision,Hm as useNotifications,zm as useNotifyWatcher,$m as usePageContext,$i as useRuntime,Jd as useRuntimeContext,cD as useRuntimeEvents,uD as useRuntimeState,sD as useSessionContext,FE as useShadowCanvasConfig,ss as useShadowRoot,lD as useViewportContext,ao as validateAction,db as validateActions,QF as validateActivationConfig,XF as validateCondition,oB as validateConfig,U8 as validateEventFilter,q$ as validateFrequencyEntry,$8 as validateNormalizedEvent,sF as validateRecipe,m8 as validateRuntimeContext,P$ as validateStoredValue,KF as validateStrategy,Zb as widgetRegistry};
447
446
  /*! Bundled license information:
448
447
 
449
448
  react/cjs/react.production.js: