@syntrologie/runtime-sdk 2.6.0-canary.6 → 2.6.0

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.
@@ -1,12 +1,12 @@
1
- var AE=Object.create;var lc=Object.defineProperty;var kE=Object.getOwnPropertyDescriptor;var EE=Object.getOwnPropertyNames;var TE=Object.getPrototypeOf,RE=Object.prototype.hasOwnProperty;var _b=t=>{throw TypeError(t)};var ME=(t,e,a)=>e in t?lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var tr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),DE=(t,e)=>{for(var a in e)lc(t,a,{get:e[a],enumerable:!0})},OE=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of EE(e))!RE.call(t,n)&&n!==a&&lc(t,n,{get:()=>e[n],enumerable:!(r=kE(e,n))||r.enumerable});return t};var K=(t,e,a)=>(a=t!=null?AE(TE(t)):{},OE(e||!t||!t.__esModule?lc(a,"default",{value:t,enumerable:!0}):a,t));var $=(t,e,a)=>ME(t,typeof e!="symbol"?e+"":e,a),wb=(t,e,a)=>e.has(t)||_b("Cannot "+a);var ge=(t,e,a)=>(wb(t,e,"read from private field"),a?a.call(t):e.get(t)),cn=(t,e,a)=>e.has(t)?_b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),ar=(t,e,a,r)=>(wb(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var Bb=tr(ie=>{"use strict";var Pp=Symbol.for("react.transitional.element"),BE=Symbol.for("react.portal"),FE=Symbol.for("react.fragment"),NE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),HE=Symbol.for("react.consumer"),UE=Symbol.for("react.context"),qE=Symbol.for("react.forward_ref"),zE=Symbol.for("react.suspense"),VE=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),$E=Symbol.for("react.activity"),Lb=Symbol.iterator;function jE(t){return t===null||typeof t!="object"?null:(t=Lb&&t[Lb]||t["@@iterator"],typeof t=="function"?t:null)}var Tb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rb=Object.assign,Mb={};function hi(t,e,a){this.props=t,this.context=e,this.refs=Mb,this.updater=a||Tb}hi.prototype.isReactComponent={};hi.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")};hi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Db(){}Db.prototype=hi.prototype;function Hp(t,e,a){this.props=t,this.context=e,this.refs=Mb,this.updater=a||Tb}var Up=Hp.prototype=new Db;Up.constructor=Hp;Rb(Up,hi.prototype);Up.isPureReactComponent=!0;var Ib=Array.isArray;function Np(){}var Be={H:null,A:null,T:null,S:null},Ob=Object.prototype.hasOwnProperty;function qp(t,e,a){var r=a.ref;return{$$typeof:Pp,type:t,key:e,ref:r!==void 0?r:null,props:a}}function GE(t,e){return qp(t.type,e,t.props)}function zp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Pp}function WE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var Ab=/\/+/g;function Fp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?WE(""+t.key):e.toString(36)}function ZE(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Np,Np):(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 pi(t,e,a,r,n){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case Pp:case BE:i=!0;break;case Eb:return i=t._init,pi(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Fp(t,0):r,Ib(n)?(a="",i!=null&&(a=i.replace(Ab,"$&/")+"/"),pi(n,e,a,"",function(u){return u})):n!=null&&(zp(n)&&(n=GE(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(Ab,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(Ib(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Fp(r,l),i+=pi(r,e,a,o,n);else if(l=jE(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Fp(r,l++),i+=pi(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return pi(ZE(t),e,a,r,n);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 i}function uc(t,e,a){if(t==null)return t;var r=[],n=0;return pi(t,r,"","",function(o){return e.call(a,o,n++)}),r}function XE(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var kb=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)},YE={map:uc,forEach:function(t,e,a){uc(t,function(){e.apply(this,arguments)},a)},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(!zp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ie.Activity=$E;ie.Children=YE;ie.Component=hi;ie.Fragment=FE;ie.Profiler=PE;ie.PureComponent=Hp;ie.StrictMode=NE;ie.Suspense=zE;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;ie.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};ie.cache=function(t){return function(){return t.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=Rb({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!Ob.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(r[o]=e[o]);var o=arguments.length-2;if(o===1)r.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];r.children=i}return qp(t.type,n,r)};ie.createContext=function(t){return t={$$typeof:UE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:HE,_context:t},t};ie.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)Ob.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=e[r]);var i=arguments.length-2;if(i===1)n.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];n.children=s}if(t&&t.defaultProps)for(r in i=t.defaultProps,i)n[r]===void 0&&(n[r]=i[r]);return qp(t,o,n)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(t){return{$$typeof:qE,render:t}};ie.isValidElement=zp;ie.lazy=function(t){return{$$typeof:Eb,_payload:{_status:-1,_result:t},_init:XE}};ie.memo=function(t,e){return{$$typeof:VE,type:t,compare:e===void 0?null:e}};ie.startTransition=function(t){var e=Be.T,a={};Be.T=a;try{var r=t(),n=Be.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Np,kb)}catch(o){kb(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Be.T=e}};ie.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};ie.use=function(t){return Be.H.use(t)};ie.useActionState=function(t,e,a){return Be.H.useActionState(t,e,a)};ie.useCallback=function(t,e){return Be.H.useCallback(t,e)};ie.useContext=function(t){return Be.H.useContext(t)};ie.useDebugValue=function(){};ie.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};ie.useEffect=function(t,e){return Be.H.useEffect(t,e)};ie.useEffectEvent=function(t){return Be.H.useEffectEvent(t)};ie.useId=function(){return Be.H.useId()};ie.useImperativeHandle=function(t,e,a){return Be.H.useImperativeHandle(t,e,a)};ie.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};ie.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};ie.useMemo=function(t,e){return Be.H.useMemo(t,e)};ie.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};ie.useReducer=function(t,e,a){return Be.H.useReducer(t,e,a)};ie.useRef=function(t){return Be.H.useRef(t)};ie.useState=function(t){return Be.H.useState(t)};ie.useSyncExternalStore=function(t,e,a){return Be.H.useSyncExternalStore(t,e,a)};ie.useTransition=function(){return Be.H.useTransition()};ie.version="19.2.4"});var We=tr((rH,Fb)=>{"use strict";Fb.exports=Bb()});var Pb=tr(Ot=>{"use strict";var KE=We();function Nb(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}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 dn(){}var Dt={d:{f:dn,r:function(){throw Error(Nb(522))},D:dn,C:dn,L:dn,m:dn,X:dn,S:dn,M:dn},p:0,findDOMNode:null},QE=Symbol.for("react.portal");function JE(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QE,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var Vs=KE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function cc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Ot.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Nb(299));return JE(t,e,null,a)};Ot.flushSync=function(t){var e=Vs.T,a=Dt.p;try{if(Vs.T=null,Dt.p=2,t)return t()}finally{Vs.T=e,Dt.p=a,Dt.d.f()}};Ot.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dt.d.C(t,e))};Ot.prefetchDNS=function(t){typeof t=="string"&&Dt.d.D(t)};Ot.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=cc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Dt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Dt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ot.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=cc(e.as,e.crossOrigin);Dt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Dt.d.M(t)};Ot.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=cc(a,e.crossOrigin);Dt.d.L(t,a,{crossOrigin:r,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})}};Ot.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=cc(e.as,e.crossOrigin);Dt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Dt.d.m(t)};Ot.requestFormReset=function(t){Dt.d.r(t)};Ot.unstable_batchedUpdates=function(t,e){return t(e)};Ot.useFormState=function(t,e,a){return Vs.H.useFormState(t,e,a)};Ot.useFormStatus=function(){return Vs.H.useHostTransitionStatus()};Ot.version="19.2.4"});var $s=tr((oH,Ub)=>{"use strict";function Hb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hb)}catch(t){console.error(t)}}Hb(),Ub.exports=Pb()});var Yb=tr(Ue=>{"use strict";function Gp(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<dc(n,e))t[r]=e,t[a]=n,a=r;else break e}}function rr(t){return t.length===0?null:t[0]}function pc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var r=0,n=t.length,o=n>>>1;r<o;){var i=2*(r+1)-1,s=t[i],l=i+1,u=t[l];if(0>dc(s,a))l<n&&0>dc(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>dc(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function dc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}Ue.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(qb=performance,Ue.unstable_now=function(){return qb.now()}):(Vp=Date,zb=Vp.now(),Ue.unstable_now=function(){return Vp.now()-zb});var qb,Vp,zb,xr=[],fn=[],eT=1,xa=null,kt=3,Wp=!1,js=!1,Gs=!1,Zp=!1,jb=typeof setTimeout=="function"?setTimeout:null,Gb=typeof clearTimeout=="function"?clearTimeout:null,Vb=typeof setImmediate<"u"?setImmediate:null;function fc(t){for(var e=rr(fn);e!==null;){if(e.callback===null)pc(fn);else if(e.startTime<=t)pc(fn),e.sortIndex=e.expirationTime,Gp(xr,e);else break;e=rr(fn)}}function Xp(t){if(Gs=!1,fc(t),!js)if(rr(xr)!==null)js=!0,gi||(gi=!0,mi());else{var e=rr(fn);e!==null&&Yp(Xp,e.startTime-t)}}var gi=!1,Ws=-1,Wb=5,Zb=-1;function Xb(){return Zp?!0:!(Ue.unstable_now()-Zb<Wb)}function $p(){if(Zp=!1,gi){var t=Ue.unstable_now();Zb=t;var e=!0;try{e:{js=!1,Gs&&(Gs=!1,Gb(Ws),Ws=-1),Wp=!0;var a=kt;try{t:{for(fc(t),xa=rr(xr);xa!==null&&!(xa.expirationTime>t&&Xb());){var r=xa.callback;if(typeof r=="function"){xa.callback=null,kt=xa.priorityLevel;var n=r(xa.expirationTime<=t);if(t=Ue.unstable_now(),typeof n=="function"){xa.callback=n,fc(t),e=!0;break t}xa===rr(xr)&&pc(xr),fc(t)}else pc(xr);xa=rr(xr)}if(xa!==null)e=!0;else{var o=rr(fn);o!==null&&Yp(Xp,o.startTime-t),e=!1}}break e}finally{xa=null,kt=a,Wp=!1}e=void 0}}finally{e?mi():gi=!1}}}var mi;typeof Vb=="function"?mi=function(){Vb($p)}:typeof MessageChannel<"u"?(jp=new MessageChannel,$b=jp.port2,jp.port1.onmessage=$p,mi=function(){$b.postMessage(null)}):mi=function(){jb($p,0)};var jp,$b;function Yp(t,e){Ws=jb(function(){t(Ue.unstable_now())},e)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(t){t.callback=null};Ue.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"):Wb=0<t?Math.floor(1e3/t):5};Ue.unstable_getCurrentPriorityLevel=function(){return kt};Ue.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var a=kt;kt=e;try{return t()}finally{kt=a}};Ue.unstable_requestPaint=function(){Zp=!0};Ue.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=kt;kt=t;try{return e()}finally{kt=a}};Ue.unstable_scheduleCallback=function(t,e,a){var r=Ue.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,t){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,t={id:eT++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,Gp(fn,t),rr(xr)===null&&t===rr(fn)&&(Gs?(Gb(Ws),Ws=-1):Gs=!0,Yp(Xp,a-r))):(t.sortIndex=n,Gp(xr,t),js||Wp||(js=!0,gi||(gi=!0,mi()))),t};Ue.unstable_shouldYield=Xb;Ue.unstable_wrapCallback=function(t){var e=kt;return function(){var a=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=a}}}});var Qb=tr((sH,Kb)=>{"use strict";Kb.exports=Yb()});var cw=tr(Pd=>{"use strict";var it=Qb(),w0=We(),tT=$s();function D(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}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 L0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Dl(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function I0(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 A0(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 Jb(t){if(Dl(t)!==t)throw Error(D(188))}function aT(t){var e=t.alternate;if(!e){if(e=Dl(t),e===null)throw Error(D(188));return e!==t?null:t}for(var a=t,r=e;;){var n=a.return;if(n===null)break;var o=n.alternate;if(o===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===a)return Jb(n),t;if(o===r)return Jb(n),e;o=o.sibling}throw Error(D(188))}if(a.return!==r.return)a=n,r=o;else{for(var i=!1,s=n.child;s;){if(s===a){i=!0,a=n,r=o;break}if(s===r){i=!0,r=n,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,r=n;break}if(s===r){i=!0,r=o,a=n;break}s=s.sibling}if(!i)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?t:e}function k0(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=k0(t),e!==null)return e;t=t.sibling}return null}var Pe=Object.assign,rT=Symbol.for("react.element"),hc=Symbol.for("react.transitional.element"),tl=Symbol.for("react.portal"),Ci=Symbol.for("react.fragment"),E0=Symbol.for("react.strict_mode"),Th=Symbol.for("react.profiler"),T0=Symbol.for("react.consumer"),Ar=Symbol.for("react.context"),Lm=Symbol.for("react.forward_ref"),Rh=Symbol.for("react.suspense"),Mh=Symbol.for("react.suspense_list"),Im=Symbol.for("react.memo"),pn=Symbol.for("react.lazy"),Dh=Symbol.for("react.activity"),nT=Symbol.for("react.memo_cache_sentinel"),eS=Symbol.iterator;function Zs(t){return t===null||typeof t!="object"?null:(t=eS&&t[eS]||t["@@iterator"],typeof t=="function"?t:null)}var oT=Symbol.for("react.client.reference");function Oh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oT?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ci:return"Fragment";case Th:return"Profiler";case E0:return"StrictMode";case Rh:return"Suspense";case Mh:return"SuspenseList";case Dh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case tl:return"Portal";case Ar:return t.displayName||"Context";case T0:return(t._context.displayName||"Context")+".Consumer";case Lm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Im:return e=t.displayName||null,e!==null?e:Oh(t.type)||"Memo";case pn:e=t._payload,t=t._init;try{return Oh(t(e))}catch{}}return null}var al=Array.isArray,te=w0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=tT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bo={pending:!1,data:null,method:null,action:null},Bh=[],_i=-1;function lr(t){return{current:t}}function ht(t){0>_i||(t.current=Bh[_i],Bh[_i]=null,_i--)}function Re(t,e){_i++,Bh[_i]=t.current,t.current=e}var sr=lr(null),xl=lr(null),wn=lr(null),Wc=lr(null);function Zc(t,e){switch(Re(wn,e),Re(xl,t),Re(sr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?s0(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=s0(e),t=Y_(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(sr),Re(sr,t)}function qi(){ht(sr),ht(xl),ht(wn)}function Fh(t){t.memoizedState!==null&&Re(Wc,t);var e=sr.current,a=Y_(e,t.type);e!==a&&(Re(xl,t),Re(sr,a))}function Xc(t){xl.current===t&&(ht(sr),ht(xl)),Wc.current===t&&(ht(Wc),Tl._currentValue=bo)}var Kp,tS;function go(t){if(Kp===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Kp=e&&e[1]||"",tS=-1<a.stack.indexOf(`
1
+ var AE=Object.create;var sc=Object.defineProperty;var kE=Object.getOwnPropertyDescriptor;var EE=Object.getOwnPropertyNames;var TE=Object.getPrototypeOf,RE=Object.prototype.hasOwnProperty;var _b=t=>{throw TypeError(t)};var ME=(t,e,a)=>e in t?sc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var tr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),DE=(t,e)=>{for(var a in e)sc(t,a,{get:e[a],enumerable:!0})},OE=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of EE(e))!RE.call(t,n)&&n!==a&&sc(t,n,{get:()=>e[n],enumerable:!(r=kE(e,n))||r.enumerable});return t};var K=(t,e,a)=>(a=t!=null?AE(TE(t)):{},OE(e||!t||!t.__esModule?sc(a,"default",{value:t,enumerable:!0}):a,t));var $=(t,e,a)=>ME(t,typeof e!="symbol"?e+"":e,a),wb=(t,e,a)=>e.has(t)||_b("Cannot "+a);var ge=(t,e,a)=>(wb(t,e,"read from private field"),a?a.call(t):e.get(t)),cn=(t,e,a)=>e.has(t)?_b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),ar=(t,e,a,r)=>(wb(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var Bb=tr(ie=>{"use strict";var Np=Symbol.for("react.transitional.element"),BE=Symbol.for("react.portal"),FE=Symbol.for("react.fragment"),NE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),HE=Symbol.for("react.consumer"),UE=Symbol.for("react.context"),qE=Symbol.for("react.forward_ref"),zE=Symbol.for("react.suspense"),VE=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),$E=Symbol.for("react.activity"),Lb=Symbol.iterator;function jE(t){return t===null||typeof t!="object"?null:(t=Lb&&t[Lb]||t["@@iterator"],typeof t=="function"?t:null)}var Tb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rb=Object.assign,Mb={};function hi(t,e,a){this.props=t,this.context=e,this.refs=Mb,this.updater=a||Tb}hi.prototype.isReactComponent={};hi.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")};hi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Db(){}Db.prototype=hi.prototype;function Pp(t,e,a){this.props=t,this.context=e,this.refs=Mb,this.updater=a||Tb}var Hp=Pp.prototype=new Db;Hp.constructor=Pp;Rb(Hp,hi.prototype);Hp.isPureReactComponent=!0;var Ib=Array.isArray;function Fp(){}var Be={H:null,A:null,T:null,S:null},Ob=Object.prototype.hasOwnProperty;function Up(t,e,a){var r=a.ref;return{$$typeof:Np,type:t,key:e,ref:r!==void 0?r:null,props:a}}function GE(t,e){return Up(t.type,e,t.props)}function qp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Np}function WE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var Ab=/\/+/g;function Bp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?WE(""+t.key):e.toString(36)}function ZE(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Fp,Fp):(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 pi(t,e,a,r,n){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case Np:case BE:i=!0;break;case Eb:return i=t._init,pi(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Bp(t,0):r,Ib(n)?(a="",i!=null&&(a=i.replace(Ab,"$&/")+"/"),pi(n,e,a,"",function(u){return u})):n!=null&&(qp(n)&&(n=GE(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(Ab,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(Ib(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Bp(r,l),i+=pi(r,e,a,o,n);else if(l=jE(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Bp(r,l++),i+=pi(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return pi(ZE(t),e,a,r,n);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 i}function lc(t,e,a){if(t==null)return t;var r=[],n=0;return pi(t,r,"","",function(o){return e.call(a,o,n++)}),r}function XE(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var kb=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)},YE={map:lc,forEach:function(t,e,a){lc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return lc(t,function(){e++}),e},toArray:function(t){return lc(t,function(e){return e})||[]},only:function(t){if(!qp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ie.Activity=$E;ie.Children=YE;ie.Component=hi;ie.Fragment=FE;ie.Profiler=PE;ie.PureComponent=Pp;ie.StrictMode=NE;ie.Suspense=zE;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;ie.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};ie.cache=function(t){return function(){return t.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=Rb({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!Ob.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(r[o]=e[o]);var o=arguments.length-2;if(o===1)r.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];r.children=i}return Up(t.type,n,r)};ie.createContext=function(t){return t={$$typeof:UE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:HE,_context:t},t};ie.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)Ob.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=e[r]);var i=arguments.length-2;if(i===1)n.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];n.children=s}if(t&&t.defaultProps)for(r in i=t.defaultProps,i)n[r]===void 0&&(n[r]=i[r]);return Up(t,o,n)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(t){return{$$typeof:qE,render:t}};ie.isValidElement=qp;ie.lazy=function(t){return{$$typeof:Eb,_payload:{_status:-1,_result:t},_init:XE}};ie.memo=function(t,e){return{$$typeof:VE,type:t,compare:e===void 0?null:e}};ie.startTransition=function(t){var e=Be.T,a={};Be.T=a;try{var r=t(),n=Be.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Fp,kb)}catch(o){kb(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Be.T=e}};ie.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};ie.use=function(t){return Be.H.use(t)};ie.useActionState=function(t,e,a){return Be.H.useActionState(t,e,a)};ie.useCallback=function(t,e){return Be.H.useCallback(t,e)};ie.useContext=function(t){return Be.H.useContext(t)};ie.useDebugValue=function(){};ie.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};ie.useEffect=function(t,e){return Be.H.useEffect(t,e)};ie.useEffectEvent=function(t){return Be.H.useEffectEvent(t)};ie.useId=function(){return Be.H.useId()};ie.useImperativeHandle=function(t,e,a){return Be.H.useImperativeHandle(t,e,a)};ie.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};ie.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};ie.useMemo=function(t,e){return Be.H.useMemo(t,e)};ie.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};ie.useReducer=function(t,e,a){return Be.H.useReducer(t,e,a)};ie.useRef=function(t){return Be.H.useRef(t)};ie.useState=function(t){return Be.H.useState(t)};ie.useSyncExternalStore=function(t,e,a){return Be.H.useSyncExternalStore(t,e,a)};ie.useTransition=function(){return Be.H.useTransition()};ie.version="19.2.4"});var We=tr((rH,Fb)=>{"use strict";Fb.exports=Bb()});var Pb=tr(Ot=>{"use strict";var KE=We();function Nb(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}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 dn(){}var Dt={d:{f:dn,r:function(){throw Error(Nb(522))},D:dn,C:dn,L:dn,m:dn,X:dn,S:dn,M:dn},p:0,findDOMNode:null},QE=Symbol.for("react.portal");function JE(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QE,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var Vs=KE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function uc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Ot.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Nb(299));return JE(t,e,null,a)};Ot.flushSync=function(t){var e=Vs.T,a=Dt.p;try{if(Vs.T=null,Dt.p=2,t)return t()}finally{Vs.T=e,Dt.p=a,Dt.d.f()}};Ot.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dt.d.C(t,e))};Ot.prefetchDNS=function(t){typeof t=="string"&&Dt.d.D(t)};Ot.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=uc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Dt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Dt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ot.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=uc(e.as,e.crossOrigin);Dt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Dt.d.M(t)};Ot.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=uc(a,e.crossOrigin);Dt.d.L(t,a,{crossOrigin:r,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})}};Ot.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=uc(e.as,e.crossOrigin);Dt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Dt.d.m(t)};Ot.requestFormReset=function(t){Dt.d.r(t)};Ot.unstable_batchedUpdates=function(t,e){return t(e)};Ot.useFormState=function(t,e,a){return Vs.H.useFormState(t,e,a)};Ot.useFormStatus=function(){return Vs.H.useHostTransitionStatus()};Ot.version="19.2.4"});var $s=tr((oH,Ub)=>{"use strict";function Hb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hb)}catch(t){console.error(t)}}Hb(),Ub.exports=Pb()});var Yb=tr(Ue=>{"use strict";function jp(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<cc(n,e))t[r]=e,t[a]=n,a=r;else break e}}function rr(t){return t.length===0?null:t[0]}function fc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var r=0,n=t.length,o=n>>>1;r<o;){var i=2*(r+1)-1,s=t[i],l=i+1,u=t[l];if(0>cc(s,a))l<n&&0>cc(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>cc(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function cc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}Ue.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(qb=performance,Ue.unstable_now=function(){return qb.now()}):(zp=Date,zb=zp.now(),Ue.unstable_now=function(){return zp.now()-zb});var qb,zp,zb,xr=[],fn=[],eT=1,xa=null,kt=3,Gp=!1,js=!1,Gs=!1,Wp=!1,jb=typeof setTimeout=="function"?setTimeout:null,Gb=typeof clearTimeout=="function"?clearTimeout:null,Vb=typeof setImmediate<"u"?setImmediate:null;function dc(t){for(var e=rr(fn);e!==null;){if(e.callback===null)fc(fn);else if(e.startTime<=t)fc(fn),e.sortIndex=e.expirationTime,jp(xr,e);else break;e=rr(fn)}}function Zp(t){if(Gs=!1,dc(t),!js)if(rr(xr)!==null)js=!0,gi||(gi=!0,mi());else{var e=rr(fn);e!==null&&Xp(Zp,e.startTime-t)}}var gi=!1,Ws=-1,Wb=5,Zb=-1;function Xb(){return Wp?!0:!(Ue.unstable_now()-Zb<Wb)}function Vp(){if(Wp=!1,gi){var t=Ue.unstable_now();Zb=t;var e=!0;try{e:{js=!1,Gs&&(Gs=!1,Gb(Ws),Ws=-1),Gp=!0;var a=kt;try{t:{for(dc(t),xa=rr(xr);xa!==null&&!(xa.expirationTime>t&&Xb());){var r=xa.callback;if(typeof r=="function"){xa.callback=null,kt=xa.priorityLevel;var n=r(xa.expirationTime<=t);if(t=Ue.unstable_now(),typeof n=="function"){xa.callback=n,dc(t),e=!0;break t}xa===rr(xr)&&fc(xr),dc(t)}else fc(xr);xa=rr(xr)}if(xa!==null)e=!0;else{var o=rr(fn);o!==null&&Xp(Zp,o.startTime-t),e=!1}}break e}finally{xa=null,kt=a,Gp=!1}e=void 0}}finally{e?mi():gi=!1}}}var mi;typeof Vb=="function"?mi=function(){Vb(Vp)}:typeof MessageChannel<"u"?($p=new MessageChannel,$b=$p.port2,$p.port1.onmessage=Vp,mi=function(){$b.postMessage(null)}):mi=function(){jb(Vp,0)};var $p,$b;function Xp(t,e){Ws=jb(function(){t(Ue.unstable_now())},e)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(t){t.callback=null};Ue.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"):Wb=0<t?Math.floor(1e3/t):5};Ue.unstable_getCurrentPriorityLevel=function(){return kt};Ue.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var a=kt;kt=e;try{return t()}finally{kt=a}};Ue.unstable_requestPaint=function(){Wp=!0};Ue.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=kt;kt=t;try{return e()}finally{kt=a}};Ue.unstable_scheduleCallback=function(t,e,a){var r=Ue.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,t){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,t={id:eT++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,jp(fn,t),rr(xr)===null&&t===rr(fn)&&(Gs?(Gb(Ws),Ws=-1):Gs=!0,Xp(Zp,a-r))):(t.sortIndex=n,jp(xr,t),js||Gp||(js=!0,gi||(gi=!0,mi()))),t};Ue.unstable_shouldYield=Xb;Ue.unstable_wrapCallback=function(t){var e=kt;return function(){var a=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=a}}}});var Qb=tr((sH,Kb)=>{"use strict";Kb.exports=Yb()});var cw=tr(Nd=>{"use strict";var it=Qb(),w0=We(),tT=$s();function D(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}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 L0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Dl(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function I0(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 A0(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 Jb(t){if(Dl(t)!==t)throw Error(D(188))}function aT(t){var e=t.alternate;if(!e){if(e=Dl(t),e===null)throw Error(D(188));return e!==t?null:t}for(var a=t,r=e;;){var n=a.return;if(n===null)break;var o=n.alternate;if(o===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===a)return Jb(n),t;if(o===r)return Jb(n),e;o=o.sibling}throw Error(D(188))}if(a.return!==r.return)a=n,r=o;else{for(var i=!1,s=n.child;s;){if(s===a){i=!0,a=n,r=o;break}if(s===r){i=!0,r=n,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,r=n;break}if(s===r){i=!0,r=o,a=n;break}s=s.sibling}if(!i)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?t:e}function k0(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=k0(t),e!==null)return e;t=t.sibling}return null}var Pe=Object.assign,rT=Symbol.for("react.element"),pc=Symbol.for("react.transitional.element"),tl=Symbol.for("react.portal"),Ci=Symbol.for("react.fragment"),E0=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),T0=Symbol.for("react.consumer"),Ar=Symbol.for("react.context"),wm=Symbol.for("react.forward_ref"),Th=Symbol.for("react.suspense"),Rh=Symbol.for("react.suspense_list"),Lm=Symbol.for("react.memo"),pn=Symbol.for("react.lazy"),Mh=Symbol.for("react.activity"),nT=Symbol.for("react.memo_cache_sentinel"),eS=Symbol.iterator;function Zs(t){return t===null||typeof t!="object"?null:(t=eS&&t[eS]||t["@@iterator"],typeof t=="function"?t:null)}var oT=Symbol.for("react.client.reference");function Dh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oT?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ci:return"Fragment";case Eh:return"Profiler";case E0:return"StrictMode";case Th:return"Suspense";case Rh:return"SuspenseList";case Mh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case tl:return"Portal";case Ar:return t.displayName||"Context";case T0:return(t._context.displayName||"Context")+".Consumer";case wm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Lm:return e=t.displayName||null,e!==null?e:Dh(t.type)||"Memo";case pn:e=t._payload,t=t._init;try{return Dh(t(e))}catch{}}return null}var al=Array.isArray,te=w0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=tT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bo={pending:!1,data:null,method:null,action:null},Oh=[],_i=-1;function lr(t){return{current:t}}function ht(t){0>_i||(t.current=Oh[_i],Oh[_i]=null,_i--)}function Re(t,e){_i++,Oh[_i]=t.current,t.current=e}var sr=lr(null),xl=lr(null),wn=lr(null),Gc=lr(null);function Wc(t,e){switch(Re(wn,e),Re(xl,t),Re(sr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?s0(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=s0(e),t=Y_(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(sr),Re(sr,t)}function qi(){ht(sr),ht(xl),ht(wn)}function Bh(t){t.memoizedState!==null&&Re(Gc,t);var e=sr.current,a=Y_(e,t.type);e!==a&&(Re(xl,t),Re(sr,a))}function Zc(t){xl.current===t&&(ht(sr),ht(xl)),Gc.current===t&&(ht(Gc),Tl._currentValue=bo)}var Yp,tS;function go(t){if(Yp===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Yp=e&&e[1]||"",tS=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Kp+t+tS}var Qp=!1;function Jp(t,e){if(!t||Qp)return"";Qp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={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(m){var h=m}Reflect.construct(t,[],d)}else{try{d.call()}catch(m){h=m}t.call(d.prototype)}}else{try{throw Error()}catch(m){h=m}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(m){if(m&&h&&typeof m.stack=="string")return[m.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
3
+ `+Yp+t+tS}var Kp=!1;function Qp(t,e){if(!t||Kp)return"";Kp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={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(m){var h=m}Reflect.construct(t,[],d)}else{try{d.call()}catch(m){h=m}t.call(d.prototype)}}else{try{throw Error()}catch(m){h=m}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(m){if(m&&h&&typeof m.stack=="string")return[m.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
4
4
  `),u=s.split(`
5
5
  `);for(n=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(r===l.length||n===u.length)for(r=l.length-1,n=u.length-1;1<=r&&0<=n&&l[r]!==u[n];)n--;for(;1<=r&&0<=n;r--,n--)if(l[r]!==u[n]){if(r!==1||n!==1)do if(r--,n--,0>n||l[r]!==u[n]){var c=`
6
- `+l[r].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=r&&0<=n);break}}}finally{Qp=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?go(a):""}function iT(t,e){switch(t.tag){case 26:case 27:case 5:return go(t.type);case 16:return go("Lazy");case 13:return t.child!==e&&e!==null?go("Suspense Fallback"):go("Suspense");case 19:return go("SuspenseList");case 0:case 15:return Jp(t.type,!1);case 11:return Jp(t.type.render,!1);case 1:return Jp(t.type,!0);case 31:return go("Activity");default:return""}}function aS(t){try{var e="",a=null;do e+=iT(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
6
+ `+l[r].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=r&&0<=n);break}}}finally{Kp=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?go(a):""}function iT(t,e){switch(t.tag){case 26:case 27:case 5:return go(t.type);case 16:return go("Lazy");case 13:return t.child!==e&&e!==null?go("Suspense Fallback"):go("Suspense");case 19:return go("SuspenseList");case 0:case 15:return Qp(t.type,!1);case 11:return Qp(t.type.render,!1);case 1:return Qp(t.type,!0);case 31:return go("Activity");default:return""}}function aS(t){try{var e="",a=null;do e+=iT(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
7
7
  Error generating stack: `+r.message+`
8
- `+r.stack}}var Nh=Object.prototype.hasOwnProperty,Am=it.unstable_scheduleCallback,eh=it.unstable_cancelCallback,sT=it.unstable_shouldYield,lT=it.unstable_requestPaint,sa=it.unstable_now,uT=it.unstable_getCurrentPriorityLevel,R0=it.unstable_ImmediatePriority,M0=it.unstable_UserBlockingPriority,Yc=it.unstable_NormalPriority,cT=it.unstable_LowPriority,D0=it.unstable_IdlePriority,dT=it.log,fT=it.unstable_setDisableYieldValue,Ol=null,la=null;function xn(t){if(typeof dT=="function"&&fT(t),la&&typeof la.setStrictMode=="function")try{la.setStrictMode(Ol,t)}catch{}}var ua=Math.clz32?Math.clz32:mT,pT=Math.log,hT=Math.LN2;function mT(t){return t>>>=0,t===0?32:31-(pT(t)/hT|0)|0}var mc=256,gc=262144,vc=4194304;function vo(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,a){var r=t.pendingLanes;if(r===0)return 0;var n=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?n=vo(r):(i&=s,i!==0?n=vo(i):a||(a=s&~t,a!==0&&(n=vo(a))))):(s=r&~o,s!==0?n=vo(s):i!==0?n=vo(i):a||(a=r&~t,a!==0&&(n=vo(a)))),n===0?0:e!==0&&e!==n&&(e&o)===0&&(o=n&-n,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:n}function Bl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function gT(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 O0(){var t=vc;return vc<<=1,(vc&62914560)===0&&(vc=4194304),t}function th(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Fl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vT(t,e,a,r,n,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-ua(a),d=1<<c;s[c]=0,l[c]=-1;var h=u[c];if(h!==null)for(u[c]=null,c=0;c<h.length;c++){var m=h[c];m!==null&&(m.lane&=-536870913)}a&=~d}r!==0&&B0(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function B0(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-ua(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function F0(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-ua(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function N0(t,e){var a=e&-e;return a=(a&42)!==0?1:km(a),(a&(t.suspendedLanes|e))!==0?0:a}function km(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 Em(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function P0(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:sw(t.type))}function rS(t,e){var a=xe.p;try{return xe.p=t,e()}finally{xe.p=a}}var Nn=Math.random().toString(36).slice(2),yt="__reactFiber$"+Nn,Wt="__reactProps$"+Nn,Qi="__reactContainer$"+Nn,Ph="__reactEvents$"+Nn,yT="__reactListeners$"+Nn,xT="__reactHandles$"+Nn,nS="__reactResources$"+Nn,Nl="__reactMarker$"+Nn;function Tm(t){delete t[yt],delete t[Wt],delete t[Ph],delete t[yT],delete t[xT]}function wi(t){var e=t[yt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[Qi]||a[yt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=f0(t);t!==null;){if(a=t[yt])return a;t=f0(t)}return e}t=a,a=t.parentNode}return null}function Ji(t){if(t=t[yt]||t[Qi]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function rl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(D(33))}function Oi(t){var e=t[nS];return e||(e=t[nS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function pt(t){t[Nl]=!0}var H0=new Set,U0={};function To(t,e){zi(t,e),zi(t+"Capture",e)}function zi(t,e){for(U0[t]=e,t=0;t<e.length;t++)H0.add(e[t])}var bT=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]*$"),oS={},iS={};function ST(t){return Nh.call(iS,t)?!0:Nh.call(oS,t)?!1:bT.test(t)?iS[t]=!0:(oS[t]=!0,!1)}function Mc(t,e,a){if(ST(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function yc(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function br(t,e,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+r)}}function Sa(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function q0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function CT(t,e,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Hh(t){if(!t._valueTracker){var e=q0(t)?"checked":"value";t._valueTracker=CT(t,e,""+t[e])}}function z0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=q0(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Kc(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 _T=/[\n"\\]/g;function wa(t){return t.replace(_T,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Uh(t,e,a,r,n,o,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),e!=null?i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Sa(e)):t.value!==""+Sa(e)&&(t.value=""+Sa(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?qh(t,i,Sa(e)):a!=null?qh(t,i,Sa(a)):r!=null&&t.removeAttribute("value"),n==null&&o!=null&&(t.defaultChecked=!!o),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Sa(s):t.removeAttribute("name")}function V0(t,e,a,r,n,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Hh(t);return}a=a!=null?""+Sa(a):"",e=e!=null?""+Sa(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Hh(t)}function qh(t,e,a){e==="number"&&Kc(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Bi(t,e,a,r){if(t=t.options,e){e={};for(var n=0;n<a.length;n++)e["$"+a[n]]=!0;for(a=0;a<t.length;a++)n=e.hasOwnProperty("$"+t[a].value),t[a].selected!==n&&(t[a].selected=n),n&&r&&(t[a].defaultSelected=!0)}else{for(a=""+Sa(a),e=null,n=0;n<t.length;n++){if(t[n].value===a){t[n].selected=!0,r&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function $0(t,e,a){if(e!=null&&(e=""+Sa(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Sa(a):""}function j0(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(D(92));if(al(r)){if(1<r.length)throw Error(D(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Sa(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Hh(t)}function Vi(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var wT=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 sS(t,e,a){var r=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,a):typeof a!="number"||a===0||wT.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function G0(t,e,a){if(e!=null&&typeof e!="object")throw Error(D(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var n in e)r=e[n],e.hasOwnProperty(n)&&a[n]!==r&&sS(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&sS(t,o,e[o])}function Rm(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 LT=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"]]),IT=/^[\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 Dc(t){return IT.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function kr(){}var zh=null;function Mm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Li=null,Fi=null;function lS(t){var e=Ji(t);if(e&&(t=e.stateNode)){var a=t[Wt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Uh(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[Wt]||null;if(!n)throw Error(D(90));Uh(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(e=0;e<a.length;e++)r=a[e],r.form===t.form&&z0(r)}break e;case"textarea":$0(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Bi(t,!!a.multiple,e,!1)}}}var ah=!1;function W0(t,e,a){if(ah)return t(e,a);ah=!0;try{var r=t(e);return r}finally{if(ah=!1,(Li!==null||Fi!==null)&&(Od(),Li&&(e=Li,t=Fi,Fi=Li=null,lS(e),t)))for(e=0;e<t.length;e++)lS(t[e])}}function bl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[Wt]||null;if(r===null)return null;a=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(D(231,e,typeof a));return a}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=!1;if(Dr)try{vi={},Object.defineProperty(vi,"passive",{get:function(){Vh=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{Vh=!1}var vi,bn=null,Dm=null,Oc=null;function Z0(){if(Oc)return Oc;var t,e=Dm,a=e.length,r,n="value"in bn?bn.value:bn.textContent,o=n.length;for(t=0;t<a&&e[t]===n[t];t++);var i=a-t;for(r=1;r<=i&&e[a-r]===n[o-r];r++);return Oc=n.slice(t,1<r?1-r:void 0)}function Bc(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 xc(){return!0}function uS(){return!1}function Zt(t){function e(a,r,n,o,i){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(a=t[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?xc:uS,this.isPropagationStopped=uS,this}return Pe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=xc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=xc)},persist:function(){},isPersistent:xc}),e}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_d=Zt(Ro),Pl=Pe({},Ro,{view:0,detail:0}),AT=Zt(Pl),rh,nh,Xs,wd=Pe({},Pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Om,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!==Xs&&(Xs&&t.type==="mousemove"?(rh=t.screenX-Xs.screenX,nh=t.screenY-Xs.screenY):nh=rh=0,Xs=t),rh)},movementY:function(t){return"movementY"in t?t.movementY:nh}}),cS=Zt(wd),kT=Pe({},wd,{dataTransfer:0}),ET=Zt(kT),TT=Pe({},Pl,{relatedTarget:0}),oh=Zt(TT),RT=Pe({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),MT=Zt(RT),DT=Pe({},Ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OT=Zt(DT),BT=Pe({},Ro,{data:0}),dS=Zt(BT),FT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NT={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"},PT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=PT[t])?!!e[t]:!1}function Om(){return HT}var UT=Pe({},Pl,{key:function(t){if(t.key){var e=FT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Bc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?NT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Om,charCode:function(t){return t.type==="keypress"?Bc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qT=Zt(UT),zT=Pe({},wd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fS=Zt(zT),VT=Pe({},Pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Om}),$T=Zt(VT),jT=Pe({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),GT=Zt(jT),WT=Pe({},wd,{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}),ZT=Zt(WT),XT=Pe({},Ro,{newState:0,oldState:0}),YT=Zt(XT),KT=[9,13,27,32],Bm=Dr&&"CompositionEvent"in window,il=null;Dr&&"documentMode"in document&&(il=document.documentMode);var QT=Dr&&"TextEvent"in window&&!il,X0=Dr&&(!Bm||il&&8<il&&11>=il),pS=" ",hS=!1;function Y0(t,e){switch(t){case"keyup":return KT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K0(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ii=!1;function JT(t,e){switch(t){case"compositionend":return K0(e);case"keypress":return e.which!==32?null:(hS=!0,pS);case"textInput":return t=e.data,t===pS&&hS?null:t;default:return null}}function eR(t,e){if(Ii)return t==="compositionend"||!Bm&&Y0(t,e)?(t=Z0(),Oc=Dm=bn=null,Ii=!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 X0&&e.locale!=="ko"?null:e.data;default:return null}}var tR={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 mS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tR[t.type]:e==="textarea"}function Q0(t,e,a,r){Li?Fi?Fi.push(r):Fi=[r]:Li=r,e=md(e,"onChange"),0<e.length&&(a=new _d("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var sl=null,Sl=null;function aR(t){W_(t,0)}function Ld(t){var e=rl(t);if(z0(e))return t}function gS(t,e){if(t==="change")return e}var J0=!1;Dr&&(Dr?(Sc="oninput"in document,Sc||(ih=document.createElement("div"),ih.setAttribute("oninput","return;"),Sc=typeof ih.oninput=="function"),bc=Sc):bc=!1,J0=bc&&(!document.documentMode||9<document.documentMode));var bc,Sc,ih;function vS(){sl&&(sl.detachEvent("onpropertychange",eC),Sl=sl=null)}function eC(t){if(t.propertyName==="value"&&Ld(Sl)){var e=[];Q0(e,Sl,t,Mm(t)),W0(aR,e)}}function rR(t,e,a){t==="focusin"?(vS(),sl=e,Sl=a,sl.attachEvent("onpropertychange",eC)):t==="focusout"&&vS()}function nR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ld(Sl)}function oR(t,e){if(t==="click")return Ld(e)}function iR(t,e){if(t==="input"||t==="change")return Ld(e)}function sR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var da=typeof Object.is=="function"?Object.is:sR;function Cl(t,e){if(da(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),r=Object.keys(e);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!Nh.call(e,n)||!da(t[n],e[n]))return!1}return!0}function yS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xS(t,e){var a=yS(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=e&&r>=e)return{node:a,offset:e-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=yS(a)}}function tC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?tC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function aC(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Kc(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Kc(t.document)}return e}function Fm(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 lR=Dr&&"documentMode"in document&&11>=document.documentMode,Ai=null,$h=null,ll=null,jh=!1;function bS(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;jh||Ai==null||Ai!==Kc(r)||(r=Ai,"selectionStart"in r&&Fm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ll&&Cl(ll,r)||(ll=r,r=md($h,"onSelect"),0<r.length&&(e=new _d("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=Ai)))}function mo(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var ki={animationend:mo("Animation","AnimationEnd"),animationiteration:mo("Animation","AnimationIteration"),animationstart:mo("Animation","AnimationStart"),transitionrun:mo("Transition","TransitionRun"),transitionstart:mo("Transition","TransitionStart"),transitioncancel:mo("Transition","TransitionCancel"),transitionend:mo("Transition","TransitionEnd")},sh={},rC={};Dr&&(rC=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function Mo(t){if(sh[t])return sh[t];if(!ki[t])return t;var e=ki[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in rC)return sh[t]=e[a];return t}var nC=Mo("animationend"),oC=Mo("animationiteration"),iC=Mo("animationstart"),uR=Mo("transitionrun"),cR=Mo("transitionstart"),dR=Mo("transitioncancel"),sC=Mo("transitionend"),lC=new Map,Gh="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(" ");Gh.push("scrollEnd");function za(t,e){lC.set(t,e),To(e,[t])}var Qc=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)},ba=[],Ei=0,Nm=0;function Id(){for(var t=Ei,e=Nm=Ei=0;e<t;){var a=ba[e];ba[e++]=null;var r=ba[e];ba[e++]=null;var n=ba[e];ba[e++]=null;var o=ba[e];if(ba[e++]=null,r!==null&&n!==null){var i=r.pending;i===null?n.next=n:(n.next=i.next,i.next=n),r.pending=n}o!==0&&uC(a,n,o)}}function Ad(t,e,a,r){ba[Ei++]=t,ba[Ei++]=e,ba[Ei++]=a,ba[Ei++]=r,Nm|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Pm(t,e,a,r){return Ad(t,e,a,r),Jc(t)}function Do(t,e){return Ad(t,null,null,e),Jc(t)}function uC(t,e,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var n=!1,o=t.return;o!==null;)o.childLanes|=a,r=o.alternate,r!==null&&(r.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(n=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,n&&e!==null&&(n=31-ua(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function Jc(t){if(50<vl)throw vl=0,pm=null,Error(D(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ti={};function fR(t,e,a,r){this.tag=t,this.key=a,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oa(t,e,a,r){return new fR(t,e,a,r)}function Hm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Tr(t,e){var a=t.alternate;return a===null?(a=oa(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function cC(t,e){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Fc(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Hm(t)&&(i=1);else if(typeof t=="string")i=mM(t,a,sr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Dh:return t=oa(31,a,e,n),t.elementType=Dh,t.lanes=o,t;case Ci:return So(a.children,n,o,e);case E0:i=8,n|=24;break;case Th:return t=oa(12,a,e,n|2),t.elementType=Th,t.lanes=o,t;case Rh:return t=oa(13,a,e,n),t.elementType=Rh,t.lanes=o,t;case Mh:return t=oa(19,a,e,n),t.elementType=Mh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ar:i=10;break e;case T0:i=9;break e;case Lm:i=11;break e;case Im:i=14;break e;case pn:i=16,r=null;break e}i=29,a=Error(D(130,t===null?"null":typeof t,"")),r=null}return e=oa(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function So(t,e,a,r){return t=oa(7,t,r,e),t.lanes=a,t}function lh(t,e,a){return t=oa(6,t,null,e),t.lanes=a,t}function dC(t){var e=oa(18,null,null,0);return e.stateNode=t,e}function uh(t,e,a){return e=oa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var SS=new WeakMap;function La(t,e){if(typeof t=="object"&&t!==null){var a=SS.get(t);return a!==void 0?a:(e={value:t,source:e,stack:aS(e)},SS.set(t,e),e)}return{value:t,source:e,stack:aS(e)}}var Ri=[],Mi=0,ed=null,_l=0,Ca=[],_a=0,Dn=null,nr=1,or="";function Lr(t,e){Ri[Mi++]=_l,Ri[Mi++]=ed,ed=t,_l=e}function fC(t,e,a){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Dn,Dn=t;var r=nr;t=or;var n=32-ua(r)-1;r&=~(1<<n),a+=1;var o=32-ua(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,nr=1<<32-ua(e)+n|a<<n|r,or=o+t}else nr=1<<o|a<<n|r,or=t}function Um(t){t.return!==null&&(Lr(t,1),fC(t,1,0))}function qm(t){for(;t===ed;)ed=Ri[--Mi],Ri[Mi]=null,_l=Ri[--Mi],Ri[Mi]=null;for(;t===Dn;)Dn=Ca[--_a],Ca[_a]=null,or=Ca[--_a],Ca[_a]=null,nr=Ca[--_a],Ca[_a]=null}function pC(t,e){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Dn,nr=e.id,or=e.overflow,Dn=t}var xt=null,Ne=null,me=!1,Ln=null,Ia=!1,Wh=Error(D(519));function On(t){var e=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wl(La(e,t)),Wh}function CS(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[yt]=t,e[Wt]=r,a){case"dialog":ce("cancel",e),ce("close",e);break;case"iframe":case"object":case"embed":ce("load",e);break;case"video":case"audio":for(a=0;a<kl.length;a++)ce(kl[a],e);break;case"source":ce("error",e);break;case"img":case"image":case"link":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"input":ce("invalid",e),V0(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ce("invalid",e);break;case"textarea":ce("invalid",e),j0(e,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||r.suppressHydrationWarning===!0||X_(e.textContent,a)?(r.popover!=null&&(ce("beforetoggle",e),ce("toggle",e)),r.onScroll!=null&&ce("scroll",e),r.onScrollEnd!=null&&ce("scrollend",e),r.onClick!=null&&(e.onclick=kr),e=!0):e=!1,e||On(t,!0)}function _S(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 31:case 13:Ia=!1;return;case 27:case 3:Ia=!0;return;default:xt=xt.return}}function yi(t){if(t!==xt)return!1;if(!me)return _S(t),me=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||ym(t.type,t.memoizedProps)),a=!a),a&&Ne&&On(t),_S(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));Ne=d0(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));Ne=d0(t)}else e===27?(e=Ne,Pn(t.type)?(t=Cm,Cm=null,Ne=t):Ne=e):Ne=xt?ka(t.stateNode.nextSibling):null;return!0}function Lo(){Ne=xt=null,me=!1}function ch(){var t=Ln;return t!==null&&(jt===null?jt=t:jt.push.apply(jt,t),Ln=null),t}function wl(t){Ln===null?Ln=[t]:Ln.push(t)}var Zh=lr(null),Oo=null,Er=null;function mn(t,e,a){Re(Zh,e._currentValue),e._currentValue=a}function Rr(t){t._currentValue=Zh.current,ht(Zh)}function Xh(t,e,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===a)break;t=t.return}}function Yh(t,e,a,r){var n=t.child;for(n!==null&&(n.return=t);n!==null;){var o=n.dependencies;if(o!==null){var i=n.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=n;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),Xh(o.return,a,t),r||(i=null);break e}o=s.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(D(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Xh(i,a,t),i=null}else i=n.child;if(i!==null)i.return=n;else for(i=n;i!==null;){if(i===t){i=null;break}if(n=i.sibling,n!==null){n.return=i.return,i=n;break}i=i.return}n=i}}function es(t,e,a,r){t=null;for(var n=e,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(D(387));if(i=i.memoizedProps,i!==null){var s=n.type;da(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===Wc.current){if(i=n.alternate,i===null)throw Error(D(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(Tl):t=[Tl])}n=n.return}t!==null&&Yh(e,t,a,r),e.flags|=262144}function td(t){for(t=t.firstContext;t!==null;){if(!da(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Io(t){Oo=t,Er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return hC(Oo,t)}function Cc(t,e){return Oo===null&&Io(t),hC(t,e)}function hC(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Er===null){if(t===null)throw Error(D(308));Er=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Er=Er.next=e;return a}var pR=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},hR=it.unstable_scheduleCallback,mR=it.unstable_NormalPriority,at={$$typeof:Ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zm(){return{controller:new pR,data:new Map,refCount:0}}function Hl(t){t.refCount--,t.refCount===0&&hR(mR,function(){t.controller.abort()})}var ul=null,Kh=0,$i=0,Ni=null;function gR(t,e){if(ul===null){var a=ul=[];Kh=0,$i=pg(),Ni={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Kh++,e.then(wS,wS),e}function wS(){if(--Kh===0&&ul!==null){Ni!==null&&(Ni.status="fulfilled");var t=ul;ul=null,$i=0,Ni=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function vR(t,e){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var n=0;n<a.length;n++)(0,a[n])(e)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var LS=te.S;te.S=function(t,e){k_=sa(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&gR(t,e),LS!==null&&LS(t,e)};var Co=lr(null);function Vm(){var t=Co.current;return t!==null?t:Ae.pooledCache}function Nc(t,e){e===null?Re(Co,Co.current):Re(Co,e.pool)}function mC(){var t=Vm();return t===null?null:{parent:at._currentValue,pool:t}}var ts=Error(D(460)),$m=Error(D(474)),kd=Error(D(542)),ad={then:function(){}};function IS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function gC(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(kr,kr),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kS(t),t;default:if(typeof e.status=="string")e.then(kr,kr);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(D(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=r}},function(r){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kS(t),t}throw _o=e,ts}}function yo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(_o=a,ts):a}}var _o=null;function AS(){if(_o===null)throw Error(D(459));var t=_o;return _o=null,t}function kS(t){if(t===ts||t===kd)throw Error(D(483))}var Pi=null,Ll=0;function _c(t){var e=Ll;return Ll+=1,Pi===null&&(Pi=[]),gC(Pi,t,e)}function Ys(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function wc(t,e){throw e.$$typeof===rT?Error(D(525)):(t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function vC(t){function e(f,g){if(t){var v=f.deletions;v===null?(f.deletions=[g],f.flags|=16):v.push(g)}}function a(f,g){if(!t)return null;for(;g!==null;)e(f,g),g=g.sibling;return null}function r(f){for(var g=new Map;f!==null;)f.key!==null?g.set(f.key,f):g.set(f.index,f),f=f.sibling;return g}function n(f,g){return f=Tr(f,g),f.index=0,f.sibling=null,f}function o(f,g,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<g?(f.flags|=67108866,g):v):(f.flags|=67108866,g)):(f.flags|=1048576,g)}function i(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,g,v,y){return g===null||g.tag!==6?(g=lh(v,f.mode,y),g.return=f,g):(g=n(g,v),g.return=f,g)}function l(f,g,v,y){var _=v.type;return _===Ci?c(f,g,v.props.children,y,v.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pn&&yo(_)===g.type)?(g=n(g,v.props),Ys(g,v),g.return=f,g):(g=Fc(v.type,v.key,v.props,null,f.mode,y),Ys(g,v),g.return=f,g)}function u(f,g,v,y){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=uh(v,f.mode,y),g.return=f,g):(g=n(g,v.children||[]),g.return=f,g)}function c(f,g,v,y,_){return g===null||g.tag!==7?(g=So(v,f.mode,y,_),g.return=f,g):(g=n(g,v),g.return=f,g)}function d(f,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=lh(""+g,f.mode,v),g.return=f,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case hc:return v=Fc(g.type,g.key,g.props,null,f.mode,v),Ys(v,g),v.return=f,v;case tl:return g=uh(g,f.mode,v),g.return=f,g;case pn:return g=yo(g),d(f,g,v)}if(al(g)||Zs(g))return g=So(g,f.mode,v,null),g.return=f,g;if(typeof g.then=="function")return d(f,_c(g),v);if(g.$$typeof===Ar)return d(f,Cc(f,g),v);wc(f,g)}return null}function h(f,g,v,y){var _=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(f,g,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:return v.key===_?l(f,g,v,y):null;case tl:return v.key===_?u(f,g,v,y):null;case pn:return v=yo(v),h(f,g,v,y)}if(al(v)||Zs(v))return _!==null?null:c(f,g,v,y,null);if(typeof v.then=="function")return h(f,g,_c(v),y);if(v.$$typeof===Ar)return h(f,g,Cc(f,v),y);wc(f,v)}return null}function m(f,g,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(g,f,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case hc:return f=f.get(y.key===null?v:y.key)||null,l(g,f,y,_);case tl:return f=f.get(y.key===null?v:y.key)||null,u(g,f,y,_);case pn:return y=yo(y),m(f,g,v,y,_)}if(al(y)||Zs(y))return f=f.get(v)||null,c(g,f,y,_,null);if(typeof y.then=="function")return m(f,g,v,_c(y),_);if(y.$$typeof===Ar)return m(f,g,v,Cc(g,y),_);wc(g,y)}return null}function S(f,g,v,y){for(var _=null,w=null,C=g,L=g=0,k=null;C!==null&&L<v.length;L++){C.index>L?(k=C,C=null):k=C.sibling;var A=h(f,C,v[L],y);if(A===null){C===null&&(C=k);break}t&&C&&A.alternate===null&&e(f,C),g=o(A,g,L),w===null?_=A:w.sibling=A,w=A,C=k}if(L===v.length)return a(f,C),me&&Lr(f,L),_;if(C===null){for(;L<v.length;L++)C=d(f,v[L],y),C!==null&&(g=o(C,g,L),w===null?_=C:w.sibling=C,w=C);return me&&Lr(f,L),_}for(C=r(C);L<v.length;L++)k=m(C,f,L,v[L],y),k!==null&&(t&&k.alternate!==null&&C.delete(k.key===null?L:k.key),g=o(k,g,L),w===null?_=k:w.sibling=k,w=k);return t&&C.forEach(function(M){return e(f,M)}),me&&Lr(f,L),_}function b(f,g,v,y){if(v==null)throw Error(D(151));for(var _=null,w=null,C=g,L=g=0,k=null,A=v.next();C!==null&&!A.done;L++,A=v.next()){C.index>L?(k=C,C=null):k=C.sibling;var M=h(f,C,A.value,y);if(M===null){C===null&&(C=k);break}t&&C&&M.alternate===null&&e(f,C),g=o(M,g,L),w===null?_=M:w.sibling=M,w=M,C=k}if(A.done)return a(f,C),me&&Lr(f,L),_;if(C===null){for(;!A.done;L++,A=v.next())A=d(f,A.value,y),A!==null&&(g=o(A,g,L),w===null?_=A:w.sibling=A,w=A);return me&&Lr(f,L),_}for(C=r(C);!A.done;L++,A=v.next())A=m(C,f,L,A.value,y),A!==null&&(t&&A.alternate!==null&&C.delete(A.key===null?L:A.key),g=o(A,g,L),w===null?_=A:w.sibling=A,w=A);return t&&C.forEach(function(T){return e(f,T)}),me&&Lr(f,L),_}function x(f,g,v,y){if(typeof v=="object"&&v!==null&&v.type===Ci&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:e:{for(var _=v.key;g!==null;){if(g.key===_){if(_=v.type,_===Ci){if(g.tag===7){a(f,g.sibling),y=n(g,v.props.children),y.return=f,f=y;break e}}else if(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pn&&yo(_)===g.type){a(f,g.sibling),y=n(g,v.props),Ys(y,v),y.return=f,f=y;break e}a(f,g);break}else e(f,g);g=g.sibling}v.type===Ci?(y=So(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Fc(v.type,v.key,v.props,null,f.mode,y),Ys(y,v),y.return=f,f=y)}return i(f);case tl:e:{for(_=v.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){a(f,g.sibling),y=n(g,v.children||[]),y.return=f,f=y;break e}else{a(f,g);break}else e(f,g);g=g.sibling}y=uh(v,f.mode,y),y.return=f,f=y}return i(f);case pn:return v=yo(v),x(f,g,v,y)}if(al(v))return S(f,g,v,y);if(Zs(v)){if(_=Zs(v),typeof _!="function")throw Error(D(150));return v=_.call(v),b(f,g,v,y)}if(typeof v.then=="function")return x(f,g,_c(v),y);if(v.$$typeof===Ar)return x(f,g,Cc(f,v),y);wc(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(a(f,g.sibling),y=n(g,v),y.return=f,f=y):(a(f,g),y=lh(v,f.mode,y),y.return=f,f=y),i(f)):a(f,g)}return function(f,g,v,y){try{Ll=0;var _=x(f,g,v,y);return Pi=null,_}catch(C){if(C===ts||C===kd)throw C;var w=oa(29,C,null,f.mode);return w.lanes=y,w.return=f,w}}}var Ao=vC(!0),yC=vC(!1),hn=!1;function jm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qh(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 In(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function An(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(ye&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=Jc(t),uC(t,null,a),e}return Ad(t,r,e,a),Jc(t)}function cl(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,F0(t,a)}}function dh(t,e){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?n=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?n=o=e:o=o.next=e}else n=o=e;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var Jh=!1;function dl(){if(Jh){var t=Ni;if(t!==null)throw t}}function fl(t,e,a,r){Jh=!1;var n=t.updateQueue;hn=!1;var o=n.firstBaseUpdate,i=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=n.baseState;i=0,c=u=l=null,s=o;do{var h=s.lane&-536870913,m=h!==s.lane;if(m?(he&h)===h:(r&h)===h){h!==0&&h===$i&&(Jh=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;h=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,h=typeof S=="function"?S.call(x,d,h):S,h==null)break e;d=Pe({},d,h);break e;case 2:hn=!0}}h=s.callback,h!==null&&(t.flags|=64,m&&(t.flags|=8192),m=n.callbacks,m===null?n.callbacks=[h]:m.push(h))}else m={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,i|=h;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;m=s,s=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);c===null&&(l=d),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,o===null&&(n.shared.lanes=0),Fn|=i,t.lanes=i,t.memoizedState=d}}function xC(t,e){if(typeof t!="function")throw Error(D(191,t));t.call(e)}function bC(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)xC(a[t],e)}var ji=lr(null),rd=lr(0);function ES(t,e){t=Nr,Re(rd,t),Re(ji,e),Nr=t|e.baseLanes}function em(){Re(rd,Nr),Re(ji,ji.current)}function Gm(){Nr=rd.current,ht(ji),ht(rd)}var fa=lr(null),Aa=null;function gn(t){var e=t.alternate;Re(Ke,Ke.current&1),Re(fa,t),Aa===null&&(e===null||ji.current!==null||e.memoizedState!==null)&&(Aa=t)}function tm(t){Re(Ke,Ke.current),Re(fa,t),Aa===null&&(Aa=t)}function SC(t){t.tag===22?(Re(Ke,Ke.current),Re(fa,t),Aa===null&&(Aa=t)):vn(t)}function vn(){Re(Ke,Ke.current),Re(fa,fa.current)}function na(t){ht(fa),Aa===t&&(Aa=null),ht(Ke)}var Ke=lr(0);function nd(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||bm(a)||Sm(a)))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 Or=0,se=null,Le=null,et=null,od=!1,Hi=!1,ko=!1,id=0,Il=0,Ui=null,yR=0;function Ze(){throw Error(D(321))}function Wm(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!da(t[a],e[a]))return!1;return!0}function Zm(t,e,a,r,n,o){return Or=o,se=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,te.H=t===null||t.memoizedState===null?QC:og,ko=!1,o=a(r,n),ko=!1,Hi&&(o=_C(e,a,r,n)),CC(t),o}function CC(t){te.H=Al;var e=Le!==null&&Le.next!==null;if(Or=0,et=Le=se=null,od=!1,Il=0,Ui=null,e)throw Error(D(300));t===null||rt||(t=t.dependencies,t!==null&&td(t)&&(rt=!0))}function _C(t,e,a,r){se=t;var n=0;do{if(Hi&&(Ui=null),Il=0,Hi=!1,25<=n)throw Error(D(301));if(n+=1,et=Le=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}te.H=JC,o=e(a,r)}while(Hi);return o}function xR(){var t=te.H,e=t.useState()[0];return e=typeof e.then=="function"?Ul(e):e,t=t.useState()[0],(Le!==null?Le.memoizedState:null)!==t&&(se.flags|=1024),e}function Xm(){var t=id!==0;return id=0,t}function Ym(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Km(t){if(od){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}od=!1}Or=0,et=Le=se=null,Hi=!1,Il=id=0,Ui=null}function Bt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?se.memoizedState=et=t:et=et.next=t,et}function Qe(){if(Le===null){var t=se.alternate;t=t!==null?t.memoizedState:null}else t=Le.next;var e=et===null?se.memoizedState:et.next;if(e!==null)et=e,Le=t;else{if(t===null)throw se.alternate===null?Error(D(467)):Error(D(310));Le=t,t={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},et===null?se.memoizedState=et=t:et=et.next=t}return et}function Ed(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(t){var e=Il;return Il+=1,Ui===null&&(Ui=[]),t=gC(Ui,t,e),e=se,(et===null?e.memoizedState:et.next)===null&&(e=e.alternate,te.H=e===null||e.memoizedState===null?QC:og),t}function Td(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ul(t);if(t.$$typeof===Ar)return bt(t)}throw Error(D(438,String(t)))}function Qm(t){var e=null,a=se.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var r=se.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(n){return n.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=Ed(),se.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),r=0;r<t;r++)a[r]=nT;return e.index++,a}function Br(t,e){return typeof e=="function"?e(t):e}function Pc(t){var e=Qe();return Jm(e,Le,t)}function Jm(t,e,a){var r=t.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=a;var n=t.baseQueue,o=r.pending;if(o!==null){if(n!==null){var i=n.next;n.next=o.next,o.next=i}e.baseQueue=n=o,r.pending=null}if(o=t.baseState,n===null)t.memoizedState=o;else{e=n.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(he&d)===d:(Or&d)===d){var h=u.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===$i&&(c=!0);else if((Or&h)===h){u=u.next,h===$i&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,se.lanes|=h,Fn|=h;d=u.action,ko&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else h={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=h,i=o):l=l.next=h,se.lanes|=d,Fn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!da(o,t.memoizedState)&&(rt=!0,c&&(a=Ni,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,r.lastRenderedState=o}return n===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function fh(t){var e=Qe(),a=e.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=t;var r=a.dispatch,n=a.pending,o=e.memoizedState;if(n!==null){a.pending=null;var i=n=n.next;do o=t(o,i.action),i=i.next;while(i!==n);da(o,e.memoizedState)||(rt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function wC(t,e,a){var r=se,n=Qe(),o=me;if(o){if(a===void 0)throw Error(D(407));a=a()}else a=e();var i=!da((Le||n).memoizedState,a);if(i&&(n.memoizedState=a,rt=!0),n=n.queue,eg(AC.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,Gi(9,{destroy:void 0},IC.bind(null,r,n,a,e),null),Ae===null)throw Error(D(349));o||(Or&127)!==0||LC(r,e,a)}return a}function LC(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=se.updateQueue,e===null?(e=Ed(),se.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function IC(t,e,a,r){e.value=a,e.getSnapshot=r,kC(e)&&EC(t)}function AC(t,e,a){return a(function(){kC(e)&&EC(t)})}function kC(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!da(t,a)}catch{return!0}}function EC(t){var e=Do(t,2);e!==null&&Gt(e,t,2)}function am(t){var e=Bt();if(typeof t=="function"){var a=t;if(t=a(),ko){xn(!0);try{a()}finally{xn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:t},e}function TC(t,e,a,r){return t.baseState=a,Jm(t,Le,typeof r=="function"?r:Br)}function bR(t,e,a,r,n){if(Md(t))throw Error(D(485));if(t=e.action,t!==null){var o={payload:n,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};te.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,RC(e,o)):(o.next=a.next,e.pending=a.next=o)}}function RC(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=te.T,i={};te.T=i;try{var s=a(n,r),l=te.S;l!==null&&l(i,s),TS(t,e,s)}catch(u){rm(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),te.T=o}}else try{o=a(n,r),TS(t,e,o)}catch(u){rm(t,e,u)}}function TS(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){RS(t,e,r)},function(r){return rm(t,e,r)}):RS(t,e,a)}function RS(t,e,a){e.status="fulfilled",e.value=a,MC(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,RC(t,a)))}function rm(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,MC(e),e=e.next;while(e!==r)}t.action=null}function MC(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function DC(t,e){return e}function MS(t,e){if(me){var a=Ae.formState;if(a!==null){e:{var r=se;if(me){if(Ne){t:{for(var n=Ne,o=Ia;n.nodeType!==8;){if(!o){n=null;break t}if(n=ka(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ne=ka(n.nextSibling),r=n.data==="F!";break e}}On(r)}r=!1}r&&(e=a[0])}}return a=Bt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DC,lastRenderedState:e},a.queue=r,a=XC.bind(null,se,r),r.dispatch=a,r=am(!1),o=ng.bind(null,se,!1,r.queue),r=Bt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=bR.bind(null,se,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function DS(t){var e=Qe();return OC(e,Le,t)}function OC(t,e,a){if(e=Jm(t,e,DC)[0],t=Pc(Br)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=Ul(e)}catch(i){throw i===ts?kd:i}else r=e;e=Qe();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(se.flags|=2048,Gi(9,{destroy:void 0},SR.bind(null,n,a),null)),[r,o,t]}function SR(t,e){t.action=e}function OS(t){var e=Qe(),a=Le;if(a!==null)return OC(e,a,t);Qe(),e=e.memoizedState,a=Qe();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function Gi(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=se.updateQueue,e===null&&(e=Ed(),se.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,e.lastEffect=t),t}function BC(){return Qe().memoizedState}function Hc(t,e,a,r){var n=Bt();se.flags|=t,n.memoizedState=Gi(1|e,{destroy:void 0},a,r===void 0?null:r)}function Rd(t,e,a,r){var n=Qe();r=r===void 0?null:r;var o=n.memoizedState.inst;Le!==null&&r!==null&&Wm(r,Le.memoizedState.deps)?n.memoizedState=Gi(e,o,a,r):(se.flags|=t,n.memoizedState=Gi(1|e,o,a,r))}function BS(t,e){Hc(8390656,8,t,e)}function eg(t,e){Rd(2048,8,t,e)}function CR(t){se.flags|=4;var e=se.updateQueue;if(e===null)e=Ed(),se.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function FC(t){var e=Qe().memoizedState;return CR({ref:e,nextImpl:t}),function(){if((ye&2)!==0)throw Error(D(440));return e.impl.apply(void 0,arguments)}}function NC(t,e){return Rd(4,2,t,e)}function PC(t,e){return Rd(4,4,t,e)}function HC(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function UC(t,e,a){a=a!=null?a.concat([t]):null,Rd(4,4,HC.bind(null,e,t),a)}function tg(){}function qC(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Wm(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function zC(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Wm(e,r[1]))return r[0];if(r=t(),ko){xn(!0);try{t()}finally{xn(!1)}}return a.memoizedState=[r,e],r}function ag(t,e,a){return a===void 0||(Or&1073741824)!==0&&(he&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=T_(),se.lanes|=t,Fn|=t,a)}function VC(t,e,a,r){return da(a,e)?a:ji.current!==null?(t=ag(t,a,r),da(t,e)||(rt=!0),t):(Or&42)===0||(Or&1073741824)!==0&&(he&261930)===0?(rt=!0,t.memoizedState=a):(t=T_(),se.lanes|=t,Fn|=t,e)}function $C(t,e,a,r,n){var o=xe.p;xe.p=o!==0&&8>o?o:8;var i=te.T,s={};te.T=s,ng(t,!1,e,a);try{var l=n(),u=te.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=vR(l,r);pl(t,e,c,ca(t))}else pl(t,e,r,ca(t))}catch(d){pl(t,e,{then:function(){},status:"rejected",reason:d},ca())}finally{xe.p=o,i!==null&&s.types!==null&&(i.types=s.types),te.T=i}}function _R(){}function nm(t,e,a,r){if(t.tag!==5)throw Error(D(476));var n=jC(t).queue;$C(t,n,e,bo,a===null?_R:function(){return GC(t),a(r)})}function jC(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:bo,baseState:bo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:bo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function GC(t){var e=jC(t);e.next===null&&(e=t.alternate.memoizedState),pl(t,e.next.queue,{},ca())}function rg(){return bt(Tl)}function WC(){return Qe().memoizedState}function ZC(){return Qe().memoizedState}function wR(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ca();t=In(a);var r=An(e,t,a);r!==null&&(Gt(r,e,a),cl(r,e,a)),e={cache:zm()},t.payload=e;return}e=e.return}}function LR(t,e,a){var r=ca();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Md(t)?YC(e,a):(a=Pm(t,e,a,r),a!==null&&(Gt(a,t,r),KC(a,e,r)))}function XC(t,e,a){var r=ca();pl(t,e,a,r)}function pl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Md(t))YC(e,n);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(n.hasEagerState=!0,n.eagerState=s,da(s,i))return Ad(t,e,n,0),Ae===null&&Id(),!1}catch{}if(a=Pm(t,e,n,r),a!==null)return Gt(a,t,r),KC(a,e,r),!0}return!1}function ng(t,e,a,r){if(r={lane:2,revertLane:pg(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Md(t)){if(e)throw Error(D(479))}else e=Pm(t,a,r,2),e!==null&&Gt(e,t,2)}function Md(t){var e=t.alternate;return t===se||e!==null&&e===se}function YC(t,e){Hi=od=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function KC(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,F0(t,a)}}var Al={readContext:bt,use:Td,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};Al.useEffectEvent=Ze;var QC={readContext:bt,use:Td,useCallback:function(t,e){return Bt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:BS,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Hc(4194308,4,HC.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Hc(4194308,4,t,e)},useInsertionEffect:function(t,e){Hc(4,2,t,e)},useMemo:function(t,e){var a=Bt();e=e===void 0?null:e;var r=t();if(ko){xn(!0);try{t()}finally{xn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Bt();if(a!==void 0){var n=a(e);if(ko){xn(!0);try{a(e)}finally{xn(!1)}}}else n=e;return r.memoizedState=r.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},r.queue=t,t=t.dispatch=LR.bind(null,se,t),[r.memoizedState,t]},useRef:function(t){var e=Bt();return t={current:t},e.memoizedState=t},useState:function(t){t=am(t);var e=t.queue,a=XC.bind(null,se,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:tg,useDeferredValue:function(t,e){var a=Bt();return ag(a,t,e)},useTransition:function(){var t=am(!1);return t=$C.bind(null,se,t.queue,!0,!1),Bt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=se,n=Bt();if(me){if(a===void 0)throw Error(D(407));a=a()}else{if(a=e(),Ae===null)throw Error(D(349));(he&127)!==0||LC(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,BS(AC.bind(null,r,o,t),[t]),r.flags|=2048,Gi(9,{destroy:void 0},IC.bind(null,r,o,a,e),null),a},useId:function(){var t=Bt(),e=Ae.identifierPrefix;if(me){var a=or,r=nr;a=(r&~(1<<32-ua(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=id++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=yR++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:rg,useFormState:MS,useActionState:MS,useOptimistic:function(t){var e=Bt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=ng.bind(null,se,!0,a),a.dispatch=e,[t,e]},useMemoCache:Qm,useCacheRefresh:function(){return Bt().memoizedState=wR.bind(null,se)},useEffectEvent:function(t){var e=Bt(),a={impl:t};return e.memoizedState=a,function(){if((ye&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},og={readContext:bt,use:Td,useCallback:qC,useContext:bt,useEffect:eg,useImperativeHandle:UC,useInsertionEffect:NC,useLayoutEffect:PC,useMemo:zC,useReducer:Pc,useRef:BC,useState:function(){return Pc(Br)},useDebugValue:tg,useDeferredValue:function(t,e){var a=Qe();return VC(a,Le.memoizedState,t,e)},useTransition:function(){var t=Pc(Br)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:Ul(t),e]},useSyncExternalStore:wC,useId:WC,useHostTransitionStatus:rg,useFormState:DS,useActionState:DS,useOptimistic:function(t,e){var a=Qe();return TC(a,Le,t,e)},useMemoCache:Qm,useCacheRefresh:ZC};og.useEffectEvent=FC;var JC={readContext:bt,use:Td,useCallback:qC,useContext:bt,useEffect:eg,useImperativeHandle:UC,useInsertionEffect:NC,useLayoutEffect:PC,useMemo:zC,useReducer:fh,useRef:BC,useState:function(){return fh(Br)},useDebugValue:tg,useDeferredValue:function(t,e){var a=Qe();return Le===null?ag(a,t,e):VC(a,Le.memoizedState,t,e)},useTransition:function(){var t=fh(Br)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:Ul(t),e]},useSyncExternalStore:wC,useId:WC,useHostTransitionStatus:rg,useFormState:OS,useActionState:OS,useOptimistic:function(t,e){var a=Qe();return Le!==null?TC(a,Le,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Qm,useCacheRefresh:ZC};JC.useEffectEvent=FC;function ph(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Pe({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var om={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ca(),n=In(r);n.payload=e,a!=null&&(n.callback=a),e=An(t,n,r),e!==null&&(Gt(e,t,r),cl(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ca(),n=In(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=An(t,n,r),e!==null&&(Gt(e,t,r),cl(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ca(),r=In(a);r.tag=2,e!=null&&(r.callback=e),e=An(t,r,a),e!==null&&(Gt(e,t,a),cl(e,t,a))}};function FS(t,e,a,r,n,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,i):e.prototype&&e.prototype.isPureReactComponent?!Cl(a,r)||!Cl(n,o):!0}function NS(t,e,a,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,r),e.state!==t&&om.enqueueReplaceState(e,e.state,null)}function Eo(t,e){var a=e;if("ref"in e){a={};for(var r in e)r!=="ref"&&(a[r]=e[r])}if(t=t.defaultProps){a===e&&(a=Pe({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function e_(t){Qc(t)}function t_(t){console.error(t)}function a_(t){Qc(t)}function sd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function PS(t,e,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function im(t,e,a){return a=In(a),a.tag=3,a.payload={element:null},a.callback=function(){sd(t,e)},a}function r_(t){return t=In(t),t.tag=3,t}function n_(t,e,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var o=r.value;t.payload=function(){return n(o)},t.callback=function(){PS(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){PS(e,a,r),typeof n!="function"&&(kn===null?kn=new Set([this]):kn.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function IR(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&es(e,a,n,!0),a=fa.current,a!==null){switch(a.tag){case 31:case 13:return Aa===null?fd():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===ad?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),wh(t,r,n)),!1;case 22:return a.flags|=65536,r===ad?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([r]):a.add(r)),wh(t,r,n)),!1}throw Error(D(435,a.tag))}return wh(t,r,n),fd(),!1}if(me)return e=fa.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Wh&&(t=Error(D(422),{cause:r}),wl(La(t,a)))):(r!==Wh&&(e=Error(D(423),{cause:r}),wl(La(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=La(r,a),n=im(t.stateNode,r,n),dh(t,n),Xe!==4&&(Xe=2)),!1;var o=Error(D(520),{cause:r});if(o=La(o,a),gl===null?gl=[o]:gl.push(o),Xe!==4&&(Xe=2),e===null)return!0;r=La(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=im(a.stateNode,r,t),dh(a,t),!1;case 1:if(e=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(kn===null||!kn.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=r_(n),n_(n,t,a,r),dh(a,n),!1}a=a.return}while(a!==null);return!1}var ig=Error(D(461)),rt=!1;function vt(t,e,a,r){e.child=t===null?yC(e,null,a,r):Ao(e,t.child,a,r)}function HS(t,e,a,r,n){a=a.render;var o=e.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Io(e),r=Zm(t,e,a,i,o,n),s=Xm(),t!==null&&!rt?(Ym(t,e,n),Fr(t,e,n)):(me&&s&&Um(e),e.flags|=1,vt(t,e,r,n),e.child)}function US(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Hm(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,o_(t,e,o,r,n)):(t=Fc(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!sg(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Cl,a(i,r)&&t.ref===e.ref)return Fr(t,e,n)}return e.flags|=1,t=Tr(o,r),t.ref=e.ref,t.return=e,e.child=t}function o_(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Cl(o,r)&&t.ref===e.ref)if(rt=!1,e.pendingProps=r=o,sg(t,n))(t.flags&131072)!==0&&(rt=!0);else return e.lanes=t.lanes,Fr(t,e,n)}return sm(t,e,a,r,n)}function i_(t,e,a,r){var n=r.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(r=e.child=t.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~o}else r=0,e.child=null;return qS(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Nc(e,o!==null?o.cachePool:null),o!==null?ES(e,o):em(),SC(e);else return r=e.lanes=536870912,qS(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Nc(e,o.cachePool),ES(e,o),vn(e),e.memoizedState=null):(t!==null&&Nc(e,null),em(),vn(e));return vt(t,e,n,a),e.child}function nl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function qS(t,e,a,r,n){var o=Vm();return o=o===null?null:{parent:at._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Nc(e,null),em(),SC(e),t!==null&&es(t,e,r,!0),e.childLanes=n,null}function Uc(t,e){return e=ld({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function zS(t,e,a){return Ao(e,t.child,null,a),t=Uc(e,e.pendingProps),t.flags|=2,na(e),e.memoizedState=null,t}function AR(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(me){if(r.mode==="hidden")return t=Uc(e,r),e.lanes=536870912,nl(null,t);if(tm(e),(t=Ne)?(t=Q_(t,Ia),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=dC(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw On(e);return e.lanes=536870912,null}return Uc(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(tm(e),n)if(e.flags&256)e.flags&=-257,e=zS(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(D(558));else if(rt||es(t,e,a,!1),n=(a&t.childLanes)!==0,rt||n){if(r=Ae,r!==null&&(i=N0(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Do(t,i),Gt(r,t,i),ig;fd(),e=zS(t,e,a)}else t=o.treeContext,Ne=ka(i.nextSibling),xt=e,me=!0,Ln=null,Ia=!1,t!==null&&pC(e,t),e=Uc(e,r),e.flags|=4096;return e}return t=Tr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function qc(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(D(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function sm(t,e,a,r,n){return Io(e),a=Zm(t,e,a,r,void 0,n),r=Xm(),t!==null&&!rt?(Ym(t,e,n),Fr(t,e,n)):(me&&r&&Um(e),e.flags|=1,vt(t,e,a,n),e.child)}function VS(t,e,a,r,n,o){return Io(e),e.updateQueue=null,a=_C(e,r,a,n),CC(t),r=Xm(),t!==null&&!rt?(Ym(t,e,o),Fr(t,e,o)):(me&&r&&Um(e),e.flags|=1,vt(t,e,a,o),e.child)}function $S(t,e,a,r,n){if(Io(e),e.stateNode===null){var o=Ti,i=a.contextType;typeof i=="object"&&i!==null&&(o=bt(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=om,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},jm(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?bt(i):Ti,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(ph(e,a,i,r),o.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&om.enqueueReplaceState(o,o.state,null),fl(e,r,o,n),dl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Eo(a,s);o.props=l;var u=o.context,c=a.contextType;i=Ti,typeof c=="object"&&c!==null&&(i=bt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&NS(e,o,r,i),hn=!1;var h=e.memoizedState;o.state=h,fl(e,r,o,n),dl(),u=e.memoizedState,s||h!==u||hn?(typeof d=="function"&&(ph(e,a,d,r),u=e.memoizedState),(l=hn||FS(e,a,l,r,h,u,i))?(c||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=r,e.memoizedState=u),o.props=r,o.state=u,o.context=i,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Qh(t,e),i=e.memoizedProps,c=Eo(a,i),o.props=c,d=e.pendingProps,h=o.context,u=a.contextType,l=Ti,typeof u=="object"&&u!==null&&(l=bt(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||h!==l)&&NS(e,o,r,l),hn=!1,h=e.memoizedState,o.state=h,fl(e,r,o,n),dl();var m=e.memoizedState;i!==d||h!==m||hn||t!==null&&t.dependencies!==null&&td(t.dependencies)?(typeof s=="function"&&(ph(e,a,s,r),m=e.memoizedState),(c=hn||FS(e,a,c,r,h,m,l)||t!==null&&t.dependencies!==null&&td(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,qc(t,e),r=(e.flags&128)!==0,o||r?(o=e.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&r?(e.child=Ao(e,t.child,null,n),e.child=Ao(e,null,a,n)):vt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Fr(t,e,n),t}function jS(t,e,a,r){return Lo(),e.flags|=256,vt(t,e,a,r),e.child}var hh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mh(t){return{baseLanes:t,cachePool:mC()}}function gh(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=ia),t}function s_(t,e,a){var r=e.pendingProps,n=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(me){if(n?gn(e):vn(e),(t=Ne)?(t=Q_(t,Ia),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=dC(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw On(e);return Sm(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(vn(e),n=e.mode,s=ld({mode:"hidden",children:s},n),r=So(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=mh(a),r.childLanes=gh(t,i,a),e.memoizedState=hh,nl(null,r)):(gn(e),lm(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(gn(e),e.flags&=-257,e=vh(t,e,a)):e.memoizedState!==null?(vn(e),e.child=t.child,e.flags|=128,e=null):(vn(e),s=r.fallback,n=e.mode,r=ld({mode:"visible",children:r.children},n),s=So(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Ao(e,t.child,null,a),r=e.child,r.memoizedState=mh(a),r.childLanes=gh(t,i,a),e.memoizedState=hh,e=nl(null,r));else if(gn(e),Sm(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(D(419)),r.stack="",r.digest=i,wl({value:r,source:null,stack:null}),e=vh(t,e,a)}else if(rt||es(t,e,a,!1),i=(a&t.childLanes)!==0,rt||i){if(i=Ae,i!==null&&(r=N0(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Do(t,r),Gt(i,t,r),ig;bm(s)||fd(),e=vh(t,e,a)}else bm(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ne=ka(s.nextSibling),xt=e,me=!0,Ln=null,Ia=!1,t!==null&&pC(e,t),e=lm(e,r.children),e.flags|=4096);return e}return n?(vn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=Tr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Tr(u,s):(s=So(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,nl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=mh(a):(n=s.cachePool,n!==null?(l=at._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=mC(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=gh(t,i,a),e.memoizedState=hh,nl(t.child,r)):(gn(e),a=t.child,t=a.sibling,a=Tr(a,{mode:"visible",children:r.children}),a.return=e,a.sibling=null,t!==null&&(i=e.deletions,i===null?(e.deletions=[t],e.flags|=16):i.push(t)),e.child=a,e.memoizedState=null,a)}function lm(t,e){return e=ld({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function ld(t,e){return t=oa(22,t,null,e),t.lanes=0,t}function vh(t,e,a){return Ao(e,t.child,null,a),t=lm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function GS(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Xh(t.return,e,a)}function yh(t,e,a,r,n,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=a,i.tailMode=n,i.treeForkCount=o)}function l_(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=Ke.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Re(Ke,i),vt(t,e,r,a),r=me?_l:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&GS(t,a,e);else if(t.tag===19)GS(t,a,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(n){case"forwards":for(a=e.child,n=null;a!==null;)t=a.alternate,t!==null&&nd(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),yh(e,!1,n,a,o,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&nd(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}yh(e,!0,a,null,o,r);break;case"together":yh(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Fr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Fn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(es(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,a=Tr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Tr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function sg(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&td(t)))}function kR(t,e,a){switch(e.tag){case 3:Zc(e,e.stateNode.containerInfo),mn(e,at,t.memoizedState.cache),Lo();break;case 27:case 5:Fh(e);break;case 4:Zc(e,e.stateNode.containerInfo);break;case 10:mn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,tm(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(gn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?s_(t,e,a):(gn(e),t=Fr(t,e,a),t!==null?t.sibling:null);gn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(es(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return l_(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Re(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,i_(t,e,a,e.pendingProps);case 24:mn(e,at,t.memoizedState.cache)}return Fr(t,e,a)}function u_(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)rt=!0;else{if(!sg(t,a)&&(e.flags&128)===0)return rt=!1,kR(t,e,a);rt=(t.flags&131072)!==0}else rt=!1,me&&(e.flags&1048576)!==0&&fC(e,_l,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=yo(e.elementType),e.type=t,typeof t=="function")Hm(t)?(r=Eo(t,r),e.tag=1,e=$S(null,e,t,r,a)):(e.tag=0,e=sm(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===Lm){e.tag=11,e=HS(null,e,t,r,a);break e}else if(n===Im){e.tag=14,e=US(null,e,t,r,a);break e}}throw e=Oh(t)||t,Error(D(306,e,""))}}return e;case 0:return sm(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Eo(r,e.pendingProps),$S(t,e,r,n,a);case 3:e:{if(Zc(e,e.stateNode.containerInfo),t===null)throw Error(D(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,Qh(t,e),fl(e,r,null,a);var i=e.memoizedState;if(r=i.cache,mn(e,at,r),r!==o.cache&&Yh(e,[at],a,!0),dl(),r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=jS(t,e,r,a);break e}else if(r!==n){n=La(Error(D(424)),e),wl(n),e=jS(t,e,r,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ne=ka(t.firstChild),xt=e,me=!0,Ln=null,Ia=!0,a=yC(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Lo(),r===n){e=Fr(t,e,a);break e}vt(t,e,r,a)}e=e.child}return e;case 26:return qc(t,e),t===null?(a=h0(e.type,null,e.pendingProps,null))?e.memoizedState=a:me||(a=e.type,t=e.pendingProps,r=gd(wn.current).createElement(a),r[yt]=e,r[Wt]=t,St(r,a,t),pt(r),e.stateNode=r):e.memoizedState=h0(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Fh(e),t===null&&me&&(r=e.stateNode=J_(e.type,e.pendingProps,wn.current),xt=e,Ia=!0,n=Ne,Pn(e.type)?(Cm=n,Ne=ka(r.firstChild)):Ne=n),vt(t,e,e.pendingProps.children,a),qc(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&me&&((n=r=Ne)&&(r=aM(r,e.type,e.pendingProps,Ia),r!==null?(e.stateNode=r,xt=e,Ne=ka(r.firstChild),Ia=!1,n=!0):n=!1),n||On(e)),Fh(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,ym(n,o)?r=null:i!==null&&ym(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=Zm(t,e,xR,null,null,a),Tl._currentValue=n),qc(t,e),vt(t,e,r,a),e.child;case 6:return t===null&&me&&((t=a=Ne)&&(a=rM(a,e.pendingProps,Ia),a!==null?(e.stateNode=a,xt=e,Ne=null,t=!0):t=!1),t||On(e)),null;case 13:return s_(t,e,a);case 4:return Zc(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ao(e,null,r,a):vt(t,e,r,a),e.child;case 11:return HS(t,e,e.type,e.pendingProps,a);case 7:return vt(t,e,e.pendingProps,a),e.child;case 8:return vt(t,e,e.pendingProps.children,a),e.child;case 12:return vt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,mn(e,e.type,r.value),vt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,Io(e),n=bt(n),r=r(n),e.flags|=1,vt(t,e,r,a),e.child;case 14:return US(t,e,e.type,e.pendingProps,a);case 15:return o_(t,e,e.type,e.pendingProps,a);case 19:return l_(t,e,a);case 31:return AR(t,e,a);case 22:return i_(t,e,a,e.pendingProps);case 24:return Io(e),r=bt(at),t===null?(n=Vm(),n===null&&(n=Ae,o=zm(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},jm(e),mn(e,at,n)):((t.lanes&a)!==0&&(Qh(t,e),fl(e,null,null,a),dl()),n=t.memoizedState,o=e.memoizedState,n.parent!==r?(n={parent:r,cache:r},e.memoizedState=n,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=n),mn(e,at,r)):(r=o.cache,mn(e,at,r),r!==n.cache&&Yh(e,[at],a,!0))),vt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(D(156,e.tag))}function Sr(t){t.flags|=4}function xh(t,e,a,r,n){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(n&335544128)===n)if(t.stateNode.complete)t.flags|=8192;else if(D_())t.flags|=8192;else throw _o=ad,$m}else t.flags&=-16777217}function WS(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!aw(e))if(D_())t.flags|=8192;else throw _o=ad,$m}function Lc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?O0():536870912,t.lanes|=e,Wi|=e)}function Ks(t,e){if(!me)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fe(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(e)for(var n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=r,t.childLanes=a,e}function ER(t,e,a){var r=e.pendingProps;switch(qm(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(e),null;case 1:return Fe(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Rr(at),qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(yi(e)?Sr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ch())),Fe(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(Sr(e),o!==null?(Fe(e),WS(e,o)):(Fe(e),xh(e,n,null,r,a))):o?o!==t.memoizedState?(Sr(e),Fe(e),WS(e,o)):(Fe(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&Sr(e),Fe(e),xh(e,n,t,r,a)),null;case 27:if(Xc(e),a=wn.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Fe(e),null}t=sr.current,yi(e)?CS(e,t):(t=J_(n,r,a),e.stateNode=t,Sr(e))}return Fe(e),null;case 5:if(Xc(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Fe(e),null}if(o=sr.current,yi(e))CS(e,o);else{var i=gd(wn.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}o[yt]=e,o[Wt]=r;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(St(o,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Sr(e)}}return Fe(e),xh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(D(166));if(t=wn.current,yi(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=xt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[yt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||X_(t.nodeValue,a)),t||On(e,!0)}else t=gd(t).createTextNode(r),t[yt]=e,e.stateNode=t}return Fe(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=yi(e),a!==null){if(t===null){if(!r)throw Error(D(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(557));t[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),t=!1}else a=ch(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(na(e),e):(na(e),null);if((e.flags&128)!==0)throw Error(D(558))}return Fe(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=yi(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(D(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));n[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),n=!1}else n=ch(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(na(e),e):(na(e),null)}return na(e),(e.flags&128)!==0?(e.lanes=a,e):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=e.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==n&&(r.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),Lc(e,e.updateQueue),Fe(e),null);case 4:return qi(),t===null&&hg(e.stateNode.containerInfo),Fe(e),null;case 10:return Rr(e.type),Fe(e),null;case 19:if(ht(Ke),r=e.memoizedState,r===null)return Fe(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)Ks(r,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=nd(t),o!==null){for(e.flags|=128,Ks(r,!1),t=o.updateQueue,e.updateQueue=t,Lc(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)cC(a,t),a=a.sibling;return Re(Ke,Ke.current&1|2),me&&Lr(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&sa()>cd&&(e.flags|=128,n=!0,Ks(r,!1),e.lanes=4194304)}else{if(!n)if(t=nd(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Lc(e,t),Ks(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!me)return Fe(e),null}else 2*sa()-r.renderingStartTime>cd&&a!==536870912&&(e.flags|=128,n=!0,Ks(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=sa(),t.sibling=null,a=Ke.current,Re(Ke,n?a&1|2:a&1),me&&Lr(e,r.treeForkCount),t):(Fe(e),null);case 22:case 23:return na(e),Gm(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(a&536870912)!==0&&(e.flags&128)===0&&(Fe(e),e.subtreeFlags&6&&(e.flags|=8192)):Fe(e),a=e.updateQueue,a!==null&&Lc(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==a&&(e.flags|=2048),t!==null&&ht(Co),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Rr(at),Fe(e),null;case 25:return null;case 30:return null}throw Error(D(156,e.tag))}function TR(t,e){switch(qm(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Rr(at),qi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Xc(e),null;case 31:if(e.memoizedState!==null){if(na(e),e.alternate===null)throw Error(D(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(na(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(Ke),null;case 4:return qi(),null;case 10:return Rr(e.type),null;case 22:case 23:return na(e),Gm(),t!==null&&ht(Co),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Rr(at),null;case 25:return null;default:return null}}function c_(t,e){switch(qm(e),e.tag){case 3:Rr(at),qi();break;case 26:case 27:case 5:Xc(e);break;case 4:qi();break;case 31:e.memoizedState!==null&&na(e);break;case 13:na(e);break;case 19:ht(Ke);break;case 10:Rr(e.type);break;case 22:case 23:na(e),Gm(),t!==null&&ht(Co);break;case 24:Rr(at)}}function ql(t,e){try{var a=e.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&t)===t){r=void 0;var o=a.create,i=a.inst;r=o(),i.destroy=r}a=a.next}while(a!==n)}}catch(s){Se(e,e.return,s)}}function Bn(t,e,a){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var o=n.next;r=o;do{if((r.tag&t)===t){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,n=e;var l=a,u=s;try{u()}catch(c){Se(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){Se(e,e.return,c)}}function d_(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{bC(e,a)}catch(r){Se(t,t.return,r)}}}function f_(t,e,a){a.props=Eo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Se(t,e,r)}}function hl(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(n){Se(t,e,n)}}function ir(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Se(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Se(t,e,n)}else a.current=null}function p_(t){var e=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Se(t,t.return,n)}}function bh(t,e,a){try{var r=t.stateNode;YR(r,t.type,a,e),r[Wt]=e}catch(n){Se(t,t.return,n)}}function h_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Pn(t.type)||t.tag===4}function Sh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h_(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&&Pn(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 um(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=kr));else if(r!==4&&(r===27&&Pn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(um(t,e,a),t=t.sibling;t!==null;)um(t,e,a),t=t.sibling}function ud(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(r!==4&&(r===27&&Pn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(ud(t,e,a),t=t.sibling;t!==null;)ud(t,e,a),t=t.sibling}function m_(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);St(e,r,a),e[yt]=t,e[Wt]=a}catch(o){Se(t,t.return,o)}}var Ir=!1,tt=!1,Ch=!1,ZS=typeof WeakSet=="function"?WeakSet:Set,ft=null;function RR(t,e){if(t=t.containerInfo,gm=bd,t=aC(t),Fm(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var m;d!==a||n!==0&&d.nodeType!==3||(s=i+n),d!==o||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===t)break t;if(h===a&&++u===n&&(s=i),h===o&&++c===r&&(l=i),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(vm={focusedElem:t,selectionRange:a},bd=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,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(a=0;a<t.length;a++)n=t[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,n=o.memoizedProps,o=o.memoizedState,r=a.stateNode;try{var S=Eo(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(b){Se(a,a.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)xm(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xm(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(D(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function g_(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:_r(t,a),r&4&&ql(5,a);break;case 1:if(_r(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){Se(a,a.return,i)}else{var n=Eo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){Se(a,a.return,i)}}r&64&&d_(a),r&512&&hl(a,a.return);break;case 3:if(_r(t,a),r&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{bC(t,e)}catch(i){Se(a,a.return,i)}}break;case 27:e===null&&r&4&&m_(a);case 26:case 5:_r(t,a),e===null&&r&4&&p_(a),r&512&&hl(a,a.return);break;case 12:_r(t,a);break;case 31:_r(t,a),r&4&&x_(t,a);break;case 13:_r(t,a),r&4&&b_(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=UR.bind(null,a),nM(t,a))));break;case 22:if(r=a.memoizedState!==null||Ir,!r){e=e!==null&&e.memoizedState!==null||tt,n=Ir;var o=tt;Ir=r,(tt=e)&&!o?wr(t,a,(a.subtreeFlags&8772)!==0):_r(t,a),Ir=n,tt=o}break;case 30:break;default:_r(t,a)}}function v_(t){var e=t.alternate;e!==null&&(t.alternate=null,v_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Tm(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 qe=null,$t=!1;function Cr(t,e,a){for(a=a.child;a!==null;)y_(t,e,a),a=a.sibling}function y_(t,e,a){if(la&&typeof la.onCommitFiberUnmount=="function")try{la.onCommitFiberUnmount(Ol,a)}catch{}switch(a.tag){case 26:tt||ir(a,e),Cr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||ir(a,e);var r=qe,n=$t;Pn(a.type)&&(qe=a.stateNode,$t=!1),Cr(t,e,a),yl(a.stateNode),qe=r,$t=n;break;case 5:tt||ir(a,e);case 6:if(r=qe,n=$t,qe=null,Cr(t,e,a),qe=r,$t=n,qe!==null)if($t)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(o){Se(a,e,o)}else try{qe.removeChild(a.stateNode)}catch(o){Se(a,e,o)}break;case 18:qe!==null&&($t?(t=qe,u0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Ki(t)):u0(qe,a.stateNode));break;case 4:r=qe,n=$t,qe=a.stateNode.containerInfo,$t=!0,Cr(t,e,a),qe=r,$t=n;break;case 0:case 11:case 14:case 15:Bn(2,a,e),tt||Bn(4,a,e),Cr(t,e,a);break;case 1:tt||(ir(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&f_(a,e,r)),Cr(t,e,a);break;case 21:Cr(t,e,a);break;case 22:tt=(r=tt)||a.memoizedState!==null,Cr(t,e,a),tt=r;break;default:Cr(t,e,a)}}function x_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ki(t)}catch(a){Se(e,e.return,a)}}}function b_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ki(t)}catch(a){Se(e,e.return,a)}}function MR(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new ZS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new ZS),e;default:throw Error(D(435,t.tag))}}function Ic(t,e){var a=MR(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=qR.bind(null,t,r);r.then(n,n)}})}function zt(t,e){var a=e.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Pn(s.type)){qe=s.stateNode,$t=!1;break e}break;case 5:qe=s.stateNode,$t=!1;break e;case 3:case 4:qe=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(qe===null)throw Error(D(160));y_(o,i,n),qe=null,$t=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)S_(e,t),e=e.sibling}var qa=null;function S_(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(e,t),Vt(t),r&4&&(Bn(3,t,t.return),ql(3,t),Bn(5,t,t.return));break;case 1:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&64&&Ir&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=qa;if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&4){var o=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":o=n.getElementsByTagName("title")[0],(!o||o[Nl]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),St(o,r,a),o[yt]=t,pt(o),r=o;break e;case"link":var i=g0("link","href",n).get(r+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;case"meta":if(i=g0("meta","content",n).get(r+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;default:throw Error(D(468,r))}o[yt]=t,pt(o),r=o}t.stateNode=r}else v0(n,t.type,t.stateNode);else t.stateNode=m0(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?v0(n,t.type,t.stateNode):m0(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&bh(t,t.memoizedProps,a.memoizedProps)}break;case 27:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),a!==null&&r&4&&bh(t,t.memoizedProps,a.memoizedProps);break;case 5:if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),t.flags&32){n=t.stateNode;try{Vi(n,"")}catch(S){Se(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,bh(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Ch=!0);break;case 6:if(zt(e,t),Vt(t),r&4){if(t.stateNode===null)throw Error(D(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){Se(t,t.return,S)}}break;case 3:if($c=null,n=qa,qa=vd(e.containerInfo),zt(e,t),qa=n,Vt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Ki(e.containerInfo)}catch(S){Se(t,t.return,S)}Ch&&(Ch=!1,C_(t));break;case 4:r=qa,qa=vd(t.stateNode.containerInfo),zt(e,t),Vt(t),qa=r;break;case 12:zt(e,t),Vt(t);break;case 31:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ic(t,r)));break;case 13:zt(e,t),Vt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Dd=sa()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ic(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Ir,c=tt;if(Ir=u||n,tt=c||l,zt(e,t),tt=c,Ir=u,Vt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||Ir||tt||xo(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,n)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.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){Se(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){Se(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var m=l.stateNode;n?c0(m,!0):c0(l.stateNode,!1)}catch(S){Se(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;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ic(t,a))));break;case 19:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ic(t,r)));break;case 30:break;case 21:break;default:zt(e,t),Vt(t)}}function Vt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(h_(r)){a=r;break}r=r.return}if(a==null)throw Error(D(160));switch(a.tag){case 27:var n=a.stateNode,o=Sh(t);ud(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(Vi(i,""),a.flags&=-33);var s=Sh(t);ud(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=Sh(t);um(t,u,l);break;default:throw Error(D(161))}}catch(c){Se(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function C_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;C_(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function _r(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)g_(t,e.alternate,e),e=e.sibling}function xo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Bn(4,e,e.return),xo(e);break;case 1:ir(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&f_(e,e.return,a),xo(e);break;case 27:yl(e.stateNode);case 26:case 5:ir(e,e.return),xo(e);break;case 22:e.memoizedState===null&&xo(e);break;case 30:xo(e);break;default:xo(e)}t=t.sibling}}function wr(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,n=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:wr(n,o,a),ql(4,o);break;case 1:if(wr(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){Se(r,r.return,u)}if(r=o,n=r.updateQueue,n!==null){var s=r.stateNode;try{var l=n.shared.hiddenCallbacks;if(l!==null)for(n.shared.hiddenCallbacks=null,n=0;n<l.length;n++)xC(l[n],s)}catch(u){Se(r,r.return,u)}}a&&i&64&&d_(o),hl(o,o.return);break;case 27:m_(o);case 26:case 5:wr(n,o,a),a&&r===null&&i&4&&p_(o),hl(o,o.return);break;case 12:wr(n,o,a);break;case 31:wr(n,o,a),a&&i&4&&x_(n,o);break;case 13:wr(n,o,a),a&&i&4&&b_(n,o);break;case 22:o.memoizedState===null&&wr(n,o,a),hl(o,o.return);break;case 30:break;default:wr(n,o,a)}e=e.sibling}}function lg(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Hl(a))}function ug(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Hl(t))}function Ua(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)__(t,e,a,r),e=e.sibling}function __(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Ua(t,e,a,r),n&2048&&ql(9,e);break;case 1:Ua(t,e,a,r);break;case 3:Ua(t,e,a,r),n&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Hl(t)));break;case 12:if(n&2048){Ua(t,e,a,r),t=e.stateNode;try{var o=e.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Se(e,e.return,l)}}else Ua(t,e,a,r);break;case 31:Ua(t,e,a,r);break;case 13:Ua(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Ua(t,e,a,r):ml(t,e):o._visibility&2?Ua(t,e,a,r):(o._visibility|=2,bi(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&lg(i,e);break;case 24:Ua(t,e,a,r),n&2048&&ug(e.alternate,e);break;default:Ua(t,e,a,r)}}function bi(t,e,a,r,n){for(n=n&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:bi(o,i,s,l,n),ql(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?bi(o,i,s,l,n):ml(o,i):(c._visibility|=2,bi(o,i,s,l,n)),n&&u&2048&&lg(i.alternate,i);break;case 24:bi(o,i,s,l,n),n&&u&2048&&ug(i.alternate,i);break;default:bi(o,i,s,l,n)}e=e.sibling}}function ml(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,r=e,n=r.flags;switch(r.tag){case 22:ml(a,r),n&2048&&lg(r.alternate,r);break;case 24:ml(a,r),n&2048&&ug(r.alternate,r);break;default:ml(a,r)}e=e.sibling}}var ol=8192;function xi(t,e,a){if(t.subtreeFlags&ol)for(t=t.child;t!==null;)w_(t,e,a),t=t.sibling}function w_(t,e,a){switch(t.tag){case 26:xi(t,e,a),t.flags&ol&&t.memoizedState!==null&&gM(a,qa,t.memoizedState,t.memoizedProps);break;case 5:xi(t,e,a);break;case 3:case 4:var r=qa;qa=vd(t.stateNode.containerInfo),xi(t,e,a),qa=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ol,ol=16777216,xi(t,e,a),ol=r):xi(t,e,a));break;default:xi(t,e,a)}}function L_(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 a=0;a<e.length;a++){var r=e[a];ft=r,A_(r,t)}L_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)I_(t),t=t.sibling}function I_(t){switch(t.tag){case 0:case 11:case 15:Qs(t),t.flags&2048&&Bn(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,zc(t)):Qs(t);break;default:Qs(t)}}function zc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,A_(r,t)}L_(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Bn(8,e,e.return),zc(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,zc(e));break;default:zc(e)}t=t.sibling}}function A_(t,e){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Bn(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Hl(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=t;ft!==null;){r=ft;var n=r.sibling,o=r.return;if(v_(r),r===a){ft=null;break e}if(n!==null){n.return=o,ft=n;break e}ft=o}}}var DR={getCacheForType:function(t){var e=bt(at),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return bt(at).controller.signal}},OR=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ae=null,de=null,he=0,be=0,ra=null,Sn=!1,as=!1,cg=!1,Nr=0,Xe=0,Fn=0,wo=0,dg=0,ia=0,Wi=0,gl=null,jt=null,cm=!1,Dd=0,k_=0,cd=1/0,dd=null,kn=null,ot=0,En=null,Zi=null,Mr=0,dm=0,fm=null,E_=null,vl=0,pm=null;function ca(){return(ye&2)!==0&&he!==0?he&-he:te.T!==null?pg():P0()}function T_(){if(ia===0)if((he&536870912)===0||me){var t=gc;gc<<=1,(gc&3932160)===0&&(gc=262144),ia=t}else ia=536870912;return t=fa.current,t!==null&&(t.flags|=32),ia}function Gt(t,e,a){(t===Ae&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(Xi(t,0),Cn(t,he,ia,!1)),Fl(t,a),((ye&2)===0||t!==Ae)&&(t===Ae&&((ye&2)===0&&(wo|=a),Xe===4&&Cn(t,he,ia,!1)),ur(t))}function R_(t,e,a){if((ye&6)!==0)throw Error(D(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Bl(t,e),n=r?NR(t,e):_h(t,e,!0),o=r;do{if(n===0){as&&!r&&Cn(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!BR(a)){n=_h(t,e,!1),o=!1;continue}if(n===2){if(o=e,t.errorRecoveryDisabledLanes&o)var i=0;else i=t.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){e=i;e:{var s=t;n=gl;var l=s.current.memoizedState.isDehydrated;if(l&&(Xi(s,i).flags|=256),i=_h(s,i,!1),i!==2){if(cg&&!l){s.errorRecoveryDisabledLanes|=o,wo|=o,n=4;break e}o=jt,jt=n,o!==null&&(jt===null?jt=o:jt.push.apply(jt,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){Xi(t,0),Cn(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(D(345));case 4:if((e&4194048)!==e)break;case 6:Cn(r,e,ia,!Sn);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((e&62914560)===e&&(n=Dd+300-sa(),10<n)){if(Cn(r,e,ia,!Sn),Cd(r,0,!0)!==0)break e;Mr=e,r.timeoutHandle=K_(XS.bind(null,r,a,jt,dd,cm,e,ia,wo,Wi,Sn,o,"Throttled",-0,0),n);break e}XS(r,a,jt,dd,cm,e,ia,wo,Wi,Sn,o,null,-0,0)}}break}while(!0);ur(t)}function XS(t,e,a,r,n,o,i,s,l,u,c,d,h,m){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:kr},w_(e,o,d);var S=(o&62914560)===o?Dd-sa():(o&4194048)===o?k_-sa():0;if(S=vM(d,S),S!==null){Mr=o,t.cancelPendingCommit=S(KS.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,h,m)),Cn(t,o,i,!u);return}}KS(t,e,o,a,r,n,i,s,l)}function BR(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],o=n.getSnapshot;n=n.value;try{if(!da(o(),n))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;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 Cn(t,e,a,r){e&=~dg,e&=~wo,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-ua(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&B0(t,a,e)}function Od(){return(ye&6)===0?(zl(0,!1),!1):!0}function fg(){if(de!==null){if(be===0)var t=de.return;else t=de,Er=Oo=null,Km(t),Pi=null,Ll=0,t=de;for(;t!==null;)c_(t.alternate,t),t=t.return;de=null}}function Xi(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,JR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Mr=0,fg(),Ae=t,de=a=Tr(t.current,null),he=e,be=0,ra=null,Sn=!1,as=Bl(t,e),cg=!1,Wi=ia=dg=wo=Fn=Xe=0,jt=gl=null,cm=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var n=31-ua(r),o=1<<n;e|=t[n],r&=~o}return Nr=e,Id(),a}function M_(t,e){se=null,te.H=Al,e===ts||e===kd?(e=AS(),be=3):e===$m?(e=AS(),be=4):be=e===ig?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ra=e,de===null&&(Xe=1,sd(t,La(e,t.current)))}function D_(){var t=fa.current;return t===null?!0:(he&4194048)===he?Aa===null:(he&62914560)===he||(he&536870912)!==0?t===Aa:!1}function O_(){var t=te.H;return te.H=Al,t===null?Al:t}function B_(){var t=te.A;return te.A=DR,t}function fd(){Xe=4,Sn||(he&4194048)!==he&&fa.current!==null||(as=!0),(Fn&134217727)===0&&(wo&134217727)===0||Ae===null||Cn(Ae,he,ia,!1)}function _h(t,e,a){var r=ye;ye|=2;var n=O_(),o=B_();(Ae!==t||he!==e)&&(dd=null,Xi(t,e)),e=!1;var i=Xe;e:do try{if(be!==0&&de!==null){var s=de,l=ra;switch(be){case 8:fg(),i=6;break e;case 3:case 2:case 9:case 6:fa.current===null&&(e=!0);var u=be;if(be=0,ra=null,Di(t,s,l,u),a&&as){i=0;break e}break;default:u=be,be=0,ra=null,Di(t,s,l,u)}}FR(),i=Xe;break}catch(c){M_(t,c)}while(!0);return e&&t.shellSuspendCounter++,Er=Oo=null,ye=r,te.H=n,te.A=o,de===null&&(Ae=null,he=0,Id()),i}function FR(){for(;de!==null;)F_(de)}function NR(t,e){var a=ye;ye|=2;var r=O_(),n=B_();Ae!==t||he!==e?(dd=null,cd=sa()+500,Xi(t,e)):as=Bl(t,e);e:do try{if(be!==0&&de!==null){e=de;var o=ra;t:switch(be){case 1:be=0,ra=null,Di(t,e,o,1);break;case 2:case 9:if(IS(o)){be=0,ra=null,YS(e);break}e=function(){be!==2&&be!==9||Ae!==t||(be=7),ur(t)},o.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:IS(o)?(be=0,ra=null,YS(e)):(be=0,ra=null,Di(t,e,o,7));break;case 5:var i=null;switch(de.tag){case 26:i=de.memoizedState;case 5:case 27:var s=de;if(i?aw(i):s.stateNode.complete){be=0,ra=null;var l=s.sibling;if(l!==null)de=l;else{var u=s.return;u!==null?(de=u,Bd(u)):de=null}break t}}be=0,ra=null,Di(t,e,o,5);break;case 6:be=0,ra=null,Di(t,e,o,6);break;case 8:fg(),Xe=6;break e;default:throw Error(D(462))}}PR();break}catch(c){M_(t,c)}while(!0);return Er=Oo=null,te.H=r,te.A=n,ye=a,de!==null?0:(Ae=null,he=0,Id(),Xe)}function PR(){for(;de!==null&&!sT();)F_(de)}function F_(t){var e=u_(t.alternate,t,Nr);t.memoizedProps=t.pendingProps,e===null?Bd(t):de=e}function YS(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=VS(a,e,e.pendingProps,e.type,void 0,he);break;case 11:e=VS(a,e,e.pendingProps,e.type.render,e.ref,he);break;case 5:Km(e);default:c_(a,e),e=de=cC(e,Nr),e=u_(a,e,Nr)}t.memoizedProps=t.pendingProps,e===null?Bd(t):de=e}function Di(t,e,a,r){Er=Oo=null,Km(e),Pi=null,Ll=0;var n=e.return;try{if(IR(t,n,e,a,he)){Xe=1,sd(t,La(a,t.current)),de=null;return}}catch(o){if(n!==null)throw de=n,o;Xe=1,sd(t,La(a,t.current)),de=null;return}e.flags&32768?(me||r===1?t=!0:as||(he&536870912)!==0?t=!1:(Sn=t=!0,(r===2||r===9||r===3||r===6)&&(r=fa.current,r!==null&&r.tag===13&&(r.flags|=16384))),N_(e,t)):Bd(e)}function Bd(t){var e=t;do{if((e.flags&32768)!==0){N_(e,Sn);return}t=e.return;var a=ER(e.alternate,e,Nr);if(a!==null){de=a;return}if(e=e.sibling,e!==null){de=e;return}de=e=t}while(e!==null);Xe===0&&(Xe=5)}function N_(t,e){do{var a=TR(t.alternate,t);if(a!==null){a.flags&=32767,de=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){de=t;return}de=t=a}while(t!==null);Xe=6,de=null}function KS(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Fd();while(ot!==0);if((ye&6)!==0)throw Error(D(327));if(e!==null){if(e===t.current)throw Error(D(177));if(o=e.lanes|e.childLanes,o|=Nm,vT(t,a,o,i,s,l),t===Ae&&(de=Ae=null,he=0),Zi=e,En=t,Mr=a,dm=o,fm=n,E_=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,zR(Yc,function(){return z_(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=te.T,te.T=null,n=xe.p,xe.p=2,i=ye,ye|=4;try{RR(t,e,a)}finally{ye=i,xe.p=n,te.T=r}}ot=1,P_(),H_(),U_()}}function P_(){if(ot===1){ot=0;var t=En,e=Zi,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=te.T,te.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{S_(e,t);var o=vm,i=aC(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&tC(s.ownerDocument.documentElement,s)){if(l!==null&&Fm(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!m.extend&&b>x&&(i=x,x=b,b=i);var f=xS(s,b),g=xS(s,x);if(f&&g&&(m.rangeCount!==1||m.anchorNode!==f.node||m.anchorOffset!==f.offset||m.focusNode!==g.node||m.focusOffset!==g.offset)){var v=d.createRange();v.setStart(f.node,f.offset),m.removeAllRanges(),b>x?(m.addRange(v),m.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),m.addRange(v))}}}}for(d=[],m=s;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.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}}bd=!!gm,vm=gm=null}finally{ye=n,xe.p=r,te.T=a}}t.current=e,ot=2}}function H_(){if(ot===2){ot=0;var t=En,e=Zi,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=te.T,te.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{g_(t,e.alternate,e)}finally{ye=n,xe.p=r,te.T=a}}ot=3}}function U_(){if(ot===4||ot===3){ot=0,lT();var t=En,e=Zi,a=Mr,r=E_;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ot=5:(ot=0,Zi=En=null,q_(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(kn=null),Em(a),e=e.stateNode,la&&typeof la.onCommitFiberRoot=="function")try{la.onCommitFiberRoot(Ol,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=te.T,n=xe.p,xe.p=2,te.T=null;try{for(var o=t.onRecoverableError,i=0;i<r.length;i++){var s=r[i];o(s.value,{componentStack:s.stack})}}finally{te.T=e,xe.p=n}}(Mr&3)!==0&&Fd(),ur(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===pm?vl++:(vl=0,pm=t):vl=0,zl(0,!1)}}function q_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Hl(e)))}function Fd(){return P_(),H_(),U_(),z_()}function z_(){if(ot!==5)return!1;var t=En,e=dm;dm=0;var a=Em(Mr),r=te.T,n=xe.p;try{xe.p=32>a?32:a,te.T=null,a=fm,fm=null;var o=En,i=Mr;if(ot=0,Zi=En=null,Mr=0,(ye&6)!==0)throw Error(D(331));var s=ye;if(ye|=4,I_(o.current),__(o,o.current,i,a),ye=s,zl(0,!1),la&&typeof la.onPostCommitFiberRoot=="function")try{la.onPostCommitFiberRoot(Ol,o)}catch{}return!0}finally{xe.p=n,te.T=r,q_(t,e)}}function QS(t,e,a){e=La(a,e),e=im(t.stateNode,e,2),t=An(t,e,2),t!==null&&(Fl(t,2),ur(t))}function Se(t,e,a){if(t.tag===3)QS(t,t,a);else for(;e!==null;){if(e.tag===3){QS(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(kn===null||!kn.has(r))){t=La(a,t),a=r_(2),r=An(e,a,2),r!==null&&(n_(a,r,e,t),Fl(r,2),ur(r));break}}e=e.return}}function wh(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new OR;var n=new Set;r.set(e,n)}else n=r.get(e),n===void 0&&(n=new Set,r.set(e,n));n.has(a)||(cg=!0,n.add(a),t=HR.bind(null,t,e,a),e.then(t,t))}function HR(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ae===t&&(he&a)===a&&(Xe===4||Xe===3&&(he&62914560)===he&&300>sa()-Dd?(ye&2)===0&&Xi(t,0):dg|=a,Wi===he&&(Wi=0)),ur(t)}function V_(t,e){e===0&&(e=O0()),t=Do(t,e),t!==null&&(Fl(t,e),ur(t))}function UR(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),V_(t,a)}function qR(t,e){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(D(314))}r!==null&&r.delete(e),V_(t,a)}function zR(t,e){return Am(t,e)}var pd=null,Si=null,hm=!1,hd=!1,Lh=!1,_n=0;function ur(t){t!==Si&&t.next===null&&(Si===null?pd=Si=t:Si=Si.next=t),hd=!0,hm||(hm=!0,$R())}function zl(t,e){if(!Lh&&hd){Lh=!0;do for(var a=!1,r=pd;r!==null;){if(!e)if(t!==0){var n=r.pendingLanes;if(n===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-ua(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,JS(r,o))}else o=he,o=Cd(r,r===Ae?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Bl(r,o)||(a=!0,JS(r,o));r=r.next}while(a);Lh=!1}}function VR(){$_()}function $_(){hd=hm=!1;var t=0;_n!==0&&QR()&&(t=_n);for(var e=sa(),a=null,r=pd;r!==null;){var n=r.next,o=j_(r,e);o===0?(r.next=null,a===null?pd=n:a.next=n,n===null&&(Si=a)):(a=r,(t!==0||(o&3)!==0)&&(hd=!0)),r=n}ot!==0&&ot!==5||zl(t,!1),_n!==0&&(_n=0)}function j_(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-ua(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=gT(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,a=he,a=Cd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&eh(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Bl(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&eh(r),Em(a)){case 2:case 8:a=M0;break;case 32:a=Yc;break;case 268435456:a=D0;break;default:a=Yc}return r=G_.bind(null,t),a=Am(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&eh(r),t.callbackPriority=2,t.callbackNode=null,2}function G_(t,e){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Fd()&&t.callbackNode!==a)return null;var r=he;return r=Cd(t,t===Ae?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(R_(t,r,e),j_(t,sa()),t.callbackNode!=null&&t.callbackNode===a?G_.bind(null,t):null)}function JS(t,e){if(Fd())return null;R_(t,e,!0)}function $R(){eM(function(){(ye&6)!==0?Am(R0,VR):$_()})}function pg(){if(_n===0){var t=$i;t===0&&(t=mc,mc<<=1,(mc&261888)===0&&(mc=256)),_n=t}return _n}function e0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Dc(""+t)}function t0(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function jR(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=e0((n[Wt]||null).action),i=r.submitter;i&&(e=(e=i[Wt]||null)?e0(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new _d("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(_n!==0){var l=i?t0(n,i):new FormData(n);nm(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?t0(n,i):new FormData(n),nm(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(Ac=0;Ac<Gh.length;Ac++)kc=Gh[Ac],a0=kc.toLowerCase(),r0=kc[0].toUpperCase()+kc.slice(1),za(a0,"on"+r0);var kc,a0,r0,Ac;za(nC,"onAnimationEnd");za(oC,"onAnimationIteration");za(iC,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(uR,"onTransitionRun");za(cR,"onTransitionStart");za(dR,"onTransitionCancel");za(sC,"onTransitionEnd");zi("onMouseEnter",["mouseout","mouseover"]);zi("onMouseLeave",["mouseout","mouseover"]);zi("onPointerEnter",["pointerout","pointerover"]);zi("onPointerLeave",["pointerout","pointerover"]);To("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));To("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));To("onBeforeInput",["compositionend","keypress","textInput","paste"]);To("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));To("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));To("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kl="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(" "),GR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kl));function W_(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],n=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){Qc(c)}n.currentTarget=null,o=l}else for(i=0;i<r.length;i++){if(s=r[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){Qc(c)}n.currentTarget=null,o=l}}}}function ce(t,e){var a=e[Ph];a===void 0&&(a=e[Ph]=new Set);var r=t+"__bubble";a.has(r)||(Z_(e,t,2,!1),a.add(r))}function Ih(t,e,a){var r=0;e&&(r|=4),Z_(a,t,r,e)}var Ec="_reactListening"+Math.random().toString(36).slice(2);function hg(t){if(!t[Ec]){t[Ec]=!0,H0.forEach(function(a){a!=="selectionchange"&&(GR.has(a)||Ih(a,!1,t),Ih(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ec]||(e[Ec]=!0,Ih("selectionchange",!1,e))}}function Z_(t,e,a,r){switch(sw(e)){case 2:var n=bM;break;case 8:n=SM;break;default:n=yg}a=n.bind(null,e,a,t),n=void 0,!Vh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),r?n!==void 0?t.addEventListener(e,a,{capture:!0,passive:n}):t.addEventListener(e,a,!0):n!==void 0?t.addEventListener(e,a,{passive:n}):t.addEventListener(e,a,!1)}function Ah(t,e,a,r,n){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===n)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===n)return;i=i.return}for(;s!==null;){if(i=wi(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){r=o=i;continue e}s=s.parentNode}}r=r.return}W0(function(){var u=o,c=Mm(a),d=[];e:{var h=lC.get(t);if(h!==void 0){var m=_d,S=t;switch(t){case"keypress":if(Bc(a)===0)break e;case"keydown":case"keyup":m=qT;break;case"focusin":S="focus",m=oh;break;case"focusout":S="blur",m=oh;break;case"beforeblur":case"afterblur":m=oh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=cS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=ET;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=$T;break;case nC:case oC:case iC:m=MT;break;case sC:m=GT;break;case"scroll":case"scrollend":m=AT;break;case"wheel":m=ZT;break;case"copy":case"cut":case"paste":m=OT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=fS;break;case"toggle":case"beforetoggle":m=YT}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?h!==null?h+"Capture":null:h;b=[];for(var g=u,v;g!==null;){var y=g;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=bl(g,f),y!=null&&b.push(El(g,y,v))),x)break;g=g.return}0<b.length&&(h=new m(h,S,null,a,c),d.push({event:h,listeners:b}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&a!==zh&&(S=a.relatedTarget||a.fromElement)&&(wi(S)||S[Qi]))break e;if((m||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,m?(S=a.relatedTarget||a.toElement,m=u,S=S?wi(S):null,S!==null&&(x=Dl(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(m=null,S=u),m!==S)){if(b=cS,y="onMouseLeave",f="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(b=fS,y="onPointerLeave",f="onPointerEnter",g="pointer"),x=m==null?h:rl(m),v=S==null?h:rl(S),h=new b(y,g+"leave",m,a,c),h.target=x,h.relatedTarget=v,y=null,wi(c)===u&&(b=new b(f,g+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,m&&S)t:{for(b=WR,f=m,g=S,v=0,y=f;y;y=b(y))v++;y=0;for(var _=g;_;_=b(_))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)g=b(g),y--;for(;v--;){if(f===g||g!==null&&f===g.alternate){b=f;break t}f=b(f),g=b(g)}b=null}else b=null;m!==null&&n0(d,h,m,b,!1),S!==null&&x!==null&&n0(d,x,S,b,!0)}}e:{if(h=u?rl(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var w=gS;else if(mS(h))if(J0)w=iR;else{w=nR;var C=rR}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&Rm(u.elementType)&&(w=gS):w=oR;if(w&&(w=w(t,u))){Q0(d,w,a,c);break e}C&&C(t,h,u),t==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&qh(h,"number",h.value)}switch(C=u?rl(u):window,t){case"focusin":(mS(C)||C.contentEditable==="true")&&(Ai=C,$h=u,ll=null);break;case"focusout":ll=$h=Ai=null;break;case"mousedown":jh=!0;break;case"contextmenu":case"mouseup":case"dragend":jh=!1,bS(d,a,c);break;case"selectionchange":if(lR)break;case"keydown":case"keyup":bS(d,a,c)}var L;if(Bm)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Ii?Y0(t,a)&&(k="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(k="onCompositionStart");k&&(X0&&a.locale!=="ko"&&(Ii||k!=="onCompositionStart"?k==="onCompositionEnd"&&Ii&&(L=Z0()):(bn=c,Dm="value"in bn?bn.value:bn.textContent,Ii=!0)),C=md(u,k),0<C.length&&(k=new dS(k,t,null,a,c),d.push({event:k,listeners:C}),L?k.data=L:(L=K0(a),L!==null&&(k.data=L)))),(L=QT?JT(t,a):eR(t,a))&&(k=md(u,"onBeforeInput"),0<k.length&&(C=new dS("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:k}),C.data=L)),jR(d,t,u,a,c)}W_(d,e)})}function El(t,e,a){return{instance:t,listener:e,currentTarget:a}}function md(t,e){for(var a=e+"Capture",r=[];t!==null;){var n=t,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=bl(t,a),n!=null&&r.unshift(El(t,n,o)),n=bl(t,e),n!=null&&r.push(El(t,n,o))),t.tag===3)return r;t=t.return}return[]}function WR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function n0(t,e,a,r,n){for(var o=e._reactName,i=[];a!==null&&a!==r;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,n?(u=bl(a,o),u!=null&&i.unshift(El(a,u,l))):n||(u=bl(a,o),u!=null&&i.push(El(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var ZR=/\r\n?/g,XR=/\u0000|\uFFFD/g;function o0(t){return(typeof t=="string"?t:""+t).replace(ZR,`
9
- `).replace(XR,"")}function X_(t,e){return e=o0(e),o0(t)===e}function we(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Vi(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Vi(t,""+r);break;case"className":yc(t,"class",r);break;case"tabIndex":yc(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":yc(t,a,r);break;case"style":G0(t,r,o);break;case"data":if(e!=="object"){yc(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Dc(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(e!=="input"&&we(t,e,"name",n.name,n,null),we(t,e,"formEncType",n.formEncType,n,null),we(t,e,"formMethod",n.formMethod,n,null),we(t,e,"formTarget",n.formTarget,n,null)):(we(t,e,"encType",n.encType,n,null),we(t,e,"method",n.method,n,null),we(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Dc(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=kr);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}a=Dc(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""+r):t.removeAttribute(a);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":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":ce("beforetoggle",t),ce("toggle",t),Mc(t,"popover",r);break;case"xlinkActuate":br(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":br(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":br(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":br(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":br(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":br(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":br(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":br(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":br(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Mc(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=LT.get(a)||a,Mc(t,a,r))}}function mm(t,e,a,r,n,o){switch(a){case"style":G0(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));t.innerHTML=a}}break;case"children":typeof r=="string"?Vi(t,r):(typeof r=="number"||typeof r=="bigint")&&Vi(t,""+r);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"onClick":r!=null&&(t.onclick=kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!U0.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),e=a.slice(2,n?a.length-7:void 0),o=t[Wt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,n),typeof r=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,r,n);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):Mc(t,a,r)}}}function St(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",t),ce("load",t);var r=!1,n=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,o,i,a,null)}}n&&we(t,e,"srcSet",a.srcSet,a,null),r&&we(t,e,"src",a.src,a,null);return;case"input":ce("invalid",t);var s=o=i=n=null,l=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":n=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(D(137,e));break;default:we(t,e,r,c,a,null)}}V0(t,o,s,l,u,i,n,!1);return;case"select":ce("invalid",t),r=i=o=null;for(n in a)if(a.hasOwnProperty(n)&&(s=a[n],s!=null))switch(n){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:we(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Bi(t,!!r,e,!1):a!=null&&Bi(t,!!r,a,!0);return;case"textarea":ce("invalid",t),o=n=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":n=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(D(91));break;default:we(t,e,i,s,a,null)}j0(t,r,n,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null)&&(l==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":we(t,e,l,r,a,null));return;case"dialog":ce("beforetoggle",t),ce("toggle",t),ce("cancel",t),ce("close",t);break;case"iframe":case"object":ce("load",t);break;case"video":case"audio":for(r=0;r<kl.length;r++)ce(kl[r],t);break;case"image":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"embed":case"source":case"link":ce("error",t),ce("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(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,u,r,a,null)}return;default:if(Rm(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&mm(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&we(t,e,s,r,a,null))}function YR(t,e,a,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,i=null,s=null,l=null,u=null,c=null;for(m in a){var d=a[m];if(a.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(m)||we(t,e,m,null,r,d)}}for(var h in r){var m=r[h];if(d=a[h],r.hasOwnProperty(h)&&(m!=null||d!=null))switch(h){case"type":o=m;break;case"name":n=m;break;case"checked":u=m;break;case"defaultChecked":c=m;break;case"value":i=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(D(137,e));break;default:m!==d&&we(t,e,h,m,r,d)}}Uh(t,i,s,l,u,c,o,n);return;case"select":m=i=s=h=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:r.hasOwnProperty(o)||we(t,e,o,null,r,l)}for(n in r)if(o=r[n],l=a[n],r.hasOwnProperty(n)&&(o!=null||l!=null))switch(n){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&we(t,e,n,o,r,l)}e=s,a=i,r=m,h!=null?Bi(t,!!a,h,!1):!!r!=!!a&&(e!=null?Bi(t,!!a,e,!0):Bi(t,!!a,a?[]:"",!1));return;case"textarea":m=h=null;for(s in a)if(n=a[s],a.hasOwnProperty(s)&&n!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,r,n)}for(i in r)if(n=r[i],o=a[i],r.hasOwnProperty(i)&&(n!=null||o!=null))switch(i){case"value":h=n;break;case"defaultValue":m=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(D(91));break;default:n!==o&&we(t,e,i,n,r,o)}$0(t,h,m);return;case"option":for(var S in a)h=a[S],a.hasOwnProperty(S)&&h!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,r,h));for(l in r)h=r[l],m=a[l],r.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,r,m));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 a)h=a[b],a.hasOwnProperty(b)&&h!=null&&!r.hasOwnProperty(b)&&we(t,e,b,null,r,h);for(u in r)if(h=r[u],m=a[u],r.hasOwnProperty(u)&&h!==m&&(h!=null||m!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,e));break;default:we(t,e,u,h,r,m)}return;default:if(Rm(e)){for(var x in a)h=a[x],a.hasOwnProperty(x)&&h!==void 0&&!r.hasOwnProperty(x)&&mm(t,e,x,void 0,r,h);for(c in r)h=r[c],m=a[c],!r.hasOwnProperty(c)||h===m||h===void 0&&m===void 0||mm(t,e,c,h,r,m);return}}for(var f in a)h=a[f],a.hasOwnProperty(f)&&h!=null&&!r.hasOwnProperty(f)&&we(t,e,f,null,r,h);for(d in r)h=r[d],m=a[d],!r.hasOwnProperty(d)||h===m||h==null&&m==null||we(t,e,d,h,r,m)}function i0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],o=n.transferSize,i=n.initiatorType,s=n.duration;if(o&&s&&i0(i)){for(i=0,s=n.responseEnd,r+=1;r<a.length;r++){var l=a[r],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&i0(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--r,e+=8*(o+i)/(n.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 gm=null,vm=null;function gd(t){return t.nodeType===9?t:t.ownerDocument}function s0(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 Y_(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 ym(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 kh=null;function QR(){var t=window.event;return t&&t.type==="popstate"?t===kh?!1:(kh=t,!0):(kh=null,!1)}var K_=typeof setTimeout=="function"?setTimeout:void 0,JR=typeof clearTimeout=="function"?clearTimeout:void 0,l0=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof l0<"u"?function(t){return l0.resolve(null).then(t).catch(tM)}:K_;function tM(t){setTimeout(function(){throw t})}function Pn(t){return t==="head"}function u0(t,e){var a=e,r=0;do{var n=a.nextSibling;if(t.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(n),Ki(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")yl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,yl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[Nl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&yl(t.ownerDocument.body);a=n}while(a);Ki(e)}function c0(t,e){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function xm(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xm(a),Tm(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function aM(t,e,a,r){for(;t.nodeType===1;){var n=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){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!==n.rel||t.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||t.getAttribute("title")!==(n.title==null?null:n.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(n.src==null?null:n.src)||t.getAttribute("type")!==(n.type==null?null:n.type)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=ka(t.nextSibling),t===null)break}return null}function rM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ka(t.nextSibling),t===null))return null;return t}function Q_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=ka(t.nextSibling),t===null))return null;return t}function bm(t){return t.data==="$?"||t.data==="$~"}function Sm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function nM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var r=function(){e(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function ka(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 Cm=null;function d0(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return ka(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function f0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function J_(t,e,a){switch(e=gd(a),t){case"html":if(t=e.documentElement,!t)throw Error(D(452));return t;case"head":if(t=e.head,!t)throw Error(D(453));return t;case"body":if(t=e.body,!t)throw Error(D(454));return t;default:throw Error(D(451))}}function yl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Tm(t)}var Ea=new Map,p0=new Set;function vd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Pr=xe.d;xe.d={f:oM,r:iM,D:sM,C:lM,L:uM,m:cM,X:fM,S:dM,M:pM};function oM(){var t=Pr.f(),e=Od();return t||e}function iM(t){var e=Ji(t);e!==null&&e.tag===5&&e.type==="form"?GC(e):Pr.r(t)}var rs=typeof document>"u"?null:document;function ew(t,e,a){var r=rs;if(r&&typeof e=="string"&&e){var n=wa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),p0.has(n)||(p0.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function sM(t){Pr.D(t),ew("dns-prefetch",t,null)}function lM(t,e){Pr.C(t,e),ew("preconnect",t,e)}function uM(t,e,a){Pr.L(t,e,a);var r=rs;if(r&&t&&e){var n='link[rel="preload"][as="'+wa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+wa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+wa(a.imageSizes)+'"]')):n+='[href="'+wa(t)+'"]';var o=n;switch(e){case"style":o=Yi(t);break;case"script":o=ns(t)}Ea.has(o)||(t=Pe({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ea.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(Vl(o))||e==="script"&&r.querySelector($l(o))||(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function cM(t,e){Pr.m(t,e);var a=rs;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+wa(r)+'"][href="'+wa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ns(t)}if(!Ea.has(o)&&(t=Pe({rel:"modulepreload",href:t},e),Ea.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($l(o)))return}r=a.createElement("link"),St(r,"link",t),pt(r),a.head.appendChild(r)}}}function dM(t,e,a){Pr.S(t,e,a);var r=rs;if(r&&t){var n=Oi(r).hoistableStyles,o=Yi(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Vl(o)))s.loading=5;else{t=Pe({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ea.get(o))&&mg(t,a);var l=i=r.createElement("link");pt(l),St(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Vc(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function fM(t,e){Pr.X(t,e);var a=rs;if(a&&t){var r=Oi(a).hoistableScripts,n=ns(t),o=r.get(n);o||(o=a.querySelector($l(n)),o||(t=Pe({src:t,async:!0},e),(e=Ea.get(n))&&gg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function pM(t,e){Pr.M(t,e);var a=rs;if(a&&t){var r=Oi(a).hoistableScripts,n=ns(t),o=r.get(n);o||(o=a.querySelector($l(n)),o||(t=Pe({src:t,async:!0,type:"module"},e),(e=Ea.get(n))&&gg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function h0(t,e,a,r){var n=(n=wn.current)?vd(n):null;if(!n)throw Error(D(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Yi(a.href),a=Oi(n).hoistableStyles,r=a.get(e),r||(r={type:"style",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Yi(a.href);var o=Oi(n).hoistableStyles,i=o.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=n.querySelector(Vl(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Ea.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ea.set(t,a),o||hM(n,t,a,i.state))),e&&r===null)throw Error(D(528,""));return i}if(e&&r!==null)throw Error(D(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ns(a),a=Oi(n).hoistableScripts,r=a.get(e),r||(r={type:"script",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,t))}}function Yi(t){return'href="'+wa(t)+'"'}function Vl(t){return'link[rel="stylesheet"]['+t+"]"}function tw(t){return Pe({},t,{"data-precedence":t.precedence,precedence:null})}function hM(t,e,a,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),St(e,"link",a),pt(e),t.head.appendChild(e))}function ns(t){return'[src="'+wa(t)+'"]'}function $l(t){return"script[async]"+t}function m0(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+wa(a.href)+'"]');if(r)return e.instance=r,pt(r),r;var n=Pe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),St(r,"style",n),Vc(r,a.precedence,t),e.instance=r;case"stylesheet":n=Yi(a.href);var o=t.querySelector(Vl(n));if(o)return e.state.loading|=4,e.instance=o,pt(o),o;r=tw(a),(n=Ea.get(n))&&mg(r,n),o=(t.ownerDocument||t).createElement("link"),pt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),e.state.loading|=4,Vc(o,a.precedence,t),e.instance=o;case"script":return o=ns(a.src),(n=t.querySelector($l(o)))?(e.instance=n,pt(n),n):(r=a,(n=Ea.get(o))&&(r=Pe({},a),gg(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),pt(n),St(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(D(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Vc(r,a.precedence,t));return e.instance}function Vc(t,e,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,o=n,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===e)o=s;else if(o!==n)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function mg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function gg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var $c=null;function g0(t,e,a){if($c===null){var r=new Map,n=$c=new Map;n.set(a,r)}else n=$c,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),n=0;n<a.length;n++){var o=a[n];if(!(o[Nl]||o[yt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function v0(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function mM(t,e,a){if(a===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 aw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gM(t,e,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Yi(r.href),o=e.querySelector(Vl(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=yd.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,pt(o);return}o=e.ownerDocument||e,r=tw(r),(n=Ea.get(n))&&mg(r,n),o=o.createElement("link"),pt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=yd.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Eh=0;function vM(t,e){return t.stylesheets&&t.count===0&&jc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&jc(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Eh===0&&(Eh=62500*KR());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&jc(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Eh?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function yd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var xd=null;function jc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,xd=new Map,e.forEach(yM,t),xd=null,yd.call(t))}function yM(t,e){if(!(e.state.loading&4)){var a=xd.get(t);if(a)var r=a.get(null);else{a=new Map,xd.set(t,a);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var i=n[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),r=i)}r&&a.set(null,r)}n=e.instance,i=n.getAttribute("data-precedence"),o=a.get(i)||r,o===r&&a.set(null,n),a.set(i,n),this.count++,r=yd.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),o?o.parentNode.insertBefore(n,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(n,t.firstChild)),e.state.loading|=4}}var Tl={$$typeof:Ar,Provider:null,Consumer:null,_currentValue:bo,_currentValue2:bo,_threadCount:0};function xM(t,e,a,r,n,o,i,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=th(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=th(0),this.hiddenUpdates=th(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function rw(t,e,a,r,n,o,i,s,l,u,c,d){return t=new xM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=oa(3,null,null,e),t.current=o,o.stateNode=t,e=zm(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},jm(o),t}function nw(t){return t?(t=Ti,t):Ti}function ow(t,e,a,r,n,o){n=nw(n),r.context===null?r.context=n:r.pendingContext=n,r=In(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=An(t,r,e),a!==null&&(Gt(a,t,e),cl(a,t,e))}function y0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function vg(t,e){y0(t,e),(t=t.alternate)&&y0(t,e)}function iw(t){if(t.tag===13||t.tag===31){var e=Do(t,67108864);e!==null&&Gt(e,t,67108864),vg(t,67108864)}}function x0(t){if(t.tag===13||t.tag===31){var e=ca();e=km(e);var a=Do(t,e);a!==null&&Gt(a,t,e),vg(t,e)}}var bd=!0;function bM(t,e,a,r){var n=te.T;te.T=null;var o=xe.p;try{xe.p=2,yg(t,e,a,r)}finally{xe.p=o,te.T=n}}function SM(t,e,a,r){var n=te.T;te.T=null;var o=xe.p;try{xe.p=8,yg(t,e,a,r)}finally{xe.p=o,te.T=n}}function yg(t,e,a,r){if(bd){var n=_m(r);if(n===null)Ah(t,e,r,Sd,a),b0(t,r);else if(_M(n,t,e,a,r))r.stopPropagation();else if(b0(t,r),e&4&&-1<CM.indexOf(t)){for(;n!==null;){var o=Ji(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=vo(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-ua(i);s.entanglements[1]|=l,i&=~l}ur(o),(ye&6)===0&&(cd=sa()+500,zl(0,!1))}}break;case 31:case 13:s=Do(o,2),s!==null&&Gt(s,o,2),Od(),vg(o,2)}if(o=_m(r),o===null&&Ah(t,e,r,Sd,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Ah(t,e,r,null,a)}}function _m(t){return t=Mm(t),xg(t)}var Sd=null;function xg(t){if(Sd=null,t=wi(t),t!==null){var e=Dl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=I0(e),t!==null)return t;t=null}else if(a===31){if(t=A0(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Sd=t,null}function sw(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(uT()){case R0:return 2;case M0:return 8;case Yc:case cT:return 32;case D0:return 268435456;default:return 32}default:return 32}}var wm=!1,Tn=null,Rn=null,Mn=null,Rl=new Map,Ml=new Map,yn=[],CM="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 b0(t,e){switch(t){case"focusin":case"focusout":Tn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Rl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ml.delete(e.pointerId)}}function Js(t,e,a,r,n,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:r,nativeEvent:o,targetContainers:[n]},e!==null&&(e=Ji(e),e!==null&&iw(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function _M(t,e,a,r,n){switch(e){case"focusin":return Tn=Js(Tn,t,e,a,r,n),!0;case"dragenter":return Rn=Js(Rn,t,e,a,r,n),!0;case"mouseover":return Mn=Js(Mn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Rl.set(o,Js(Rl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Ml.set(o,Js(Ml.get(o)||null,t,e,a,r,n)),!0}return!1}function lw(t){var e=wi(t.target);if(e!==null){var a=Dl(e);if(a!==null){if(e=a.tag,e===13){if(e=I0(a),e!==null){t.blockedOn=e,rS(t.priority,function(){x0(a)});return}}else if(e===31){if(e=A0(a),e!==null){t.blockedOn=e,rS(t.priority,function(){x0(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=_m(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);zh=r,a.target.dispatchEvent(r),zh=null}else return e=Ji(a),e!==null&&iw(e),t.blockedOn=a,!1;e.shift()}return!0}function S0(t,e,a){Gc(t)&&a.delete(e)}function wM(){wm=!1,Tn!==null&&Gc(Tn)&&(Tn=null),Rn!==null&&Gc(Rn)&&(Rn=null),Mn!==null&&Gc(Mn)&&(Mn=null),Rl.forEach(S0),Ml.forEach(S0)}function Tc(t,e){t.blockedOn===e&&(t.blockedOn=null,wm||(wm=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,wM)))}var Rc=null;function C0(t){Rc!==t&&(Rc=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Rc===t&&(Rc=null);for(var e=0;e<t.length;e+=3){var a=t[e],r=t[e+1],n=t[e+2];if(typeof r!="function"){if(xg(r||a)===null)continue;break}var o=Ji(a);o!==null&&(t.splice(e,3),e-=3,nm(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function Ki(t){function e(l){return Tc(l,t)}Tn!==null&&Tc(Tn,t),Rn!==null&&Tc(Rn,t),Mn!==null&&Tc(Mn,t),Rl.forEach(e),Ml.forEach(e);for(var a=0;a<yn.length;a++){var r=yn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<yn.length&&(a=yn[0],a.blockedOn===null);)lw(a),a.blockedOn===null&&yn.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],o=a[r+1],i=n[Wt]||null;if(typeof o=="function")i||C0(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[Wt]||null)s=i.formAction;else if(xg(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),C0(a)}}}function uw(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return n=i})},focusReset:"manual",scroll:"manual"})}function e(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!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 r=!1,n=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),n!==null&&(n(),n=null)}}}function bg(t){this._internalRoot=t}Nd.prototype.render=bg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));var a=e.current,r=ca();ow(a,r,t,e,null,null)};Nd.prototype.unmount=bg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;ow(t.current,2,null,t,null,null),Od(),e[Qi]=null}};function Nd(t){this._internalRoot=t}Nd.prototype.unstable_scheduleHydration=function(t){if(t){var e=P0();t={blockedOn:null,target:t,priority:e};for(var a=0;a<yn.length&&e!==0&&e<yn[a].priority;a++);yn.splice(a,0,t),a===0&&lw(t)}};var _0=w0.version;if(_0!=="19.2.4")throw Error(D(527,_0,"19.2.4"));xe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=aT(e),t=t!==null?k0(t):null,t=t===null?null:t.stateNode,t};var LM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(el=__REACT_DEVTOOLS_GLOBAL_HOOK__,!el.isDisabled&&el.supportsFiber))try{Ol=el.inject(LM),la=el}catch{}var el;Pd.createRoot=function(t,e){if(!L0(t))throw Error(D(299));var a=!1,r="",n=e_,o=t_,i=a_;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(n=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=rw(t,1,!1,null,null,a,r,null,n,o,i,uw),t[Qi]=e.current,hg(t),new bg(e)};Pd.hydrateRoot=function(t,e,a){if(!L0(t))throw Error(D(299));var r=!1,n="",o=e_,i=t_,s=a_,l=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),e=rw(t,1,!0,e,a??null,r,n,l,o,i,s,uw),e.context=nw(null),a=e.current,r=ca(),r=km(r),n=In(r),n.callback=null,An(a,n,r),a=r,e.current.lanes=a,Fl(e,a),ur(e),t[Qi]=e.current,hg(t),new Nd(e)};Pd.version="19.2.4"});var Bo=tr((uH,fw)=>{"use strict";function dw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dw)}catch(t){console.error(t)}}dw(),fw.exports=cw()});var lL=tr(af=>{"use strict";var b2=Symbol.for("react.transitional.element"),S2=Symbol.for("react.fragment");function sL(t,e,a){var r=null;if(a!==void 0&&(r=""+a),e.key!==void 0&&(r=""+e.key),"key"in e){a={};for(var n in e)n!=="key"&&(a[n]=e[n])}else a=e;return e=a.ref,{$$typeof:b2,type:t,key:r,ref:e!==void 0?e:null,props:a}}af.Fragment=S2;af.jsx=sL;af.jsxs=sL});var Me=tr((I4,uL)=>{"use strict";uL.exports=lL()});var LE=K(We(),1),Rp=K($s(),1),eH=K(Bo(),1);function pw(t,e,a,r){let n=r?.maxRetries??3,o=r?.debounceMs??50,i=t.parentElement??e.parentElement;if(!i)return()=>{};let s=0,l=null,u=!1,c=new MutationObserver(d=>{if(!u){for(let h of d)for(let m of h.removedNodes)if(m===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var IM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Sg(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 a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!IM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),m=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||m)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var hw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=Sg(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),m=(a.parentElement??a).querySelector(`[${n}="${d}"]`);m&&m.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(n,o),i.innerHTML=r;let s=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":s=a.innerHTML,a.replaceWith(i);break}let l=null;if(t.deepLink){let{tileId:d,itemId:h}=t.deepLink;l=()=>{let m=window.SynOS?.handle;m&&(m.open(),m.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:h}))},i.style.cursor="pointer",i.addEventListener("click",l)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let c=pw(i,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":break}});return{cleanup:()=>{if(l&&i.removeEventListener("click",l),c(),t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(h=>{d.setAttribute(h.name,h.value)}),i.replaceWith(d)}else i.remove()},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=Sg(d.html))}}},mw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=r},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},gw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.attr.toLowerCase();if(r.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(r==="href"||r==="src"||r==="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=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},vw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||a.classList.remove(t.className)}}},yw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&a.classList.add(t.className)}}},xw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=new Map;for(let n of Object.keys(t.styles)){let o=a.style.getPropertyValue(n);r.set(n,o)}for(let[n,o]of Object.entries(t.styles))a.style.setProperty(n,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[n,o]of r)o?a.style.setProperty(n,o):a.style.removeProperty(n)},updateFn:n=>{if("styles"in n&&typeof n.styles=="object"&&n.styles)for(let[o,i]of Object.entries(n.styles))a.style.setProperty(o,i)}}},Cg=[{kind:"content:insertHtml",executor:hw},{kind:"content:setText",executor:mw},{kind:"content:setAttr",executor:gw},{kind:"content:addClass",executor:vw},{kind:"content:removeClass",executor:yw},{kind:"content:setStyle",executor:xw}],_g={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Cg};var AM={light:50,medium:100,heavy:200},kM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],bw={init(t,e,a){let r=AM[a.intensity],n=a.colors.length>0?a.colors:kM,o=[];for(let i=0;i<r;i++)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:n[Math.floor(Math.random()*n.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let r=!1;for(let n of t)n.vy+=.15,n.vx*=.99,n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y>0&&n.opacity>0&&n.y>500&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var EM={light:20,medium:40,heavy:80},TM="\u{1F389}",Sw={init(t,e,a){let r=EM[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:TM,o=[];for(let i=0;i<r;i++)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:n,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let i of o)i.data&&(i.data.originX=i.x);return o},update(t,e,a){let r=!1;for(let n of t){n.y+=n.vy;let o=n.data?.wobblePhase??0,i=n.data?.wobbleAmp??1,s=n.data?.originX??n.x;n.x=s+Math.sin(a*.003+o)*i*20,n.y>600&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e)a.opacity<.01||!a.emoji||(t.save(),t.globalAlpha=a.opacity,t.font=`${a.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.emoji,a.x,a.y),t.restore())}};var RM={light:20,medium:40,heavy:80},MM={light:3,medium:4,heavy:5},Cw={init(t,e,a){let r=RM[a.intensity],n=MM[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<n;s++){let l=Math.random()*t*.8+t*.1,u=Math.random()*e*.6,c=o[Math.floor(Math.random()*o.length)];for(let d=0;d<r;d++){let h=Math.PI*2*d/r+(Math.random()-.5)*.3,m=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(h)*m,vy:Math.sin(h)*m,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let r=!1;for(let n of t)n.vx*=.97,n.vy*=.97,n.vy+=.03,n.x+=n.vx,n.y+=n.vy,n.opacity-=.008,n.opacity<0&&(n.opacity=0),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var DM={light:30,medium:60,heavy:120},_w={init(t,e,a){let r=DM[a.intensity],n=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<r;i++)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:n[Math.floor(Math.random()*n.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,a){let r=!1;for(let n of t){n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.data&&(n.data.baseOpacity=(n.data.baseOpacity??1)-.001,n.data.baseOpacity<0&&(n.data.baseOpacity=0));let o=n.data?.phase??0,i=n.data?.baseOpacity??1;if(i<=.01)n.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;n.opacity=i*s}n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e){if(a.opacity<.01)continue;t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation);let r=a.size;t.beginPath(),t.moveTo(0,-r),t.lineTo(r*.3,-r*.3),t.lineTo(r,0),t.lineTo(r*.3,r*.3),t.lineTo(0,r),t.lineTo(-r*.3,r*.3),t.lineTo(-r,0),t.lineTo(-r*.3,-r*.3),t.closePath(),t.fill(),t.restore()}}};var Hd=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,a,r){this.container=e,this.effect=a,this.duration=r.duration;let n=document.createElement("canvas");n.setAttribute("data-syntro-celebrate",""),Object.assign(n.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;n.width=i*o,n.height=s*o,n.style.width=`${i}px`,n.style.height=`${s}px`;let l=n.getContext("2d");l&&(l.scale(o,o),this.canvas=n,this.ctx=l,e.appendChild(n),this.particles=a.init(i,s,r),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 a=e-this.startTime,r=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let n=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,n,o),!this.effect.update(this.particles,r,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var OM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function BM(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function FM(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),r=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return BM(a,r||a)}catch{}return null}var ww=new Map([["confetti",bw],["fireworks",Cw],["sparkles",_w],["emoji-rain",Sw]]),Lw=async(t,e)=>{let a=ww.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...ww.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??FM(e.overlayRoot)??OM,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new Hd;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Lg="syntro_active_tour",Ud=new Map;function NM(t){try{let e=localStorage.getItem(Lg);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function wg(t){try{localStorage.setItem(Lg,JSON.stringify(t))}catch{}}function PM(){try{localStorage.removeItem(Lg)}catch{}}function jl(){return window.location.pathname}function HM(t){if(!t.route)return!0;let e=jl();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Ig=async(t,e)=>{let{tourId:a,steps:r,startStep:n,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${a}" has no steps`);if(Ud.has(a))return{cleanup:async()=>{let v=Ud.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=NM(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},wg(i));let l=r.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=n||r[0].id;l=r.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=r[l].id,wg(i)}let u=r[l];if(!HM(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:jl()}),{cleanup:()=>{}};let c=!1,d=null,h=null,m=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){PM(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,wg(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==jl()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await x(y)},x=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:r.findIndex(y=>y.id===v.id),totalSteps:r.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:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let L=v.onAction[C];L&&b(L)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let L=v.onAction[C];L&&b(L)}}),_=h;h=()=>{_(),y()}}}};m=(()=>{let v=jl(),y=()=>{let C=jl();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{w(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await x(u);let g=async()=>{c=!0,Ud.delete(a),await S(),m&&m(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Ud.set(a,{cleanup:g}),{cleanup:g}};var Va={white:"#ffffff",black:"#000000"},oe={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},I={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"},Ct={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},ze={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},pa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Gl={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Ft={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Wl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var ha={primary:I[10],secondary:I[9],tertiary:I[8]},AH={primary:I[2],secondary:I[0]},Ag={primary:I[4],secondary:I[3]},qd={primary:{text:Va.white,icon:Va.white,border:oe[3],backgroundDefault:oe[3],backgroundHover:oe[2]},neutral:{text:I[10],textHover:Va.white,icon:I[10],iconHover:Va.white,border:I[4],background:I[2]},link:{text:Va.white,icon:Va.white,hover:oe[5]},error:{text:ze[5],hover:ze[6]},success:{text:ke[5],hover:ke[6]}},kH={slateGrey:{content:I[10],pillOutline:I[10],borderPrimary:I[5],borderSecondary:I[5],background:I[3]},brand:{content:oe[9],pillOutline:oe[9],borderPrimary:oe[6],borderSecondary:oe[6],background:oe[0]},red:{content:ze[8],pillOutline:ze[4],borderPrimary:ze[2],borderSecondary:ze[2],background:ze[0]},yellow:{content:Ct[8],pillOutline:Ct[4],borderPrimary:Ct[2],borderSecondary:Ct[2],background:Ct[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:Ft[8],pillOutline:Ft[4],borderPrimary:Ft[2],borderSecondary:Ft[2],background:Ft[0]},blue:{content:pa[8],pillOutline:pa[4],borderPrimary:pa[2],borderSecondary:pa[2],background:pa[0]},orange:{content:Gl[8],pillOutline:Gl[4],borderPrimary:Gl[2],borderSecondary:Gl[2],background:Gl[0]},pink:{content:Wl[8],pillOutline:Wl[4],borderPrimary:Wl[2],borderSecondary:Wl[2],background:Wl[0]}},EH={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:Ct[8],border:Ct[2],background:Ct[0]},red:{content:ze[8],border:ze[2],background:ze[0]}},TH={green:{content:ke[1],background:ke[9]},yellow:{content:Ct[1],background:Ct[9]},red:{content:ze[1],background:ze[9]}},RH={content:I[10],border:I[4],background:"#1c2124"},MH={backgroundDefault:I[2],backgroundHover:I[1],selected:I[3]},DH={background:I[2],icon:I[10],borderDefault:I[4],borderSelected:oe[3],textLabel:I[9],textPlaceholder:I[8],textHint:I[8]},OH={backgroundDefault:I[2],backgroundDisabled:I[0],textLabel:I[9],textPlaceholder:I[8],textHint:I[8],textError:ze[5],iconDefault:I[9],iconPlaceholder:I[10],iconError:ze[5],borderDefault:I[4],borderSelected:oe[3],borderError:ze[5]},BH={handleDefault:Va.white,handleDisabled:I[10],off:{backgroundDefault:I[4],backgroundHover:I[5],backgroundDisabled:I[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:I[4]}},FH={off:{backgroundDefault:"#00000000",backgroundHover:I[5],backgroundDisabled:I[2],border:I[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:I[2],border:ke[3]}},NH={content:I[10],background:I[4]},PH={background:I[4],active:ke[3]},HH={background:I[1],content:I[9],border:I[4]},UH={backgroundDefault:I[1],backgroundHover:I[3],backgroundActive:I[4],border:I[4],contentPrimary:I[10],contentSecondary:I[9],contentTertiary:I[8]},qH={background:I[1],content:I[9],border:I[4]},zH={activeBackground:I[3],activeContent:oe[5],inactiveContent:I[9],border:I[4]},VH={header:{textDefault:I[9],textHover:I[8],backgroundDefault:I[1]},border:I[4],cell:{textPrimary:I[10],textSecondary:I[9],backgroundDefault:I[2],backgroundHover:I[1]}},$H={textPrimaryDefault:I[10],textPrimaryHover:I[10],textSecondaryDefault:I[8],textSecondaryHover:I[9],iconPrimary:I[10],iconSecondary:I[8]},jH={background:ke[1],active:ke[5]},GH={textDefault:I[10],textSelected:Va.white,textDisabled:I[7],backgroundDefault:I[2],backgroundMiddle:I[3],backgroundSelected:oe[3],border:I[4]},WH=I[9];var Iw=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function Aw(t,e,a){let r=a?.paddingPx??12,n=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${pa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=c.getPropertyValue("--syntro-ring").trim(),m=document.createElement("div");m.className="syntro-spotlight-scrim";let S=s||l;Object.assign(m.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(m),requestAnimationFrame(()=>m.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||h||pa[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(!Iw)for(let k=0;k<4;k++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),m.appendChild(A)}let f=k=>{m.style.clipPath=k,m.style.webkitClipPath=k},g=()=>{if(!t.isConnected){L.destroy();return}let k=t.getBoundingClientRect(),A=Math.max(0,k.left-r),M=Math.max(0,k.top-r),T=Math.min(window.innerWidth,k.width+r*2),R=Math.min(window.innerHeight,k.height+r*2);if(Object.assign(b.style,{left:`${A}px`,top:`${M}px`,width:`${T}px`,height:`${R}px`}),Iw){let B=window.innerWidth,F=window.innerHeight,P=Math.min(n,T/2,R/2),Y=`M 0 0 L ${B} 0 L ${B} ${F} L 0 ${F} Z`,N=`M ${A+P} ${M} A ${P} ${P} 0 0 0 ${A} ${M+P} L ${A} ${M+R-P} A ${P} ${P} 0 0 0 ${A+P} ${M+R} L ${A+T-P} ${M+R} A ${P} ${P} 0 0 0 ${A+T} ${M+R-P} L ${A+T} ${M+P} A ${P} ${P} 0 0 0 ${A+T-P} ${M} L ${A+P} ${M} Z`;f(`path('${Y} ${N}')`)}else{let[B,F,P,Y]=x;Object.assign(B.style,{left:"0px",top:"0px",width:"100vw",height:`${M}px`}),Object.assign(P.style,{left:"0px",top:`${M+R}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(M+R))}px`}),Object.assign(Y.style,{left:"0px",top:`${M}px`,width:`${A}px`,height:`${R}px`}),Object.assign(F.style,{left:`${A+T}px`,top:`${M}px`,width:`${Math.max(0,window.innerWidth-(A+T))}px`,height:`${R}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(g));v.observe(t);let y=()=>requestAnimationFrame(g),_=()=>requestAnimationFrame(g);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let w=k=>{k.key==="Escape"&&u&&L.destroy()};u&&window.addEventListener("keydown",w);let C=k=>{s?(k.preventDefault(),k.stopPropagation()):l&&L.destroy()};m.addEventListener("click",C);let L={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",w),m.removeEventListener("click",C),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),b.remove()},220)}};return g(),L}var UM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ma(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 a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!UM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||h)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Fo={bg:"var(--sc-overlay-background, #ffffff)",title:"var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))",text:"var(--sc-overlay-text-color, #4b5563)",accent:"var(--sc-color-primary, #4f46e5)",radius:"var(--sc-border-radius, 12px)"},kg=async(t,e)=>{let{content:a,size:r="md",blocking:n=!1,scrim:o,dismiss:i,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
8
+ `+r.stack}}var Fh=Object.prototype.hasOwnProperty,Im=it.unstable_scheduleCallback,Jp=it.unstable_cancelCallback,sT=it.unstable_shouldYield,lT=it.unstable_requestPaint,sa=it.unstable_now,uT=it.unstable_getCurrentPriorityLevel,R0=it.unstable_ImmediatePriority,M0=it.unstable_UserBlockingPriority,Xc=it.unstable_NormalPriority,cT=it.unstable_LowPriority,D0=it.unstable_IdlePriority,dT=it.log,fT=it.unstable_setDisableYieldValue,Ol=null,la=null;function xn(t){if(typeof dT=="function"&&fT(t),la&&typeof la.setStrictMode=="function")try{la.setStrictMode(Ol,t)}catch{}}var ua=Math.clz32?Math.clz32:mT,pT=Math.log,hT=Math.LN2;function mT(t){return t>>>=0,t===0?32:31-(pT(t)/hT|0)|0}var hc=256,mc=262144,gc=4194304;function vo(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 Sd(t,e,a){var r=t.pendingLanes;if(r===0)return 0;var n=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?n=vo(r):(i&=s,i!==0?n=vo(i):a||(a=s&~t,a!==0&&(n=vo(a))))):(s=r&~o,s!==0?n=vo(s):i!==0?n=vo(i):a||(a=r&~t,a!==0&&(n=vo(a)))),n===0?0:e!==0&&e!==n&&(e&o)===0&&(o=n&-n,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:n}function Bl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function gT(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 O0(){var t=gc;return gc<<=1,(gc&62914560)===0&&(gc=4194304),t}function eh(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Fl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vT(t,e,a,r,n,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-ua(a),d=1<<c;s[c]=0,l[c]=-1;var h=u[c];if(h!==null)for(u[c]=null,c=0;c<h.length;c++){var m=h[c];m!==null&&(m.lane&=-536870913)}a&=~d}r!==0&&B0(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function B0(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-ua(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function F0(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-ua(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function N0(t,e){var a=e&-e;return a=(a&42)!==0?1:Am(a),(a&(t.suspendedLanes|e))!==0?0:a}function Am(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 km(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function P0(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:sw(t.type))}function rS(t,e){var a=xe.p;try{return xe.p=t,e()}finally{xe.p=a}}var Nn=Math.random().toString(36).slice(2),yt="__reactFiber$"+Nn,Wt="__reactProps$"+Nn,Qi="__reactContainer$"+Nn,Nh="__reactEvents$"+Nn,yT="__reactListeners$"+Nn,xT="__reactHandles$"+Nn,nS="__reactResources$"+Nn,Nl="__reactMarker$"+Nn;function Em(t){delete t[yt],delete t[Wt],delete t[Nh],delete t[yT],delete t[xT]}function wi(t){var e=t[yt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[Qi]||a[yt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=f0(t);t!==null;){if(a=t[yt])return a;t=f0(t)}return e}t=a,a=t.parentNode}return null}function Ji(t){if(t=t[yt]||t[Qi]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function rl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(D(33))}function Oi(t){var e=t[nS];return e||(e=t[nS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function pt(t){t[Nl]=!0}var H0=new Set,U0={};function To(t,e){zi(t,e),zi(t+"Capture",e)}function zi(t,e){for(U0[t]=e,t=0;t<e.length;t++)H0.add(e[t])}var bT=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]*$"),oS={},iS={};function ST(t){return Fh.call(iS,t)?!0:Fh.call(oS,t)?!1:bT.test(t)?iS[t]=!0:(oS[t]=!0,!1)}function Rc(t,e,a){if(ST(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function vc(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function br(t,e,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+r)}}function Sa(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function q0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function CT(t,e,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ph(t){if(!t._valueTracker){var e=q0(t)?"checked":"value";t._valueTracker=CT(t,e,""+t[e])}}function z0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=q0(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Yc(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 _T=/[\n"\\]/g;function wa(t){return t.replace(_T,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Hh(t,e,a,r,n,o,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),e!=null?i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Sa(e)):t.value!==""+Sa(e)&&(t.value=""+Sa(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?Uh(t,i,Sa(e)):a!=null?Uh(t,i,Sa(a)):r!=null&&t.removeAttribute("value"),n==null&&o!=null&&(t.defaultChecked=!!o),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Sa(s):t.removeAttribute("name")}function V0(t,e,a,r,n,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Ph(t);return}a=a!=null?""+Sa(a):"",e=e!=null?""+Sa(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Ph(t)}function Uh(t,e,a){e==="number"&&Yc(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Bi(t,e,a,r){if(t=t.options,e){e={};for(var n=0;n<a.length;n++)e["$"+a[n]]=!0;for(a=0;a<t.length;a++)n=e.hasOwnProperty("$"+t[a].value),t[a].selected!==n&&(t[a].selected=n),n&&r&&(t[a].defaultSelected=!0)}else{for(a=""+Sa(a),e=null,n=0;n<t.length;n++){if(t[n].value===a){t[n].selected=!0,r&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function $0(t,e,a){if(e!=null&&(e=""+Sa(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Sa(a):""}function j0(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(D(92));if(al(r)){if(1<r.length)throw Error(D(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Sa(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Ph(t)}function Vi(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var wT=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 sS(t,e,a){var r=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,a):typeof a!="number"||a===0||wT.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function G0(t,e,a){if(e!=null&&typeof e!="object")throw Error(D(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var n in e)r=e[n],e.hasOwnProperty(n)&&a[n]!==r&&sS(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&sS(t,o,e[o])}function Tm(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 LT=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"]]),IT=/^[\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 Mc(t){return IT.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function kr(){}var qh=null;function Rm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Li=null,Fi=null;function lS(t){var e=Ji(t);if(e&&(t=e.stateNode)){var a=t[Wt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Hh(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[Wt]||null;if(!n)throw Error(D(90));Hh(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(e=0;e<a.length;e++)r=a[e],r.form===t.form&&z0(r)}break e;case"textarea":$0(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Bi(t,!!a.multiple,e,!1)}}}var th=!1;function W0(t,e,a){if(th)return t(e,a);th=!0;try{var r=t(e);return r}finally{if(th=!1,(Li!==null||Fi!==null)&&(Dd(),Li&&(e=Li,t=Fi,Fi=Li=null,lS(e),t)))for(e=0;e<t.length;e++)lS(t[e])}}function bl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[Wt]||null;if(r===null)return null;a=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(D(231,e,typeof a));return a}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zh=!1;if(Dr)try{vi={},Object.defineProperty(vi,"passive",{get:function(){zh=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{zh=!1}var vi,bn=null,Mm=null,Dc=null;function Z0(){if(Dc)return Dc;var t,e=Mm,a=e.length,r,n="value"in bn?bn.value:bn.textContent,o=n.length;for(t=0;t<a&&e[t]===n[t];t++);var i=a-t;for(r=1;r<=i&&e[a-r]===n[o-r];r++);return Dc=n.slice(t,1<r?1-r:void 0)}function Oc(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 yc(){return!0}function uS(){return!1}function Zt(t){function e(a,r,n,o,i){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(a=t[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?yc:uS,this.isPropagationStopped=uS,this}return Pe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=yc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=yc)},persist:function(){},isPersistent:yc}),e}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=Zt(Ro),Pl=Pe({},Ro,{view:0,detail:0}),AT=Zt(Pl),ah,rh,Xs,_d=Pe({},Pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,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!==Xs&&(Xs&&t.type==="mousemove"?(ah=t.screenX-Xs.screenX,rh=t.screenY-Xs.screenY):rh=ah=0,Xs=t),ah)},movementY:function(t){return"movementY"in t?t.movementY:rh}}),cS=Zt(_d),kT=Pe({},_d,{dataTransfer:0}),ET=Zt(kT),TT=Pe({},Pl,{relatedTarget:0}),nh=Zt(TT),RT=Pe({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),MT=Zt(RT),DT=Pe({},Ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OT=Zt(DT),BT=Pe({},Ro,{data:0}),dS=Zt(BT),FT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NT={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"},PT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=PT[t])?!!e[t]:!1}function Dm(){return HT}var UT=Pe({},Pl,{key:function(t){if(t.key){var e=FT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Oc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?NT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(t){return t.type==="keypress"?Oc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Oc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qT=Zt(UT),zT=Pe({},_d,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fS=Zt(zT),VT=Pe({},Pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),$T=Zt(VT),jT=Pe({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),GT=Zt(jT),WT=Pe({},_d,{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}),ZT=Zt(WT),XT=Pe({},Ro,{newState:0,oldState:0}),YT=Zt(XT),KT=[9,13,27,32],Om=Dr&&"CompositionEvent"in window,il=null;Dr&&"documentMode"in document&&(il=document.documentMode);var QT=Dr&&"TextEvent"in window&&!il,X0=Dr&&(!Om||il&&8<il&&11>=il),pS=" ",hS=!1;function Y0(t,e){switch(t){case"keyup":return KT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K0(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ii=!1;function JT(t,e){switch(t){case"compositionend":return K0(e);case"keypress":return e.which!==32?null:(hS=!0,pS);case"textInput":return t=e.data,t===pS&&hS?null:t;default:return null}}function eR(t,e){if(Ii)return t==="compositionend"||!Om&&Y0(t,e)?(t=Z0(),Dc=Mm=bn=null,Ii=!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 X0&&e.locale!=="ko"?null:e.data;default:return null}}var tR={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 mS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tR[t.type]:e==="textarea"}function Q0(t,e,a,r){Li?Fi?Fi.push(r):Fi=[r]:Li=r,e=hd(e,"onChange"),0<e.length&&(a=new Cd("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var sl=null,Sl=null;function aR(t){W_(t,0)}function wd(t){var e=rl(t);if(z0(e))return t}function gS(t,e){if(t==="change")return e}var J0=!1;Dr&&(Dr?(bc="oninput"in document,bc||(oh=document.createElement("div"),oh.setAttribute("oninput","return;"),bc=typeof oh.oninput=="function"),xc=bc):xc=!1,J0=xc&&(!document.documentMode||9<document.documentMode));var xc,bc,oh;function vS(){sl&&(sl.detachEvent("onpropertychange",eC),Sl=sl=null)}function eC(t){if(t.propertyName==="value"&&wd(Sl)){var e=[];Q0(e,Sl,t,Rm(t)),W0(aR,e)}}function rR(t,e,a){t==="focusin"?(vS(),sl=e,Sl=a,sl.attachEvent("onpropertychange",eC)):t==="focusout"&&vS()}function nR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return wd(Sl)}function oR(t,e){if(t==="click")return wd(e)}function iR(t,e){if(t==="input"||t==="change")return wd(e)}function sR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var da=typeof Object.is=="function"?Object.is:sR;function Cl(t,e){if(da(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),r=Object.keys(e);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!Fh.call(e,n)||!da(t[n],e[n]))return!1}return!0}function yS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xS(t,e){var a=yS(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=e&&r>=e)return{node:a,offset:e-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=yS(a)}}function tC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?tC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function aC(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Yc(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Yc(t.document)}return e}function Bm(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 lR=Dr&&"documentMode"in document&&11>=document.documentMode,Ai=null,Vh=null,ll=null,$h=!1;function bS(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;$h||Ai==null||Ai!==Yc(r)||(r=Ai,"selectionStart"in r&&Bm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ll&&Cl(ll,r)||(ll=r,r=hd(Vh,"onSelect"),0<r.length&&(e=new Cd("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=Ai)))}function mo(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var ki={animationend:mo("Animation","AnimationEnd"),animationiteration:mo("Animation","AnimationIteration"),animationstart:mo("Animation","AnimationStart"),transitionrun:mo("Transition","TransitionRun"),transitionstart:mo("Transition","TransitionStart"),transitioncancel:mo("Transition","TransitionCancel"),transitionend:mo("Transition","TransitionEnd")},ih={},rC={};Dr&&(rC=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function Mo(t){if(ih[t])return ih[t];if(!ki[t])return t;var e=ki[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in rC)return ih[t]=e[a];return t}var nC=Mo("animationend"),oC=Mo("animationiteration"),iC=Mo("animationstart"),uR=Mo("transitionrun"),cR=Mo("transitionstart"),dR=Mo("transitioncancel"),sC=Mo("transitionend"),lC=new Map,jh="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(" ");jh.push("scrollEnd");function za(t,e){lC.set(t,e),To(e,[t])}var Kc=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)},ba=[],Ei=0,Fm=0;function Ld(){for(var t=Ei,e=Fm=Ei=0;e<t;){var a=ba[e];ba[e++]=null;var r=ba[e];ba[e++]=null;var n=ba[e];ba[e++]=null;var o=ba[e];if(ba[e++]=null,r!==null&&n!==null){var i=r.pending;i===null?n.next=n:(n.next=i.next,i.next=n),r.pending=n}o!==0&&uC(a,n,o)}}function Id(t,e,a,r){ba[Ei++]=t,ba[Ei++]=e,ba[Ei++]=a,ba[Ei++]=r,Fm|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Nm(t,e,a,r){return Id(t,e,a,r),Qc(t)}function Do(t,e){return Id(t,null,null,e),Qc(t)}function uC(t,e,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var n=!1,o=t.return;o!==null;)o.childLanes|=a,r=o.alternate,r!==null&&(r.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(n=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,n&&e!==null&&(n=31-ua(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function Qc(t){if(50<vl)throw vl=0,fm=null,Error(D(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ti={};function fR(t,e,a,r){this.tag=t,this.key=a,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oa(t,e,a,r){return new fR(t,e,a,r)}function Pm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Tr(t,e){var a=t.alternate;return a===null?(a=oa(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function cC(t,e){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Bc(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Pm(t)&&(i=1);else if(typeof t=="string")i=mM(t,a,sr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Mh:return t=oa(31,a,e,n),t.elementType=Mh,t.lanes=o,t;case Ci:return So(a.children,n,o,e);case E0:i=8,n|=24;break;case Eh:return t=oa(12,a,e,n|2),t.elementType=Eh,t.lanes=o,t;case Th:return t=oa(13,a,e,n),t.elementType=Th,t.lanes=o,t;case Rh:return t=oa(19,a,e,n),t.elementType=Rh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ar:i=10;break e;case T0:i=9;break e;case wm:i=11;break e;case Lm:i=14;break e;case pn:i=16,r=null;break e}i=29,a=Error(D(130,t===null?"null":typeof t,"")),r=null}return e=oa(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function So(t,e,a,r){return t=oa(7,t,r,e),t.lanes=a,t}function sh(t,e,a){return t=oa(6,t,null,e),t.lanes=a,t}function dC(t){var e=oa(18,null,null,0);return e.stateNode=t,e}function lh(t,e,a){return e=oa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var SS=new WeakMap;function La(t,e){if(typeof t=="object"&&t!==null){var a=SS.get(t);return a!==void 0?a:(e={value:t,source:e,stack:aS(e)},SS.set(t,e),e)}return{value:t,source:e,stack:aS(e)}}var Ri=[],Mi=0,Jc=null,_l=0,Ca=[],_a=0,Dn=null,nr=1,or="";function Lr(t,e){Ri[Mi++]=_l,Ri[Mi++]=Jc,Jc=t,_l=e}function fC(t,e,a){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Dn,Dn=t;var r=nr;t=or;var n=32-ua(r)-1;r&=~(1<<n),a+=1;var o=32-ua(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,nr=1<<32-ua(e)+n|a<<n|r,or=o+t}else nr=1<<o|a<<n|r,or=t}function Hm(t){t.return!==null&&(Lr(t,1),fC(t,1,0))}function Um(t){for(;t===Jc;)Jc=Ri[--Mi],Ri[Mi]=null,_l=Ri[--Mi],Ri[Mi]=null;for(;t===Dn;)Dn=Ca[--_a],Ca[_a]=null,or=Ca[--_a],Ca[_a]=null,nr=Ca[--_a],Ca[_a]=null}function pC(t,e){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Dn,nr=e.id,or=e.overflow,Dn=t}var xt=null,Ne=null,me=!1,Ln=null,Ia=!1,Gh=Error(D(519));function On(t){var e=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wl(La(e,t)),Gh}function CS(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[yt]=t,e[Wt]=r,a){case"dialog":ce("cancel",e),ce("close",e);break;case"iframe":case"object":case"embed":ce("load",e);break;case"video":case"audio":for(a=0;a<kl.length;a++)ce(kl[a],e);break;case"source":ce("error",e);break;case"img":case"image":case"link":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"input":ce("invalid",e),V0(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ce("invalid",e);break;case"textarea":ce("invalid",e),j0(e,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||r.suppressHydrationWarning===!0||X_(e.textContent,a)?(r.popover!=null&&(ce("beforetoggle",e),ce("toggle",e)),r.onScroll!=null&&ce("scroll",e),r.onScrollEnd!=null&&ce("scrollend",e),r.onClick!=null&&(e.onclick=kr),e=!0):e=!1,e||On(t,!0)}function _S(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 31:case 13:Ia=!1;return;case 27:case 3:Ia=!0;return;default:xt=xt.return}}function yi(t){if(t!==xt)return!1;if(!me)return _S(t),me=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||vm(t.type,t.memoizedProps)),a=!a),a&&Ne&&On(t),_S(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));Ne=d0(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));Ne=d0(t)}else e===27?(e=Ne,Pn(t.type)?(t=Sm,Sm=null,Ne=t):Ne=e):Ne=xt?ka(t.stateNode.nextSibling):null;return!0}function Lo(){Ne=xt=null,me=!1}function uh(){var t=Ln;return t!==null&&(jt===null?jt=t:jt.push.apply(jt,t),Ln=null),t}function wl(t){Ln===null?Ln=[t]:Ln.push(t)}var Wh=lr(null),Oo=null,Er=null;function mn(t,e,a){Re(Wh,e._currentValue),e._currentValue=a}function Rr(t){t._currentValue=Wh.current,ht(Wh)}function Zh(t,e,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===a)break;t=t.return}}function Xh(t,e,a,r){var n=t.child;for(n!==null&&(n.return=t);n!==null;){var o=n.dependencies;if(o!==null){var i=n.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=n;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),Zh(o.return,a,t),r||(i=null);break e}o=s.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(D(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Zh(i,a,t),i=null}else i=n.child;if(i!==null)i.return=n;else for(i=n;i!==null;){if(i===t){i=null;break}if(n=i.sibling,n!==null){n.return=i.return,i=n;break}i=i.return}n=i}}function es(t,e,a,r){t=null;for(var n=e,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(D(387));if(i=i.memoizedProps,i!==null){var s=n.type;da(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===Gc.current){if(i=n.alternate,i===null)throw Error(D(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(Tl):t=[Tl])}n=n.return}t!==null&&Xh(e,t,a,r),e.flags|=262144}function ed(t){for(t=t.firstContext;t!==null;){if(!da(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Io(t){Oo=t,Er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return hC(Oo,t)}function Sc(t,e){return Oo===null&&Io(t),hC(t,e)}function hC(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Er===null){if(t===null)throw Error(D(308));Er=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Er=Er.next=e;return a}var pR=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},hR=it.unstable_scheduleCallback,mR=it.unstable_NormalPriority,at={$$typeof:Ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qm(){return{controller:new pR,data:new Map,refCount:0}}function Hl(t){t.refCount--,t.refCount===0&&hR(mR,function(){t.controller.abort()})}var ul=null,Yh=0,$i=0,Ni=null;function gR(t,e){if(ul===null){var a=ul=[];Yh=0,$i=fg(),Ni={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Yh++,e.then(wS,wS),e}function wS(){if(--Yh===0&&ul!==null){Ni!==null&&(Ni.status="fulfilled");var t=ul;ul=null,$i=0,Ni=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function vR(t,e){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var n=0;n<a.length;n++)(0,a[n])(e)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var LS=te.S;te.S=function(t,e){k_=sa(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&gR(t,e),LS!==null&&LS(t,e)};var Co=lr(null);function zm(){var t=Co.current;return t!==null?t:Ae.pooledCache}function Fc(t,e){e===null?Re(Co,Co.current):Re(Co,e.pool)}function mC(){var t=zm();return t===null?null:{parent:at._currentValue,pool:t}}var ts=Error(D(460)),Vm=Error(D(474)),Ad=Error(D(542)),td={then:function(){}};function IS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function gC(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(kr,kr),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kS(t),t;default:if(typeof e.status=="string")e.then(kr,kr);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(D(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=r}},function(r){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kS(t),t}throw _o=e,ts}}function yo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(_o=a,ts):a}}var _o=null;function AS(){if(_o===null)throw Error(D(459));var t=_o;return _o=null,t}function kS(t){if(t===ts||t===Ad)throw Error(D(483))}var Pi=null,Ll=0;function Cc(t){var e=Ll;return Ll+=1,Pi===null&&(Pi=[]),gC(Pi,t,e)}function Ys(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function _c(t,e){throw e.$$typeof===rT?Error(D(525)):(t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function vC(t){function e(f,g){if(t){var v=f.deletions;v===null?(f.deletions=[g],f.flags|=16):v.push(g)}}function a(f,g){if(!t)return null;for(;g!==null;)e(f,g),g=g.sibling;return null}function r(f){for(var g=new Map;f!==null;)f.key!==null?g.set(f.key,f):g.set(f.index,f),f=f.sibling;return g}function n(f,g){return f=Tr(f,g),f.index=0,f.sibling=null,f}function o(f,g,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<g?(f.flags|=67108866,g):v):(f.flags|=67108866,g)):(f.flags|=1048576,g)}function i(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,g,v,y){return g===null||g.tag!==6?(g=sh(v,f.mode,y),g.return=f,g):(g=n(g,v),g.return=f,g)}function l(f,g,v,y){var _=v.type;return _===Ci?c(f,g,v.props.children,y,v.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pn&&yo(_)===g.type)?(g=n(g,v.props),Ys(g,v),g.return=f,g):(g=Bc(v.type,v.key,v.props,null,f.mode,y),Ys(g,v),g.return=f,g)}function u(f,g,v,y){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=lh(v,f.mode,y),g.return=f,g):(g=n(g,v.children||[]),g.return=f,g)}function c(f,g,v,y,_){return g===null||g.tag!==7?(g=So(v,f.mode,y,_),g.return=f,g):(g=n(g,v),g.return=f,g)}function d(f,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=sh(""+g,f.mode,v),g.return=f,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case pc:return v=Bc(g.type,g.key,g.props,null,f.mode,v),Ys(v,g),v.return=f,v;case tl:return g=lh(g,f.mode,v),g.return=f,g;case pn:return g=yo(g),d(f,g,v)}if(al(g)||Zs(g))return g=So(g,f.mode,v,null),g.return=f,g;if(typeof g.then=="function")return d(f,Cc(g),v);if(g.$$typeof===Ar)return d(f,Sc(f,g),v);_c(f,g)}return null}function h(f,g,v,y){var _=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(f,g,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case pc:return v.key===_?l(f,g,v,y):null;case tl:return v.key===_?u(f,g,v,y):null;case pn:return v=yo(v),h(f,g,v,y)}if(al(v)||Zs(v))return _!==null?null:c(f,g,v,y,null);if(typeof v.then=="function")return h(f,g,Cc(v),y);if(v.$$typeof===Ar)return h(f,g,Sc(f,v),y);_c(f,v)}return null}function m(f,g,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(g,f,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case pc:return f=f.get(y.key===null?v:y.key)||null,l(g,f,y,_);case tl:return f=f.get(y.key===null?v:y.key)||null,u(g,f,y,_);case pn:return y=yo(y),m(f,g,v,y,_)}if(al(y)||Zs(y))return f=f.get(v)||null,c(g,f,y,_,null);if(typeof y.then=="function")return m(f,g,v,Cc(y),_);if(y.$$typeof===Ar)return m(f,g,v,Sc(g,y),_);_c(g,y)}return null}function S(f,g,v,y){for(var _=null,w=null,C=g,L=g=0,k=null;C!==null&&L<v.length;L++){C.index>L?(k=C,C=null):k=C.sibling;var A=h(f,C,v[L],y);if(A===null){C===null&&(C=k);break}t&&C&&A.alternate===null&&e(f,C),g=o(A,g,L),w===null?_=A:w.sibling=A,w=A,C=k}if(L===v.length)return a(f,C),me&&Lr(f,L),_;if(C===null){for(;L<v.length;L++)C=d(f,v[L],y),C!==null&&(g=o(C,g,L),w===null?_=C:w.sibling=C,w=C);return me&&Lr(f,L),_}for(C=r(C);L<v.length;L++)k=m(C,f,L,v[L],y),k!==null&&(t&&k.alternate!==null&&C.delete(k.key===null?L:k.key),g=o(k,g,L),w===null?_=k:w.sibling=k,w=k);return t&&C.forEach(function(M){return e(f,M)}),me&&Lr(f,L),_}function b(f,g,v,y){if(v==null)throw Error(D(151));for(var _=null,w=null,C=g,L=g=0,k=null,A=v.next();C!==null&&!A.done;L++,A=v.next()){C.index>L?(k=C,C=null):k=C.sibling;var M=h(f,C,A.value,y);if(M===null){C===null&&(C=k);break}t&&C&&M.alternate===null&&e(f,C),g=o(M,g,L),w===null?_=M:w.sibling=M,w=M,C=k}if(A.done)return a(f,C),me&&Lr(f,L),_;if(C===null){for(;!A.done;L++,A=v.next())A=d(f,A.value,y),A!==null&&(g=o(A,g,L),w===null?_=A:w.sibling=A,w=A);return me&&Lr(f,L),_}for(C=r(C);!A.done;L++,A=v.next())A=m(C,f,L,A.value,y),A!==null&&(t&&A.alternate!==null&&C.delete(A.key===null?L:A.key),g=o(A,g,L),w===null?_=A:w.sibling=A,w=A);return t&&C.forEach(function(T){return e(f,T)}),me&&Lr(f,L),_}function x(f,g,v,y){if(typeof v=="object"&&v!==null&&v.type===Ci&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case pc:e:{for(var _=v.key;g!==null;){if(g.key===_){if(_=v.type,_===Ci){if(g.tag===7){a(f,g.sibling),y=n(g,v.props.children),y.return=f,f=y;break e}}else if(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pn&&yo(_)===g.type){a(f,g.sibling),y=n(g,v.props),Ys(y,v),y.return=f,f=y;break e}a(f,g);break}else e(f,g);g=g.sibling}v.type===Ci?(y=So(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Bc(v.type,v.key,v.props,null,f.mode,y),Ys(y,v),y.return=f,f=y)}return i(f);case tl:e:{for(_=v.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){a(f,g.sibling),y=n(g,v.children||[]),y.return=f,f=y;break e}else{a(f,g);break}else e(f,g);g=g.sibling}y=lh(v,f.mode,y),y.return=f,f=y}return i(f);case pn:return v=yo(v),x(f,g,v,y)}if(al(v))return S(f,g,v,y);if(Zs(v)){if(_=Zs(v),typeof _!="function")throw Error(D(150));return v=_.call(v),b(f,g,v,y)}if(typeof v.then=="function")return x(f,g,Cc(v),y);if(v.$$typeof===Ar)return x(f,g,Sc(f,v),y);_c(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(a(f,g.sibling),y=n(g,v),y.return=f,f=y):(a(f,g),y=sh(v,f.mode,y),y.return=f,f=y),i(f)):a(f,g)}return function(f,g,v,y){try{Ll=0;var _=x(f,g,v,y);return Pi=null,_}catch(C){if(C===ts||C===Ad)throw C;var w=oa(29,C,null,f.mode);return w.lanes=y,w.return=f,w}}}var Ao=vC(!0),yC=vC(!1),hn=!1;function $m(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kh(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 In(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function An(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(ye&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=Qc(t),uC(t,null,a),e}return Id(t,r,e,a),Qc(t)}function cl(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,F0(t,a)}}function ch(t,e){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?n=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?n=o=e:o=o.next=e}else n=o=e;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var Qh=!1;function dl(){if(Qh){var t=Ni;if(t!==null)throw t}}function fl(t,e,a,r){Qh=!1;var n=t.updateQueue;hn=!1;var o=n.firstBaseUpdate,i=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=n.baseState;i=0,c=u=l=null,s=o;do{var h=s.lane&-536870913,m=h!==s.lane;if(m?(he&h)===h:(r&h)===h){h!==0&&h===$i&&(Qh=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;h=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,h=typeof S=="function"?S.call(x,d,h):S,h==null)break e;d=Pe({},d,h);break e;case 2:hn=!0}}h=s.callback,h!==null&&(t.flags|=64,m&&(t.flags|=8192),m=n.callbacks,m===null?n.callbacks=[h]:m.push(h))}else m={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,i|=h;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;m=s,s=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);c===null&&(l=d),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,o===null&&(n.shared.lanes=0),Fn|=i,t.lanes=i,t.memoizedState=d}}function xC(t,e){if(typeof t!="function")throw Error(D(191,t));t.call(e)}function bC(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)xC(a[t],e)}var ji=lr(null),ad=lr(0);function ES(t,e){t=Nr,Re(ad,t),Re(ji,e),Nr=t|e.baseLanes}function Jh(){Re(ad,Nr),Re(ji,ji.current)}function jm(){Nr=ad.current,ht(ji),ht(ad)}var fa=lr(null),Aa=null;function gn(t){var e=t.alternate;Re(Ke,Ke.current&1),Re(fa,t),Aa===null&&(e===null||ji.current!==null||e.memoizedState!==null)&&(Aa=t)}function em(t){Re(Ke,Ke.current),Re(fa,t),Aa===null&&(Aa=t)}function SC(t){t.tag===22?(Re(Ke,Ke.current),Re(fa,t),Aa===null&&(Aa=t)):vn(t)}function vn(){Re(Ke,Ke.current),Re(fa,fa.current)}function na(t){ht(fa),Aa===t&&(Aa=null),ht(Ke)}var Ke=lr(0);function rd(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xm(a)||bm(a)))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 Or=0,se=null,Le=null,et=null,nd=!1,Hi=!1,ko=!1,od=0,Il=0,Ui=null,yR=0;function Ze(){throw Error(D(321))}function Gm(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!da(t[a],e[a]))return!1;return!0}function Wm(t,e,a,r,n,o){return Or=o,se=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,te.H=t===null||t.memoizedState===null?QC:ng,ko=!1,o=a(r,n),ko=!1,Hi&&(o=_C(e,a,r,n)),CC(t),o}function CC(t){te.H=Al;var e=Le!==null&&Le.next!==null;if(Or=0,et=Le=se=null,nd=!1,Il=0,Ui=null,e)throw Error(D(300));t===null||rt||(t=t.dependencies,t!==null&&ed(t)&&(rt=!0))}function _C(t,e,a,r){se=t;var n=0;do{if(Hi&&(Ui=null),Il=0,Hi=!1,25<=n)throw Error(D(301));if(n+=1,et=Le=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}te.H=JC,o=e(a,r)}while(Hi);return o}function xR(){var t=te.H,e=t.useState()[0];return e=typeof e.then=="function"?Ul(e):e,t=t.useState()[0],(Le!==null?Le.memoizedState:null)!==t&&(se.flags|=1024),e}function Zm(){var t=od!==0;return od=0,t}function Xm(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Ym(t){if(nd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}nd=!1}Or=0,et=Le=se=null,Hi=!1,Il=od=0,Ui=null}function Bt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?se.memoizedState=et=t:et=et.next=t,et}function Qe(){if(Le===null){var t=se.alternate;t=t!==null?t.memoizedState:null}else t=Le.next;var e=et===null?se.memoizedState:et.next;if(e!==null)et=e,Le=t;else{if(t===null)throw se.alternate===null?Error(D(467)):Error(D(310));Le=t,t={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},et===null?se.memoizedState=et=t:et=et.next=t}return et}function kd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(t){var e=Il;return Il+=1,Ui===null&&(Ui=[]),t=gC(Ui,t,e),e=se,(et===null?e.memoizedState:et.next)===null&&(e=e.alternate,te.H=e===null||e.memoizedState===null?QC:ng),t}function Ed(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ul(t);if(t.$$typeof===Ar)return bt(t)}throw Error(D(438,String(t)))}function Km(t){var e=null,a=se.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var r=se.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(n){return n.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=kd(),se.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),r=0;r<t;r++)a[r]=nT;return e.index++,a}function Br(t,e){return typeof e=="function"?e(t):e}function Nc(t){var e=Qe();return Qm(e,Le,t)}function Qm(t,e,a){var r=t.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=a;var n=t.baseQueue,o=r.pending;if(o!==null){if(n!==null){var i=n.next;n.next=o.next,o.next=i}e.baseQueue=n=o,r.pending=null}if(o=t.baseState,n===null)t.memoizedState=o;else{e=n.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(he&d)===d:(Or&d)===d){var h=u.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===$i&&(c=!0);else if((Or&h)===h){u=u.next,h===$i&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,se.lanes|=h,Fn|=h;d=u.action,ko&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else h={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=h,i=o):l=l.next=h,se.lanes|=d,Fn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!da(o,t.memoizedState)&&(rt=!0,c&&(a=Ni,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,r.lastRenderedState=o}return n===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function dh(t){var e=Qe(),a=e.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=t;var r=a.dispatch,n=a.pending,o=e.memoizedState;if(n!==null){a.pending=null;var i=n=n.next;do o=t(o,i.action),i=i.next;while(i!==n);da(o,e.memoizedState)||(rt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function wC(t,e,a){var r=se,n=Qe(),o=me;if(o){if(a===void 0)throw Error(D(407));a=a()}else a=e();var i=!da((Le||n).memoizedState,a);if(i&&(n.memoizedState=a,rt=!0),n=n.queue,Jm(AC.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,Gi(9,{destroy:void 0},IC.bind(null,r,n,a,e),null),Ae===null)throw Error(D(349));o||(Or&127)!==0||LC(r,e,a)}return a}function LC(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=se.updateQueue,e===null?(e=kd(),se.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function IC(t,e,a,r){e.value=a,e.getSnapshot=r,kC(e)&&EC(t)}function AC(t,e,a){return a(function(){kC(e)&&EC(t)})}function kC(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!da(t,a)}catch{return!0}}function EC(t){var e=Do(t,2);e!==null&&Gt(e,t,2)}function tm(t){var e=Bt();if(typeof t=="function"){var a=t;if(t=a(),ko){xn(!0);try{a()}finally{xn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:t},e}function TC(t,e,a,r){return t.baseState=a,Qm(t,Le,typeof r=="function"?r:Br)}function bR(t,e,a,r,n){if(Rd(t))throw Error(D(485));if(t=e.action,t!==null){var o={payload:n,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};te.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,RC(e,o)):(o.next=a.next,e.pending=a.next=o)}}function RC(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=te.T,i={};te.T=i;try{var s=a(n,r),l=te.S;l!==null&&l(i,s),TS(t,e,s)}catch(u){am(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),te.T=o}}else try{o=a(n,r),TS(t,e,o)}catch(u){am(t,e,u)}}function TS(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){RS(t,e,r)},function(r){return am(t,e,r)}):RS(t,e,a)}function RS(t,e,a){e.status="fulfilled",e.value=a,MC(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,RC(t,a)))}function am(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,MC(e),e=e.next;while(e!==r)}t.action=null}function MC(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function DC(t,e){return e}function MS(t,e){if(me){var a=Ae.formState;if(a!==null){e:{var r=se;if(me){if(Ne){t:{for(var n=Ne,o=Ia;n.nodeType!==8;){if(!o){n=null;break t}if(n=ka(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ne=ka(n.nextSibling),r=n.data==="F!";break e}}On(r)}r=!1}r&&(e=a[0])}}return a=Bt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DC,lastRenderedState:e},a.queue=r,a=XC.bind(null,se,r),r.dispatch=a,r=tm(!1),o=rg.bind(null,se,!1,r.queue),r=Bt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=bR.bind(null,se,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function DS(t){var e=Qe();return OC(e,Le,t)}function OC(t,e,a){if(e=Qm(t,e,DC)[0],t=Nc(Br)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=Ul(e)}catch(i){throw i===ts?Ad:i}else r=e;e=Qe();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(se.flags|=2048,Gi(9,{destroy:void 0},SR.bind(null,n,a),null)),[r,o,t]}function SR(t,e){t.action=e}function OS(t){var e=Qe(),a=Le;if(a!==null)return OC(e,a,t);Qe(),e=e.memoizedState,a=Qe();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function Gi(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=se.updateQueue,e===null&&(e=kd(),se.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,e.lastEffect=t),t}function BC(){return Qe().memoizedState}function Pc(t,e,a,r){var n=Bt();se.flags|=t,n.memoizedState=Gi(1|e,{destroy:void 0},a,r===void 0?null:r)}function Td(t,e,a,r){var n=Qe();r=r===void 0?null:r;var o=n.memoizedState.inst;Le!==null&&r!==null&&Gm(r,Le.memoizedState.deps)?n.memoizedState=Gi(e,o,a,r):(se.flags|=t,n.memoizedState=Gi(1|e,o,a,r))}function BS(t,e){Pc(8390656,8,t,e)}function Jm(t,e){Td(2048,8,t,e)}function CR(t){se.flags|=4;var e=se.updateQueue;if(e===null)e=kd(),se.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function FC(t){var e=Qe().memoizedState;return CR({ref:e,nextImpl:t}),function(){if((ye&2)!==0)throw Error(D(440));return e.impl.apply(void 0,arguments)}}function NC(t,e){return Td(4,2,t,e)}function PC(t,e){return Td(4,4,t,e)}function HC(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function UC(t,e,a){a=a!=null?a.concat([t]):null,Td(4,4,HC.bind(null,e,t),a)}function eg(){}function qC(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Gm(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function zC(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Gm(e,r[1]))return r[0];if(r=t(),ko){xn(!0);try{t()}finally{xn(!1)}}return a.memoizedState=[r,e],r}function tg(t,e,a){return a===void 0||(Or&1073741824)!==0&&(he&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=T_(),se.lanes|=t,Fn|=t,a)}function VC(t,e,a,r){return da(a,e)?a:ji.current!==null?(t=tg(t,a,r),da(t,e)||(rt=!0),t):(Or&42)===0||(Or&1073741824)!==0&&(he&261930)===0?(rt=!0,t.memoizedState=a):(t=T_(),se.lanes|=t,Fn|=t,e)}function $C(t,e,a,r,n){var o=xe.p;xe.p=o!==0&&8>o?o:8;var i=te.T,s={};te.T=s,rg(t,!1,e,a);try{var l=n(),u=te.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=vR(l,r);pl(t,e,c,ca(t))}else pl(t,e,r,ca(t))}catch(d){pl(t,e,{then:function(){},status:"rejected",reason:d},ca())}finally{xe.p=o,i!==null&&s.types!==null&&(i.types=s.types),te.T=i}}function _R(){}function rm(t,e,a,r){if(t.tag!==5)throw Error(D(476));var n=jC(t).queue;$C(t,n,e,bo,a===null?_R:function(){return GC(t),a(r)})}function jC(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:bo,baseState:bo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:bo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function GC(t){var e=jC(t);e.next===null&&(e=t.alternate.memoizedState),pl(t,e.next.queue,{},ca())}function ag(){return bt(Tl)}function WC(){return Qe().memoizedState}function ZC(){return Qe().memoizedState}function wR(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ca();t=In(a);var r=An(e,t,a);r!==null&&(Gt(r,e,a),cl(r,e,a)),e={cache:qm()},t.payload=e;return}e=e.return}}function LR(t,e,a){var r=ca();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Rd(t)?YC(e,a):(a=Nm(t,e,a,r),a!==null&&(Gt(a,t,r),KC(a,e,r)))}function XC(t,e,a){var r=ca();pl(t,e,a,r)}function pl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Rd(t))YC(e,n);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(n.hasEagerState=!0,n.eagerState=s,da(s,i))return Id(t,e,n,0),Ae===null&&Ld(),!1}catch{}if(a=Nm(t,e,n,r),a!==null)return Gt(a,t,r),KC(a,e,r),!0}return!1}function rg(t,e,a,r){if(r={lane:2,revertLane:fg(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rd(t)){if(e)throw Error(D(479))}else e=Nm(t,a,r,2),e!==null&&Gt(e,t,2)}function Rd(t){var e=t.alternate;return t===se||e!==null&&e===se}function YC(t,e){Hi=nd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function KC(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,F0(t,a)}}var Al={readContext:bt,use:Ed,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};Al.useEffectEvent=Ze;var QC={readContext:bt,use:Ed,useCallback:function(t,e){return Bt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:BS,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Pc(4194308,4,HC.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Pc(4194308,4,t,e)},useInsertionEffect:function(t,e){Pc(4,2,t,e)},useMemo:function(t,e){var a=Bt();e=e===void 0?null:e;var r=t();if(ko){xn(!0);try{t()}finally{xn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Bt();if(a!==void 0){var n=a(e);if(ko){xn(!0);try{a(e)}finally{xn(!1)}}}else n=e;return r.memoizedState=r.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},r.queue=t,t=t.dispatch=LR.bind(null,se,t),[r.memoizedState,t]},useRef:function(t){var e=Bt();return t={current:t},e.memoizedState=t},useState:function(t){t=tm(t);var e=t.queue,a=XC.bind(null,se,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:eg,useDeferredValue:function(t,e){var a=Bt();return tg(a,t,e)},useTransition:function(){var t=tm(!1);return t=$C.bind(null,se,t.queue,!0,!1),Bt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=se,n=Bt();if(me){if(a===void 0)throw Error(D(407));a=a()}else{if(a=e(),Ae===null)throw Error(D(349));(he&127)!==0||LC(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,BS(AC.bind(null,r,o,t),[t]),r.flags|=2048,Gi(9,{destroy:void 0},IC.bind(null,r,o,a,e),null),a},useId:function(){var t=Bt(),e=Ae.identifierPrefix;if(me){var a=or,r=nr;a=(r&~(1<<32-ua(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=od++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=yR++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:ag,useFormState:MS,useActionState:MS,useOptimistic:function(t){var e=Bt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=rg.bind(null,se,!0,a),a.dispatch=e,[t,e]},useMemoCache:Km,useCacheRefresh:function(){return Bt().memoizedState=wR.bind(null,se)},useEffectEvent:function(t){var e=Bt(),a={impl:t};return e.memoizedState=a,function(){if((ye&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},ng={readContext:bt,use:Ed,useCallback:qC,useContext:bt,useEffect:Jm,useImperativeHandle:UC,useInsertionEffect:NC,useLayoutEffect:PC,useMemo:zC,useReducer:Nc,useRef:BC,useState:function(){return Nc(Br)},useDebugValue:eg,useDeferredValue:function(t,e){var a=Qe();return VC(a,Le.memoizedState,t,e)},useTransition:function(){var t=Nc(Br)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:Ul(t),e]},useSyncExternalStore:wC,useId:WC,useHostTransitionStatus:ag,useFormState:DS,useActionState:DS,useOptimistic:function(t,e){var a=Qe();return TC(a,Le,t,e)},useMemoCache:Km,useCacheRefresh:ZC};ng.useEffectEvent=FC;var JC={readContext:bt,use:Ed,useCallback:qC,useContext:bt,useEffect:Jm,useImperativeHandle:UC,useInsertionEffect:NC,useLayoutEffect:PC,useMemo:zC,useReducer:dh,useRef:BC,useState:function(){return dh(Br)},useDebugValue:eg,useDeferredValue:function(t,e){var a=Qe();return Le===null?tg(a,t,e):VC(a,Le.memoizedState,t,e)},useTransition:function(){var t=dh(Br)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:Ul(t),e]},useSyncExternalStore:wC,useId:WC,useHostTransitionStatus:ag,useFormState:OS,useActionState:OS,useOptimistic:function(t,e){var a=Qe();return Le!==null?TC(a,Le,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Km,useCacheRefresh:ZC};JC.useEffectEvent=FC;function fh(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Pe({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var nm={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ca(),n=In(r);n.payload=e,a!=null&&(n.callback=a),e=An(t,n,r),e!==null&&(Gt(e,t,r),cl(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ca(),n=In(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=An(t,n,r),e!==null&&(Gt(e,t,r),cl(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ca(),r=In(a);r.tag=2,e!=null&&(r.callback=e),e=An(t,r,a),e!==null&&(Gt(e,t,a),cl(e,t,a))}};function FS(t,e,a,r,n,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,i):e.prototype&&e.prototype.isPureReactComponent?!Cl(a,r)||!Cl(n,o):!0}function NS(t,e,a,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,r),e.state!==t&&nm.enqueueReplaceState(e,e.state,null)}function Eo(t,e){var a=e;if("ref"in e){a={};for(var r in e)r!=="ref"&&(a[r]=e[r])}if(t=t.defaultProps){a===e&&(a=Pe({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function e_(t){Kc(t)}function t_(t){console.error(t)}function a_(t){Kc(t)}function id(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function PS(t,e,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function om(t,e,a){return a=In(a),a.tag=3,a.payload={element:null},a.callback=function(){id(t,e)},a}function r_(t){return t=In(t),t.tag=3,t}function n_(t,e,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var o=r.value;t.payload=function(){return n(o)},t.callback=function(){PS(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){PS(e,a,r),typeof n!="function"&&(kn===null?kn=new Set([this]):kn.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function IR(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&es(e,a,n,!0),a=fa.current,a!==null){switch(a.tag){case 31:case 13:return Aa===null?dd():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===td?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),_h(t,r,n)),!1;case 22:return a.flags|=65536,r===td?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([r]):a.add(r)),_h(t,r,n)),!1}throw Error(D(435,a.tag))}return _h(t,r,n),dd(),!1}if(me)return e=fa.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Gh&&(t=Error(D(422),{cause:r}),wl(La(t,a)))):(r!==Gh&&(e=Error(D(423),{cause:r}),wl(La(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=La(r,a),n=om(t.stateNode,r,n),ch(t,n),Xe!==4&&(Xe=2)),!1;var o=Error(D(520),{cause:r});if(o=La(o,a),gl===null?gl=[o]:gl.push(o),Xe!==4&&(Xe=2),e===null)return!0;r=La(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=om(a.stateNode,r,t),ch(a,t),!1;case 1:if(e=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(kn===null||!kn.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=r_(n),n_(n,t,a,r),ch(a,n),!1}a=a.return}while(a!==null);return!1}var og=Error(D(461)),rt=!1;function vt(t,e,a,r){e.child=t===null?yC(e,null,a,r):Ao(e,t.child,a,r)}function HS(t,e,a,r,n){a=a.render;var o=e.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Io(e),r=Wm(t,e,a,i,o,n),s=Zm(),t!==null&&!rt?(Xm(t,e,n),Fr(t,e,n)):(me&&s&&Hm(e),e.flags|=1,vt(t,e,r,n),e.child)}function US(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Pm(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,o_(t,e,o,r,n)):(t=Bc(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!ig(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Cl,a(i,r)&&t.ref===e.ref)return Fr(t,e,n)}return e.flags|=1,t=Tr(o,r),t.ref=e.ref,t.return=e,e.child=t}function o_(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Cl(o,r)&&t.ref===e.ref)if(rt=!1,e.pendingProps=r=o,ig(t,n))(t.flags&131072)!==0&&(rt=!0);else return e.lanes=t.lanes,Fr(t,e,n)}return im(t,e,a,r,n)}function i_(t,e,a,r){var n=r.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(r=e.child=t.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~o}else r=0,e.child=null;return qS(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fc(e,o!==null?o.cachePool:null),o!==null?ES(e,o):Jh(),SC(e);else return r=e.lanes=536870912,qS(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Fc(e,o.cachePool),ES(e,o),vn(e),e.memoizedState=null):(t!==null&&Fc(e,null),Jh(),vn(e));return vt(t,e,n,a),e.child}function nl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function qS(t,e,a,r,n){var o=zm();return o=o===null?null:{parent:at._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Fc(e,null),Jh(),SC(e),t!==null&&es(t,e,r,!0),e.childLanes=n,null}function Hc(t,e){return e=sd({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function zS(t,e,a){return Ao(e,t.child,null,a),t=Hc(e,e.pendingProps),t.flags|=2,na(e),e.memoizedState=null,t}function AR(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(me){if(r.mode==="hidden")return t=Hc(e,r),e.lanes=536870912,nl(null,t);if(em(e),(t=Ne)?(t=Q_(t,Ia),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=dC(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw On(e);return e.lanes=536870912,null}return Hc(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(em(e),n)if(e.flags&256)e.flags&=-257,e=zS(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(D(558));else if(rt||es(t,e,a,!1),n=(a&t.childLanes)!==0,rt||n){if(r=Ae,r!==null&&(i=N0(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Do(t,i),Gt(r,t,i),og;dd(),e=zS(t,e,a)}else t=o.treeContext,Ne=ka(i.nextSibling),xt=e,me=!0,Ln=null,Ia=!1,t!==null&&pC(e,t),e=Hc(e,r),e.flags|=4096;return e}return t=Tr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(D(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function im(t,e,a,r,n){return Io(e),a=Wm(t,e,a,r,void 0,n),r=Zm(),t!==null&&!rt?(Xm(t,e,n),Fr(t,e,n)):(me&&r&&Hm(e),e.flags|=1,vt(t,e,a,n),e.child)}function VS(t,e,a,r,n,o){return Io(e),e.updateQueue=null,a=_C(e,r,a,n),CC(t),r=Zm(),t!==null&&!rt?(Xm(t,e,o),Fr(t,e,o)):(me&&r&&Hm(e),e.flags|=1,vt(t,e,a,o),e.child)}function $S(t,e,a,r,n){if(Io(e),e.stateNode===null){var o=Ti,i=a.contextType;typeof i=="object"&&i!==null&&(o=bt(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=nm,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},$m(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?bt(i):Ti,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(fh(e,a,i,r),o.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&nm.enqueueReplaceState(o,o.state,null),fl(e,r,o,n),dl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Eo(a,s);o.props=l;var u=o.context,c=a.contextType;i=Ti,typeof c=="object"&&c!==null&&(i=bt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&NS(e,o,r,i),hn=!1;var h=e.memoizedState;o.state=h,fl(e,r,o,n),dl(),u=e.memoizedState,s||h!==u||hn?(typeof d=="function"&&(fh(e,a,d,r),u=e.memoizedState),(l=hn||FS(e,a,l,r,h,u,i))?(c||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=r,e.memoizedState=u),o.props=r,o.state=u,o.context=i,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Kh(t,e),i=e.memoizedProps,c=Eo(a,i),o.props=c,d=e.pendingProps,h=o.context,u=a.contextType,l=Ti,typeof u=="object"&&u!==null&&(l=bt(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||h!==l)&&NS(e,o,r,l),hn=!1,h=e.memoizedState,o.state=h,fl(e,r,o,n),dl();var m=e.memoizedState;i!==d||h!==m||hn||t!==null&&t.dependencies!==null&&ed(t.dependencies)?(typeof s=="function"&&(fh(e,a,s,r),m=e.memoizedState),(c=hn||FS(e,a,c,r,h,m,l)||t!==null&&t.dependencies!==null&&ed(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,Uc(t,e),r=(e.flags&128)!==0,o||r?(o=e.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&r?(e.child=Ao(e,t.child,null,n),e.child=Ao(e,null,a,n)):vt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Fr(t,e,n),t}function jS(t,e,a,r){return Lo(),e.flags|=256,vt(t,e,a,r),e.child}var ph={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hh(t){return{baseLanes:t,cachePool:mC()}}function mh(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=ia),t}function s_(t,e,a){var r=e.pendingProps,n=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(me){if(n?gn(e):vn(e),(t=Ne)?(t=Q_(t,Ia),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=dC(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw On(e);return bm(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(vn(e),n=e.mode,s=sd({mode:"hidden",children:s},n),r=So(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=hh(a),r.childLanes=mh(t,i,a),e.memoizedState=ph,nl(null,r)):(gn(e),sm(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(gn(e),e.flags&=-257,e=gh(t,e,a)):e.memoizedState!==null?(vn(e),e.child=t.child,e.flags|=128,e=null):(vn(e),s=r.fallback,n=e.mode,r=sd({mode:"visible",children:r.children},n),s=So(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Ao(e,t.child,null,a),r=e.child,r.memoizedState=hh(a),r.childLanes=mh(t,i,a),e.memoizedState=ph,e=nl(null,r));else if(gn(e),bm(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(D(419)),r.stack="",r.digest=i,wl({value:r,source:null,stack:null}),e=gh(t,e,a)}else if(rt||es(t,e,a,!1),i=(a&t.childLanes)!==0,rt||i){if(i=Ae,i!==null&&(r=N0(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Do(t,r),Gt(i,t,r),og;xm(s)||dd(),e=gh(t,e,a)}else xm(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ne=ka(s.nextSibling),xt=e,me=!0,Ln=null,Ia=!1,t!==null&&pC(e,t),e=sm(e,r.children),e.flags|=4096);return e}return n?(vn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=Tr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Tr(u,s):(s=So(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,nl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=hh(a):(n=s.cachePool,n!==null?(l=at._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=mC(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=mh(t,i,a),e.memoizedState=ph,nl(t.child,r)):(gn(e),a=t.child,t=a.sibling,a=Tr(a,{mode:"visible",children:r.children}),a.return=e,a.sibling=null,t!==null&&(i=e.deletions,i===null?(e.deletions=[t],e.flags|=16):i.push(t)),e.child=a,e.memoizedState=null,a)}function sm(t,e){return e=sd({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function sd(t,e){return t=oa(22,t,null,e),t.lanes=0,t}function gh(t,e,a){return Ao(e,t.child,null,a),t=sm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function GS(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Zh(t.return,e,a)}function vh(t,e,a,r,n,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=a,i.tailMode=n,i.treeForkCount=o)}function l_(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=Ke.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Re(Ke,i),vt(t,e,r,a),r=me?_l:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&GS(t,a,e);else if(t.tag===19)GS(t,a,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(n){case"forwards":for(a=e.child,n=null;a!==null;)t=a.alternate,t!==null&&rd(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),vh(e,!1,n,a,o,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&rd(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}vh(e,!0,a,null,o,r);break;case"together":vh(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Fr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Fn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(es(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,a=Tr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Tr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function ig(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&ed(t)))}function kR(t,e,a){switch(e.tag){case 3:Wc(e,e.stateNode.containerInfo),mn(e,at,t.memoizedState.cache),Lo();break;case 27:case 5:Bh(e);break;case 4:Wc(e,e.stateNode.containerInfo);break;case 10:mn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,em(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(gn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?s_(t,e,a):(gn(e),t=Fr(t,e,a),t!==null?t.sibling:null);gn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(es(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return l_(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Re(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,i_(t,e,a,e.pendingProps);case 24:mn(e,at,t.memoizedState.cache)}return Fr(t,e,a)}function u_(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)rt=!0;else{if(!ig(t,a)&&(e.flags&128)===0)return rt=!1,kR(t,e,a);rt=(t.flags&131072)!==0}else rt=!1,me&&(e.flags&1048576)!==0&&fC(e,_l,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=yo(e.elementType),e.type=t,typeof t=="function")Pm(t)?(r=Eo(t,r),e.tag=1,e=$S(null,e,t,r,a)):(e.tag=0,e=im(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===wm){e.tag=11,e=HS(null,e,t,r,a);break e}else if(n===Lm){e.tag=14,e=US(null,e,t,r,a);break e}}throw e=Dh(t)||t,Error(D(306,e,""))}}return e;case 0:return im(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Eo(r,e.pendingProps),$S(t,e,r,n,a);case 3:e:{if(Wc(e,e.stateNode.containerInfo),t===null)throw Error(D(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,Kh(t,e),fl(e,r,null,a);var i=e.memoizedState;if(r=i.cache,mn(e,at,r),r!==o.cache&&Xh(e,[at],a,!0),dl(),r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=jS(t,e,r,a);break e}else if(r!==n){n=La(Error(D(424)),e),wl(n),e=jS(t,e,r,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ne=ka(t.firstChild),xt=e,me=!0,Ln=null,Ia=!0,a=yC(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Lo(),r===n){e=Fr(t,e,a);break e}vt(t,e,r,a)}e=e.child}return e;case 26:return Uc(t,e),t===null?(a=h0(e.type,null,e.pendingProps,null))?e.memoizedState=a:me||(a=e.type,t=e.pendingProps,r=md(wn.current).createElement(a),r[yt]=e,r[Wt]=t,St(r,a,t),pt(r),e.stateNode=r):e.memoizedState=h0(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Bh(e),t===null&&me&&(r=e.stateNode=J_(e.type,e.pendingProps,wn.current),xt=e,Ia=!0,n=Ne,Pn(e.type)?(Sm=n,Ne=ka(r.firstChild)):Ne=n),vt(t,e,e.pendingProps.children,a),Uc(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&me&&((n=r=Ne)&&(r=aM(r,e.type,e.pendingProps,Ia),r!==null?(e.stateNode=r,xt=e,Ne=ka(r.firstChild),Ia=!1,n=!0):n=!1),n||On(e)),Bh(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,vm(n,o)?r=null:i!==null&&vm(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=Wm(t,e,xR,null,null,a),Tl._currentValue=n),Uc(t,e),vt(t,e,r,a),e.child;case 6:return t===null&&me&&((t=a=Ne)&&(a=rM(a,e.pendingProps,Ia),a!==null?(e.stateNode=a,xt=e,Ne=null,t=!0):t=!1),t||On(e)),null;case 13:return s_(t,e,a);case 4:return Wc(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ao(e,null,r,a):vt(t,e,r,a),e.child;case 11:return HS(t,e,e.type,e.pendingProps,a);case 7:return vt(t,e,e.pendingProps,a),e.child;case 8:return vt(t,e,e.pendingProps.children,a),e.child;case 12:return vt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,mn(e,e.type,r.value),vt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,Io(e),n=bt(n),r=r(n),e.flags|=1,vt(t,e,r,a),e.child;case 14:return US(t,e,e.type,e.pendingProps,a);case 15:return o_(t,e,e.type,e.pendingProps,a);case 19:return l_(t,e,a);case 31:return AR(t,e,a);case 22:return i_(t,e,a,e.pendingProps);case 24:return Io(e),r=bt(at),t===null?(n=zm(),n===null&&(n=Ae,o=qm(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},$m(e),mn(e,at,n)):((t.lanes&a)!==0&&(Kh(t,e),fl(e,null,null,a),dl()),n=t.memoizedState,o=e.memoizedState,n.parent!==r?(n={parent:r,cache:r},e.memoizedState=n,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=n),mn(e,at,r)):(r=o.cache,mn(e,at,r),r!==n.cache&&Xh(e,[at],a,!0))),vt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(D(156,e.tag))}function Sr(t){t.flags|=4}function yh(t,e,a,r,n){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(n&335544128)===n)if(t.stateNode.complete)t.flags|=8192;else if(D_())t.flags|=8192;else throw _o=td,Vm}else t.flags&=-16777217}function WS(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!aw(e))if(D_())t.flags|=8192;else throw _o=td,Vm}function wc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?O0():536870912,t.lanes|=e,Wi|=e)}function Ks(t,e){if(!me)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fe(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(e)for(var n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=r,t.childLanes=a,e}function ER(t,e,a){var r=e.pendingProps;switch(Um(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(e),null;case 1:return Fe(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Rr(at),qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(yi(e)?Sr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,uh())),Fe(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(Sr(e),o!==null?(Fe(e),WS(e,o)):(Fe(e),yh(e,n,null,r,a))):o?o!==t.memoizedState?(Sr(e),Fe(e),WS(e,o)):(Fe(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&Sr(e),Fe(e),yh(e,n,t,r,a)),null;case 27:if(Zc(e),a=wn.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Fe(e),null}t=sr.current,yi(e)?CS(e,t):(t=J_(n,r,a),e.stateNode=t,Sr(e))}return Fe(e),null;case 5:if(Zc(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Fe(e),null}if(o=sr.current,yi(e))CS(e,o);else{var i=md(wn.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}o[yt]=e,o[Wt]=r;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(St(o,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Sr(e)}}return Fe(e),yh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(D(166));if(t=wn.current,yi(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=xt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[yt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||X_(t.nodeValue,a)),t||On(e,!0)}else t=md(t).createTextNode(r),t[yt]=e,e.stateNode=t}return Fe(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=yi(e),a!==null){if(t===null){if(!r)throw Error(D(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(557));t[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),t=!1}else a=uh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(na(e),e):(na(e),null);if((e.flags&128)!==0)throw Error(D(558))}return Fe(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=yi(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(D(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));n[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),n=!1}else n=uh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(na(e),e):(na(e),null)}return na(e),(e.flags&128)!==0?(e.lanes=a,e):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=e.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==n&&(r.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),wc(e,e.updateQueue),Fe(e),null);case 4:return qi(),t===null&&pg(e.stateNode.containerInfo),Fe(e),null;case 10:return Rr(e.type),Fe(e),null;case 19:if(ht(Ke),r=e.memoizedState,r===null)return Fe(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)Ks(r,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=rd(t),o!==null){for(e.flags|=128,Ks(r,!1),t=o.updateQueue,e.updateQueue=t,wc(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)cC(a,t),a=a.sibling;return Re(Ke,Ke.current&1|2),me&&Lr(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&sa()>ud&&(e.flags|=128,n=!0,Ks(r,!1),e.lanes=4194304)}else{if(!n)if(t=rd(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,wc(e,t),Ks(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!me)return Fe(e),null}else 2*sa()-r.renderingStartTime>ud&&a!==536870912&&(e.flags|=128,n=!0,Ks(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=sa(),t.sibling=null,a=Ke.current,Re(Ke,n?a&1|2:a&1),me&&Lr(e,r.treeForkCount),t):(Fe(e),null);case 22:case 23:return na(e),jm(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(a&536870912)!==0&&(e.flags&128)===0&&(Fe(e),e.subtreeFlags&6&&(e.flags|=8192)):Fe(e),a=e.updateQueue,a!==null&&wc(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==a&&(e.flags|=2048),t!==null&&ht(Co),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Rr(at),Fe(e),null;case 25:return null;case 30:return null}throw Error(D(156,e.tag))}function TR(t,e){switch(Um(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Rr(at),qi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Zc(e),null;case 31:if(e.memoizedState!==null){if(na(e),e.alternate===null)throw Error(D(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(na(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(Ke),null;case 4:return qi(),null;case 10:return Rr(e.type),null;case 22:case 23:return na(e),jm(),t!==null&&ht(Co),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Rr(at),null;case 25:return null;default:return null}}function c_(t,e){switch(Um(e),e.tag){case 3:Rr(at),qi();break;case 26:case 27:case 5:Zc(e);break;case 4:qi();break;case 31:e.memoizedState!==null&&na(e);break;case 13:na(e);break;case 19:ht(Ke);break;case 10:Rr(e.type);break;case 22:case 23:na(e),jm(),t!==null&&ht(Co);break;case 24:Rr(at)}}function ql(t,e){try{var a=e.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&t)===t){r=void 0;var o=a.create,i=a.inst;r=o(),i.destroy=r}a=a.next}while(a!==n)}}catch(s){Se(e,e.return,s)}}function Bn(t,e,a){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var o=n.next;r=o;do{if((r.tag&t)===t){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,n=e;var l=a,u=s;try{u()}catch(c){Se(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){Se(e,e.return,c)}}function d_(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{bC(e,a)}catch(r){Se(t,t.return,r)}}}function f_(t,e,a){a.props=Eo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Se(t,e,r)}}function hl(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(n){Se(t,e,n)}}function ir(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Se(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Se(t,e,n)}else a.current=null}function p_(t){var e=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Se(t,t.return,n)}}function xh(t,e,a){try{var r=t.stateNode;YR(r,t.type,a,e),r[Wt]=e}catch(n){Se(t,t.return,n)}}function h_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Pn(t.type)||t.tag===4}function bh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h_(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&&Pn(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 lm(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=kr));else if(r!==4&&(r===27&&Pn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(lm(t,e,a),t=t.sibling;t!==null;)lm(t,e,a),t=t.sibling}function ld(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(r!==4&&(r===27&&Pn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(ld(t,e,a),t=t.sibling;t!==null;)ld(t,e,a),t=t.sibling}function m_(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);St(e,r,a),e[yt]=t,e[Wt]=a}catch(o){Se(t,t.return,o)}}var Ir=!1,tt=!1,Sh=!1,ZS=typeof WeakSet=="function"?WeakSet:Set,ft=null;function RR(t,e){if(t=t.containerInfo,mm=xd,t=aC(t),Bm(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var m;d!==a||n!==0&&d.nodeType!==3||(s=i+n),d!==o||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===t)break t;if(h===a&&++u===n&&(s=i),h===o&&++c===r&&(l=i),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(gm={focusedElem:t,selectionRange:a},xd=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,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(a=0;a<t.length;a++)n=t[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,n=o.memoizedProps,o=o.memoizedState,r=a.stateNode;try{var S=Eo(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(b){Se(a,a.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)ym(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ym(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(D(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function g_(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:_r(t,a),r&4&&ql(5,a);break;case 1:if(_r(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){Se(a,a.return,i)}else{var n=Eo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){Se(a,a.return,i)}}r&64&&d_(a),r&512&&hl(a,a.return);break;case 3:if(_r(t,a),r&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{bC(t,e)}catch(i){Se(a,a.return,i)}}break;case 27:e===null&&r&4&&m_(a);case 26:case 5:_r(t,a),e===null&&r&4&&p_(a),r&512&&hl(a,a.return);break;case 12:_r(t,a);break;case 31:_r(t,a),r&4&&x_(t,a);break;case 13:_r(t,a),r&4&&b_(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=UR.bind(null,a),nM(t,a))));break;case 22:if(r=a.memoizedState!==null||Ir,!r){e=e!==null&&e.memoizedState!==null||tt,n=Ir;var o=tt;Ir=r,(tt=e)&&!o?wr(t,a,(a.subtreeFlags&8772)!==0):_r(t,a),Ir=n,tt=o}break;case 30:break;default:_r(t,a)}}function v_(t){var e=t.alternate;e!==null&&(t.alternate=null,v_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Em(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 qe=null,$t=!1;function Cr(t,e,a){for(a=a.child;a!==null;)y_(t,e,a),a=a.sibling}function y_(t,e,a){if(la&&typeof la.onCommitFiberUnmount=="function")try{la.onCommitFiberUnmount(Ol,a)}catch{}switch(a.tag){case 26:tt||ir(a,e),Cr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||ir(a,e);var r=qe,n=$t;Pn(a.type)&&(qe=a.stateNode,$t=!1),Cr(t,e,a),yl(a.stateNode),qe=r,$t=n;break;case 5:tt||ir(a,e);case 6:if(r=qe,n=$t,qe=null,Cr(t,e,a),qe=r,$t=n,qe!==null)if($t)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(o){Se(a,e,o)}else try{qe.removeChild(a.stateNode)}catch(o){Se(a,e,o)}break;case 18:qe!==null&&($t?(t=qe,u0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Ki(t)):u0(qe,a.stateNode));break;case 4:r=qe,n=$t,qe=a.stateNode.containerInfo,$t=!0,Cr(t,e,a),qe=r,$t=n;break;case 0:case 11:case 14:case 15:Bn(2,a,e),tt||Bn(4,a,e),Cr(t,e,a);break;case 1:tt||(ir(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&f_(a,e,r)),Cr(t,e,a);break;case 21:Cr(t,e,a);break;case 22:tt=(r=tt)||a.memoizedState!==null,Cr(t,e,a),tt=r;break;default:Cr(t,e,a)}}function x_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ki(t)}catch(a){Se(e,e.return,a)}}}function b_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ki(t)}catch(a){Se(e,e.return,a)}}function MR(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new ZS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new ZS),e;default:throw Error(D(435,t.tag))}}function Lc(t,e){var a=MR(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=qR.bind(null,t,r);r.then(n,n)}})}function zt(t,e){var a=e.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Pn(s.type)){qe=s.stateNode,$t=!1;break e}break;case 5:qe=s.stateNode,$t=!1;break e;case 3:case 4:qe=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(qe===null)throw Error(D(160));y_(o,i,n),qe=null,$t=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)S_(e,t),e=e.sibling}var qa=null;function S_(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(e,t),Vt(t),r&4&&(Bn(3,t,t.return),ql(3,t),Bn(5,t,t.return));break;case 1:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&64&&Ir&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=qa;if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&4){var o=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":o=n.getElementsByTagName("title")[0],(!o||o[Nl]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),St(o,r,a),o[yt]=t,pt(o),r=o;break e;case"link":var i=g0("link","href",n).get(r+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;case"meta":if(i=g0("meta","content",n).get(r+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;default:throw Error(D(468,r))}o[yt]=t,pt(o),r=o}t.stateNode=r}else v0(n,t.type,t.stateNode);else t.stateNode=m0(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?v0(n,t.type,t.stateNode):m0(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&xh(t,t.memoizedProps,a.memoizedProps)}break;case 27:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),a!==null&&r&4&&xh(t,t.memoizedProps,a.memoizedProps);break;case 5:if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),t.flags&32){n=t.stateNode;try{Vi(n,"")}catch(S){Se(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,xh(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Sh=!0);break;case 6:if(zt(e,t),Vt(t),r&4){if(t.stateNode===null)throw Error(D(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){Se(t,t.return,S)}}break;case 3:if(Vc=null,n=qa,qa=gd(e.containerInfo),zt(e,t),qa=n,Vt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Ki(e.containerInfo)}catch(S){Se(t,t.return,S)}Sh&&(Sh=!1,C_(t));break;case 4:r=qa,qa=gd(t.stateNode.containerInfo),zt(e,t),Vt(t),qa=r;break;case 12:zt(e,t),Vt(t);break;case 31:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Lc(t,r)));break;case 13:zt(e,t),Vt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Md=sa()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Lc(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Ir,c=tt;if(Ir=u||n,tt=c||l,zt(e,t),tt=c,Ir=u,Vt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||Ir||tt||xo(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,n)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.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){Se(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){Se(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var m=l.stateNode;n?c0(m,!0):c0(l.stateNode,!1)}catch(S){Se(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;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Lc(t,a))));break;case 19:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Lc(t,r)));break;case 30:break;case 21:break;default:zt(e,t),Vt(t)}}function Vt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(h_(r)){a=r;break}r=r.return}if(a==null)throw Error(D(160));switch(a.tag){case 27:var n=a.stateNode,o=bh(t);ld(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(Vi(i,""),a.flags&=-33);var s=bh(t);ld(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=bh(t);lm(t,u,l);break;default:throw Error(D(161))}}catch(c){Se(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function C_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;C_(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function _r(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)g_(t,e.alternate,e),e=e.sibling}function xo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Bn(4,e,e.return),xo(e);break;case 1:ir(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&f_(e,e.return,a),xo(e);break;case 27:yl(e.stateNode);case 26:case 5:ir(e,e.return),xo(e);break;case 22:e.memoizedState===null&&xo(e);break;case 30:xo(e);break;default:xo(e)}t=t.sibling}}function wr(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,n=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:wr(n,o,a),ql(4,o);break;case 1:if(wr(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){Se(r,r.return,u)}if(r=o,n=r.updateQueue,n!==null){var s=r.stateNode;try{var l=n.shared.hiddenCallbacks;if(l!==null)for(n.shared.hiddenCallbacks=null,n=0;n<l.length;n++)xC(l[n],s)}catch(u){Se(r,r.return,u)}}a&&i&64&&d_(o),hl(o,o.return);break;case 27:m_(o);case 26:case 5:wr(n,o,a),a&&r===null&&i&4&&p_(o),hl(o,o.return);break;case 12:wr(n,o,a);break;case 31:wr(n,o,a),a&&i&4&&x_(n,o);break;case 13:wr(n,o,a),a&&i&4&&b_(n,o);break;case 22:o.memoizedState===null&&wr(n,o,a),hl(o,o.return);break;case 30:break;default:wr(n,o,a)}e=e.sibling}}function sg(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Hl(a))}function lg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Hl(t))}function Ua(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)__(t,e,a,r),e=e.sibling}function __(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Ua(t,e,a,r),n&2048&&ql(9,e);break;case 1:Ua(t,e,a,r);break;case 3:Ua(t,e,a,r),n&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Hl(t)));break;case 12:if(n&2048){Ua(t,e,a,r),t=e.stateNode;try{var o=e.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Se(e,e.return,l)}}else Ua(t,e,a,r);break;case 31:Ua(t,e,a,r);break;case 13:Ua(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Ua(t,e,a,r):ml(t,e):o._visibility&2?Ua(t,e,a,r):(o._visibility|=2,bi(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&sg(i,e);break;case 24:Ua(t,e,a,r),n&2048&&lg(e.alternate,e);break;default:Ua(t,e,a,r)}}function bi(t,e,a,r,n){for(n=n&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:bi(o,i,s,l,n),ql(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?bi(o,i,s,l,n):ml(o,i):(c._visibility|=2,bi(o,i,s,l,n)),n&&u&2048&&sg(i.alternate,i);break;case 24:bi(o,i,s,l,n),n&&u&2048&&lg(i.alternate,i);break;default:bi(o,i,s,l,n)}e=e.sibling}}function ml(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,r=e,n=r.flags;switch(r.tag){case 22:ml(a,r),n&2048&&sg(r.alternate,r);break;case 24:ml(a,r),n&2048&&lg(r.alternate,r);break;default:ml(a,r)}e=e.sibling}}var ol=8192;function xi(t,e,a){if(t.subtreeFlags&ol)for(t=t.child;t!==null;)w_(t,e,a),t=t.sibling}function w_(t,e,a){switch(t.tag){case 26:xi(t,e,a),t.flags&ol&&t.memoizedState!==null&&gM(a,qa,t.memoizedState,t.memoizedProps);break;case 5:xi(t,e,a);break;case 3:case 4:var r=qa;qa=gd(t.stateNode.containerInfo),xi(t,e,a),qa=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ol,ol=16777216,xi(t,e,a),ol=r):xi(t,e,a));break;default:xi(t,e,a)}}function L_(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 a=0;a<e.length;a++){var r=e[a];ft=r,A_(r,t)}L_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)I_(t),t=t.sibling}function I_(t){switch(t.tag){case 0:case 11:case 15:Qs(t),t.flags&2048&&Bn(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,qc(t)):Qs(t);break;default:Qs(t)}}function qc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,A_(r,t)}L_(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Bn(8,e,e.return),qc(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,qc(e));break;default:qc(e)}t=t.sibling}}function A_(t,e){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Bn(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Hl(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=t;ft!==null;){r=ft;var n=r.sibling,o=r.return;if(v_(r),r===a){ft=null;break e}if(n!==null){n.return=o,ft=n;break e}ft=o}}}var DR={getCacheForType:function(t){var e=bt(at),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return bt(at).controller.signal}},OR=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ae=null,de=null,he=0,be=0,ra=null,Sn=!1,as=!1,ug=!1,Nr=0,Xe=0,Fn=0,wo=0,cg=0,ia=0,Wi=0,gl=null,jt=null,um=!1,Md=0,k_=0,ud=1/0,cd=null,kn=null,ot=0,En=null,Zi=null,Mr=0,cm=0,dm=null,E_=null,vl=0,fm=null;function ca(){return(ye&2)!==0&&he!==0?he&-he:te.T!==null?fg():P0()}function T_(){if(ia===0)if((he&536870912)===0||me){var t=mc;mc<<=1,(mc&3932160)===0&&(mc=262144),ia=t}else ia=536870912;return t=fa.current,t!==null&&(t.flags|=32),ia}function Gt(t,e,a){(t===Ae&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(Xi(t,0),Cn(t,he,ia,!1)),Fl(t,a),((ye&2)===0||t!==Ae)&&(t===Ae&&((ye&2)===0&&(wo|=a),Xe===4&&Cn(t,he,ia,!1)),ur(t))}function R_(t,e,a){if((ye&6)!==0)throw Error(D(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Bl(t,e),n=r?NR(t,e):Ch(t,e,!0),o=r;do{if(n===0){as&&!r&&Cn(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!BR(a)){n=Ch(t,e,!1),o=!1;continue}if(n===2){if(o=e,t.errorRecoveryDisabledLanes&o)var i=0;else i=t.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){e=i;e:{var s=t;n=gl;var l=s.current.memoizedState.isDehydrated;if(l&&(Xi(s,i).flags|=256),i=Ch(s,i,!1),i!==2){if(ug&&!l){s.errorRecoveryDisabledLanes|=o,wo|=o,n=4;break e}o=jt,jt=n,o!==null&&(jt===null?jt=o:jt.push.apply(jt,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){Xi(t,0),Cn(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(D(345));case 4:if((e&4194048)!==e)break;case 6:Cn(r,e,ia,!Sn);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((e&62914560)===e&&(n=Md+300-sa(),10<n)){if(Cn(r,e,ia,!Sn),Sd(r,0,!0)!==0)break e;Mr=e,r.timeoutHandle=K_(XS.bind(null,r,a,jt,cd,um,e,ia,wo,Wi,Sn,o,"Throttled",-0,0),n);break e}XS(r,a,jt,cd,um,e,ia,wo,Wi,Sn,o,null,-0,0)}}break}while(!0);ur(t)}function XS(t,e,a,r,n,o,i,s,l,u,c,d,h,m){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:kr},w_(e,o,d);var S=(o&62914560)===o?Md-sa():(o&4194048)===o?k_-sa():0;if(S=vM(d,S),S!==null){Mr=o,t.cancelPendingCommit=S(KS.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,h,m)),Cn(t,o,i,!u);return}}KS(t,e,o,a,r,n,i,s,l)}function BR(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],o=n.getSnapshot;n=n.value;try{if(!da(o(),n))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;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 Cn(t,e,a,r){e&=~cg,e&=~wo,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-ua(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&B0(t,a,e)}function Dd(){return(ye&6)===0?(zl(0,!1),!1):!0}function dg(){if(de!==null){if(be===0)var t=de.return;else t=de,Er=Oo=null,Ym(t),Pi=null,Ll=0,t=de;for(;t!==null;)c_(t.alternate,t),t=t.return;de=null}}function Xi(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,JR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Mr=0,dg(),Ae=t,de=a=Tr(t.current,null),he=e,be=0,ra=null,Sn=!1,as=Bl(t,e),ug=!1,Wi=ia=cg=wo=Fn=Xe=0,jt=gl=null,um=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var n=31-ua(r),o=1<<n;e|=t[n],r&=~o}return Nr=e,Ld(),a}function M_(t,e){se=null,te.H=Al,e===ts||e===Ad?(e=AS(),be=3):e===Vm?(e=AS(),be=4):be=e===og?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ra=e,de===null&&(Xe=1,id(t,La(e,t.current)))}function D_(){var t=fa.current;return t===null?!0:(he&4194048)===he?Aa===null:(he&62914560)===he||(he&536870912)!==0?t===Aa:!1}function O_(){var t=te.H;return te.H=Al,t===null?Al:t}function B_(){var t=te.A;return te.A=DR,t}function dd(){Xe=4,Sn||(he&4194048)!==he&&fa.current!==null||(as=!0),(Fn&134217727)===0&&(wo&134217727)===0||Ae===null||Cn(Ae,he,ia,!1)}function Ch(t,e,a){var r=ye;ye|=2;var n=O_(),o=B_();(Ae!==t||he!==e)&&(cd=null,Xi(t,e)),e=!1;var i=Xe;e:do try{if(be!==0&&de!==null){var s=de,l=ra;switch(be){case 8:dg(),i=6;break e;case 3:case 2:case 9:case 6:fa.current===null&&(e=!0);var u=be;if(be=0,ra=null,Di(t,s,l,u),a&&as){i=0;break e}break;default:u=be,be=0,ra=null,Di(t,s,l,u)}}FR(),i=Xe;break}catch(c){M_(t,c)}while(!0);return e&&t.shellSuspendCounter++,Er=Oo=null,ye=r,te.H=n,te.A=o,de===null&&(Ae=null,he=0,Ld()),i}function FR(){for(;de!==null;)F_(de)}function NR(t,e){var a=ye;ye|=2;var r=O_(),n=B_();Ae!==t||he!==e?(cd=null,ud=sa()+500,Xi(t,e)):as=Bl(t,e);e:do try{if(be!==0&&de!==null){e=de;var o=ra;t:switch(be){case 1:be=0,ra=null,Di(t,e,o,1);break;case 2:case 9:if(IS(o)){be=0,ra=null,YS(e);break}e=function(){be!==2&&be!==9||Ae!==t||(be=7),ur(t)},o.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:IS(o)?(be=0,ra=null,YS(e)):(be=0,ra=null,Di(t,e,o,7));break;case 5:var i=null;switch(de.tag){case 26:i=de.memoizedState;case 5:case 27:var s=de;if(i?aw(i):s.stateNode.complete){be=0,ra=null;var l=s.sibling;if(l!==null)de=l;else{var u=s.return;u!==null?(de=u,Od(u)):de=null}break t}}be=0,ra=null,Di(t,e,o,5);break;case 6:be=0,ra=null,Di(t,e,o,6);break;case 8:dg(),Xe=6;break e;default:throw Error(D(462))}}PR();break}catch(c){M_(t,c)}while(!0);return Er=Oo=null,te.H=r,te.A=n,ye=a,de!==null?0:(Ae=null,he=0,Ld(),Xe)}function PR(){for(;de!==null&&!sT();)F_(de)}function F_(t){var e=u_(t.alternate,t,Nr);t.memoizedProps=t.pendingProps,e===null?Od(t):de=e}function YS(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=VS(a,e,e.pendingProps,e.type,void 0,he);break;case 11:e=VS(a,e,e.pendingProps,e.type.render,e.ref,he);break;case 5:Ym(e);default:c_(a,e),e=de=cC(e,Nr),e=u_(a,e,Nr)}t.memoizedProps=t.pendingProps,e===null?Od(t):de=e}function Di(t,e,a,r){Er=Oo=null,Ym(e),Pi=null,Ll=0;var n=e.return;try{if(IR(t,n,e,a,he)){Xe=1,id(t,La(a,t.current)),de=null;return}}catch(o){if(n!==null)throw de=n,o;Xe=1,id(t,La(a,t.current)),de=null;return}e.flags&32768?(me||r===1?t=!0:as||(he&536870912)!==0?t=!1:(Sn=t=!0,(r===2||r===9||r===3||r===6)&&(r=fa.current,r!==null&&r.tag===13&&(r.flags|=16384))),N_(e,t)):Od(e)}function Od(t){var e=t;do{if((e.flags&32768)!==0){N_(e,Sn);return}t=e.return;var a=ER(e.alternate,e,Nr);if(a!==null){de=a;return}if(e=e.sibling,e!==null){de=e;return}de=e=t}while(e!==null);Xe===0&&(Xe=5)}function N_(t,e){do{var a=TR(t.alternate,t);if(a!==null){a.flags&=32767,de=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){de=t;return}de=t=a}while(t!==null);Xe=6,de=null}function KS(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Bd();while(ot!==0);if((ye&6)!==0)throw Error(D(327));if(e!==null){if(e===t.current)throw Error(D(177));if(o=e.lanes|e.childLanes,o|=Fm,vT(t,a,o,i,s,l),t===Ae&&(de=Ae=null,he=0),Zi=e,En=t,Mr=a,cm=o,dm=n,E_=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,zR(Xc,function(){return z_(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=te.T,te.T=null,n=xe.p,xe.p=2,i=ye,ye|=4;try{RR(t,e,a)}finally{ye=i,xe.p=n,te.T=r}}ot=1,P_(),H_(),U_()}}function P_(){if(ot===1){ot=0;var t=En,e=Zi,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=te.T,te.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{S_(e,t);var o=gm,i=aC(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&tC(s.ownerDocument.documentElement,s)){if(l!==null&&Bm(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!m.extend&&b>x&&(i=x,x=b,b=i);var f=xS(s,b),g=xS(s,x);if(f&&g&&(m.rangeCount!==1||m.anchorNode!==f.node||m.anchorOffset!==f.offset||m.focusNode!==g.node||m.focusOffset!==g.offset)){var v=d.createRange();v.setStart(f.node,f.offset),m.removeAllRanges(),b>x?(m.addRange(v),m.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),m.addRange(v))}}}}for(d=[],m=s;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.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}}xd=!!mm,gm=mm=null}finally{ye=n,xe.p=r,te.T=a}}t.current=e,ot=2}}function H_(){if(ot===2){ot=0;var t=En,e=Zi,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=te.T,te.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{g_(t,e.alternate,e)}finally{ye=n,xe.p=r,te.T=a}}ot=3}}function U_(){if(ot===4||ot===3){ot=0,lT();var t=En,e=Zi,a=Mr,r=E_;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ot=5:(ot=0,Zi=En=null,q_(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(kn=null),km(a),e=e.stateNode,la&&typeof la.onCommitFiberRoot=="function")try{la.onCommitFiberRoot(Ol,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=te.T,n=xe.p,xe.p=2,te.T=null;try{for(var o=t.onRecoverableError,i=0;i<r.length;i++){var s=r[i];o(s.value,{componentStack:s.stack})}}finally{te.T=e,xe.p=n}}(Mr&3)!==0&&Bd(),ur(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===fm?vl++:(vl=0,fm=t):vl=0,zl(0,!1)}}function q_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Hl(e)))}function Bd(){return P_(),H_(),U_(),z_()}function z_(){if(ot!==5)return!1;var t=En,e=cm;cm=0;var a=km(Mr),r=te.T,n=xe.p;try{xe.p=32>a?32:a,te.T=null,a=dm,dm=null;var o=En,i=Mr;if(ot=0,Zi=En=null,Mr=0,(ye&6)!==0)throw Error(D(331));var s=ye;if(ye|=4,I_(o.current),__(o,o.current,i,a),ye=s,zl(0,!1),la&&typeof la.onPostCommitFiberRoot=="function")try{la.onPostCommitFiberRoot(Ol,o)}catch{}return!0}finally{xe.p=n,te.T=r,q_(t,e)}}function QS(t,e,a){e=La(a,e),e=om(t.stateNode,e,2),t=An(t,e,2),t!==null&&(Fl(t,2),ur(t))}function Se(t,e,a){if(t.tag===3)QS(t,t,a);else for(;e!==null;){if(e.tag===3){QS(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(kn===null||!kn.has(r))){t=La(a,t),a=r_(2),r=An(e,a,2),r!==null&&(n_(a,r,e,t),Fl(r,2),ur(r));break}}e=e.return}}function _h(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new OR;var n=new Set;r.set(e,n)}else n=r.get(e),n===void 0&&(n=new Set,r.set(e,n));n.has(a)||(ug=!0,n.add(a),t=HR.bind(null,t,e,a),e.then(t,t))}function HR(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ae===t&&(he&a)===a&&(Xe===4||Xe===3&&(he&62914560)===he&&300>sa()-Md?(ye&2)===0&&Xi(t,0):cg|=a,Wi===he&&(Wi=0)),ur(t)}function V_(t,e){e===0&&(e=O0()),t=Do(t,e),t!==null&&(Fl(t,e),ur(t))}function UR(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),V_(t,a)}function qR(t,e){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(D(314))}r!==null&&r.delete(e),V_(t,a)}function zR(t,e){return Im(t,e)}var fd=null,Si=null,pm=!1,pd=!1,wh=!1,_n=0;function ur(t){t!==Si&&t.next===null&&(Si===null?fd=Si=t:Si=Si.next=t),pd=!0,pm||(pm=!0,$R())}function zl(t,e){if(!wh&&pd){wh=!0;do for(var a=!1,r=fd;r!==null;){if(!e)if(t!==0){var n=r.pendingLanes;if(n===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-ua(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,JS(r,o))}else o=he,o=Sd(r,r===Ae?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Bl(r,o)||(a=!0,JS(r,o));r=r.next}while(a);wh=!1}}function VR(){$_()}function $_(){pd=pm=!1;var t=0;_n!==0&&QR()&&(t=_n);for(var e=sa(),a=null,r=fd;r!==null;){var n=r.next,o=j_(r,e);o===0?(r.next=null,a===null?fd=n:a.next=n,n===null&&(Si=a)):(a=r,(t!==0||(o&3)!==0)&&(pd=!0)),r=n}ot!==0&&ot!==5||zl(t,!1),_n!==0&&(_n=0)}function j_(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-ua(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=gT(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,a=he,a=Sd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&Jp(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Bl(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&Jp(r),km(a)){case 2:case 8:a=M0;break;case 32:a=Xc;break;case 268435456:a=D0;break;default:a=Xc}return r=G_.bind(null,t),a=Im(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&Jp(r),t.callbackPriority=2,t.callbackNode=null,2}function G_(t,e){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Bd()&&t.callbackNode!==a)return null;var r=he;return r=Sd(t,t===Ae?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(R_(t,r,e),j_(t,sa()),t.callbackNode!=null&&t.callbackNode===a?G_.bind(null,t):null)}function JS(t,e){if(Bd())return null;R_(t,e,!0)}function $R(){eM(function(){(ye&6)!==0?Im(R0,VR):$_()})}function fg(){if(_n===0){var t=$i;t===0&&(t=hc,hc<<=1,(hc&261888)===0&&(hc=256)),_n=t}return _n}function e0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Mc(""+t)}function t0(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function jR(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=e0((n[Wt]||null).action),i=r.submitter;i&&(e=(e=i[Wt]||null)?e0(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new Cd("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(_n!==0){var l=i?t0(n,i):new FormData(n);rm(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?t0(n,i):new FormData(n),rm(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(Ic=0;Ic<jh.length;Ic++)Ac=jh[Ic],a0=Ac.toLowerCase(),r0=Ac[0].toUpperCase()+Ac.slice(1),za(a0,"on"+r0);var Ac,a0,r0,Ic;za(nC,"onAnimationEnd");za(oC,"onAnimationIteration");za(iC,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(uR,"onTransitionRun");za(cR,"onTransitionStart");za(dR,"onTransitionCancel");za(sC,"onTransitionEnd");zi("onMouseEnter",["mouseout","mouseover"]);zi("onMouseLeave",["mouseout","mouseover"]);zi("onPointerEnter",["pointerout","pointerover"]);zi("onPointerLeave",["pointerout","pointerover"]);To("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));To("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));To("onBeforeInput",["compositionend","keypress","textInput","paste"]);To("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));To("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));To("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kl="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(" "),GR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kl));function W_(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],n=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){Kc(c)}n.currentTarget=null,o=l}else for(i=0;i<r.length;i++){if(s=r[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){Kc(c)}n.currentTarget=null,o=l}}}}function ce(t,e){var a=e[Nh];a===void 0&&(a=e[Nh]=new Set);var r=t+"__bubble";a.has(r)||(Z_(e,t,2,!1),a.add(r))}function Lh(t,e,a){var r=0;e&&(r|=4),Z_(a,t,r,e)}var kc="_reactListening"+Math.random().toString(36).slice(2);function pg(t){if(!t[kc]){t[kc]=!0,H0.forEach(function(a){a!=="selectionchange"&&(GR.has(a)||Lh(a,!1,t),Lh(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[kc]||(e[kc]=!0,Lh("selectionchange",!1,e))}}function Z_(t,e,a,r){switch(sw(e)){case 2:var n=bM;break;case 8:n=SM;break;default:n=vg}a=n.bind(null,e,a,t),n=void 0,!zh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),r?n!==void 0?t.addEventListener(e,a,{capture:!0,passive:n}):t.addEventListener(e,a,!0):n!==void 0?t.addEventListener(e,a,{passive:n}):t.addEventListener(e,a,!1)}function Ih(t,e,a,r,n){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===n)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===n)return;i=i.return}for(;s!==null;){if(i=wi(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){r=o=i;continue e}s=s.parentNode}}r=r.return}W0(function(){var u=o,c=Rm(a),d=[];e:{var h=lC.get(t);if(h!==void 0){var m=Cd,S=t;switch(t){case"keypress":if(Oc(a)===0)break e;case"keydown":case"keyup":m=qT;break;case"focusin":S="focus",m=nh;break;case"focusout":S="blur",m=nh;break;case"beforeblur":case"afterblur":m=nh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=cS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=ET;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=$T;break;case nC:case oC:case iC:m=MT;break;case sC:m=GT;break;case"scroll":case"scrollend":m=AT;break;case"wheel":m=ZT;break;case"copy":case"cut":case"paste":m=OT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=fS;break;case"toggle":case"beforetoggle":m=YT}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?h!==null?h+"Capture":null:h;b=[];for(var g=u,v;g!==null;){var y=g;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=bl(g,f),y!=null&&b.push(El(g,y,v))),x)break;g=g.return}0<b.length&&(h=new m(h,S,null,a,c),d.push({event:h,listeners:b}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&a!==qh&&(S=a.relatedTarget||a.fromElement)&&(wi(S)||S[Qi]))break e;if((m||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,m?(S=a.relatedTarget||a.toElement,m=u,S=S?wi(S):null,S!==null&&(x=Dl(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(m=null,S=u),m!==S)){if(b=cS,y="onMouseLeave",f="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(b=fS,y="onPointerLeave",f="onPointerEnter",g="pointer"),x=m==null?h:rl(m),v=S==null?h:rl(S),h=new b(y,g+"leave",m,a,c),h.target=x,h.relatedTarget=v,y=null,wi(c)===u&&(b=new b(f,g+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,m&&S)t:{for(b=WR,f=m,g=S,v=0,y=f;y;y=b(y))v++;y=0;for(var _=g;_;_=b(_))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)g=b(g),y--;for(;v--;){if(f===g||g!==null&&f===g.alternate){b=f;break t}f=b(f),g=b(g)}b=null}else b=null;m!==null&&n0(d,h,m,b,!1),S!==null&&x!==null&&n0(d,x,S,b,!0)}}e:{if(h=u?rl(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var w=gS;else if(mS(h))if(J0)w=iR;else{w=nR;var C=rR}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&Tm(u.elementType)&&(w=gS):w=oR;if(w&&(w=w(t,u))){Q0(d,w,a,c);break e}C&&C(t,h,u),t==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&Uh(h,"number",h.value)}switch(C=u?rl(u):window,t){case"focusin":(mS(C)||C.contentEditable==="true")&&(Ai=C,Vh=u,ll=null);break;case"focusout":ll=Vh=Ai=null;break;case"mousedown":$h=!0;break;case"contextmenu":case"mouseup":case"dragend":$h=!1,bS(d,a,c);break;case"selectionchange":if(lR)break;case"keydown":case"keyup":bS(d,a,c)}var L;if(Om)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Ii?Y0(t,a)&&(k="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(k="onCompositionStart");k&&(X0&&a.locale!=="ko"&&(Ii||k!=="onCompositionStart"?k==="onCompositionEnd"&&Ii&&(L=Z0()):(bn=c,Mm="value"in bn?bn.value:bn.textContent,Ii=!0)),C=hd(u,k),0<C.length&&(k=new dS(k,t,null,a,c),d.push({event:k,listeners:C}),L?k.data=L:(L=K0(a),L!==null&&(k.data=L)))),(L=QT?JT(t,a):eR(t,a))&&(k=hd(u,"onBeforeInput"),0<k.length&&(C=new dS("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:k}),C.data=L)),jR(d,t,u,a,c)}W_(d,e)})}function El(t,e,a){return{instance:t,listener:e,currentTarget:a}}function hd(t,e){for(var a=e+"Capture",r=[];t!==null;){var n=t,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=bl(t,a),n!=null&&r.unshift(El(t,n,o)),n=bl(t,e),n!=null&&r.push(El(t,n,o))),t.tag===3)return r;t=t.return}return[]}function WR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function n0(t,e,a,r,n){for(var o=e._reactName,i=[];a!==null&&a!==r;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,n?(u=bl(a,o),u!=null&&i.unshift(El(a,u,l))):n||(u=bl(a,o),u!=null&&i.push(El(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var ZR=/\r\n?/g,XR=/\u0000|\uFFFD/g;function o0(t){return(typeof t=="string"?t:""+t).replace(ZR,`
9
+ `).replace(XR,"")}function X_(t,e){return e=o0(e),o0(t)===e}function we(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Vi(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Vi(t,""+r);break;case"className":vc(t,"class",r);break;case"tabIndex":vc(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":vc(t,a,r);break;case"style":G0(t,r,o);break;case"data":if(e!=="object"){vc(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Mc(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(e!=="input"&&we(t,e,"name",n.name,n,null),we(t,e,"formEncType",n.formEncType,n,null),we(t,e,"formMethod",n.formMethod,n,null),we(t,e,"formTarget",n.formTarget,n,null)):(we(t,e,"encType",n.encType,n,null),we(t,e,"method",n.method,n,null),we(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Mc(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=kr);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}a=Mc(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""+r):t.removeAttribute(a);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":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":ce("beforetoggle",t),ce("toggle",t),Rc(t,"popover",r);break;case"xlinkActuate":br(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":br(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":br(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":br(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":br(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":br(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":br(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":br(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":br(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Rc(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=LT.get(a)||a,Rc(t,a,r))}}function hm(t,e,a,r,n,o){switch(a){case"style":G0(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));t.innerHTML=a}}break;case"children":typeof r=="string"?Vi(t,r):(typeof r=="number"||typeof r=="bigint")&&Vi(t,""+r);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"onClick":r!=null&&(t.onclick=kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!U0.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),e=a.slice(2,n?a.length-7:void 0),o=t[Wt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,n),typeof r=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,r,n);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):Rc(t,a,r)}}}function St(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",t),ce("load",t);var r=!1,n=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,o,i,a,null)}}n&&we(t,e,"srcSet",a.srcSet,a,null),r&&we(t,e,"src",a.src,a,null);return;case"input":ce("invalid",t);var s=o=i=n=null,l=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":n=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(D(137,e));break;default:we(t,e,r,c,a,null)}}V0(t,o,s,l,u,i,n,!1);return;case"select":ce("invalid",t),r=i=o=null;for(n in a)if(a.hasOwnProperty(n)&&(s=a[n],s!=null))switch(n){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:we(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Bi(t,!!r,e,!1):a!=null&&Bi(t,!!r,a,!0);return;case"textarea":ce("invalid",t),o=n=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":n=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(D(91));break;default:we(t,e,i,s,a,null)}j0(t,r,n,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null)&&(l==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":we(t,e,l,r,a,null));return;case"dialog":ce("beforetoggle",t),ce("toggle",t),ce("cancel",t),ce("close",t);break;case"iframe":case"object":ce("load",t);break;case"video":case"audio":for(r=0;r<kl.length;r++)ce(kl[r],t);break;case"image":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"embed":case"source":case"link":ce("error",t),ce("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(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,u,r,a,null)}return;default:if(Tm(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&hm(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&we(t,e,s,r,a,null))}function YR(t,e,a,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,i=null,s=null,l=null,u=null,c=null;for(m in a){var d=a[m];if(a.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(m)||we(t,e,m,null,r,d)}}for(var h in r){var m=r[h];if(d=a[h],r.hasOwnProperty(h)&&(m!=null||d!=null))switch(h){case"type":o=m;break;case"name":n=m;break;case"checked":u=m;break;case"defaultChecked":c=m;break;case"value":i=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(D(137,e));break;default:m!==d&&we(t,e,h,m,r,d)}}Hh(t,i,s,l,u,c,o,n);return;case"select":m=i=s=h=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:r.hasOwnProperty(o)||we(t,e,o,null,r,l)}for(n in r)if(o=r[n],l=a[n],r.hasOwnProperty(n)&&(o!=null||l!=null))switch(n){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&we(t,e,n,o,r,l)}e=s,a=i,r=m,h!=null?Bi(t,!!a,h,!1):!!r!=!!a&&(e!=null?Bi(t,!!a,e,!0):Bi(t,!!a,a?[]:"",!1));return;case"textarea":m=h=null;for(s in a)if(n=a[s],a.hasOwnProperty(s)&&n!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,r,n)}for(i in r)if(n=r[i],o=a[i],r.hasOwnProperty(i)&&(n!=null||o!=null))switch(i){case"value":h=n;break;case"defaultValue":m=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(D(91));break;default:n!==o&&we(t,e,i,n,r,o)}$0(t,h,m);return;case"option":for(var S in a)h=a[S],a.hasOwnProperty(S)&&h!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,r,h));for(l in r)h=r[l],m=a[l],r.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,r,m));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 a)h=a[b],a.hasOwnProperty(b)&&h!=null&&!r.hasOwnProperty(b)&&we(t,e,b,null,r,h);for(u in r)if(h=r[u],m=a[u],r.hasOwnProperty(u)&&h!==m&&(h!=null||m!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,e));break;default:we(t,e,u,h,r,m)}return;default:if(Tm(e)){for(var x in a)h=a[x],a.hasOwnProperty(x)&&h!==void 0&&!r.hasOwnProperty(x)&&hm(t,e,x,void 0,r,h);for(c in r)h=r[c],m=a[c],!r.hasOwnProperty(c)||h===m||h===void 0&&m===void 0||hm(t,e,c,h,r,m);return}}for(var f in a)h=a[f],a.hasOwnProperty(f)&&h!=null&&!r.hasOwnProperty(f)&&we(t,e,f,null,r,h);for(d in r)h=r[d],m=a[d],!r.hasOwnProperty(d)||h===m||h==null&&m==null||we(t,e,d,h,r,m)}function i0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],o=n.transferSize,i=n.initiatorType,s=n.duration;if(o&&s&&i0(i)){for(i=0,s=n.responseEnd,r+=1;r<a.length;r++){var l=a[r],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&i0(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--r,e+=8*(o+i)/(n.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 mm=null,gm=null;function md(t){return t.nodeType===9?t:t.ownerDocument}function s0(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 Y_(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 vm(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 Ah=null;function QR(){var t=window.event;return t&&t.type==="popstate"?t===Ah?!1:(Ah=t,!0):(Ah=null,!1)}var K_=typeof setTimeout=="function"?setTimeout:void 0,JR=typeof clearTimeout=="function"?clearTimeout:void 0,l0=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof l0<"u"?function(t){return l0.resolve(null).then(t).catch(tM)}:K_;function tM(t){setTimeout(function(){throw t})}function Pn(t){return t==="head"}function u0(t,e){var a=e,r=0;do{var n=a.nextSibling;if(t.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(n),Ki(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")yl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,yl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[Nl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&yl(t.ownerDocument.body);a=n}while(a);Ki(e)}function c0(t,e){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function ym(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ym(a),Em(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function aM(t,e,a,r){for(;t.nodeType===1;){var n=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){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!==n.rel||t.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||t.getAttribute("title")!==(n.title==null?null:n.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(n.src==null?null:n.src)||t.getAttribute("type")!==(n.type==null?null:n.type)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=ka(t.nextSibling),t===null)break}return null}function rM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ka(t.nextSibling),t===null))return null;return t}function Q_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=ka(t.nextSibling),t===null))return null;return t}function xm(t){return t.data==="$?"||t.data==="$~"}function bm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function nM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var r=function(){e(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function ka(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 Sm=null;function d0(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return ka(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function f0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function J_(t,e,a){switch(e=md(a),t){case"html":if(t=e.documentElement,!t)throw Error(D(452));return t;case"head":if(t=e.head,!t)throw Error(D(453));return t;case"body":if(t=e.body,!t)throw Error(D(454));return t;default:throw Error(D(451))}}function yl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Em(t)}var Ea=new Map,p0=new Set;function gd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Pr=xe.d;xe.d={f:oM,r:iM,D:sM,C:lM,L:uM,m:cM,X:fM,S:dM,M:pM};function oM(){var t=Pr.f(),e=Dd();return t||e}function iM(t){var e=Ji(t);e!==null&&e.tag===5&&e.type==="form"?GC(e):Pr.r(t)}var rs=typeof document>"u"?null:document;function ew(t,e,a){var r=rs;if(r&&typeof e=="string"&&e){var n=wa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),p0.has(n)||(p0.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function sM(t){Pr.D(t),ew("dns-prefetch",t,null)}function lM(t,e){Pr.C(t,e),ew("preconnect",t,e)}function uM(t,e,a){Pr.L(t,e,a);var r=rs;if(r&&t&&e){var n='link[rel="preload"][as="'+wa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+wa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+wa(a.imageSizes)+'"]')):n+='[href="'+wa(t)+'"]';var o=n;switch(e){case"style":o=Yi(t);break;case"script":o=ns(t)}Ea.has(o)||(t=Pe({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ea.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(Vl(o))||e==="script"&&r.querySelector($l(o))||(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function cM(t,e){Pr.m(t,e);var a=rs;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+wa(r)+'"][href="'+wa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ns(t)}if(!Ea.has(o)&&(t=Pe({rel:"modulepreload",href:t},e),Ea.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($l(o)))return}r=a.createElement("link"),St(r,"link",t),pt(r),a.head.appendChild(r)}}}function dM(t,e,a){Pr.S(t,e,a);var r=rs;if(r&&t){var n=Oi(r).hoistableStyles,o=Yi(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Vl(o)))s.loading=5;else{t=Pe({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ea.get(o))&&hg(t,a);var l=i=r.createElement("link");pt(l),St(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,zc(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function fM(t,e){Pr.X(t,e);var a=rs;if(a&&t){var r=Oi(a).hoistableScripts,n=ns(t),o=r.get(n);o||(o=a.querySelector($l(n)),o||(t=Pe({src:t,async:!0},e),(e=Ea.get(n))&&mg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function pM(t,e){Pr.M(t,e);var a=rs;if(a&&t){var r=Oi(a).hoistableScripts,n=ns(t),o=r.get(n);o||(o=a.querySelector($l(n)),o||(t=Pe({src:t,async:!0,type:"module"},e),(e=Ea.get(n))&&mg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function h0(t,e,a,r){var n=(n=wn.current)?gd(n):null;if(!n)throw Error(D(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Yi(a.href),a=Oi(n).hoistableStyles,r=a.get(e),r||(r={type:"style",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Yi(a.href);var o=Oi(n).hoistableStyles,i=o.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=n.querySelector(Vl(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Ea.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ea.set(t,a),o||hM(n,t,a,i.state))),e&&r===null)throw Error(D(528,""));return i}if(e&&r!==null)throw Error(D(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ns(a),a=Oi(n).hoistableScripts,r=a.get(e),r||(r={type:"script",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,t))}}function Yi(t){return'href="'+wa(t)+'"'}function Vl(t){return'link[rel="stylesheet"]['+t+"]"}function tw(t){return Pe({},t,{"data-precedence":t.precedence,precedence:null})}function hM(t,e,a,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),St(e,"link",a),pt(e),t.head.appendChild(e))}function ns(t){return'[src="'+wa(t)+'"]'}function $l(t){return"script[async]"+t}function m0(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+wa(a.href)+'"]');if(r)return e.instance=r,pt(r),r;var n=Pe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),St(r,"style",n),zc(r,a.precedence,t),e.instance=r;case"stylesheet":n=Yi(a.href);var o=t.querySelector(Vl(n));if(o)return e.state.loading|=4,e.instance=o,pt(o),o;r=tw(a),(n=Ea.get(n))&&hg(r,n),o=(t.ownerDocument||t).createElement("link"),pt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),e.state.loading|=4,zc(o,a.precedence,t),e.instance=o;case"script":return o=ns(a.src),(n=t.querySelector($l(o)))?(e.instance=n,pt(n),n):(r=a,(n=Ea.get(o))&&(r=Pe({},a),mg(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),pt(n),St(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(D(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,zc(r,a.precedence,t));return e.instance}function zc(t,e,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,o=n,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===e)o=s;else if(o!==n)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function hg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function mg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Vc=null;function g0(t,e,a){if(Vc===null){var r=new Map,n=Vc=new Map;n.set(a,r)}else n=Vc,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),n=0;n<a.length;n++){var o=a[n];if(!(o[Nl]||o[yt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function v0(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function mM(t,e,a){if(a===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 aw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gM(t,e,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Yi(r.href),o=e.querySelector(Vl(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=vd.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,pt(o);return}o=e.ownerDocument||e,r=tw(r),(n=Ea.get(n))&&hg(r,n),o=o.createElement("link"),pt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=vd.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var kh=0;function vM(t,e){return t.stylesheets&&t.count===0&&$c(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&$c(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&kh===0&&(kh=62500*KR());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&$c(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>kh?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function vd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$c(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var yd=null;function $c(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,yd=new Map,e.forEach(yM,t),yd=null,vd.call(t))}function yM(t,e){if(!(e.state.loading&4)){var a=yd.get(t);if(a)var r=a.get(null);else{a=new Map,yd.set(t,a);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var i=n[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),r=i)}r&&a.set(null,r)}n=e.instance,i=n.getAttribute("data-precedence"),o=a.get(i)||r,o===r&&a.set(null,n),a.set(i,n),this.count++,r=vd.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),o?o.parentNode.insertBefore(n,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(n,t.firstChild)),e.state.loading|=4}}var Tl={$$typeof:Ar,Provider:null,Consumer:null,_currentValue:bo,_currentValue2:bo,_threadCount:0};function xM(t,e,a,r,n,o,i,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=eh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eh(0),this.hiddenUpdates=eh(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function rw(t,e,a,r,n,o,i,s,l,u,c,d){return t=new xM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=oa(3,null,null,e),t.current=o,o.stateNode=t,e=qm(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},$m(o),t}function nw(t){return t?(t=Ti,t):Ti}function ow(t,e,a,r,n,o){n=nw(n),r.context===null?r.context=n:r.pendingContext=n,r=In(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=An(t,r,e),a!==null&&(Gt(a,t,e),cl(a,t,e))}function y0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function gg(t,e){y0(t,e),(t=t.alternate)&&y0(t,e)}function iw(t){if(t.tag===13||t.tag===31){var e=Do(t,67108864);e!==null&&Gt(e,t,67108864),gg(t,67108864)}}function x0(t){if(t.tag===13||t.tag===31){var e=ca();e=Am(e);var a=Do(t,e);a!==null&&Gt(a,t,e),gg(t,e)}}var xd=!0;function bM(t,e,a,r){var n=te.T;te.T=null;var o=xe.p;try{xe.p=2,vg(t,e,a,r)}finally{xe.p=o,te.T=n}}function SM(t,e,a,r){var n=te.T;te.T=null;var o=xe.p;try{xe.p=8,vg(t,e,a,r)}finally{xe.p=o,te.T=n}}function vg(t,e,a,r){if(xd){var n=Cm(r);if(n===null)Ih(t,e,r,bd,a),b0(t,r);else if(_M(n,t,e,a,r))r.stopPropagation();else if(b0(t,r),e&4&&-1<CM.indexOf(t)){for(;n!==null;){var o=Ji(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=vo(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-ua(i);s.entanglements[1]|=l,i&=~l}ur(o),(ye&6)===0&&(ud=sa()+500,zl(0,!1))}}break;case 31:case 13:s=Do(o,2),s!==null&&Gt(s,o,2),Dd(),gg(o,2)}if(o=Cm(r),o===null&&Ih(t,e,r,bd,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Ih(t,e,r,null,a)}}function Cm(t){return t=Rm(t),yg(t)}var bd=null;function yg(t){if(bd=null,t=wi(t),t!==null){var e=Dl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=I0(e),t!==null)return t;t=null}else if(a===31){if(t=A0(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return bd=t,null}function sw(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(uT()){case R0:return 2;case M0:return 8;case Xc:case cT:return 32;case D0:return 268435456;default:return 32}default:return 32}}var _m=!1,Tn=null,Rn=null,Mn=null,Rl=new Map,Ml=new Map,yn=[],CM="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 b0(t,e){switch(t){case"focusin":case"focusout":Tn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Rl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ml.delete(e.pointerId)}}function Js(t,e,a,r,n,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:r,nativeEvent:o,targetContainers:[n]},e!==null&&(e=Ji(e),e!==null&&iw(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function _M(t,e,a,r,n){switch(e){case"focusin":return Tn=Js(Tn,t,e,a,r,n),!0;case"dragenter":return Rn=Js(Rn,t,e,a,r,n),!0;case"mouseover":return Mn=Js(Mn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Rl.set(o,Js(Rl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Ml.set(o,Js(Ml.get(o)||null,t,e,a,r,n)),!0}return!1}function lw(t){var e=wi(t.target);if(e!==null){var a=Dl(e);if(a!==null){if(e=a.tag,e===13){if(e=I0(a),e!==null){t.blockedOn=e,rS(t.priority,function(){x0(a)});return}}else if(e===31){if(e=A0(a),e!==null){t.blockedOn=e,rS(t.priority,function(){x0(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=Cm(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);qh=r,a.target.dispatchEvent(r),qh=null}else return e=Ji(a),e!==null&&iw(e),t.blockedOn=a,!1;e.shift()}return!0}function S0(t,e,a){jc(t)&&a.delete(e)}function wM(){_m=!1,Tn!==null&&jc(Tn)&&(Tn=null),Rn!==null&&jc(Rn)&&(Rn=null),Mn!==null&&jc(Mn)&&(Mn=null),Rl.forEach(S0),Ml.forEach(S0)}function Ec(t,e){t.blockedOn===e&&(t.blockedOn=null,_m||(_m=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,wM)))}var Tc=null;function C0(t){Tc!==t&&(Tc=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Tc===t&&(Tc=null);for(var e=0;e<t.length;e+=3){var a=t[e],r=t[e+1],n=t[e+2];if(typeof r!="function"){if(yg(r||a)===null)continue;break}var o=Ji(a);o!==null&&(t.splice(e,3),e-=3,rm(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function Ki(t){function e(l){return Ec(l,t)}Tn!==null&&Ec(Tn,t),Rn!==null&&Ec(Rn,t),Mn!==null&&Ec(Mn,t),Rl.forEach(e),Ml.forEach(e);for(var a=0;a<yn.length;a++){var r=yn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<yn.length&&(a=yn[0],a.blockedOn===null);)lw(a),a.blockedOn===null&&yn.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],o=a[r+1],i=n[Wt]||null;if(typeof o=="function")i||C0(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[Wt]||null)s=i.formAction;else if(yg(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),C0(a)}}}function uw(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return n=i})},focusReset:"manual",scroll:"manual"})}function e(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!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 r=!1,n=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),n!==null&&(n(),n=null)}}}function xg(t){this._internalRoot=t}Fd.prototype.render=xg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));var a=e.current,r=ca();ow(a,r,t,e,null,null)};Fd.prototype.unmount=xg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;ow(t.current,2,null,t,null,null),Dd(),e[Qi]=null}};function Fd(t){this._internalRoot=t}Fd.prototype.unstable_scheduleHydration=function(t){if(t){var e=P0();t={blockedOn:null,target:t,priority:e};for(var a=0;a<yn.length&&e!==0&&e<yn[a].priority;a++);yn.splice(a,0,t),a===0&&lw(t)}};var _0=w0.version;if(_0!=="19.2.4")throw Error(D(527,_0,"19.2.4"));xe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=aT(e),t=t!==null?k0(t):null,t=t===null?null:t.stateNode,t};var LM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(el=__REACT_DEVTOOLS_GLOBAL_HOOK__,!el.isDisabled&&el.supportsFiber))try{Ol=el.inject(LM),la=el}catch{}var el;Nd.createRoot=function(t,e){if(!L0(t))throw Error(D(299));var a=!1,r="",n=e_,o=t_,i=a_;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(n=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=rw(t,1,!1,null,null,a,r,null,n,o,i,uw),t[Qi]=e.current,pg(t),new xg(e)};Nd.hydrateRoot=function(t,e,a){if(!L0(t))throw Error(D(299));var r=!1,n="",o=e_,i=t_,s=a_,l=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),e=rw(t,1,!0,e,a??null,r,n,l,o,i,s,uw),e.context=nw(null),a=e.current,r=ca(),r=Am(r),n=In(r),n.callback=null,An(a,n,r),a=r,e.current.lanes=a,Fl(e,a),ur(e),t[Qi]=e.current,pg(t),new Fd(e)};Nd.version="19.2.4"});var Bo=tr((uH,fw)=>{"use strict";function dw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dw)}catch(t){console.error(t)}}dw(),fw.exports=cw()});var lL=tr(tf=>{"use strict";var b2=Symbol.for("react.transitional.element"),S2=Symbol.for("react.fragment");function sL(t,e,a){var r=null;if(a!==void 0&&(r=""+a),e.key!==void 0&&(r=""+e.key),"key"in e){a={};for(var n in e)n!=="key"&&(a[n]=e[n])}else a=e;return e=a.ref,{$$typeof:b2,type:t,key:r,ref:e!==void 0?e:null,props:a}}tf.Fragment=S2;tf.jsx=sL;tf.jsxs=sL});var Me=tr((I4,uL)=>{"use strict";uL.exports=lL()});var LE=K(We(),1),Tp=K($s(),1),eH=K(Bo(),1);function pw(t,e,a,r){let n=r?.maxRetries??3,o=r?.debounceMs??50,i=t.parentElement??e.parentElement;if(!i)return()=>{};let s=0,l=null,u=!1,c=new MutationObserver(d=>{if(!u){for(let h of d)for(let m of h.removedNodes)if(m===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var IM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function bg(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 a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!IM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),m=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||m)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var hw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=bg(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),m=(a.parentElement??a).querySelector(`[${n}="${d}"]`);m&&m.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(n,o),i.innerHTML=r;let s=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":s=a.innerHTML,a.replaceWith(i);break}let l=null;if(t.deepLink){let{tileId:d,itemId:h}=t.deepLink;l=()=>{let m=window.SynOS?.handle;m&&(m.open(),m.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:h}))},i.style.cursor="pointer",i.addEventListener("click",l)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let c=pw(i,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":break}});return{cleanup:()=>{if(l&&i.removeEventListener("click",l),c(),t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(h=>{d.setAttribute(h.name,h.value)}),i.replaceWith(d)}else i.remove()},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=bg(d.html))}}},mw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=r},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},gw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.attr.toLowerCase();if(r.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(r==="href"||r==="src"||r==="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=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},vw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||a.classList.remove(t.className)}}},yw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&a.classList.add(t.className)}}},xw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=new Map;for(let n of Object.keys(t.styles)){let o=a.style.getPropertyValue(n);r.set(n,o)}for(let[n,o]of Object.entries(t.styles))a.style.setProperty(n,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[n,o]of r)o?a.style.setProperty(n,o):a.style.removeProperty(n)},updateFn:n=>{if("styles"in n&&typeof n.styles=="object"&&n.styles)for(let[o,i]of Object.entries(n.styles))a.style.setProperty(o,i)}}},Sg=[{kind:"content:insertHtml",executor:hw},{kind:"content:setText",executor:mw},{kind:"content:setAttr",executor:gw},{kind:"content:addClass",executor:vw},{kind:"content:removeClass",executor:yw},{kind:"content:setStyle",executor:xw}],Cg={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Sg};var AM={light:50,medium:100,heavy:200},kM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],bw={init(t,e,a){let r=AM[a.intensity],n=a.colors.length>0?a.colors:kM,o=[];for(let i=0;i<r;i++)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:n[Math.floor(Math.random()*n.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let r=!1;for(let n of t)n.vy+=.15,n.vx*=.99,n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y>0&&n.opacity>0&&n.y>500&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var EM={light:20,medium:40,heavy:80},TM="\u{1F389}",Sw={init(t,e,a){let r=EM[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:TM,o=[];for(let i=0;i<r;i++)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:n,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let i of o)i.data&&(i.data.originX=i.x);return o},update(t,e,a){let r=!1;for(let n of t){n.y+=n.vy;let o=n.data?.wobblePhase??0,i=n.data?.wobbleAmp??1,s=n.data?.originX??n.x;n.x=s+Math.sin(a*.003+o)*i*20,n.y>600&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e)a.opacity<.01||!a.emoji||(t.save(),t.globalAlpha=a.opacity,t.font=`${a.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.emoji,a.x,a.y),t.restore())}};var RM={light:20,medium:40,heavy:80},MM={light:3,medium:4,heavy:5},Cw={init(t,e,a){let r=RM[a.intensity],n=MM[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<n;s++){let l=Math.random()*t*.8+t*.1,u=Math.random()*e*.6,c=o[Math.floor(Math.random()*o.length)];for(let d=0;d<r;d++){let h=Math.PI*2*d/r+(Math.random()-.5)*.3,m=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(h)*m,vy:Math.sin(h)*m,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let r=!1;for(let n of t)n.vx*=.97,n.vy*=.97,n.vy+=.03,n.x+=n.vx,n.y+=n.vy,n.opacity-=.008,n.opacity<0&&(n.opacity=0),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var DM={light:30,medium:60,heavy:120},_w={init(t,e,a){let r=DM[a.intensity],n=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<r;i++)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:n[Math.floor(Math.random()*n.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,a){let r=!1;for(let n of t){n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.data&&(n.data.baseOpacity=(n.data.baseOpacity??1)-.001,n.data.baseOpacity<0&&(n.data.baseOpacity=0));let o=n.data?.phase??0,i=n.data?.baseOpacity??1;if(i<=.01)n.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;n.opacity=i*s}n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e){if(a.opacity<.01)continue;t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation);let r=a.size;t.beginPath(),t.moveTo(0,-r),t.lineTo(r*.3,-r*.3),t.lineTo(r,0),t.lineTo(r*.3,r*.3),t.lineTo(0,r),t.lineTo(-r*.3,r*.3),t.lineTo(-r,0),t.lineTo(-r*.3,-r*.3),t.closePath(),t.fill(),t.restore()}}};var Pd=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,a,r){this.container=e,this.effect=a,this.duration=r.duration;let n=document.createElement("canvas");n.setAttribute("data-syntro-celebrate",""),Object.assign(n.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;n.width=i*o,n.height=s*o,n.style.width=`${i}px`,n.style.height=`${s}px`;let l=n.getContext("2d");l&&(l.scale(o,o),this.canvas=n,this.ctx=l,e.appendChild(n),this.particles=a.init(i,s,r),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 a=e-this.startTime,r=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let n=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,n,o),!this.effect.update(this.particles,r,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var OM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function BM(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function FM(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),r=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return BM(a,r||a)}catch{}return null}var ww=new Map([["confetti",bw],["fireworks",Cw],["sparkles",_w],["emoji-rain",Sw]]),Lw=async(t,e)=>{let a=ww.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...ww.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??FM(e.overlayRoot)??OM,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new Pd;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var wg="syntro_active_tour",Hd=new Map;function NM(t){try{let e=localStorage.getItem(wg);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function _g(t){try{localStorage.setItem(wg,JSON.stringify(t))}catch{}}function PM(){try{localStorage.removeItem(wg)}catch{}}function jl(){return window.location.pathname}function HM(t){if(!t.route)return!0;let e=jl();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Lg=async(t,e)=>{let{tourId:a,steps:r,startStep:n,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${a}" has no steps`);if(Hd.has(a))return{cleanup:async()=>{let v=Hd.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=NM(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},_g(i));let l=r.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=n||r[0].id;l=r.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=r[l].id,_g(i)}let u=r[l];if(!HM(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:jl()}),{cleanup:()=>{}};let c=!1,d=null,h=null,m=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){PM(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,_g(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==jl()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await x(y)},x=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:r.findIndex(y=>y.id===v.id),totalSteps:r.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:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let L=v.onAction[C];L&&b(L)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let L=v.onAction[C];L&&b(L)}}),_=h;h=()=>{_(),y()}}}};m=(()=>{let v=jl(),y=()=>{let C=jl();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{w(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await x(u);let g=async()=>{c=!0,Hd.delete(a),await S(),m&&m(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Hd.set(a,{cleanup:g}),{cleanup:g}};var Va={white:"#ffffff",black:"#000000"},oe={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},I={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"},Ct={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},ze={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},pa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Gl={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Ft={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Wl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var ha={primary:I[10],secondary:I[9],tertiary:I[8]},AH={primary:I[2],secondary:I[0]},Ig={primary:I[4],secondary:I[3]},Ud={primary:{text:Va.white,icon:Va.white,border:oe[3],backgroundDefault:oe[3],backgroundHover:oe[2]},neutral:{text:I[10],textHover:Va.white,icon:I[10],iconHover:Va.white,border:I[4],background:I[2]},link:{text:Va.white,icon:Va.white,hover:oe[5]},error:{text:ze[5],hover:ze[6]},success:{text:ke[5],hover:ke[6]}},kH={slateGrey:{content:I[10],pillOutline:I[10],borderPrimary:I[5],borderSecondary:I[5],background:I[3]},brand:{content:oe[9],pillOutline:oe[9],borderPrimary:oe[6],borderSecondary:oe[6],background:oe[0]},red:{content:ze[8],pillOutline:ze[4],borderPrimary:ze[2],borderSecondary:ze[2],background:ze[0]},yellow:{content:Ct[8],pillOutline:Ct[4],borderPrimary:Ct[2],borderSecondary:Ct[2],background:Ct[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:Ft[8],pillOutline:Ft[4],borderPrimary:Ft[2],borderSecondary:Ft[2],background:Ft[0]},blue:{content:pa[8],pillOutline:pa[4],borderPrimary:pa[2],borderSecondary:pa[2],background:pa[0]},orange:{content:Gl[8],pillOutline:Gl[4],borderPrimary:Gl[2],borderSecondary:Gl[2],background:Gl[0]},pink:{content:Wl[8],pillOutline:Wl[4],borderPrimary:Wl[2],borderSecondary:Wl[2],background:Wl[0]}},EH={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:Ct[8],border:Ct[2],background:Ct[0]},red:{content:ze[8],border:ze[2],background:ze[0]}},TH={green:{content:ke[1],background:ke[9]},yellow:{content:Ct[1],background:Ct[9]},red:{content:ze[1],background:ze[9]}},RH={content:I[10],border:I[4],background:"#1c2124"},MH={backgroundDefault:I[2],backgroundHover:I[1],selected:I[3]},DH={background:I[2],icon:I[10],borderDefault:I[4],borderSelected:oe[3],textLabel:I[9],textPlaceholder:I[8],textHint:I[8]},OH={backgroundDefault:I[2],backgroundDisabled:I[0],textLabel:I[9],textPlaceholder:I[8],textHint:I[8],textError:ze[5],iconDefault:I[9],iconPlaceholder:I[10],iconError:ze[5],borderDefault:I[4],borderSelected:oe[3],borderError:ze[5]},BH={handleDefault:Va.white,handleDisabled:I[10],off:{backgroundDefault:I[4],backgroundHover:I[5],backgroundDisabled:I[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:I[4]}},FH={off:{backgroundDefault:"#00000000",backgroundHover:I[5],backgroundDisabled:I[2],border:I[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:I[2],border:ke[3]}},NH={content:I[10],background:I[4]},PH={background:I[4],active:ke[3]},HH={background:I[1],content:I[9],border:I[4]},UH={backgroundDefault:I[1],backgroundHover:I[3],backgroundActive:I[4],border:I[4],contentPrimary:I[10],contentSecondary:I[9],contentTertiary:I[8]},qH={background:I[1],content:I[9],border:I[4]},zH={activeBackground:I[3],activeContent:oe[5],inactiveContent:I[9],border:I[4]},VH={header:{textDefault:I[9],textHover:I[8],backgroundDefault:I[1]},border:I[4],cell:{textPrimary:I[10],textSecondary:I[9],backgroundDefault:I[2],backgroundHover:I[1]}},$H={textPrimaryDefault:I[10],textPrimaryHover:I[10],textSecondaryDefault:I[8],textSecondaryHover:I[9],iconPrimary:I[10],iconSecondary:I[8]},jH={background:ke[1],active:ke[5]},GH={textDefault:I[10],textSelected:Va.white,textDisabled:I[7],backgroundDefault:I[2],backgroundMiddle:I[3],backgroundSelected:oe[3],border:I[4]},WH=I[9];var Iw=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function Aw(t,e,a){let r=a?.paddingPx??12,n=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${pa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=c.getPropertyValue("--syntro-ring").trim(),m=document.createElement("div");m.className="syntro-spotlight-scrim";let S=s||l;Object.assign(m.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(m),requestAnimationFrame(()=>m.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||h||pa[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(!Iw)for(let k=0;k<4;k++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),m.appendChild(A)}let f=k=>{m.style.clipPath=k,m.style.webkitClipPath=k},g=()=>{if(!t.isConnected){L.destroy();return}let k=t.getBoundingClientRect(),A=Math.max(0,k.left-r),M=Math.max(0,k.top-r),T=Math.min(window.innerWidth,k.width+r*2),R=Math.min(window.innerHeight,k.height+r*2);if(Object.assign(b.style,{left:`${A}px`,top:`${M}px`,width:`${T}px`,height:`${R}px`}),Iw){let B=window.innerWidth,F=window.innerHeight,P=Math.min(n,T/2,R/2),Y=`M 0 0 L ${B} 0 L ${B} ${F} L 0 ${F} Z`,N=`M ${A+P} ${M} A ${P} ${P} 0 0 0 ${A} ${M+P} L ${A} ${M+R-P} A ${P} ${P} 0 0 0 ${A+P} ${M+R} L ${A+T-P} ${M+R} A ${P} ${P} 0 0 0 ${A+T} ${M+R-P} L ${A+T} ${M+P} A ${P} ${P} 0 0 0 ${A+T-P} ${M} L ${A+P} ${M} Z`;f(`path('${Y} ${N}')`)}else{let[B,F,P,Y]=x;Object.assign(B.style,{left:"0px",top:"0px",width:"100vw",height:`${M}px`}),Object.assign(P.style,{left:"0px",top:`${M+R}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(M+R))}px`}),Object.assign(Y.style,{left:"0px",top:`${M}px`,width:`${A}px`,height:`${R}px`}),Object.assign(F.style,{left:`${A+T}px`,top:`${M}px`,width:`${Math.max(0,window.innerWidth-(A+T))}px`,height:`${R}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(g));v.observe(t);let y=()=>requestAnimationFrame(g),_=()=>requestAnimationFrame(g);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let w=k=>{k.key==="Escape"&&u&&L.destroy()};u&&window.addEventListener("keydown",w);let C=k=>{s?(k.preventDefault(),k.stopPropagation()):l&&L.destroy()};m.addEventListener("click",C);let L={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",w),m.removeEventListener("click",C),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),b.remove()},220)}};return g(),L}var UM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ma(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 a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!UM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||h)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Fo={bg:"var(--sc-overlay-background, #ffffff)",title:"var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))",text:"var(--sc-overlay-text-color, #4b5563)",accent:"var(--sc-color-primary, #4f46e5)",radius:"var(--sc-border-radius, 12px)"},Ag=async(t,e)=>{let{content:a,size:r="md",blocking:n=!1,scrim:o,dismiss:i,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});
@@ -59,7 +59,7 @@ Error generating stack: `+r.message+`
59
59
  >
60
60
  ${ma(_.label)}
61
61
  </button>
62
- `}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let h=null,m=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(h=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};m.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{n||y.destroy()};l.addEventListener("click",x);let f=[];n&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),f.push(_))});let g;i?.timeoutMs&&(g=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:n});let y={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",b),l.removeEventListener("click",x),m.forEach(_=>_.removeEventListener("click",S)),f.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var Tw=["top","right","bottom","left"];var Hn=Math.min,Hr=Math.max,Xl=Math.round,Yl=Math.floor,$a=t=>({x:t,y:t}),qM={left:"right",right:"left",bottom:"top",top:"bottom"},zM={start:"end",end:"start"};function Vd(t,e,a){return Hr(t,Hn(e,a))}function No(t,e){return typeof t=="function"?t(e):t}function Un(t){return t.split("-")[0]}function os(t){return t.split("-")[1]}function Eg(t){return t==="x"?"y":"x"}function $d(t){return t==="y"?"height":"width"}var VM=new Set(["top","bottom"]);function Ur(t){return VM.has(Un(t))?"y":"x"}function jd(t){return Eg(Ur(t))}function Rw(t,e,a){a===void 0&&(a=!1);let r=os(t),n=jd(t),o=$d(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=Zl(i)),[i,Zl(i)]}function Mw(t){let e=Zl(t);return[zd(t),e,zd(e)]}function zd(t){return t.replace(/start|end/g,e=>zM[e])}var kw=["left","right"],Ew=["right","left"],$M=["top","bottom"],jM=["bottom","top"];function GM(t,e,a){switch(t){case"top":case"bottom":return a?e?Ew:kw:e?kw:Ew;case"left":case"right":return e?$M:jM;default:return[]}}function Dw(t,e,a,r){let n=os(t),o=GM(Un(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(zd)))),o}function Zl(t){return t.replace(/left|right|bottom|top/g,e=>qM[e])}function WM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tg(t){return typeof t!="number"?WM(t):{top:t,right:t,bottom:t,left:t}}function Po(t){let{x:e,y:a,width:r,height:n}=t;return{width:r,height:n,top:a,left:e,right:e+r,bottom:a+n,x:e,y:a}}function Ow(t,e,a){let{reference:r,floating:n}=t,o=Ur(e),i=jd(e),s=$d(i),l=Un(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,h=r[s]/2-n[s]/2,m;switch(l){case"top":m={x:c,y:r.y-n.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-n.width,y:d};break;default:m={x:r.x,y:r.y}}switch(os(e)){case"start":m[i]-=h*(a&&u?-1:1);break;case"end":m[i]+=h*(a&&u?-1:1);break}return m}async function Nw(t,e){var a;e===void 0&&(e={});let{x:r,y:n,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=No(e,t),S=Tg(m),x=s[h?d==="floating"?"reference":"floating":d],f=Po(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(x)))==null||a?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.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},_=Po(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(f.top-_.top+S.top)/y.y,bottom:(_.bottom-f.bottom+S.bottom)/y.y,left:(f.left-_.left+S.left)/y.x,right:(_.right-f.right+S.right)/y.x}}var Pw=async(t,e,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:i}=a,s=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:d}=Ow(u,r,l),h=r,m={},S=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:g}=s[x],{x:v,y,data:_,reset:w}=await g({x:c,y:d,initialPlacement:r,placement:h,strategy:n,middlewareData:m,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:Nw},elements:{reference:t,floating:e}});c=v??c,d=y??d,m={...m,[f]:{...m[f],..._}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=Ow(u,h,l)),x=-1)}return{x:c,y:d,placement:h,strategy:n,middlewareData:m}},Hw=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:r,placement:n,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=No(t,e)||{};if(u==null)return{};let d=Tg(c),h={x:a,y:r},m=jd(n),S=$d(m),b=await i.getDimensions(u),x=m==="y",f=x?"top":"left",g=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[m]-h[m]-o.floating[S],_=h[m]-o.reference[m],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=w?w[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(w)))&&(C=s.floating[v]||o.floating[S]);let L=y/2-_/2,k=C/2-b[S]/2-1,A=Hn(d[f],k),M=Hn(d[g],k),T=A,R=C-b[S]-M,B=C/2-b[S]/2+L,F=Vd(T,B,R),P=!l.arrow&&os(n)!=null&&B!==F&&o.reference[S]/2-(B<T?A:M)-b[S]/2<0,Y=P?B<T?B-T:B-R:0;return{[m]:h[m]+Y,data:{[m]:F,centerOffset:B-F-Y,...P&&{alignmentOffset:Y}},reset:P}}});var Uw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,r;let{placement:n,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=No(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let f=Un(n),g=Ur(s),v=Un(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(v||!b?[Zl(s)]:Mw(s)),w=S!=="none";!h&&w&&_.push(...Dw(s,b,S,y));let C=[s,..._],L=await l.detectOverflow(e,x),k=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&k.push(L[f]),d){let B=Rw(n,i,y);k.push(L[B[0]],L[B[1]])}if(A=[...A,{placement:n,overflows:k}],!k.every(B=>B<=0)){var M,T;let B=(((M=o.flip)==null?void 0:M.index)||0)+1,F=C[B];if(F&&(!(d==="alignment"?g!==Ur(F):!1)||A.every(N=>Ur(N.placement)===g?N.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:F}};let P=(T=A.filter(Y=>Y.overflows[0]<=0).sort((Y,N)=>Y.overflows[1]-N.overflows[1])[0])==null?void 0:T.placement;if(!P)switch(m){case"bestFit":{var R;let Y=(R=A.filter(N=>{if(w){let W=Ur(N.placement);return W===g||W==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(W=>W>0).reduce((W,Q)=>W+Q,0)]).sort((N,W)=>N[1]-W[1])[0])==null?void 0:R[0];Y&&(P=Y);break}case"initialPlacement":P=s;break}if(n!==P)return{reset:{placement:P}}}return{}}}};function Bw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Fw(t){return Tw.some(e=>t[e]>=0)}var qw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=No(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=Bw(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Fw(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=Bw(i,a.floating);return{data:{escapedOffsets:s,escaped:Fw(s)}}}default:return{}}}}};var ZM=new Set(["left","top"]);async function XM(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Un(a),s=os(a),l=Ur(a)==="y",u=ZM.has(i)?-1:1,c=o&&l?-1:1,d=No(e,t),{mainAxis:h,crossAxis:m,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"&&(m=s==="end"?S*-1:S),l?{x:m*c,y:h*u}:{x:h*u,y:m*c}}var zw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,r;let{x:n,y:o,placement:i,middlewareData:s}=e,l=await XM(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:i}}}}},Vw=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:g,y:v}=f;return{x:g,y:v}}},...u}=No(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),h=Ur(Un(n)),m=Eg(h),S=c[m],b=c[h];if(i){let f=m==="y"?"top":"left",g=m==="y"?"bottom":"right",v=S+d[f],y=S-d[g];S=Vd(v,S,y)}if(s){let f=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=b+d[f],y=b-d[g];b=Vd(v,b,y)}let x=l.fn({...e,[m]:S,[h]:b});return{...x,data:{x:x.x-a,y:x.y-r,enabled:{[m]:i,[h]:s}}}}}};function Gd(){return typeof window<"u"}function Ho(t){return jw(t)?(t.nodeName||"").toLowerCase():"#document"}function Xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ja(t){var e;return(e=(jw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jw(t){return Gd()?t instanceof Node||t instanceof Xt(t).Node:!1}function Ta(t){return Gd()?t instanceof Element||t instanceof Xt(t).Element:!1}function Ga(t){return Gd()?t instanceof HTMLElement||t instanceof Xt(t).HTMLElement:!1}function $w(t){return!Gd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xt(t).ShadowRoot}var YM=new Set(["inline","contents"]);function ss(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ra(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!YM.has(n)}var KM=new Set(["table","td","th"]);function Gw(t){return KM.has(Ho(t))}var QM=[":popover-open",":modal"];function Kl(t){return QM.some(e=>{try{return t.matches(e)}catch{return!1}})}var JM=["transform","translate","scale","rotate","perspective"],e2=["transform","translate","scale","rotate","perspective","filter"],t2=["paint","layout","strict","content"];function Wd(t){let e=Zd(),a=Ta(t)?Ra(t):t;return JM.some(r=>a[r]?a[r]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||e2.some(r=>(a.willChange||"").includes(r))||t2.some(r=>(a.contain||"").includes(r))}function Ww(t){let e=qr(t);for(;Ga(e)&&!Uo(e);){if(Wd(e))return e;if(Kl(e))return null;e=qr(e)}return null}function Zd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var a2=new Set(["html","body","#document"]);function Uo(t){return a2.has(Ho(t))}function Ra(t){return Xt(t).getComputedStyle(t)}function Ql(t){return Ta(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function qr(t){if(Ho(t)==="html")return t;let e=t.assignedSlot||t.parentNode||$w(t)&&t.host||ja(t);return $w(e)?e.host:e}function Zw(t){let e=qr(t);return Uo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ga(e)&&ss(e)?e:Zw(e)}function is(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=Zw(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=Xt(n);if(o){let s=Xd(i);return e.concat(i,i.visualViewport||[],ss(n)?n:[],s&&a?is(s):[])}return e.concat(n,is(n,[],a))}function Xd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qw(t){let e=Ra(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=Ga(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=Xl(a)!==o||Xl(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Mg(t){return Ta(t)?t:t.contextElement}function ls(t){let e=Mg(t);if(!Ga(e))return $a(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=Qw(e),i=(o?Xl(a.width):a.width)/r,s=(o?Xl(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var r2=$a(0);function Jw(t){let e=Xt(t);return!Zd()||!e.visualViewport?r2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function n2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Xt(t)?!1:e}function qo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Mg(t),i=$a(1);e&&(r?Ta(r)&&(i=ls(r)):i=ls(t));let s=n2(o,a,r)?Jw(o):$a(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(o){let h=Xt(o),m=r&&Ta(r)?Xt(r):r,S=h,b=Xd(S);for(;b&&r&&m!==S;){let x=ls(b),f=b.getBoundingClientRect(),g=Ra(b),v=f.left+(b.clientLeft+parseFloat(g.paddingLeft))*x.x,y=f.top+(b.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Xt(b),b=Xd(S)}}return Po({width:c,height:d,x:l,y:u})}function Yd(t,e){let a=Ql(t).scrollLeft;return e?e.left+a:qo(ja(t)).left+a}function eL(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Yd(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function o2(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=ja(r),s=e?Kl(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=$a(1),c=$a(0),d=Ga(r);if((d||!d&&!o)&&((Ho(r)!=="body"||ss(i))&&(l=Ql(r)),Ga(r))){let m=qo(r);u=ls(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}let h=i&&!d&&!o?eL(i,l):$a(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:a.y*u.y-l.scrollTop*u.y+c.y+h.y}}function i2(t){return Array.from(t.getClientRects())}function s2(t){let e=ja(t),a=Ql(t),r=t.ownerDocument.body,n=Hr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Hr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Yd(t),s=-a.scrollTop;return Ra(r).direction==="rtl"&&(i+=Hr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var Xw=25;function l2(t,e){let a=Xt(t),r=ja(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Zd();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Yd(r);if(u<=0){let c=r.ownerDocument,d=c.body,h=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-m);S<=Xw&&(o-=S)}else u<=Xw&&(o+=u);return{width:o,height:i,x:s,y:l}}var u2=new Set(["absolute","fixed"]);function c2(t,e){let a=qo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=Ga(t)?ls(t):$a(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=n*o.x,u=r*o.y;return{width:i,height:s,x:l,y:u}}function Yw(t,e,a){let r;if(e==="viewport")r=l2(t,a);else if(e==="document")r=s2(ja(t));else if(Ta(e))r=c2(e,a);else{let n=Jw(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Po(r)}function tL(t,e){let a=qr(t);return a===e||!Ta(a)||Uo(a)?!1:Ra(a).position==="fixed"||tL(a,e)}function d2(t,e){let a=e.get(t);if(a)return a;let r=is(t,[],!1).filter(s=>Ta(s)&&Ho(s)!=="body"),n=null,o=Ra(t).position==="fixed",i=o?qr(t):t;for(;Ta(i)&&!Uo(i);){let s=Ra(i),l=Wd(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&u2.has(n.position)||ss(i)&&!l&&tL(t,i))?r=r.filter(c=>c!==i):n=s,i=qr(i)}return e.set(t,r),r}function f2(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Kl(e)?[]:d2(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=Yw(e,c,n);return u.top=Hr(d.top,u.top),u.right=Hn(d.right,u.right),u.bottom=Hn(d.bottom,u.bottom),u.left=Hr(d.left,u.left),u},Yw(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p2(t){let{width:e,height:a}=Qw(t);return{width:e,height:a}}function h2(t,e,a){let r=Ga(e),n=ja(e),o=a==="fixed",i=qo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$a(0);function u(){l.x=Yd(n)}if(r||!r&&!o)if((Ho(e)!=="body"||ss(n))&&(s=Ql(e)),r){let m=qo(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?eL(n,s):$a(0),d=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:d,y:h,width:i.width,height:i.height}}function Rg(t){return Ra(t).position==="static"}function Kw(t,e){if(!Ga(t)||Ra(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return ja(t)===a&&(a=a.ownerDocument.body),a}function aL(t,e){let a=Xt(t);if(Kl(t))return a;if(!Ga(t)){let n=qr(t);for(;n&&!Uo(n);){if(Ta(n)&&!Rg(n))return n;n=qr(n)}return a}let r=Kw(t,e);for(;r&&Gw(r)&&Rg(r);)r=Kw(r,e);return r&&Uo(r)&&Rg(r)&&!Wd(r)?a:r||Ww(t)||a}var m2=async function(t){let e=this.getOffsetParent||aL,a=this.getDimensions,r=await a(t.floating);return{reference:h2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g2(t){return Ra(t).direction==="rtl"}var v2={convertOffsetParentRelativeRectToViewportRelativeRect:o2,getDocumentElement:ja,getClippingRect:f2,getOffsetParent:aL,getElementRects:m2,getClientRects:i2,getDimensions:p2,getScale:ls,isElement:Ta,isRTL:g2};function rL(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function y2(t,e){let a=null,r,n=ja(t);function o(){var s;clearTimeout(r),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:d,width:h,height:m}=u;if(s||e(),!h||!m)return;let S=Yl(d),b=Yl(n.clientWidth-(c+h)),x=Yl(n.clientHeight-(d+m)),f=Yl(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-f+"px",threshold:Hr(0,Hn(1,l))||1},y=!0;function _(w){let C=w[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!rL(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:n.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function Kd(t,e,a,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Mg(t),c=n||o?[...u?is(u):[],...is(e)]:[];c.forEach(f=>{n&&f.addEventListener("scroll",a,{passive:!0}),o&&f.addEventListener("resize",a)});let d=u&&s?y2(u,a):null,h=-1,m=null;i&&(m=new ResizeObserver(f=>{let[g]=f;g&&g.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),a()}),u&&!l&&m.observe(u),m.observe(e));let S,b=l?qo(t):null;l&&x();function x(){let f=qo(t);b&&!rL(b,f)&&a(),b=f,S=requestAnimationFrame(x)}return a(),()=>{var f;c.forEach(g=>{n&&g.removeEventListener("scroll",a),o&&g.removeEventListener("resize",a)}),d?.(),(f=m)==null||f.disconnect(),m=null,l&&cancelAnimationFrame(S)}}var Qd=zw;var Jd=Vw,ef=Uw;var nL=qw,oL=Hw;var tf=(t,e,a)=>{let r=new Map,n={platform:v2,...a},o={...n.platform,_c:r};return Pw(t,e,{...n,platform:o})};function x2(t){let e=t.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight;if(!(e.width>a*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),i=Math.max(e.top,0),s=Math.min(e.right,a),l=Math.min(e.bottom,r),u=(o+s)/2,c=(i+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function iL(t,e,a){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.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=ma(a.html),!a.trigger||a.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 i=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[Qd(a.offsetPx??8),ef(),Jd({padding:8}),nL(),oL({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=Kd(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=x2(t),g=await tf(f,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:w,placement:C}=g;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),w.arrow){let{x:L,y:k}=w.arrow,A=C.split("-")[0],M={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:L!=null?`${L}px`:"",top:k!=null?`${k}px`:"",right:"",bottom:"",[M[A]]:"-4px"});let T={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${T[A]||"0deg"})`}}),h=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let m=[];if(a.blocking){Array.from(document.body.children).forEach(g=>{g!==e&&g.getAttribute("inert")===null&&(g.setAttribute("inert",""),m.push(g.id||g.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let g=f[0],v=f[f.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===g&&(v.focus(),_.preventDefault()):document.activeElement===v&&(g.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>g.focus())}}let b=(()=>{if(a.trigger==="hover"){let f=null,g=()=>{f&&(clearTimeout(f),f=null),o.style.visibility="visible",o.style.opacity="1"},v=()=>{f=setTimeout(()=>{o.style.visibility="hidden",o.style.opacity="0",f=null},100)};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",g),t.addEventListener("mouseleave",v),o.addEventListener("mouseenter",g),o.addEventListener("mouseleave",v),t.addEventListener("focus",g),t.addEventListener("blur",v),()=>{f&&clearTimeout(f),t.removeEventListener("mouseenter",g),t.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",g),o.removeEventListener("mouseleave",v),t.removeEventListener("focus",g),t.removeEventListener("blur",v)}}if(a.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",h),i.forEach(f=>f.removeEventListener("click",s)),a.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 Dg=K(Me(),1),je=K(We(),1),fL=K(Bo(),1);var Ve=K(Me(),1);function C2({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ve.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ve.jsx)("div",{role:"progressbar","aria-valuenow":a,"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:`${a}%`}})})}function _2({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,Ve.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":a?"true":void 0,"data-completed":e?"true":void 0,"aria-current":a?"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 ${a?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>n(r,t.id),children:[(0,Ve.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ve.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ve.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function w2({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,Ve.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ve.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ve.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ve.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,Ve.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:()=>r(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ve.jsxs)("div",{className:"se-mb-2",children:[(0,Ve.jsx)(C2,{completed:n,total:o}),(0,Ve.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,Ve.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ve.jsx)(_2,{step:i,isCompleted:t.completedSteps.includes(i.id),isCurrent:t.currentStepId===i.id,tourId:t.tourId,onStepClick:a},i.id))}),e&&t.meta.description&&(0,Ve.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function cL({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,Ve.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,Ve.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,Ve.jsx)(w2,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function dL(t,e){let a=document.createElement("div");a.setAttribute("data-testid","workflow-toast"),a.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(a.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 r=document.createElement("div");if(r.className="se-font-semibold",r.style.fontWeight="600",r.textContent=e.title,a.appendChild(r),e.body){let i=document.createElement("div");i.className="se-mt-1 se-text-sm",i.style.marginTop="4px",i.style.fontSize="13px",i.style.color="var(--se-color-text-secondary, #666)",i.textContent=e.body,a.appendChild(i)}t.appendChild(a);let n,o=setTimeout(()=>{a.style.opacity="0",n=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(n),a.remove()}}function L2(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="core:tour"&&r.workflow&&r.tourId){let n=r.workflow,i=(r.steps||[]).map(s=>({id:s.id,title:n.stepTitles?.[s.id]||s.id}));e.set(r.tourId,{meta:n,steps:i})}}return e}function I2({runtime:t}){let[e,a]=(0,je.useState)(0),r=(0,je.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return L2(x)},[t,e]),n=(0,je.useRef)(r);n.current=r,(0,je.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,je.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,je.useRef)(new Set),s=(0,je.useRef)([]),l=(0,je.useRef)(null),u=(0,je.useRef)({}),[c,d]=(0,je.useState)([]),h=(0,je.useRef)(!1);if(!h.current&&o){let x=o.get?.("notified")||[];for(let g of x)i.current.add(g);let f=o.get?.("completed")||{};u.current={...f},h.current=!0}(0,je.useEffect)(()=>{if(r.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(g=>{let v=new Set(g.map(_=>_.tourId)),y=[];for(let[_,{meta:w,steps:C}]of r){if(v.has(_))continue;let L="active";x.includes(_)?L="dismissed":f[_]&&(L="completed"),y.push({tourId:_,meta:w,steps:C,currentStepId:null,completedSteps:[],status:L,completedAt:f[_]||void 0})}return y.length>0?[...g,...y]:g});for(let[g,{meta:v}]of r)if(!i.current.has(g)&&v.notification&&l.current&&!x.includes(g)&&!f[g]){i.current.add(g),o?.set?.("notified",[...i.current]);let y=dL(l.current,v.notification);s.current.push(y)}},[r,o]),(0,je.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let g=f.props?.tourId;if(!g)return;let v=n.current;if(!v.has(g)&&f.name==="tour.started"){a(y=>y+1);return}v.has(g)&&d(y=>y.map(w=>{if(w.tourId!==g)return w;switch(f.name){case"tour.started":{let C=f.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(g)){i.current.add(g),o?.set?.("notified",[...i.current]);let k=v.get(g);if(k?.meta.notification&&l.current){let A=dL(l.current,k.meta.notification);s.current.push(A)}}let L=y.filter(k=>k.status==="active"||k.tourId===g).map(k=>k.tourId);return L.includes(g)||L.push(g),o?.set?.("active",[...new Set(L)]),{...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,L=f.props?.nextStepId,k=C&&!w.completedSteps.includes(C)?[...w.completedSteps,C]:w.completedSteps;return{...w,currentStepId:L||w.currentStepId,completedSteps:k}}case"tour.completed":{let C=Date.now();return u.current[g]=C,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(L=>L.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 m=(0,je.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),S=(0,je.useCallback)(x=>{d(f=>{let g=f.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=g.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),g})},[o]),b=(0,je.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Dg.jsx)("div",{ref:l,children:(0,Dg.jsx)(cL,{workflows:b,onStepClick:m,onDismiss:S})})}var pL={mount(t,e){let a=e?.runtime||null,r=(0,fL.createRoot)(t);return r.render(je.default.createElement(I2,{runtime:a})),()=>{r.unmount()}}};var hL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};a.getAttribute("data-syntro-highlight")&&e.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring").forEach(s=>s.remove()),a.setAttribute("data-syntro-highlight","true");let n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=Aw(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:n,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:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight")}}},mL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let n=b=>({r:parseInt(b.slice(1,3),16),g:parseInt(b.slice(3,5),16),b:parseInt(b.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let b=getComputedStyle(e.overlayRoot),x=b.getPropertyValue("--sc-color-primary")?.trim(),f=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=n(x)),f?.startsWith("#")&&f.length>=7&&(s=n(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:h}=i;if(s){let{r:b,g:x,b:f}=s;u.textContent=`
62
+ `}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let h=null,m=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(h=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};m.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{n||y.destroy()};l.addEventListener("click",x);let f=[];n&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),f.push(_))});let g;i?.timeoutMs&&(g=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:n});let y={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",b),l.removeEventListener("click",x),m.forEach(_=>_.removeEventListener("click",S)),f.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var Tw=["top","right","bottom","left"];var Hn=Math.min,Hr=Math.max,Xl=Math.round,Yl=Math.floor,$a=t=>({x:t,y:t}),qM={left:"right",right:"left",bottom:"top",top:"bottom"},zM={start:"end",end:"start"};function zd(t,e,a){return Hr(t,Hn(e,a))}function No(t,e){return typeof t=="function"?t(e):t}function Un(t){return t.split("-")[0]}function os(t){return t.split("-")[1]}function kg(t){return t==="x"?"y":"x"}function Vd(t){return t==="y"?"height":"width"}var VM=new Set(["top","bottom"]);function Ur(t){return VM.has(Un(t))?"y":"x"}function $d(t){return kg(Ur(t))}function Rw(t,e,a){a===void 0&&(a=!1);let r=os(t),n=$d(t),o=Vd(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=Zl(i)),[i,Zl(i)]}function Mw(t){let e=Zl(t);return[qd(t),e,qd(e)]}function qd(t){return t.replace(/start|end/g,e=>zM[e])}var kw=["left","right"],Ew=["right","left"],$M=["top","bottom"],jM=["bottom","top"];function GM(t,e,a){switch(t){case"top":case"bottom":return a?e?Ew:kw:e?kw:Ew;case"left":case"right":return e?$M:jM;default:return[]}}function Dw(t,e,a,r){let n=os(t),o=GM(Un(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(qd)))),o}function Zl(t){return t.replace(/left|right|bottom|top/g,e=>qM[e])}function WM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Eg(t){return typeof t!="number"?WM(t):{top:t,right:t,bottom:t,left:t}}function Po(t){let{x:e,y:a,width:r,height:n}=t;return{width:r,height:n,top:a,left:e,right:e+r,bottom:a+n,x:e,y:a}}function Ow(t,e,a){let{reference:r,floating:n}=t,o=Ur(e),i=$d(e),s=Vd(i),l=Un(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,h=r[s]/2-n[s]/2,m;switch(l){case"top":m={x:c,y:r.y-n.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-n.width,y:d};break;default:m={x:r.x,y:r.y}}switch(os(e)){case"start":m[i]-=h*(a&&u?-1:1);break;case"end":m[i]+=h*(a&&u?-1:1);break}return m}async function Nw(t,e){var a;e===void 0&&(e={});let{x:r,y:n,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=No(e,t),S=Eg(m),x=s[h?d==="floating"?"reference":"floating":d],f=Po(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(x)))==null||a?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.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},_=Po(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(f.top-_.top+S.top)/y.y,bottom:(_.bottom-f.bottom+S.bottom)/y.y,left:(f.left-_.left+S.left)/y.x,right:(_.right-f.right+S.right)/y.x}}var Pw=async(t,e,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:i}=a,s=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:d}=Ow(u,r,l),h=r,m={},S=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:g}=s[x],{x:v,y,data:_,reset:w}=await g({x:c,y:d,initialPlacement:r,placement:h,strategy:n,middlewareData:m,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:Nw},elements:{reference:t,floating:e}});c=v??c,d=y??d,m={...m,[f]:{...m[f],..._}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=Ow(u,h,l)),x=-1)}return{x:c,y:d,placement:h,strategy:n,middlewareData:m}},Hw=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:r,placement:n,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=No(t,e)||{};if(u==null)return{};let d=Eg(c),h={x:a,y:r},m=$d(n),S=Vd(m),b=await i.getDimensions(u),x=m==="y",f=x?"top":"left",g=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[m]-h[m]-o.floating[S],_=h[m]-o.reference[m],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=w?w[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(w)))&&(C=s.floating[v]||o.floating[S]);let L=y/2-_/2,k=C/2-b[S]/2-1,A=Hn(d[f],k),M=Hn(d[g],k),T=A,R=C-b[S]-M,B=C/2-b[S]/2+L,F=zd(T,B,R),P=!l.arrow&&os(n)!=null&&B!==F&&o.reference[S]/2-(B<T?A:M)-b[S]/2<0,Y=P?B<T?B-T:B-R:0;return{[m]:h[m]+Y,data:{[m]:F,centerOffset:B-F-Y,...P&&{alignmentOffset:Y}},reset:P}}});var Uw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,r;let{placement:n,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=No(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let f=Un(n),g=Ur(s),v=Un(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(v||!b?[Zl(s)]:Mw(s)),w=S!=="none";!h&&w&&_.push(...Dw(s,b,S,y));let C=[s,..._],L=await l.detectOverflow(e,x),k=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&k.push(L[f]),d){let B=Rw(n,i,y);k.push(L[B[0]],L[B[1]])}if(A=[...A,{placement:n,overflows:k}],!k.every(B=>B<=0)){var M,T;let B=(((M=o.flip)==null?void 0:M.index)||0)+1,F=C[B];if(F&&(!(d==="alignment"?g!==Ur(F):!1)||A.every(N=>Ur(N.placement)===g?N.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:F}};let P=(T=A.filter(Y=>Y.overflows[0]<=0).sort((Y,N)=>Y.overflows[1]-N.overflows[1])[0])==null?void 0:T.placement;if(!P)switch(m){case"bestFit":{var R;let Y=(R=A.filter(N=>{if(w){let W=Ur(N.placement);return W===g||W==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(W=>W>0).reduce((W,Q)=>W+Q,0)]).sort((N,W)=>N[1]-W[1])[0])==null?void 0:R[0];Y&&(P=Y);break}case"initialPlacement":P=s;break}if(n!==P)return{reset:{placement:P}}}return{}}}};function Bw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Fw(t){return Tw.some(e=>t[e]>=0)}var qw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=No(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=Bw(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Fw(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=Bw(i,a.floating);return{data:{escapedOffsets:s,escaped:Fw(s)}}}default:return{}}}}};var ZM=new Set(["left","top"]);async function XM(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Un(a),s=os(a),l=Ur(a)==="y",u=ZM.has(i)?-1:1,c=o&&l?-1:1,d=No(e,t),{mainAxis:h,crossAxis:m,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"&&(m=s==="end"?S*-1:S),l?{x:m*c,y:h*u}:{x:h*u,y:m*c}}var zw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,r;let{x:n,y:o,placement:i,middlewareData:s}=e,l=await XM(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:i}}}}},Vw=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:g,y:v}=f;return{x:g,y:v}}},...u}=No(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),h=Ur(Un(n)),m=kg(h),S=c[m],b=c[h];if(i){let f=m==="y"?"top":"left",g=m==="y"?"bottom":"right",v=S+d[f],y=S-d[g];S=zd(v,S,y)}if(s){let f=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=b+d[f],y=b-d[g];b=zd(v,b,y)}let x=l.fn({...e,[m]:S,[h]:b});return{...x,data:{x:x.x-a,y:x.y-r,enabled:{[m]:i,[h]:s}}}}}};function jd(){return typeof window<"u"}function Ho(t){return jw(t)?(t.nodeName||"").toLowerCase():"#document"}function Xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ja(t){var e;return(e=(jw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jw(t){return jd()?t instanceof Node||t instanceof Xt(t).Node:!1}function Ta(t){return jd()?t instanceof Element||t instanceof Xt(t).Element:!1}function Ga(t){return jd()?t instanceof HTMLElement||t instanceof Xt(t).HTMLElement:!1}function $w(t){return!jd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xt(t).ShadowRoot}var YM=new Set(["inline","contents"]);function ss(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ra(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!YM.has(n)}var KM=new Set(["table","td","th"]);function Gw(t){return KM.has(Ho(t))}var QM=[":popover-open",":modal"];function Kl(t){return QM.some(e=>{try{return t.matches(e)}catch{return!1}})}var JM=["transform","translate","scale","rotate","perspective"],e2=["transform","translate","scale","rotate","perspective","filter"],t2=["paint","layout","strict","content"];function Gd(t){let e=Wd(),a=Ta(t)?Ra(t):t;return JM.some(r=>a[r]?a[r]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||e2.some(r=>(a.willChange||"").includes(r))||t2.some(r=>(a.contain||"").includes(r))}function Ww(t){let e=qr(t);for(;Ga(e)&&!Uo(e);){if(Gd(e))return e;if(Kl(e))return null;e=qr(e)}return null}function Wd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var a2=new Set(["html","body","#document"]);function Uo(t){return a2.has(Ho(t))}function Ra(t){return Xt(t).getComputedStyle(t)}function Ql(t){return Ta(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function qr(t){if(Ho(t)==="html")return t;let e=t.assignedSlot||t.parentNode||$w(t)&&t.host||ja(t);return $w(e)?e.host:e}function Zw(t){let e=qr(t);return Uo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ga(e)&&ss(e)?e:Zw(e)}function is(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=Zw(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=Xt(n);if(o){let s=Zd(i);return e.concat(i,i.visualViewport||[],ss(n)?n:[],s&&a?is(s):[])}return e.concat(n,is(n,[],a))}function Zd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qw(t){let e=Ra(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=Ga(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=Xl(a)!==o||Xl(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Rg(t){return Ta(t)?t:t.contextElement}function ls(t){let e=Rg(t);if(!Ga(e))return $a(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=Qw(e),i=(o?Xl(a.width):a.width)/r,s=(o?Xl(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var r2=$a(0);function Jw(t){let e=Xt(t);return!Wd()||!e.visualViewport?r2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function n2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Xt(t)?!1:e}function qo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Rg(t),i=$a(1);e&&(r?Ta(r)&&(i=ls(r)):i=ls(t));let s=n2(o,a,r)?Jw(o):$a(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(o){let h=Xt(o),m=r&&Ta(r)?Xt(r):r,S=h,b=Zd(S);for(;b&&r&&m!==S;){let x=ls(b),f=b.getBoundingClientRect(),g=Ra(b),v=f.left+(b.clientLeft+parseFloat(g.paddingLeft))*x.x,y=f.top+(b.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Xt(b),b=Zd(S)}}return Po({width:c,height:d,x:l,y:u})}function Xd(t,e){let a=Ql(t).scrollLeft;return e?e.left+a:qo(ja(t)).left+a}function eL(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Xd(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function o2(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=ja(r),s=e?Kl(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=$a(1),c=$a(0),d=Ga(r);if((d||!d&&!o)&&((Ho(r)!=="body"||ss(i))&&(l=Ql(r)),Ga(r))){let m=qo(r);u=ls(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}let h=i&&!d&&!o?eL(i,l):$a(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:a.y*u.y-l.scrollTop*u.y+c.y+h.y}}function i2(t){return Array.from(t.getClientRects())}function s2(t){let e=ja(t),a=Ql(t),r=t.ownerDocument.body,n=Hr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Hr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Xd(t),s=-a.scrollTop;return Ra(r).direction==="rtl"&&(i+=Hr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var Xw=25;function l2(t,e){let a=Xt(t),r=ja(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Wd();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Xd(r);if(u<=0){let c=r.ownerDocument,d=c.body,h=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-m);S<=Xw&&(o-=S)}else u<=Xw&&(o+=u);return{width:o,height:i,x:s,y:l}}var u2=new Set(["absolute","fixed"]);function c2(t,e){let a=qo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=Ga(t)?ls(t):$a(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=n*o.x,u=r*o.y;return{width:i,height:s,x:l,y:u}}function Yw(t,e,a){let r;if(e==="viewport")r=l2(t,a);else if(e==="document")r=s2(ja(t));else if(Ta(e))r=c2(e,a);else{let n=Jw(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Po(r)}function tL(t,e){let a=qr(t);return a===e||!Ta(a)||Uo(a)?!1:Ra(a).position==="fixed"||tL(a,e)}function d2(t,e){let a=e.get(t);if(a)return a;let r=is(t,[],!1).filter(s=>Ta(s)&&Ho(s)!=="body"),n=null,o=Ra(t).position==="fixed",i=o?qr(t):t;for(;Ta(i)&&!Uo(i);){let s=Ra(i),l=Gd(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&u2.has(n.position)||ss(i)&&!l&&tL(t,i))?r=r.filter(c=>c!==i):n=s,i=qr(i)}return e.set(t,r),r}function f2(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Kl(e)?[]:d2(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=Yw(e,c,n);return u.top=Hr(d.top,u.top),u.right=Hn(d.right,u.right),u.bottom=Hn(d.bottom,u.bottom),u.left=Hr(d.left,u.left),u},Yw(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p2(t){let{width:e,height:a}=Qw(t);return{width:e,height:a}}function h2(t,e,a){let r=Ga(e),n=ja(e),o=a==="fixed",i=qo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$a(0);function u(){l.x=Xd(n)}if(r||!r&&!o)if((Ho(e)!=="body"||ss(n))&&(s=Ql(e)),r){let m=qo(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?eL(n,s):$a(0),d=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:d,y:h,width:i.width,height:i.height}}function Tg(t){return Ra(t).position==="static"}function Kw(t,e){if(!Ga(t)||Ra(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return ja(t)===a&&(a=a.ownerDocument.body),a}function aL(t,e){let a=Xt(t);if(Kl(t))return a;if(!Ga(t)){let n=qr(t);for(;n&&!Uo(n);){if(Ta(n)&&!Tg(n))return n;n=qr(n)}return a}let r=Kw(t,e);for(;r&&Gw(r)&&Tg(r);)r=Kw(r,e);return r&&Uo(r)&&Tg(r)&&!Gd(r)?a:r||Ww(t)||a}var m2=async function(t){let e=this.getOffsetParent||aL,a=this.getDimensions,r=await a(t.floating);return{reference:h2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g2(t){return Ra(t).direction==="rtl"}var v2={convertOffsetParentRelativeRectToViewportRelativeRect:o2,getDocumentElement:ja,getClippingRect:f2,getOffsetParent:aL,getElementRects:m2,getClientRects:i2,getDimensions:p2,getScale:ls,isElement:Ta,isRTL:g2};function rL(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function y2(t,e){let a=null,r,n=ja(t);function o(){var s;clearTimeout(r),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:d,width:h,height:m}=u;if(s||e(),!h||!m)return;let S=Yl(d),b=Yl(n.clientWidth-(c+h)),x=Yl(n.clientHeight-(d+m)),f=Yl(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-f+"px",threshold:Hr(0,Hn(1,l))||1},y=!0;function _(w){let C=w[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!rL(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:n.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function Yd(t,e,a,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Rg(t),c=n||o?[...u?is(u):[],...is(e)]:[];c.forEach(f=>{n&&f.addEventListener("scroll",a,{passive:!0}),o&&f.addEventListener("resize",a)});let d=u&&s?y2(u,a):null,h=-1,m=null;i&&(m=new ResizeObserver(f=>{let[g]=f;g&&g.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),a()}),u&&!l&&m.observe(u),m.observe(e));let S,b=l?qo(t):null;l&&x();function x(){let f=qo(t);b&&!rL(b,f)&&a(),b=f,S=requestAnimationFrame(x)}return a(),()=>{var f;c.forEach(g=>{n&&g.removeEventListener("scroll",a),o&&g.removeEventListener("resize",a)}),d?.(),(f=m)==null||f.disconnect(),m=null,l&&cancelAnimationFrame(S)}}var Kd=zw;var Qd=Vw,Jd=Uw;var nL=qw,oL=Hw;var ef=(t,e,a)=>{let r=new Map,n={platform:v2,...a},o={...n.platform,_c:r};return Pw(t,e,{...n,platform:o})};function x2(t){let e=t.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight;if(!(e.width>a*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),i=Math.max(e.top,0),s=Math.min(e.right,a),l=Math.min(e.bottom,r),u=(o+s)/2,c=(i+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function iL(t,e,a){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.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=ma(a.html),!a.trigger||a.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 i=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[Kd(a.offsetPx??8),Jd(),Qd({padding:8}),nL(),oL({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=Yd(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=x2(t),g=await ef(f,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:w,placement:C}=g;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),w.arrow){let{x:L,y:k}=w.arrow,A=C.split("-")[0],M={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:L!=null?`${L}px`:"",top:k!=null?`${k}px`:"",right:"",bottom:"",[M[A]]:"-4px"});let T={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${T[A]||"0deg"})`}}),h=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let m=[];if(a.blocking){Array.from(document.body.children).forEach(g=>{g!==e&&g.getAttribute("inert")===null&&(g.setAttribute("inert",""),m.push(g.id||g.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let g=f[0],v=f[f.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===g&&(v.focus(),_.preventDefault()):document.activeElement===v&&(g.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>g.focus())}}let b=(()=>{if(a.trigger==="hover"){let f=null,g=()=>{f&&(clearTimeout(f),f=null),o.style.visibility="visible",o.style.opacity="1"},v=()=>{f=setTimeout(()=>{o.style.visibility="hidden",o.style.opacity="0",f=null},100)};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",g),t.addEventListener("mouseleave",v),o.addEventListener("mouseenter",g),o.addEventListener("mouseleave",v),t.addEventListener("focus",g),t.addEventListener("blur",v),()=>{f&&clearTimeout(f),t.removeEventListener("mouseenter",g),t.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",g),o.removeEventListener("mouseleave",v),t.removeEventListener("focus",g),t.removeEventListener("blur",v)}}if(a.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",h),i.forEach(f=>f.removeEventListener("click",s)),a.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 Mg=K(Me(),1),je=K(We(),1),fL=K(Bo(),1);var Ve=K(Me(),1);function C2({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ve.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ve.jsx)("div",{role:"progressbar","aria-valuenow":a,"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:`${a}%`}})})}function _2({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,Ve.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":a?"true":void 0,"data-completed":e?"true":void 0,"aria-current":a?"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 ${a?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>n(r,t.id),children:[(0,Ve.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ve.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ve.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function w2({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,Ve.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ve.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ve.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ve.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,Ve.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:()=>r(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ve.jsxs)("div",{className:"se-mb-2",children:[(0,Ve.jsx)(C2,{completed:n,total:o}),(0,Ve.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,Ve.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ve.jsx)(_2,{step:i,isCompleted:t.completedSteps.includes(i.id),isCurrent:t.currentStepId===i.id,tourId:t.tourId,onStepClick:a},i.id))}),e&&t.meta.description&&(0,Ve.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function cL({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,Ve.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,Ve.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,Ve.jsx)(w2,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function dL(t,e){let a=document.createElement("div");a.setAttribute("data-testid","workflow-toast"),a.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(a.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 r=document.createElement("div");if(r.className="se-font-semibold",r.style.fontWeight="600",r.textContent=e.title,a.appendChild(r),e.body){let i=document.createElement("div");i.className="se-mt-1 se-text-sm",i.style.marginTop="4px",i.style.fontSize="13px",i.style.color="var(--se-color-text-secondary, #666)",i.textContent=e.body,a.appendChild(i)}t.appendChild(a);let n,o=setTimeout(()=>{a.style.opacity="0",n=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(n),a.remove()}}function L2(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="core:tour"&&r.workflow&&r.tourId){let n=r.workflow,i=(r.steps||[]).map(s=>({id:s.id,title:n.stepTitles?.[s.id]||s.id}));e.set(r.tourId,{meta:n,steps:i})}}return e}function I2({runtime:t}){let[e,a]=(0,je.useState)(0),r=(0,je.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return L2(x)},[t,e]),n=(0,je.useRef)(r);n.current=r,(0,je.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,je.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,je.useRef)(new Set),s=(0,je.useRef)([]),l=(0,je.useRef)(null),u=(0,je.useRef)({}),[c,d]=(0,je.useState)([]),h=(0,je.useRef)(!1);if(!h.current&&o){let x=o.get?.("notified")||[];for(let g of x)i.current.add(g);let f=o.get?.("completed")||{};u.current={...f},h.current=!0}(0,je.useEffect)(()=>{if(r.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(g=>{let v=new Set(g.map(_=>_.tourId)),y=[];for(let[_,{meta:w,steps:C}]of r){if(v.has(_))continue;let L="active";x.includes(_)?L="dismissed":f[_]&&(L="completed"),y.push({tourId:_,meta:w,steps:C,currentStepId:null,completedSteps:[],status:L,completedAt:f[_]||void 0})}return y.length>0?[...g,...y]:g});for(let[g,{meta:v}]of r)if(!i.current.has(g)&&v.notification&&l.current&&!x.includes(g)&&!f[g]){i.current.add(g),o?.set?.("notified",[...i.current]);let y=dL(l.current,v.notification);s.current.push(y)}},[r,o]),(0,je.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let g=f.props?.tourId;if(!g)return;let v=n.current;if(!v.has(g)&&f.name==="tour.started"){a(y=>y+1);return}v.has(g)&&d(y=>y.map(w=>{if(w.tourId!==g)return w;switch(f.name){case"tour.started":{let C=f.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(g)){i.current.add(g),o?.set?.("notified",[...i.current]);let k=v.get(g);if(k?.meta.notification&&l.current){let A=dL(l.current,k.meta.notification);s.current.push(A)}}let L=y.filter(k=>k.status==="active"||k.tourId===g).map(k=>k.tourId);return L.includes(g)||L.push(g),o?.set?.("active",[...new Set(L)]),{...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,L=f.props?.nextStepId,k=C&&!w.completedSteps.includes(C)?[...w.completedSteps,C]:w.completedSteps;return{...w,currentStepId:L||w.currentStepId,completedSteps:k}}case"tour.completed":{let C=Date.now();return u.current[g]=C,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(L=>L.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 m=(0,je.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),S=(0,je.useCallback)(x=>{d(f=>{let g=f.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=g.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),g})},[o]),b=(0,je.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Mg.jsx)("div",{ref:l,children:(0,Mg.jsx)(cL,{workflows:b,onStepClick:m,onDismiss:S})})}var pL={mount(t,e){let a=e?.runtime||null,r=(0,fL.createRoot)(t);return r.render(je.default.createElement(I2,{runtime:a})),()=>{r.unmount()}}};var hL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};a.getAttribute("data-syntro-highlight")&&e.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring").forEach(s=>s.remove()),a.setAttribute("data-syntro-highlight","true");let n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=Aw(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:n,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:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight")}}},mL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let n=b=>({r:parseInt(b.slice(1,3),16),g:parseInt(b.slice(3,5),16),b:parseInt(b.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let b=getComputedStyle(e.overlayRoot),x=b.getPropertyValue("--sc-color-primary")?.trim(),f=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=n(x)),f?.startsWith("#")&&f.length>=7&&(s=n(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:h}=i;if(s){let{r:b,g:x,b:f}=s;u.textContent=`
63
63
  @keyframes syntro-pulse-anim {
64
64
  0%, 100% {
65
65
  box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${h}, 0.35);
@@ -94,14 +94,14 @@ Error generating stack: `+r.message+`
94
94
  <button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
95
95
  ${ma(r.cta.label)}
96
96
  </button>
97
- </div>`);let o=iL(a,e.overlayRoot,{html:n,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:i=>{if(i==="dismiss"){o.destroy();return}if(i==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let s=r.ctaButtons.find(l=>l.actionId===i);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:i,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()}}},Og=[{kind:"overlays:highlight",executor:hL},{kind:"overlays:pulse",executor:mL},{kind:"overlays:badge",executor:gL},{kind:"overlays:tooltip",executor:vL},{kind:"overlays:modal",executor:kg},{kind:"core:tour",executor:Ig},{kind:"overlays:celebrate",executor:Lw}],Bg={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Og,widgets:[{id:"adaptive-overlays:workflow-tracker",component:pL,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Fg(t){let{appId:e,runtime:a,isBuiltIn:r=!1}=t,n=`app:${e}:`,o=[],i=[],s=a.state.ns(`app:${e}`);return{appId:e,state:{get:u=>s.get(u),set:(u,c)=>s.set(u,c),remove:u=>s.remove(u)},telemetry:a.telemetry?{emit:(u,c)=>{a.events.publish(u,{...c,_appId:e})},getSessionId:()=>a.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,d)=>{let h=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:m=>h.update(m)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function Ng(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var A2=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"]),k2={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function yL(t){return k2[t]??t}function xL(t){return A2.has(t)}function bL(t){if(xL(t))return null;let e=t.indexOf(":");return e===-1?null:yL(t.slice(0,e))}function Pg(t){let e=t.indexOf(":");return e===-1?null:yL(t.slice(0,e))}function Hg(t){let{cdnBase:e,registry:a,timeout:r=1e4,onLoadStart:n,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(b){return`${e}/adaptives/${b}/index.js`}async function c(b){if(a.has(b))return{appId:b,success:!0,manifest:a.get(b)?.manifest};if(l.has(b))return l.get(b);if(i.has(b))return i.get(b);let x=(async()=>{n?.(b);try{let f=u(b);if(s.has(f)){let _=a.get(b);if(_)return o?.(b,!0),{appId:b,success:!0,manifest:_.manifest}}let g=new Promise((_,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${b}`)),r)}),v=d(f,b);await Promise.race([v,g]),s.add(f);let y=a.get(b);if(!y)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:y.manifest}}catch(f){let g=f instanceof Error?f.message:String(f);o?.(b,!1,g);let v={appId:b,success:!1,error:g};return l.set(b,v),v}finally{i.delete(b)}})();return i.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?a.register(f.manifest):f.default?.manifest?a.register(f.default.manifest):f.default&&a.register(f.default);return}catch{}return new Promise((f,g)=>{let v=document.createElement("script");v.src=b,v.async=!0,v.onload=()=>{a.get(x)?f():g(new Error(`App ${x} did not self-register`))},v.onerror=()=>{g(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(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 g=bL(f.kind);if(g&&x.add(g),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=Pg(v);y&&x.add(y)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let g=Pg(f.widget);g&&x.add(g)}}return Array.from(x)}async function m(b){let x=h(b);return x.length===0?[]:await Promise.all(x.map(g=>c(g)))}async function S(b){return Promise.all(b.map(x=>c(x)))}return{loadApp:c,loadAppsForConfig:m,preloadApps:S,getRequiredApps:h,getAppUrl:u}}var rf=class{constructor(){$(this,"apps",new Map);$(this,"eventListeners",new Set);$(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.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 a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let r of a.manifest.dependencies){let n=this.apps.get(r);if(!n||n.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}a.state="activating";try{let r=a.manifest.metadata?.isBuiltIn===!0,n=Fg({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=a.manifest,i=[];if(o){if(o.actions)for(let s of o.actions)n.registerAction(s);if(o.widgets)for(let s of o.widgets)n.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(u=>{if(s.names.includes(u.name)){let c={appId:e,state:n.state,telemetry:n.telemetry,surfaces:n.surfaces};try{s.handler(u,c)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});i.push(l)}}a.cleanup=async()=>{for(let s of i)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Ng(e,this.runtime)},a.state="active",a.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,n]of this.apps)if(n.state==="active"&&n.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);a.state="deactivating";try{a.cleanup&&(await a.cleanup(),a.cleanup=void 0),a.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let a=this.apps.get(e);a&&(a.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 a of this.eventListeners)try{a(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Jl=new rf;var Za=K(Me(),1);var zo=K(We(),1),qg=K(Bo(),1);var zr=K(We(),1);var SL=/```json\s*\n([\s\S]*?)```/g;function CL(t){let e=[],a=t,r=[],n;for(SL.lastIndex=0;(n=SL.exec(t))!==null;)r.push({fullMatch:n[0],json:n[1],index:n.index});for(let o=r.length-1;o>=0;o--){let{fullMatch:i,json:s}=r[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
97
+ </div>`);let o=iL(a,e.overlayRoot,{html:n,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:i=>{if(i==="dismiss"){o.destroy();return}if(i==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let s=r.ctaButtons.find(l=>l.actionId===i);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:i,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()}}},Dg=[{kind:"overlays:highlight",executor:hL},{kind:"overlays:pulse",executor:mL},{kind:"overlays:badge",executor:gL},{kind:"overlays:tooltip",executor:vL},{kind:"overlays:modal",executor:Ag},{kind:"core:tour",executor:Lg},{kind:"overlays:celebrate",executor:Lw}],Og={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Dg,widgets:[{id:"adaptive-overlays:workflow-tracker",component:pL,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Bg(t){let{appId:e,runtime:a,isBuiltIn:r=!1}=t,n=`app:${e}:`,o=[],i=[],s=a.state.ns(`app:${e}`);return{appId:e,state:{get:u=>s.get(u),set:(u,c)=>s.set(u,c),remove:u=>s.remove(u)},telemetry:a.telemetry?{emit:(u,c)=>{a.events.publish(u,{...c,_appId:e})},getSessionId:()=>a.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,d)=>{let h=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:m=>h.update(m)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function Fg(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var A2=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"]),k2={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function yL(t){return k2[t]??t}function xL(t){return A2.has(t)}function bL(t){if(xL(t))return null;let e=t.indexOf(":");return e===-1?null:yL(t.slice(0,e))}function Ng(t){let e=t.indexOf(":");return e===-1?null:yL(t.slice(0,e))}function Pg(t){let{cdnBase:e,registry:a,timeout:r=1e4,onLoadStart:n,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(b){return`${e}/adaptives/${b}/index.js`}async function c(b){if(a.has(b))return{appId:b,success:!0,manifest:a.get(b)?.manifest};if(l.has(b))return l.get(b);if(i.has(b))return i.get(b);let x=(async()=>{n?.(b);try{let f=u(b);if(s.has(f)){let _=a.get(b);if(_)return o?.(b,!0),{appId:b,success:!0,manifest:_.manifest}}let g=new Promise((_,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${b}`)),r)}),v=d(f,b);await Promise.race([v,g]),s.add(f);let y=a.get(b);if(!y)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:y.manifest}}catch(f){let g=f instanceof Error?f.message:String(f);o?.(b,!1,g);let v={appId:b,success:!1,error:g};return l.set(b,v),v}finally{i.delete(b)}})();return i.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?a.register(f.manifest):f.default?.manifest?a.register(f.default.manifest):f.default&&a.register(f.default);return}catch{}return new Promise((f,g)=>{let v=document.createElement("script");v.src=b,v.async=!0,v.onload=()=>{a.get(x)?f():g(new Error(`App ${x} did not self-register`))},v.onerror=()=>{g(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(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 g=bL(f.kind);if(g&&x.add(g),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=Ng(v);y&&x.add(y)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let g=Ng(f.widget);g&&x.add(g)}}return Array.from(x)}async function m(b){let x=h(b);return x.length===0?[]:await Promise.all(x.map(g=>c(g)))}async function S(b){return Promise.all(b.map(x=>c(x)))}return{loadApp:c,loadAppsForConfig:m,preloadApps:S,getRequiredApps:h,getAppUrl:u}}var af=class{constructor(){$(this,"apps",new Map);$(this,"eventListeners",new Set);$(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.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 a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let r of a.manifest.dependencies){let n=this.apps.get(r);if(!n||n.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}a.state="activating";try{let r=a.manifest.metadata?.isBuiltIn===!0,n=Bg({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=a.manifest,i=[];if(o){if(o.actions)for(let s of o.actions)n.registerAction(s);if(o.widgets)for(let s of o.widgets)n.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(u=>{if(s.names.includes(u.name)){let c={appId:e,state:n.state,telemetry:n.telemetry,surfaces:n.surfaces};try{s.handler(u,c)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});i.push(l)}}a.cleanup=async()=>{for(let s of i)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Fg(e,this.runtime)},a.state="active",a.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,n]of this.apps)if(n.state==="active"&&n.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);a.state="deactivating";try{a.cleanup&&(await a.cleanup(),a.cleanup=void 0),a.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let a=this.apps.get(e);a&&(a.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 a of this.eventListeners)try{a(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Jl=new af;var Za=K(Me(),1);var zo=K(We(),1),Ug=K(Bo(),1);var zr=K(We(),1);var SL=/```json\s*\n([\s\S]*?)```/g;function CL(t){let e=[],a=t,r=[],n;for(SL.lastIndex=0;(n=SL.exec(t))!==null;)r.push({fullMatch:n[0],json:n[1],index:n.index});for(let o=r.length-1;o>=0;o--){let{fullMatch:i,json:s}=r[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
98
98
 
99
- `).trim(),{displayText:a,actions:e}}var eu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function E2(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new eu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new eu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function _L(t,e){let a=E2(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new eu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var T2=0;function Ug(){return`msg-${Date.now()}-${++T2}`}function wL(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,zr.useState)(()=>n?[{id:Ug(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,zr.useState)(!1),[h,m]=(0,zr.useState)(null),S=(0,zr.useRef)(null),b=(0,zr.useCallback)(async f=>{let g=f.trim();if(!g)return;m(null);let v={id:Ug(),role:"user",text:g,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(A=>({role:A.role,content:A.text})),w=await _L(e,{message:g,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:L}=CL(w.response),k={id:Ug(),role:"assistant",text:C,timestamp:Date.now()};u(A=>[...A,k]),L.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(L),r.events.publish("chatbot.actions_applied",{count:L.length,kinds:L.map(A=>A.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";m(_)}finally{d(!1)}},[e,l,o,i,s,r,a]),x=(0,zr.useCallback)(()=>{u([]),m(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:h,sendMessage:b,clearMessages:x}}var Wa={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:Ft[4],color:Va.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:I[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:I[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:ze[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:I[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Ft[4],color:Va.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function R2({message:t}){let e=t.role==="user",a={...Wa.messageBubble,...e?Wa.userMessage:Wa.assistantMessage};return(0,Za.jsx)("div",{style:a,children:t.text})}function M2({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=wL({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,zo.useRef)(null),u=(0,zo.useRef)(null);(0,zo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let h=u.current;if(!h||!h.value.trim()||n)return;let m=h.value;h.value="",i(m)};return(0,Za.jsxs)("div",{style:Wa.container,"data-testid":"chat-assistant",children:[(0,Za.jsxs)("div",{ref:l,style:Wa.messageList,children:[r.map(d=>(0,Za.jsx)(R2,{message:d},d.id)),n&&(0,Za.jsx)("div",{style:Wa.loadingDots,children:"Thinking..."})]}),o&&(0,Za.jsx)("div",{style:Wa.errorBanner,children:o}),(0,Za.jsxs)("form",{onSubmit:c,style:Wa.inputForm,children:[(0,Za.jsx)("input",{ref:u,style:Wa.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,Za.jsx)("button",{type:"submit",disabled:n,style:{...Wa.sendButton,...n?Wa.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var LL={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof qg.createRoot=="function"){let o=(0,qg.createRoot)(t);return o.render(zo.default.createElement(M2,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${I[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
99
+ `).trim(),{displayText:a,actions:e}}var eu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function E2(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new eu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new eu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function _L(t,e){let a=E2(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new eu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var T2=0;function Hg(){return`msg-${Date.now()}-${++T2}`}function wL(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,zr.useState)(()=>n?[{id:Hg(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,zr.useState)(!1),[h,m]=(0,zr.useState)(null),S=(0,zr.useRef)(null),b=(0,zr.useCallback)(async f=>{let g=f.trim();if(!g)return;m(null);let v={id:Hg(),role:"user",text:g,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(A=>({role:A.role,content:A.text})),w=await _L(e,{message:g,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:L}=CL(w.response),k={id:Hg(),role:"assistant",text:C,timestamp:Date.now()};u(A=>[...A,k]),L.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(L),r.events.publish("chatbot.actions_applied",{count:L.length,kinds:L.map(A=>A.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";m(_)}finally{d(!1)}},[e,l,o,i,s,r,a]),x=(0,zr.useCallback)(()=>{u([]),m(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:h,sendMessage:b,clearMessages:x}}var Wa={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:Ft[4],color:Va.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:I[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:I[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:ze[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:I[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Ft[4],color:Va.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function R2({message:t}){let e=t.role==="user",a={...Wa.messageBubble,...e?Wa.userMessage:Wa.assistantMessage};return(0,Za.jsx)("div",{style:a,children:t.text})}function M2({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=wL({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,zo.useRef)(null),u=(0,zo.useRef)(null);(0,zo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let h=u.current;if(!h||!h.value.trim()||n)return;let m=h.value;h.value="",i(m)};return(0,Za.jsxs)("div",{style:Wa.container,"data-testid":"chat-assistant",children:[(0,Za.jsxs)("div",{ref:l,style:Wa.messageList,children:[r.map(d=>(0,Za.jsx)(R2,{message:d},d.id)),n&&(0,Za.jsx)("div",{style:Wa.loadingDots,children:"Thinking..."})]}),o&&(0,Za.jsx)("div",{style:Wa.errorBanner,children:o}),(0,Za.jsxs)("form",{onSubmit:c,style:Wa.inputForm,children:[(0,Za.jsx)("input",{ref:u,style:Wa.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,Za.jsx)("button",{type:"submit",disabled:n,style:{...Wa.sendButton,...n?Wa.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var LL={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof Ug.createRoot=="function"){let o=(0,Ug.createRoot)(t);return o.render(zo.default.createElement(M2,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${I[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
100
100
  <div style="padding: 16px; font-family: system-ui; color: ${I[10]};">
101
101
  <p style="margin: 0 0 8px; color: ${I[8]};">${a.greeting||"Hi! How can I help?"}</p>
102
102
  <p style="margin: 0; font-size: 12px; color: ${I[7]};">Chat widget mounted. Awaiting React renderer.</p>
103
103
  </div>
104
- `,()=>{t.innerHTML=""})}};var IL={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:LL,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function AL(t,e,a){if(e){let r=t.getState().items.find(n=>n.config.id===e);if(r)return r}if(a){let r=t.findByQuestion(a);if(r)return r}throw new Error("FAQ item not found")}async function D2(t,e,a){let r=AL(a,t.itemId,t.itemQuestion),{id:n}=r.config;t.expand!==!1&&a.expand(n);let o=document.querySelector(`[data-faq-item-id="${n}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:n}),{cleanup:()=>{}}}async function O2(t,e,a){let r=AL(a,t.itemId,t.itemQuestion),{id:n}=r.config,o=t.state??"toggle",i;switch(o){case"open":a.expand(n),i="open";break;case"closed":a.collapse(n),i="closed";break;default:{let s=a.getState().expandedItems.has(n);a.toggle(n),i=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:n,newState:i}),{cleanup:()=>{}}}async function B2(t,e,a){switch(t.operation){case"add":{let r=t.items??[],n=t.position==="prepend"?"prepend":"append";a.addItems(r,n);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!a.getState().items.some(n=>n.config.id===t.itemId))throw new Error("FAQ item not found");a.removeItem(t.itemId);break}case"reorder":{let r=t.order??[];a.reorderItems(r);break}case"replace":{let r=t.items??[];a.replaceItems(r);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var kL=[{kind:"faq:scroll_to",executor:D2},{kind:"faq:toggle_item",executor:O2},{kind:"faq:update",executor:B2}];var He=K(Me(),1);var Ee=K(We(),1),zg=K(Bo(),1);function EL(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function F2(t){return typeof t=="string"?(0,He.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,He.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,He.jsx)("p",{style:{margin:0},children:t.content})}function N2(t){return t?t===!0?{style:"thumbs"}:t:null}function P2(t){return t.prompt||"Was this helpful?"}var Et={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"8px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease",backgroundColor:"var(--sc-content-search-background)",color:"var(--sc-content-search-color)"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",color:"var(--sc-content-chevron-color, currentColor)"},answer:{padding:"var(--sc-content-body-padding, 0 16px 12px 16px)",fontSize:"var(--sc-content-body-font-size, 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:"var(--sc-content-category-font-size, 12px)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)",marginTop:"var(--sc-content-category-gap, 4px)"},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"}},us={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[11]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[8],color:Ft[2]},categoryHeader:{color:I[7]},emptyState:{color:I[8]},feedbackPrompt:{color:I[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[5]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[0],color:Ft[6]},categoryHeader:{color:I[8]},emptyState:{color:I[7]},feedbackPrompt:{color:I[8]}}};function H2({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Ee.useState)(!1),d=us[o],{question:h,answer:m}=t.config,S={...Et.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Et.question,...d.question,...u?d.questionHover:{}},x={...Et.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Et.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g={...Et.feedback,...d.feedbackPrompt};return(0,He.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,He.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,He.jsx)("span",{children:h}),(0,He.jsx)("span",{style:x,children:"\u203A"})]}),(0,He.jsxs)("div",{style:f,"aria-hidden":!e,children:[F2(m),e&&i&&(0,He.jsxs)("div",{style:g,children:[(0,He.jsx)("span",{children:P2(i)}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="up"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,h,"up"),children:"\u{1F44D}"}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="down"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,h,"down"),children:"\u{1F44E}"})]})]})]})}function U2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Ee.useReducer)(M=>M+1,0),[o,i]=(0,Ee.useState)(new Set),[s,l]=(0,Ee.useState)(null),[u,c]=(0,Ee.useState)(""),[d,h]=(0,Ee.useState)(new Map),m=(0,Ee.useMemo)(()=>N2(t.feedback),[t.feedback]);(0,Ee.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Ee.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let R=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(B=>{let F=B.props?.actionId;return typeof F=="string"&&F.startsWith("faq:open:")}).pop();if(R&&Date.now()-R.ts<1e4){let B=R.props.actionId.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},T=>{let R=T.props?.actionId;if(typeof R!="string"||!R.startsWith("faq:open:"))return;let B=R.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;let M=R=>{let B=R.props?.tileId,F=R.props?.itemId;B===a&&F&&(i(new Set([F])),l(F),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let P=document.querySelector(`[data-faq-item-id="${F}"]`);P&&P.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let B=e.events.getRecent({names:["notification.deep_link"]},5).filter(F=>F.props?.tileId===a&&F.props?.itemId).pop();B&&Date.now()-B.ts<1e4&&M(B)}return e.events.subscribe({names:["notification.deep_link"]},M)},[e,a]);let S=(0,Ee.useMemo)(()=>t.actions.filter(M=>M.triggerWhen?e.evaluateSync(M.triggerWhen).value:!0),[t.actions,e,r]),b=(0,Ee.useMemo)(()=>t.ordering==="priority"?[...S].sort((M,T)=>(T.config.priority??0)-(M.config.priority??0)):S,[S,t.ordering]),x=(0,Ee.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let M=u.toLowerCase();return b.filter(T=>T.config.question.toLowerCase().includes(M)||EL(T.config.answer).toLowerCase().includes(M)||T.config.category?.toLowerCase().includes(M))},[b,u,t.searchable]),f=(0,Ee.useMemo)(()=>{let M=new Map;for(let T of x){let R=T.config.category;M.has(R)||M.set(R,[]),M.get(R).push(T)}return M},[x]),g=(0,Ee.useMemo)(()=>x.some(M=>M.config.category),[x]),v=(0,Ee.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Ee.useCallback)(M=>{i(T=>{let R=new Set(T);return t.expandBehavior==="single"?T.has(M)?new Set:new Set([M]):(T.has(M)?R.delete(M):R.add(M),R)}),e.events.publish("faq:toggled",{instanceId:a,questionId:M,expanded:!o.has(M),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,Ee.useCallback)((M,T,R)=>{h(B=>{let F=new Map(B);return F.set(M,R),F}),e.events.publish("faq:feedback",{itemId:M,question:T,value:R})},[e.events]),w={...Et.container,...us[v].container},C={...Et.searchInput,...us[v].searchInput},L={...Et.emptyState,...us[v].emptyState},k={...Et.categoryHeader,...us[v].categoryHeader},A=M=>M.map((T,R)=>(0,He.jsx)(H2,{item:T,isExpanded:o.has(T.config.id),isHighlighted:s===T.config.id,isLast:R===M.length-1,onToggle:()=>y(T.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(T.config.id),onFeedback:_},T.config.id));return S.length===0?(0,He.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,He.jsx)("div",{style:L,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,He.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,He.jsxs)("div",{style:Et.searchWrapper,children:[(0,He.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,He.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:M=>c(M.target.value),style:C})]}),(0,He.jsx)("div",{style:Et.accordion,children:g?Array.from(f.entries()).map(([M,T])=>(0,He.jsxs)(Ee.default.Fragment,{children:[M&&(0,He.jsx)("div",{style:k,"data-category-header":M,children:M}),A(T)]},M??"__ungrouped")):A(x)}),t.searchable&&x.length===0&&u&&(0,He.jsxs)("div",{style:{...Et.noResults,...us[v].emptyState},children:['No questions found matching "',u,'"']})]})}var TL={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof zg.createRoot=="function"){let i=(0,zg.createRoot)(t);return i.render(Ee.default.createElement(U2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
104
+ `,()=>{t.innerHTML=""})}};var IL={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:LL,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function AL(t,e,a){if(e){let r=t.getState().items.find(n=>n.config.id===e);if(r)return r}if(a){let r=t.findByQuestion(a);if(r)return r}throw new Error("FAQ item not found")}async function D2(t,e,a){let r=AL(a,t.itemId,t.itemQuestion),{id:n}=r.config;t.expand!==!1&&a.expand(n);let o=document.querySelector(`[data-faq-item-id="${n}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:n}),{cleanup:()=>{}}}async function O2(t,e,a){let r=AL(a,t.itemId,t.itemQuestion),{id:n}=r.config,o=t.state??"toggle",i;switch(o){case"open":a.expand(n),i="open";break;case"closed":a.collapse(n),i="closed";break;default:{let s=a.getState().expandedItems.has(n);a.toggle(n),i=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:n,newState:i}),{cleanup:()=>{}}}async function B2(t,e,a){switch(t.operation){case"add":{let r=t.items??[],n=t.position==="prepend"?"prepend":"append";a.addItems(r,n);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!a.getState().items.some(n=>n.config.id===t.itemId))throw new Error("FAQ item not found");a.removeItem(t.itemId);break}case"reorder":{let r=t.order??[];a.reorderItems(r);break}case"replace":{let r=t.items??[];a.replaceItems(r);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var kL=[{kind:"faq:scroll_to",executor:D2},{kind:"faq:toggle_item",executor:O2},{kind:"faq:update",executor:B2}];var He=K(Me(),1);var Ee=K(We(),1),qg=K(Bo(),1);function EL(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function F2(t){return typeof t=="string"?(0,He.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,He.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,He.jsx)("p",{style:{margin:0},children:t.content})}function N2(t){return t?t===!0?{style:"thumbs"}:t:null}function P2(t){return t.prompt||"Was this helpful?"}var Et={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"8px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease",backgroundColor:"var(--sc-content-search-background)",color:"var(--sc-content-search-color)"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",color:"var(--sc-content-chevron-color, currentColor)"},answer:{padding:"var(--sc-content-body-padding, 0 16px 12px 16px)",fontSize:"var(--sc-content-body-font-size, 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:"var(--sc-content-category-font-size, 12px)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)",marginTop:"var(--sc-content-category-gap, 4px)"},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"}},us={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[11]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[8],color:Ft[2]},categoryHeader:{color:I[7]},emptyState:{color:I[8]},feedbackPrompt:{color:I[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[5]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[0],color:Ft[6]},categoryHeader:{color:I[8]},emptyState:{color:I[7]},feedbackPrompt:{color:I[8]}}};function H2({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Ee.useState)(!1),d=us[o],{question:h,answer:m}=t.config,S={...Et.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Et.question,...d.question,...u?d.questionHover:{}},x={...Et.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Et.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g={...Et.feedback,...d.feedbackPrompt};return(0,He.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,He.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,He.jsx)("span",{children:h}),(0,He.jsx)("span",{style:x,children:"\u203A"})]}),(0,He.jsxs)("div",{style:f,"aria-hidden":!e,children:[F2(m),e&&i&&(0,He.jsxs)("div",{style:g,children:[(0,He.jsx)("span",{children:P2(i)}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="up"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,h,"up"),children:"\u{1F44D}"}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="down"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,h,"down"),children:"\u{1F44E}"})]})]})]})}function U2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Ee.useReducer)(M=>M+1,0),[o,i]=(0,Ee.useState)(new Set),[s,l]=(0,Ee.useState)(null),[u,c]=(0,Ee.useState)(""),[d,h]=(0,Ee.useState)(new Map),m=(0,Ee.useMemo)(()=>N2(t.feedback),[t.feedback]);(0,Ee.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Ee.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let R=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(B=>{let F=B.props?.actionId;return typeof F=="string"&&F.startsWith("faq:open:")}).pop();if(R&&Date.now()-R.ts<1e4){let B=R.props.actionId.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},T=>{let R=T.props?.actionId;if(typeof R!="string"||!R.startsWith("faq:open:"))return;let B=R.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;let M=R=>{let B=R.props?.tileId,F=R.props?.itemId;B===a&&F&&(i(new Set([F])),l(F),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let P=document.querySelector(`[data-faq-item-id="${F}"]`);P&&P.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let B=e.events.getRecent({names:["notification.deep_link"]},5).filter(F=>F.props?.tileId===a&&F.props?.itemId).pop();B&&Date.now()-B.ts<1e4&&M(B)}return e.events.subscribe({names:["notification.deep_link"]},M)},[e,a]);let S=(0,Ee.useMemo)(()=>t.actions.filter(M=>M.triggerWhen?e.evaluateSync(M.triggerWhen).value:!0),[t.actions,e,r]),b=(0,Ee.useMemo)(()=>t.ordering==="priority"?[...S].sort((M,T)=>(T.config.priority??0)-(M.config.priority??0)):S,[S,t.ordering]),x=(0,Ee.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let M=u.toLowerCase();return b.filter(T=>T.config.question.toLowerCase().includes(M)||EL(T.config.answer).toLowerCase().includes(M)||T.config.category?.toLowerCase().includes(M))},[b,u,t.searchable]),f=(0,Ee.useMemo)(()=>{let M=new Map;for(let T of x){let R=T.config.category;M.has(R)||M.set(R,[]),M.get(R).push(T)}return M},[x]),g=(0,Ee.useMemo)(()=>x.some(M=>M.config.category),[x]),v=(0,Ee.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Ee.useCallback)(M=>{i(T=>{let R=new Set(T);return t.expandBehavior==="single"?T.has(M)?new Set:new Set([M]):(T.has(M)?R.delete(M):R.add(M),R)}),e.events.publish("faq:toggled",{instanceId:a,questionId:M,expanded:!o.has(M),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,Ee.useCallback)((M,T,R)=>{h(B=>{let F=new Map(B);return F.set(M,R),F}),e.events.publish("faq:feedback",{itemId:M,question:T,value:R})},[e.events]),w={...Et.container,...us[v].container},C={...Et.searchInput,...us[v].searchInput},L={...Et.emptyState,...us[v].emptyState},k={...Et.categoryHeader,...us[v].categoryHeader},A=M=>M.map((T,R)=>(0,He.jsx)(H2,{item:T,isExpanded:o.has(T.config.id),isHighlighted:s===T.config.id,isLast:R===M.length-1,onToggle:()=>y(T.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(T.config.id),onFeedback:_},T.config.id));return S.length===0?(0,He.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,He.jsx)("div",{style:L,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,He.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,He.jsxs)("div",{style:Et.searchWrapper,children:[(0,He.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,He.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:M=>c(M.target.value),style:C})]}),(0,He.jsx)("div",{style:Et.accordion,children:g?Array.from(f.entries()).map(([M,T])=>(0,He.jsxs)(Ee.default.Fragment,{children:[M&&(0,He.jsx)("div",{style:k,"data-category-header":M,children:M}),A(T)]},M??"__ungrouped")):A(x)}),t.searchable&&x.length===0&&u&&(0,He.jsxs)("div",{style:{...Et.noResults,...us[v].emptyState},children:['No questions found matching "',u,'"']})]})}var TL={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof qg.createRoot=="function"){let i=(0,qg.createRoot)(t);return i.render(Ee.default.createElement(U2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
105
105
  <div style="font-family: system-ui; max-width: 800px;">
106
106
  ${o.map(i=>`
107
107
  <div style="margin-bottom: 8px; padding: 16px; background: ${I[12]}; border-radius: 8px;">
@@ -110,23 +110,23 @@ Error generating stack: `+r.message+`
110
110
  </div>
111
111
  `).join("")}
112
112
  </div>
113
- `,()=>{t.innerHTML=""}}};var RL={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:kL,widgets:[{id:"adaptive-faq:accordion",component:TL,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753",subtitle:"Curated just for you."}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`faq:${a.config.id}`,strategy:a.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:a.config.id,question:a.config.question,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var q2=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},z2=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},V2={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},$2=[{kind:"gamification:awardBadge",executor:q2},{kind:"gamification:addPoints",executor:z2}],j2=[V2],ML={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:$2,eventHandlers:j2};var _t=K(Me(),1);var st=K(We(),1),Vg=K(Bo(),1);function nf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Xa={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0,color:"var(--sc-content-chevron-color, currentColor)"},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"var(--sc-content-body-padding, 0 16px 12px 16px)"},description:{fontSize:"var(--sc-content-body-font-size, 14px)",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:"var(--sc-content-category-font-size, 12px)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},of={light:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[7]},emptyState:{color:I[8]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[8]},emptyState:{color:I[7]}}};function G2({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,theme:o}){let[i,s]=(0,st.useState)(!1),l=of[o],{title:u,description:c,href:d,icon:h,external:m}=t.config,S={...Xa.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Xa.header,...l.header,...i?l.headerHover:{}},x={...Xa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Xa.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g=v=>{v.preventDefault(),v.stopPropagation(),d&&n(d,m??!1)};return(0,_t.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,_t.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[h&&(0,_t.jsx)("span",{style:Xa.icon,children:h}),(0,_t.jsx)("span",{children:u}),(0,_t.jsx)("span",{style:x,children:"\u203A"})]}),(0,_t.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,_t.jsx)("p",{style:Xa.description,children:c}),d&&(0,_t.jsxs)("a",{href:d,onClick:g,style:{...Xa.linkButton,...l.linkButton},target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,children:["Go ",m?"\u2197":"\u2192"]})]})]})}function W2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,st.useReducer)(f=>f+1,0),[o,i]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[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,r]),l=(0,st.useMemo)(()=>{let f=new Map;for(let g of s){let v=g.config.category;f.has(v)||f.set(v,[]),f.get(v).push(g)}return f},[s]),u=(0,st.useMemo)(()=>s.some(f=>f.config.category),[s]),c=(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=>{i(g=>{let v=g.has(f),y;if(t.expandBehavior==="single"){for(let _ of g)_!==f&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(g),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:a,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),h=(0,st.useCallback)((f,g)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:f,external:g,timestamp:Date.now()}),g)window.open(f,"_blank","noopener,noreferrer");else{let y=new URL(f,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),m={...Xa.container,...of[c].container},S={...Xa.categoryHeader,...of[c].categoryHeader},b={...Xa.emptyState,...of[c].emptyState},x=f=>f.map((g,v)=>(0,_t.jsx)(G2,{item:g,isExpanded:o.has(g.config.id),isLast:v===f.length-1,onToggle:()=>d(g.config.id),onNavigate:h,theme:c},g.config.id));return s.length===0?(0,_t.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:b,children:"You're all set for now! We'll share helpful tips here when they're relevant to what you're doing."})}):(0,_t.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:Xa.accordion,children:u?Array.from(l.entries()).map(([f,g])=>(0,_t.jsxs)(st.default.Fragment,{children:[f&&(0,_t.jsx)("div",{style:S,"data-category-header":f,children:f}),x(g)]},f??"__ungrouped")):x(s)})})}var DL={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof Vg.createRoot=="function"){let i=(0,Vg.createRoot)(t);return i.render(st.default.createElement(W2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
113
+ `,()=>{t.innerHTML=""}}};var RL={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:kL,widgets:[{id:"adaptive-faq:accordion",component:TL,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753",subtitle:"Curated just for you."}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`faq:${a.config.id}`,strategy:a.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:a.config.id,question:a.config.question,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var q2=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},z2=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},V2={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},$2=[{kind:"gamification:awardBadge",executor:q2},{kind:"gamification:addPoints",executor:z2}],j2=[V2],ML={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:$2,eventHandlers:j2};var _t=K(Me(),1);var st=K(We(),1),zg=K(Bo(),1);function rf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Xa={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0,color:"var(--sc-content-chevron-color, currentColor)"},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"var(--sc-content-body-padding, 0 16px 12px 16px)"},description:{fontSize:"var(--sc-content-body-font-size, 14px)",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:"var(--sc-content-category-font-size, 12px)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},nf={light:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[7]},emptyState:{color:I[8]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[8]},emptyState:{color:I[7]}}};function G2({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,theme:o}){let[i,s]=(0,st.useState)(!1),l=nf[o],{title:u,description:c,href:d,icon:h,external:m}=t.config,S={...Xa.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Xa.header,...l.header,...i?l.headerHover:{}},x={...Xa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Xa.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g=v=>{v.preventDefault(),v.stopPropagation(),d&&n(d,m??!1)};return(0,_t.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,_t.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[h&&(0,_t.jsx)("span",{style:Xa.icon,children:h}),(0,_t.jsx)("span",{children:u}),(0,_t.jsx)("span",{style:x,children:"\u203A"})]}),(0,_t.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,_t.jsx)("p",{style:Xa.description,children:c}),d&&(0,_t.jsxs)("a",{href:d,onClick:g,style:{...Xa.linkButton,...l.linkButton},target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,children:["Go ",m?"\u2197":"\u2192"]})]})]})}function W2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,st.useReducer)(f=>f+1,0),[o,i]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[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,r]),l=(0,st.useMemo)(()=>{let f=new Map;for(let g of s){let v=g.config.category;f.has(v)||f.set(v,[]),f.get(v).push(g)}return f},[s]),u=(0,st.useMemo)(()=>s.some(f=>f.config.category),[s]),c=(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=>{i(g=>{let v=g.has(f),y;if(t.expandBehavior==="single"){for(let _ of g)_!==f&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(g),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:a,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),h=(0,st.useCallback)((f,g)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:f,external:g,timestamp:Date.now()}),g)window.open(f,"_blank","noopener,noreferrer");else{let y=new URL(f,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),m={...Xa.container,...nf[c].container},S={...Xa.categoryHeader,...nf[c].categoryHeader},b={...Xa.emptyState,...nf[c].emptyState},x=f=>f.map((g,v)=>(0,_t.jsx)(G2,{item:g,isExpanded:o.has(g.config.id),isLast:v===f.length-1,onToggle:()=>d(g.config.id),onNavigate:h,theme:c},g.config.id));return s.length===0?(0,_t.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:b,children:"You're all set for now! We'll share helpful tips here when they're relevant to what you're doing."})}):(0,_t.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:Xa.accordion,children:u?Array.from(l.entries()).map(([f,g])=>(0,_t.jsxs)(st.default.Fragment,{children:[f&&(0,_t.jsx)("div",{style:S,"data-category-header":f,children:f}),x(g)]},f??"__ungrouped")):x(s)})})}var DL={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof zg.createRoot=="function"){let i=(0,zg.createRoot)(t);return i.render(st.default.createElement(W2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
114
114
  <div style="font-family: system-ui; max-width: 100%;">
115
115
  ${o.map(i=>`
116
116
  <div style="margin-bottom: 4px; padding: 12px 16px; background: ${I[12]}; border-radius: 8px;">
117
- ${i.config.icon?`<span>${nf(i.config.icon)}</span> `:""}<strong>${nf(i.config.title)}</strong>
118
- <p style="margin-top: 8px; color: ${I[6]}; font-size: 13px;">${nf(i.config.description)}</p>
119
- ${i.config.href?`<a href="${nf(i.config.href)}" style="color: ${Ft[2]}; font-size: 13px;">Go &rarr;</a>`:""}
117
+ ${i.config.icon?`<span>${rf(i.config.icon)}</span> `:""}<strong>${rf(i.config.title)}</strong>
118
+ <p style="margin-top: 8px; color: ${I[6]}; font-size: 13px;">${rf(i.config.description)}</p>
119
+ ${i.config.href?`<a href="${rf(i.config.href)}" style="color: ${Ft[2]}; font-size: 13px;">Go &rarr;</a>`:""}
120
120
  </div>
121
121
  `).join("")}
122
122
  </div>
123
- `,()=>{t.innerHTML=""}}};var Z2=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);return a?(a.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 X2(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var Y2=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&X2(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},K2=[{kind:"navigation:scrollTo",executor:Z2},{kind:"navigation:navigate",executor:Y2}],OL={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:K2,widgets:[{id:"adaptive-nav:tips",component:DL,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`nav:${a.config.id}`,strategy:a.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:a.config.id,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var Q2=[IL,_g,RL,ML,OL,Bg],J2=Q2.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:a})=>({kind:e,executor:a})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function BL(t){let e=0;for(let a of J2)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var FL={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function NL(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...FL,...t};if(n&&document.querySelector(n))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(a);let s=!1,l=()=>{s||(s=!0,clearTimeout(c),document.documentElement.classList.remove(a),i.remove(),o&&u&&document.removeEventListener(o,u))},u;o&&(u=()=>l(),document.addEventListener(o,u));let c=setTimeout(()=>{l()},e);return()=>{l()}}function eD(t={}){let{className:e,style:a}={...FL,...t};return`
123
+ `,()=>{t.innerHTML=""}}};var Z2=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);return a?(a.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 X2(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var Y2=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&X2(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},K2=[{kind:"navigation:scrollTo",executor:Z2},{kind:"navigation:navigate",executor:Y2}],OL={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:K2,widgets:[{id:"adaptive-nav:tips",component:DL,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`nav:${a.config.id}`,strategy:a.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:a.config.id,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var Q2=[IL,Cg,RL,ML,OL,Og],J2=Q2.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:a})=>({kind:e,executor:a})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function BL(t){let e=0;for(let a of J2)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var FL={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function NL(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...FL,...t};if(n&&document.querySelector(n))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(a);let s=!1,l=()=>{s||(s=!0,clearTimeout(c),document.documentElement.classList.remove(a),i.remove(),o&&u&&document.removeEventListener(o,u))},u;o&&(u=()=>l(),document.addEventListener(o,u));let c=setTimeout(()=>{l()},e);return()=>{l()}}function eD(t={}){let{className:e,style:a}={...FL,...t};return`
124
124
  (function() {
125
125
  var s = document.createElement('style');
126
126
  s.textContent = '.${e} { ${a} }';
127
127
  document.head.appendChild(s);
128
128
  document.documentElement.className += ' ${e}';
129
- })();`}function sf(t,e,a="first-match"){for(let r of e){let n=t.getFeatureValue?.(r,null);if(!n||typeof n!="object")continue;let o=n,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||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 $g=!1;function PL(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function jg(t){if(PL()){$g=!0;return}$g=t??!1}function tD(){return PL()?!0:$g}function X(t,e,a){tD()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ga(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function lf(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var Gg="2.6.0-canary.6";var qn="2.0";var aD=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function rD(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):aD.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function nD(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var HL="syntro_config_cache",oD=1440*60*1e3;function UL(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function iD(t,e){if(UL())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(HL,JSON.stringify(a))}catch{}}function sD(t){if(!UL())return null;try{let e=localStorage.getItem(HL);if(!e)return null;let a=JSON.parse(e);return!a.config||typeof a.timestamp!="number"||!a.sdkVersion||a.sdkVersion!==t||Date.now()-a.timestamp>oD?null:a.config}catch{return null}}var Wg=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(a,null);if(r)return r};function lD(t,e,a){if(e){let r=t.getFeatureValue?.(e,null);if(r&&typeof r=="object"){let n=r.variant_flags;if(n&&n.length>0)return n}}if(a&&t.getAllFeatures){let r=t.getAllFeatures();return Object.keys(r).filter(n=>n.startsWith(a))}return[]}var cs=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&n){let c=e.getFeatureValue?.(n,null);if(c&&typeof c=="object")return X("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i)){let c=lD(e,o,i);if(c.length>0){let d=sf(e,c);if(d)return X("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Wg({configUri:t,experiments:e,featureKey:a});if(!l)return X("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!rD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(nD(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":Gg,"X-SDK-Schema-Version":qn}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return X("SmartCanvas Config","Fetched config from URI",d),s&&iD(d,s),d}catch(c){if(s){let d=sD(s);if(d)return X("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var uD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function qL(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let r=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(r))}catch(r){return ga("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var ds,fs;function zn(){if(ds==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)ds={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${ds.token.slice(0,15)}...)`);else{let e=qL("editor_source");e&&(ds=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 ds??null}function Vo(){if(fs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)fs={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=${fs.mode})`);else{let e=qL("editor_conf");e&&(fs=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return fs??null}function cD(t){X("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return X("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ga("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):uD.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(X("Syntro Runtime","\u2713 Editor URL validated"),!0):(ga("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ga("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var zL=()=>{let t=Vo();return!zn()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function dD(){return zn()?.token??null}function fD(){return zn()?.api_base??null}var tu=null,VL=async t=>{if(X("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){X("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){X("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(tu)return X("Syntro Runtime","Editor SDK load already in progress, waiting..."),tu;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){X("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),X("Syntro Runtime","================================");return}let a=fD(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){ga("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),X("Syntro Runtime","================================");return}let o=dD();if(!o){ga("Syntro Runtime","\u274C No token found in editor_source."),X("Syntro Runtime","================================");return}let i=`${n}?token=${encodeURIComponent(o)}`;if(X("Syntro Runtime","Editor URL:",i),X("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!n,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!cD(n)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",n),X("Syntro Runtime","================================");return}return X("Syntro Runtime","\u2713 URL validated, injecting script tag..."),tu=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",X("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{X("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),X("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),X("Syntro Runtime","================================"),tu=null,l(c)},document.head.appendChild(u),X("Syntro Runtime","Script tag appended to <head>")}),tu};var pD=new Set(["tag_name","$el_text"]);function hD(t){return pD.has(t)||t.startsWith("attr__")}function $L(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function mD(t){let{events:e,match:a}=t;return r=>{if(!e.includes(r.name))return!1;if(a){for(let[n,o]of Object.entries(a))if(hD(n)){let i=r.props?.elements;if(!i||!i.some(l=>$L(o,l[n])))return!1}else if(!$L(o,r.props?.[n]))return!1}return!0}}function jL(t,e){for(let a of t.rules)for(let r of a.conditions)if(r.type==="event_count"&&r.key){let n=r.counter,o=n?mD(n):()=>!0;e.register(r.key,o)}}function uf(t,e,a){for(let r of t){let n=r.props;if(!n)continue;let o=n.actions;if(o)for(let i of o)i.triggerWhen?.type==="rules"&&jL(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&jL(n.triggerWhen,e)}}var cr=null;function WL(t){cr&&cr!==t?t.appendChild(cr):cr=t;let e=t.getRootNode();e instanceof ShadowRoot&&gD(e)}function ZL(){return cr||(cr=document.createElement("div"),cr.id="syntro-overlays",Object.assign(cr.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(cr)),cr}var GL=!1;function gD(t){if(GL)return;let e=`
129
+ })();`}function of(t,e,a="first-match"){for(let r of e){let n=t.getFeatureValue?.(r,null);if(!n||typeof n!="object")continue;let o=n,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||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 Vg=!1;function PL(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function $g(t){if(PL()){Vg=!0;return}Vg=t??!1}function tD(){return PL()?!0:Vg}function X(t,e,a){tD()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ga(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function sf(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var jg="2.6.0";var qn="2.0";var aD=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function rD(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):aD.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function nD(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var HL="syntro_config_cache",oD=1440*60*1e3;function UL(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function iD(t,e){if(UL())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(HL,JSON.stringify(a))}catch{}}function sD(t){if(!UL())return null;try{let e=localStorage.getItem(HL);if(!e)return null;let a=JSON.parse(e);return!a.config||typeof a.timestamp!="number"||!a.sdkVersion||a.sdkVersion!==t||Date.now()-a.timestamp>oD?null:a.config}catch{return null}}var Gg=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(a,null);if(r)return r};function lD(t,e,a){if(e){let r=t.getFeatureValue?.(e,null);if(r&&typeof r=="object"){let n=r.variant_flags;if(n&&n.length>0)return n}}if(t.getAllFeatures){let r=t.getAllFeatures();return a?Object.keys(r).filter(n=>n.startsWith(a)):Object.keys(r)}return[]}var cs=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&n){let c=e.getFeatureValue?.(n,null);if(c&&typeof c=="object")return X("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i||e.getAllFeatures)){let c=lD(e,o,i);if(c.length>0){let d=of(e,c);if(d)return X("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Gg({configUri:t,experiments:e,featureKey:a});if(!l)return X("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!rD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(nD(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":jg,"X-SDK-Schema-Version":qn}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return X("SmartCanvas Config","Fetched config from URI",d),s&&iD(d,s),d}catch(c){if(s){let d=sD(s);if(d)return X("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var uD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function qL(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let r=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(r))}catch(r){return ga("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var ds,fs;function zn(){if(ds==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)ds={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${ds.token.slice(0,15)}...)`);else{let e=qL("editor_source");e&&(ds=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 ds??null}function Vo(){if(fs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)fs={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=${fs.mode})`);else{let e=qL("editor_conf");e&&(fs=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return fs??null}function cD(t){X("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return X("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ga("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):uD.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(X("Syntro Runtime","\u2713 Editor URL validated"),!0):(ga("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ga("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var zL=()=>{let t=Vo();return!zn()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function dD(){return zn()?.token??null}function fD(){return zn()?.api_base??null}var tu=null,VL=async t=>{if(X("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){X("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){X("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(tu)return X("Syntro Runtime","Editor SDK load already in progress, waiting..."),tu;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){X("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),X("Syntro Runtime","================================");return}let a=fD(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){ga("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),X("Syntro Runtime","================================");return}let o=dD();if(!o){ga("Syntro Runtime","\u274C No token found in editor_source."),X("Syntro Runtime","================================");return}let i=`${n}?token=${encodeURIComponent(o)}`;if(X("Syntro Runtime","Editor URL:",i),X("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!n,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!cD(n)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",n),X("Syntro Runtime","================================");return}return X("Syntro Runtime","\u2713 URL validated, injecting script tag..."),tu=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",X("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{X("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),X("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),X("Syntro Runtime","================================"),tu=null,l(c)},document.head.appendChild(u),X("Syntro Runtime","Script tag appended to <head>")}),tu};var pD=new Set(["tag_name","$el_text"]);function hD(t){return pD.has(t)||t.startsWith("attr__")}function $L(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function mD(t){let{events:e,match:a}=t;return r=>{if(!e.includes(r.name))return!1;if(a){for(let[n,o]of Object.entries(a))if(hD(n)){let i=r.props?.elements;if(!i||!i.some(l=>$L(o,l[n])))return!1}else if(!$L(o,r.props?.[n]))return!1}return!0}}function jL(t,e){for(let a of t.rules)for(let r of a.conditions)if(r.type==="event_count"&&r.key){let n=r.counter,o=n?mD(n):()=>!0;e.register(r.key,o)}}function lf(t,e,a){for(let r of t){let n=r.props;if(!n)continue;let o=n.actions;if(o)for(let i of o)i.triggerWhen?.type==="rules"&&jL(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&jL(n.triggerWhen,e)}}var cr=null;function WL(t){cr&&cr!==t?t.appendChild(cr):cr=t;let e=t.getRootNode();e instanceof ShadowRoot&&gD(e)}function ZL(){return cr||(cr=document.createElement("div"),cr.id="syntro-overlays",Object.assign(cr.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(cr)),cr}var GL=!1;function gD(t){if(GL)return;let e=`
130
130
  :host {
131
131
  --syntro-surface: var(--sc-overlay-background, #0f1318);
132
132
  --syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
@@ -388,7 +388,7 @@ Error generating stack: `+r.message+`
388
388
  .syntro-modal-btn-primary:hover {
389
389
  background: var(--syntro-accent-hover, #d44844);
390
390
  }
391
- `,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),GL=!0}var vI=K(Bo(),1);var Zg=class{constructor(e){$(this,"state");$(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let r=sessionStorage?.getItem("syntro:editor:panel-open");r!==null&&(a=JSON.parse(r))}catch{}this.state={open:a}}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)}},XL=t=>new Zg(t);var cf=K(We(),1),QL=K(Me(),1),YL=(0,cf.createContext)(null);function KL({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,QL.jsx)(YL.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function ps(){let t=(0,cf.useContext)(YL);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Pt=K(We(),1);var lt=K(We(),1),hv=K($s(),1);var Ce={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"},hs="1.0.0";function Ya(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:hs}}function vD(t){return Ya(Ce.CANVAS_OPENED,{surface:t})}function yD(t){return Ya(Ce.CANVAS_CLOSED,{surface:t})}function xD(t,e){return Ya(Ce.TILE_VIEWED,{tileId:t,surface:e})}function bD(t,e){return Ya(Ce.TILE_EXPANDED,{tileId:t,surface:e})}function SD(t,e){return Ya(Ce.TILE_COLLAPSED,{tileId:t,surface:e})}function CD(t,e,a){return Ya(Ce.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function _D(t,e){return Ya(Ce.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function wD(t,e){return Ya(Ce.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function LD(t,e,a){return Ya(Ce.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function ID(t,e,a){return Ya(Ce.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function AD(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ya(a,e)}var au={canvasOpened:vD,canvasClosed:yD,tileViewed:xD,tileExpanded:bD,tileCollapsed:SD,tileAction:CD,overlayStarted:_D,overlayCompleted:wD,overlayDismissed:LD,overlayStepViewed:ID,custom:AD};var Ma=K(Me(),1),JL="syntro-toast-styles",kD=`
391
+ `,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),GL=!0}var vI=K(Bo(),1);var Wg=class{constructor(e){$(this,"state");$(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let r=sessionStorage?.getItem("syntro:editor:panel-open");r!==null&&(a=JSON.parse(r))}catch{}this.state={open:a}}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)}},XL=t=>new Wg(t);var uf=K(We(),1),QL=K(Me(),1),YL=(0,uf.createContext)(null);function KL({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,QL.jsx)(YL.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function ps(){let t=(0,uf.useContext)(YL);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Pt=K(We(),1);var lt=K(We(),1),pv=K($s(),1);var Ce={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"},hs="1.0.0";function Ya(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:hs}}function vD(t){return Ya(Ce.CANVAS_OPENED,{surface:t})}function yD(t){return Ya(Ce.CANVAS_CLOSED,{surface:t})}function xD(t,e){return Ya(Ce.TILE_VIEWED,{tileId:t,surface:e})}function bD(t,e){return Ya(Ce.TILE_EXPANDED,{tileId:t,surface:e})}function SD(t,e){return Ya(Ce.TILE_COLLAPSED,{tileId:t,surface:e})}function CD(t,e,a){return Ya(Ce.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function _D(t,e){return Ya(Ce.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function wD(t,e){return Ya(Ce.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function LD(t,e,a){return Ya(Ce.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function ID(t,e,a){return Ya(Ce.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function AD(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ya(a,e)}var au={canvasOpened:vD,canvasClosed:yD,tileViewed:xD,tileExpanded:bD,tileCollapsed:SD,tileAction:CD,overlayStarted:_D,overlayCompleted:wD,overlayDismissed:LD,overlayStepViewed:ID,custom:AD};var Ma=K(Me(),1),JL="syntro-toast-styles",kD=`
392
392
  @keyframes syntro-toast-slide-in {
393
393
  from { opacity: 0; transform: translateY(12px); }
394
394
  to { opacity: 1; transform: translateY(0); }
@@ -406,10 +406,10 @@ Error generating stack: `+r.message+`
406
406
  .syntro-toast-progress.paused {
407
407
  animation-play-state: paused;
408
408
  }
409
- `;function ED(t){if(t.querySelector(`#${JL}`))return;let e=document.createElement("style");e.id=JL,e.textContent=kD,t.appendChild(e)}function Xg({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=ps();return ED(n),t.length===0?null:(0,Ma.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[r==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Ma.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:i=>{i.currentTarget.style.transform="translateY(-1px)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Ma.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ma.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,Ma.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ma.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,Ma.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,Ma.jsx)("button",{type:"button",onClick:i=>{i.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,Ma.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ma.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Ka=K(We(),1);var Yg=3,Kg=8e3,Qg=3e4;var TD=0;function df(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function RD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Jg(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!RD(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++TD}-${o}`,title:df(n.title,t.props),body:n.body?df(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?df(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function ev(t,e){let[a,r]=(0,Ka.useState)([]),n=(0,Ka.useRef)(new Map),o=(0,Ka.useRef)(new Map),i=(0,Ka.useCallback)(u=>{t?.publish(Ce.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Ka.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(h=>h.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,Ka.useCallback)(u=>{r(d=>{let h=d.find(m=>m.id===u);return h&&i(h),d.filter(m=>m.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Ka.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Jg(c,e);if(!d)return;let{notification:h,rule:m}=d,S=h.itemId?`${h.tileId}:${c.name}:${h.itemId}`:`${h.tileId}:${c.name}`,b=n.current.get(S),x=Date.now(),f=m.cooldown??3e4;b!==void 0&&x-b<f||(n.current.set(S,x),r(g=>{if(h.itemId&&g.some(_=>_.tileId===h.tileId&&_.itemId===h.itemId))return g;let v=[...g,h];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(Ce.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var ff=K(We(),1);function MD(t,e){let a=[];for(let r of t){let n=r.widget.split(":")[0],i=e.get(n)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(r.props??{}))}return a}function tv(t,e,a){let r=(0,ff.useRef)(new Map);(0,ff.useEffect)(()=>{if(!t?.events||!a)return;let n=MD(e,a);if(n.length===0)return;let o=t.state.ns("notified");for(let s of n)if(!r.current.has(s.id)){let l=t.evaluateSync(s.strategy);r.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 n){let l=t.evaluateSync(s.strategy),u=r.current.get(s.id)??!1;r.current.set(s.id,l.value),!u&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):u&&!l.value&&o.remove(s.id)}})},[t,e,a])}var Yt=K(We(),1),eI=K(Me(),1),av=(0,Yt.createContext)({runtime:null,context:null});function rv({runtime:t,children:e}){let[a,r]=(0,Yt.useState)(t?t.context.get():null);(0,Yt.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Yt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,eI.jsx)(av.Provider,{value:n,children:e})}function Vr(){let{runtime:t}=(0,Yt.useContext)(av);return t}function pf(){let{context:t}=(0,Yt.useContext)(av);return t}function nv(){return pf()?.page??null}function DD(){return pf()?.session??null}function OD(){return pf()?.viewport??null}function BD(t,e,a=[]){let r=Vr();(0,Yt.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function FD(){return Vr()?.state??null}function ND(t,e){let a=Vr(),[r,n]=(0,Yt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Yt.useEffect)(()=>{if(!a||!t){n({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||n({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),r}function re(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var PD={colorPrimary:oe[3],colorPrimaryHover:oe[4],colorPrimaryMuted:oe[0],colorBackground:re(I[1],.95),colorBackgroundElevated:re(I[3],.95),colorBackgroundSubtle:re(I[0],.2),colorSurface:re(I[4],.8),colorSurfaceHover:re(I[5],.8),colorText:ha.primary,colorTextSecondary:ha.secondary,colorTextMuted:ha.tertiary,colorTextInverse:I[1],colorBorder:Ag.primary,colorBorderSubtle:Ag.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:Ct[4],colorWarningMuted:Ct[0],colorError:ze[4],colorErrorMuted:ze[0],colorInfo:pa[4],colorInfoMuted:pa[0],colorNotification:oe[4],colorNotificationMuted:re(oe[4],.4),glassBackground:re(I[1],.6),glassBackgroundHover:re(I[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"},HD={colorPrimary:oe[3],colorPrimaryHover:oe[2],colorPrimaryMuted:re(oe[5],.1),colorBackground:re(I[12],.95),colorBackgroundElevated:re(I[11],.95),colorBackgroundSubtle:re(I[0],.02),colorSurface:re(I[11],.6),colorSurfaceHover:re(I[10],.6),colorText:I[1],colorTextSecondary:I[6],colorTextMuted:I[8],colorTextInverse:I[12],colorBorder:re(I[0],.12),colorBorderSubtle:re(I[0],.06),colorSuccess:ke[4],colorSuccessMuted:re(ke[4],.12),colorWarning:Ct[4],colorWarningMuted:re(Ct[4],.12),colorError:ze[4],colorErrorMuted:re(ze[4],.12),colorInfo:pa[4],colorInfoMuted:re(pa[4],.12),colorNotification:oe[3],colorNotificationMuted:re(oe[3],.4),glassBackground:re(I[12],.7),glassBackgroundHover:re(I[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 UD(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var ov={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:oe[3],colorPrimaryHover:oe[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:re(I[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:qd.primary.backgroundDefault,backgroundHover:qd.primary.backgroundHover,color:qd.primary.icon,size:"56px",shadow:`0 8px 32px ${re(I[0],.6)}`,borderRadius:"9999px"},tile:{background:re(I[1],.6),backgroundHover:re(I[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:ha.primary,textColor:ha.secondary,iconBackground:`linear-gradient(135deg, ${oe[3]} 0%, ${oe[3]}cc 100%)`,iconShadow:`0 2px 8px ${oe[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:re(I[1],.6),textColor:ha.primary,titleColor:ha.primary,arrowColor:re(I[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${oe[3]}`},notification:{background:re(I[0],.95),textColor:ha.primary,textSecondaryColor:ha.secondary,border:`1px solid ${I[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:re(oe[3],.15),progressGradient:`linear-gradient(90deg, ${oe[3]}, ${oe[4]})`},content:{background:re(I[3],.8),backgroundHover:re(I[5],.6),border:`1px solid ${re(I[5],.5)}`,borderRadius:"8px",textColor:ha.primary,textSecondaryColor:ha.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:re(I[3],.8),searchColor:ha.primary,chevronColor:"currentColor"}},iv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:oe[3],colorPrimaryHover:oe[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:re(I[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:oe[3],backgroundHover:oe[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:re(I[12],.7),backgroundHover:re(I[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:I[1],textColor:I[6],iconBackground:`linear-gradient(135deg, ${oe[3]} 0%, ${oe[3]}cc 100%)`,iconShadow:`0 2px 8px ${oe[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:re(I[12],.7),textColor:I[1],titleColor:I[1],arrowColor:re(I[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${oe[3]}`},notification:{background:re(I[12],.95),textColor:I[1],textSecondaryColor:I[6],border:`1px solid ${re(I[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:re(oe[3],.1),progressGradient:`linear-gradient(90deg, ${oe[3]}, ${oe[2]})`},content:{background:re(I[12],.8),backgroundHover:re(I[11],.6),border:`1px solid ${I[11]}`,borderRadius:"8px",textColor:I[1],textSecondaryColor:I[6],itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:I[12],searchColor:I[1],chevronColor:"currentColor"}};function sv(t){let e=t.mode==="light"?iv:ov;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},content:{...e.content,...t.content}}}function lv(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?iv:ov;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??r.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??r.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??r.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??r.borderRadius,canvas:{...r.canvas,...t.canvas,...e.canvas},launcher:{...r.launcher,...t.launcher,...e.launcher},tile:{...r.tile,...t.tile,...e.tile},overlay:{...r.overlay,...t.overlay,...e.overlay},notification:{...r.notification,...t.notification,...e.notification},content:{...r.content,...t.content,...e.content}}}var qD=["canvas","launcher","tile","overlay","notification","content"];function uv(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 a of qD){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${UD(n)}`]=o)}return e}var $r=K(We(),1);var aI=K(Me(),1),tI=(0,$r.createContext)(null);function cv({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,$r.useMemo)(()=>a?lv(a,e??{}):sv(e??{}),[e,a]),o=(0,$r.useMemo)(()=>uv(n),[n]);(0,$r.useEffect)(()=>{if(!r)return;let s=r.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",r.insertBefore(s,r.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
409
+ `;function ED(t){if(t.querySelector(`#${JL}`))return;let e=document.createElement("style");e.id=JL,e.textContent=kD,t.appendChild(e)}function Zg({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=ps();return ED(n),t.length===0?null:(0,Ma.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[r==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Ma.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:i=>{i.currentTarget.style.transform="translateY(-1px)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Ma.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ma.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,Ma.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ma.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,Ma.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,Ma.jsx)("button",{type:"button",onClick:i=>{i.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,Ma.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ma.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Ka=K(We(),1);var Xg=3,Yg=8e3,Kg=3e4;var TD=0;function cf(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function RD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Qg(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!RD(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++TD}-${o}`,title:cf(n.title,t.props),body:n.body?cf(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?cf(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Jg(t,e){let[a,r]=(0,Ka.useState)([]),n=(0,Ka.useRef)(new Map),o=(0,Ka.useRef)(new Map),i=(0,Ka.useCallback)(u=>{t?.publish(Ce.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Ka.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(h=>h.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,Ka.useCallback)(u=>{r(d=>{let h=d.find(m=>m.id===u);return h&&i(h),d.filter(m=>m.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Ka.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Qg(c,e);if(!d)return;let{notification:h,rule:m}=d,S=h.itemId?`${h.tileId}:${c.name}:${h.itemId}`:`${h.tileId}:${c.name}`,b=n.current.get(S),x=Date.now(),f=m.cooldown??3e4;b!==void 0&&x-b<f||(n.current.set(S,x),r(g=>{if(h.itemId&&g.some(_=>_.tileId===h.tileId&&_.itemId===h.itemId))return g;let v=[...g,h];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(Ce.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var df=K(We(),1);function MD(t,e){let a=[];for(let r of t){let n=r.widget.split(":")[0],i=e.get(n)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(r.props??{}))}return a}function ev(t,e,a){let r=(0,df.useRef)(new Map);(0,df.useEffect)(()=>{if(!t?.events||!a)return;let n=MD(e,a);if(n.length===0)return;let o=t.state.ns("notified");for(let s of n)if(!r.current.has(s.id)){let l=t.evaluateSync(s.strategy);r.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 n){let l=t.evaluateSync(s.strategy),u=r.current.get(s.id)??!1;r.current.set(s.id,l.value),!u&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):u&&!l.value&&o.remove(s.id)}})},[t,e,a])}var Yt=K(We(),1),eI=K(Me(),1),tv=(0,Yt.createContext)({runtime:null,context:null});function av({runtime:t,children:e}){let[a,r]=(0,Yt.useState)(t?t.context.get():null);(0,Yt.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Yt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,eI.jsx)(tv.Provider,{value:n,children:e})}function Vr(){let{runtime:t}=(0,Yt.useContext)(tv);return t}function ff(){let{context:t}=(0,Yt.useContext)(tv);return t}function rv(){return ff()?.page??null}function DD(){return ff()?.session??null}function OD(){return ff()?.viewport??null}function BD(t,e,a=[]){let r=Vr();(0,Yt.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function FD(){return Vr()?.state??null}function ND(t,e){let a=Vr(),[r,n]=(0,Yt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Yt.useEffect)(()=>{if(!a||!t){n({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||n({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),r}function re(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var PD={colorPrimary:oe[3],colorPrimaryHover:oe[4],colorPrimaryMuted:oe[0],colorBackground:re(I[1],.95),colorBackgroundElevated:re(I[3],.95),colorBackgroundSubtle:re(I[0],.2),colorSurface:re(I[4],.8),colorSurfaceHover:re(I[5],.8),colorText:ha.primary,colorTextSecondary:ha.secondary,colorTextMuted:ha.tertiary,colorTextInverse:I[1],colorBorder:Ig.primary,colorBorderSubtle:Ig.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:Ct[4],colorWarningMuted:Ct[0],colorError:ze[4],colorErrorMuted:ze[0],colorInfo:pa[4],colorInfoMuted:pa[0],colorNotification:oe[4],colorNotificationMuted:re(oe[4],.4),glassBackground:re(I[1],.6),glassBackgroundHover:re(I[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"},HD={colorPrimary:oe[3],colorPrimaryHover:oe[2],colorPrimaryMuted:re(oe[5],.1),colorBackground:re(I[12],.95),colorBackgroundElevated:re(I[11],.95),colorBackgroundSubtle:re(I[0],.02),colorSurface:re(I[11],.6),colorSurfaceHover:re(I[10],.6),colorText:I[1],colorTextSecondary:I[6],colorTextMuted:I[8],colorTextInverse:I[12],colorBorder:re(I[0],.12),colorBorderSubtle:re(I[0],.06),colorSuccess:ke[4],colorSuccessMuted:re(ke[4],.12),colorWarning:Ct[4],colorWarningMuted:re(Ct[4],.12),colorError:ze[4],colorErrorMuted:re(ze[4],.12),colorInfo:pa[4],colorInfoMuted:re(pa[4],.12),colorNotification:oe[3],colorNotificationMuted:re(oe[3],.4),glassBackground:re(I[12],.7),glassBackgroundHover:re(I[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 UD(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var nv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:oe[3],colorPrimaryHover:oe[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:re(I[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:Ud.primary.backgroundDefault,backgroundHover:Ud.primary.backgroundHover,color:Ud.primary.icon,size:"56px",shadow:`0 8px 32px ${re(I[0],.6)}`,borderRadius:"9999px"},tile:{background:re(I[1],.6),backgroundHover:re(I[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:ha.primary,textColor:ha.secondary,iconBackground:`linear-gradient(135deg, ${oe[3]} 0%, ${oe[3]}cc 100%)`,iconShadow:`0 2px 8px ${oe[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:re(I[1],.6),textColor:ha.primary,titleColor:ha.primary,arrowColor:re(I[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${oe[3]}`},notification:{background:re(I[0],.95),textColor:ha.primary,textSecondaryColor:ha.secondary,border:`1px solid ${I[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:re(oe[3],.15),progressGradient:`linear-gradient(90deg, ${oe[3]}, ${oe[4]})`},content:{background:re(I[3],.8),backgroundHover:re(I[5],.6),border:`1px solid ${re(I[5],.5)}`,borderRadius:"8px",textColor:ha.primary,textSecondaryColor:ha.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:re(I[3],.8),searchColor:ha.primary,chevronColor:"currentColor"}},ov={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:oe[3],colorPrimaryHover:oe[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:re(I[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:oe[3],backgroundHover:oe[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:re(I[12],.7),backgroundHover:re(I[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:I[1],textColor:I[6],iconBackground:`linear-gradient(135deg, ${oe[3]} 0%, ${oe[3]}cc 100%)`,iconShadow:`0 2px 8px ${oe[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:re(I[12],.7),textColor:I[1],titleColor:I[1],arrowColor:re(I[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${oe[3]}`},notification:{background:re(I[12],.95),textColor:I[1],textSecondaryColor:I[6],border:`1px solid ${re(I[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:re(oe[3],.1),progressGradient:`linear-gradient(90deg, ${oe[3]}, ${oe[2]})`},content:{background:re(I[12],.8),backgroundHover:re(I[11],.6),border:`1px solid ${I[11]}`,borderRadius:"8px",textColor:I[1],textSecondaryColor:I[6],itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:I[12],searchColor:I[1],chevronColor:"currentColor"}};function iv(t){let e=t.mode==="light"?ov:nv;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},content:{...e.content,...t.content}}}function sv(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?ov:nv;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??r.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??r.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??r.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??r.borderRadius,canvas:{...r.canvas,...t.canvas,...e.canvas},launcher:{...r.launcher,...t.launcher,...e.launcher},tile:{...r.tile,...t.tile,...e.tile},overlay:{...r.overlay,...t.overlay,...e.overlay},notification:{...r.notification,...t.notification,...e.notification},content:{...r.content,...t.content,...e.content}}}var qD=["canvas","launcher","tile","overlay","notification","content"];function lv(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 a of qD){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${UD(n)}`]=o)}return e}var $r=K(We(),1);var aI=K(Me(),1),tI=(0,$r.createContext)(null);function uv({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,$r.useMemo)(()=>a?sv(a,e??{}):iv(e??{}),[e,a]),o=(0,$r.useMemo)(()=>lv(n),[n]);(0,$r.useEffect)(()=>{if(!r)return;let s=r.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",r.insertBefore(s,r.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
410
410
  `);s.textContent=`:host {
411
411
  ${l}
412
- }`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,aI.jsx)(tI.Provider,{value:i,children:t})}function dv(){let t=(0,$r.useContext)(tI);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Ye=K(We(),1);var mf=K(We());var hf=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var rI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var nI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var fv=t=>{let e=nI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var ru=K(We());var oI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var iI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var sI=(0,ru.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,ru.createElement)("svg",{ref:l,...oI,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:hf("lucide",n),...!o&&!iI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,ru.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Tt=(t,e)=>{let a=(0,mf.forwardRef)(({className:r,...n},o)=>(0,mf.createElement)(sI,{ref:o,iconNode:e,className:hf(`lucide-${rI(fv(t))}`,`lucide-${t}`,r),...n}));return a.displayName=fv(t),a};var zD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=Tt("circle-question-mark",zD);var VD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],nu=Tt("compass",VD);var $D=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ou=Tt("file-text",$D);var jD=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],iu=Tt("gamepad-2",jD);var GD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Vn=Tt("layers",GD);var WD=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],su=Tt("message-circle",WD);var ZD=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$n=Tt("sparkles",ZD);var XD=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],lu=Tt("trophy",XD);var pv=K(Me(),1),YD={"\u2753":Qa,"\u{1F9ED}":nu,"\u{1F4DD}":ou,"\u{1F3AF}":Vn,"\u{1F3C6}":lu,"\u2728":$n,"\u{1F4AC}":su,"\u{1F3AE}":iu};function lI({emoji:t,size:e=18,color:a="currentColor"}){let r=YD[t];return r?(0,pv.jsx)(r,{size:e,color:a}):(0,pv.jsx)("span",{children:t})}var Kt=K(Me(),1);function KD({widgetId:t,props:e}){let a=Vr(),r=(0,Ye.useRef)(null),n=(0,Ye.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Ye.useRef)(e);s.current=e;let[,l]=(0,Ye.useReducer)(d=>d+1,0);(0,Ye.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Ye.useEffect)(()=>{if(!r.current||!o||!i)return;let d=document.createElement("div");d.style.width="100%",d.style.minHeight="40px",r.current.appendChild(d);let h=o.mount(t,d,s.current);return n.current=h,()=>{h.unmount(),n.current=null,d.remove()}},[o,t,i]);let u=JSON.stringify(e),c=(0,Ye.useRef)(u);return(0,Ye.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),!o||!o.has(t)?(0,Kt.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Kt.jsx)("div",{ref:r})}function uu({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Ye.useState)(0),c=Vr();(0,Ye.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,Ye.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),h=(0,Ye.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),m=(0,Ye.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,b]=(0,Ye.useState)(!1),x=(0,Ye.useCallback)(()=>b(!0),[]),f=(0,Ye.useCallback)(()=>b(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"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:S?"scale(1.01)":"scale(1)",...r},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,Kt.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:x,onMouseLeave:f,children:[(0,Kt.jsxs)("div",{style:v,children:[(0,Kt.jsx)("div",{style:y,children:(0,Kt.jsx)(lI,{emoji:h,size:m?36:24})}),(0,Kt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Kt.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n??i}),m&&(0,Kt.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m})]})]}),(0,Kt.jsx)("div",{style:{padding:"var(--sc-tile-body-padding, 0 0.75rem 0.5rem)",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Kt.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,Kt.jsx)(KD,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ve=K(Me(),1),uI="syntro-launcher-styles";function QD(t,e){if(t.querySelector(`#${uI}`))return;let a=document.createElement("style");a.id=uI,a.textContent=e,t.appendChild(a)}function cI({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherIcon:n,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:h,displayMode:m="standard"}){let[S,b]=(0,lt.useState)(!1),[x,f]=(0,lt.useState)(null),g=(0,lt.useRef)(null),v=Vr(),{shadowRoot:y,portalRoot:_}=ps(),{config:w}=dv(),{notifications:C,dismiss:L}=ev(v?.events??null,u);tv(v,u,v?.apps);let k=(0,lt.useCallback)(j=>{v&&v.events.publish(Ce.NOTIFICATION_CLICKED,{notificationId:j.id,tileId:j.tileId,itemId:j.itemId}),t||e(),v&&j.tileId&&v.events.publish(Ce.NOTIFICATION_DEEP_LINK,{tileId:j.tileId,itemId:j.itemId}),L(j.id)},[v,t,e,L]),A=(0,lt.useMemo)(()=>`
412
+ }`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,aI.jsx)(tI.Provider,{value:i,children:t})}function cv(){let t=(0,$r.useContext)(tI);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Ye=K(We(),1);var hf=K(We());var pf=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var rI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var nI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var dv=t=>{let e=nI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var ru=K(We());var oI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var iI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var sI=(0,ru.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,ru.createElement)("svg",{ref:l,...oI,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:pf("lucide",n),...!o&&!iI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,ru.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Tt=(t,e)=>{let a=(0,hf.forwardRef)(({className:r,...n},o)=>(0,hf.createElement)(sI,{ref:o,iconNode:e,className:pf(`lucide-${rI(dv(t))}`,`lucide-${t}`,r),...n}));return a.displayName=dv(t),a};var zD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=Tt("circle-question-mark",zD);var VD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],nu=Tt("compass",VD);var $D=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ou=Tt("file-text",$D);var jD=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],iu=Tt("gamepad-2",jD);var GD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Vn=Tt("layers",GD);var WD=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],su=Tt("message-circle",WD);var ZD=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$n=Tt("sparkles",ZD);var XD=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],lu=Tt("trophy",XD);var fv=K(Me(),1),YD={"\u2753":Qa,"\u{1F9ED}":nu,"\u{1F4DD}":ou,"\u{1F3AF}":Vn,"\u{1F3C6}":lu,"\u2728":$n,"\u{1F4AC}":su,"\u{1F3AE}":iu};function lI({emoji:t,size:e=18,color:a="currentColor"}){let r=YD[t];return r?(0,fv.jsx)(r,{size:e,color:a}):(0,fv.jsx)("span",{children:t})}var Kt=K(Me(),1);function KD({widgetId:t,props:e}){let a=Vr(),r=(0,Ye.useRef)(null),n=(0,Ye.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Ye.useRef)(e);s.current=e;let[,l]=(0,Ye.useReducer)(d=>d+1,0);(0,Ye.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Ye.useEffect)(()=>{if(!r.current||!o||!i)return;let d=document.createElement("div");d.style.width="100%",d.style.minHeight="40px",r.current.appendChild(d);let h=o.mount(t,d,s.current);return n.current=h,()=>{h.unmount(),n.current=null,d.remove()}},[o,t,i]);let u=JSON.stringify(e),c=(0,Ye.useRef)(u);return(0,Ye.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),!o||!o.has(t)?(0,Kt.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Kt.jsx)("div",{ref:r})}function uu({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Ye.useState)(0),c=Vr();(0,Ye.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,Ye.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),h=(0,Ye.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),m=(0,Ye.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,b]=(0,Ye.useState)(!1),x=(0,Ye.useCallback)(()=>b(!0),[]),f=(0,Ye.useCallback)(()=>b(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"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:S?"scale(1.01)":"scale(1)",...r},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,Kt.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:x,onMouseLeave:f,children:[(0,Kt.jsxs)("div",{style:v,children:[(0,Kt.jsx)("div",{style:y,children:(0,Kt.jsx)(lI,{emoji:h,size:m?36:24})}),(0,Kt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Kt.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n??i}),m&&(0,Kt.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m})]})]}),(0,Kt.jsx)("div",{style:{padding:"var(--sc-tile-body-padding, 0 0.75rem 0.5rem)",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Kt.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,Kt.jsx)(KD,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ve=K(Me(),1),uI="syntro-launcher-styles";function QD(t,e){if(t.querySelector(`#${uI}`))return;let a=document.createElement("style");a.id=uI,a.textContent=e,t.appendChild(a)}function cI({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherIcon:n,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:h,displayMode:m="standard"}){let[S,b]=(0,lt.useState)(!1),[x,f]=(0,lt.useState)(null),g=(0,lt.useRef)(null),v=Vr(),{shadowRoot:y,portalRoot:_}=ps(),{config:w}=cv(),{notifications:C,dismiss:L}=Jg(v?.events??null,u);ev(v,u,v?.apps);let k=(0,lt.useCallback)(j=>{v&&v.events.publish(Ce.NOTIFICATION_CLICKED,{notificationId:j.id,tileId:j.tileId,itemId:j.itemId}),t||e(),v&&j.tileId&&v.events.publish(Ce.NOTIFICATION_DEEP_LINK,{tileId:j.tileId,itemId:j.itemId}),L(j.id)},[v,t,e,L]),A=(0,lt.useMemo)(()=>`
413
413
  @keyframes syntro-launcher-pulse {
414
414
  0%, 100% {
415
415
  box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${w.colorPrimary}66;
@@ -442,7 +442,7 @@ ${l}
442
442
  .syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
443
443
  .syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
444
444
  .syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
445
- `,[w.colorPrimary,w.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&u.forEach(j=>{if(a?.trackRectangleViewed(j.id,"overlay"),v){let ne=au.tileViewed(j.id,"overlay");v.events.publish(ne.name,ne.props,ne.source)}})},[a,v,t,u]),(0,lt.useEffect)(()=>{b(!0),QD(y,A)},[y,A]);let M=(0,lt.useCallback)(()=>{let j=!t;if(j?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let ne=j?au.canvasOpened("overlay"):au.canvasClosed("overlay");v.events.publish(ne.name,ne.props,ne.source)}e()},[t,a,v,e]),T=(0,lt.useCallback)(j=>{let ne=j.currentTarget.getBoundingClientRect();g.current={startX:j.clientX,startY:j.clientY,startElX:ne.left,startElY:ne.top,dragged:!1},j.currentTarget.setPointerCapture(j.pointerId)},[]),R=(0,lt.useCallback)(j=>{let ne=g.current;if(!ne)return;let At=j.clientX-ne.startX,ln=j.clientY-ne.startY;(Math.abs(At)>5||Math.abs(ln)>5)&&(ne.dragged=!0),ne.dragged&&f({x:ne.startElX+At,y:ne.startElY+ln})},[]),B=(0,lt.useCallback)(j=>{let ne=g.current;g.current=null,ne&&!ne.dragged&&M()},[M]),F=m==="focused",P=w.canvas.position==="right",Y=w.canvas.layout==="push",N=w.canvas.border??"none",W=(0,lt.useRef)(null),Q=2147483600;(0,lt.useEffect)(()=>{if(!Y)return;let j=document.documentElement,ne=P?"marginRight":"marginLeft",At=w.canvas.transitionDuration??"300ms",ln=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Mp=j.style.transition;if(j.style.transition=`${ne} ${At} ${ln}`,t){let Dp=W.current?.offsetWidth??380;j.style[ne]=`${Dp}px`}else j.style[ne]="0px";return()=>{j.style[ne]="",j.style.transition=Mp}},[Y,t,P,w.canvas.transitionDuration,w.canvas.transitionEasing]),(0,lt.useEffect)(()=>{if(!Y||!t)return;let j=W.current;if(!j)return;let ne=P?"marginRight":"marginLeft",At=new ResizeObserver(([ln])=>{document.documentElement.style[ne]=`${ln.contentRect.width}px`});return At.observe(j),()=>At.disconnect()},[Y,t,P]);let aa={display:"flex",flexDirection:"column",width:F?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let j=w.canvas.transitionDuration??"300ms",ne=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${j} ${ne}, opacity ${j} ease-out`:`transform ${j} ${ne}, opacity ${j} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let j=w.canvas.blur??"blur(24px)",ne=F&&j!=="none"?`${j} saturate(1.2)`:j;return{backdropFilter:ne,WebkitBackdropFilter:ne}})(),...(()=>{if(F||N&&N!=="none")return{};let j=w.canvas.transitionFade??"6%",ne=P?`linear-gradient(to right, transparent, black ${j})`:`linear-gradient(to left, transparent, black ${j})`;return{maskImage:ne,WebkitMaskImage:ne}})(),border:N,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":P?"translateX(120%)":"translateX(-120%)"},qt=(0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:Q},children:(0,ve.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:P?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ve.jsxs)("div",{ref:W,"data-shadow-canvas-id":"overlay-container",style:aa,children:[F&&h&&(0,ve.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ve.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:h})}),(0,ve.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,ve.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):d?(0,ve.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",d]}):F?u.length>0?(0,ve.jsx)(uu,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,ve.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(j=>(0,ve.jsx)(uu,{config:j,surface:"overlay",telemetry:a,style:{width:"100%"}},j.id))})}),l]}),(0,ve.jsx)("div",{onClick:M,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ve.jsxs)(ve.Fragment,{children:[(0,hv.createPortal)((0,ve.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:Q+47},children:[(0,ve.jsx)(Xg,{notifications:C,onDismiss:L,onClickNotification:k,position:w.canvas.position??"right"}),(0,ve.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:P?"2.5rem":void 0,left:P?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:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:g.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:g.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:T,onPointerMove:R,onPointerUp:B,onMouseEnter:j=>{g.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:j=>{g.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ve.jsxs)("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:[(0,ve.jsx)("path",{d:"M18 6L6 18"}),(0,ve.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,ve.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ve.jsxs)("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:[(0,ve.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,ve.jsx)("path",{d:"M5 3v4"}),(0,ve.jsx)("path",{d:"M3 5h4"}),(0,ve.jsx)("path",{d:"M19 17v4"}),(0,ve.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ve.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ve.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,ve.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ve.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:C.length>99?"99+":C.length})]})]})]}),_),(0,hv.createPortal)(qt,_)]}):null}var Nt=K(We(),1);var dI=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function fI({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Nt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Nt.useRef)("[]"),l=(0,Nt.useRef)(null),u=(0,Nt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let h=d.tiles||[];h=await a.filterTiles(h),e&&(h=h.filter(m=>e.shouldRenderRectangle(m))),i(m=>({...m,tiles:dI(h)}))},[a,e]),c=(0,Nt.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();X("SmartCanvas Config","Raw config response",d),l.current=d;let h=d.tiles||[];a?(h=await a.filterTiles(h),e&&(h=h.filter(x=>e.shouldRenderRectangle(x)))):e&&(h=h.filter(x=>e.shouldRenderRectangle(x))),X("SmartCanvas Config",`Tile count after filtering: ${h.length}`);let m=d.actions||[],S=JSON.stringify(m),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:dI(h),actions:b?m:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let h=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",h,d),i(m=>({...m,isLoading:!1,error:h}))}},[e,t,a]);return(0,Nt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Nt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Nt.useMemo)(()=>o,[o])}var ms=K(Me(),1);function hI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g}){return u?(0,ms.jsx)(rv,{runtime:u,children:(0,ms.jsx)(pI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g})}):(0,ms.jsx)(pI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g})}function pI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g}){let[v,y]=(0,Pt.useState)(t.getState().open),_=nv(),[w,C]=(0,Pt.useState)(()=>typeof window<"u"?window.location.href:"/"),L=_?.url??w;(0,Pt.useEffect)(()=>{if(u||typeof window>"u")return;let Y=()=>C(window.location.href);window.addEventListener("popstate",Y),window.addEventListener("hashchange",Y);let N=history.pushState,W=history.replaceState;return history.pushState=function(...Q){N.apply(this,Q),queueMicrotask(Y)},history.replaceState=function(...Q){W.apply(this,Q),queueMicrotask(Y)},()=>{window.removeEventListener("popstate",Y),window.removeEventListener("hashchange",Y),history.pushState=N,history.replaceState=W}},[u]);let k=(0,Pt.useMemo)(()=>e||cs({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),A=fI({fetcher:k,experiments:s,runtime:u,pageUrl:L}),M=A.tiles.length>0&&!A.error;(0,Pt.useEffect)(()=>t.subscribe(Y=>y(Y.open)),[t]),(0,Pt.useEffect)(()=>{!A.isLoading&&!M&&t.getState().open&&t.setOpen(!1)},[t,M,A.isLoading]);let T=(0,Pt.useRef)(f??null),R=(0,Pt.useRef)(!!f),B=(0,Pt.useRef)(0);(0,Pt.useEffect)(()=>{if(!u?.actions)return;if(R.current){A.actions.length>0&&(R.current=!1);return}let Y=++B.current,N=()=>Y!==B.current;return(async()=>{if(T.current){try{await T.current.revertAll()}catch(Q){console.error("[SmartCanvasApp] Failed to revert actions:",Q)}T.current=null}if(!N()&&A.actions.length>0)try{let Q=await u.actions.applyBatch(A.actions);N()?await Q.revertAll():T.current=Q}catch(Q){N()||console.error("[SmartCanvasApp] Failed to apply actions:",Q)}})(),()=>{T.current&&(T.current.revertAll().catch(Q=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",Q)}),T.current=null)}},[u,A.actions,L]),(0,Pt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:F}=ps(),P=A.theme;return!A.isLoading&&!M?null:(0,ms.jsx)(cv,{themeConfig:P,workspaceTheme:g,shadowRoot:F,children:(0,ms.jsx)(cI,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:b??A.launcher?.label,launcherIcon:A.launcher?.icon,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,notificationCount:A.launcher?.notificationCount??A.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:A.displayMode})})}var gv=K(Me(),1),mI="smart-canvas",gI=`
445
+ `,[w.colorPrimary,w.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&u.forEach(j=>{if(a?.trackRectangleViewed(j.id,"overlay"),v){let ne=au.tileViewed(j.id,"overlay");v.events.publish(ne.name,ne.props,ne.source)}})},[a,v,t,u]),(0,lt.useEffect)(()=>{b(!0),QD(y,A)},[y,A]);let M=(0,lt.useCallback)(()=>{let j=!t;if(j?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let ne=j?au.canvasOpened("overlay"):au.canvasClosed("overlay");v.events.publish(ne.name,ne.props,ne.source)}e()},[t,a,v,e]),T=(0,lt.useCallback)(j=>{let ne=j.currentTarget.getBoundingClientRect();g.current={startX:j.clientX,startY:j.clientY,startElX:ne.left,startElY:ne.top,dragged:!1},j.currentTarget.setPointerCapture(j.pointerId)},[]),R=(0,lt.useCallback)(j=>{let ne=g.current;if(!ne)return;let At=j.clientX-ne.startX,ln=j.clientY-ne.startY;(Math.abs(At)>5||Math.abs(ln)>5)&&(ne.dragged=!0),ne.dragged&&f({x:ne.startElX+At,y:ne.startElY+ln})},[]),B=(0,lt.useCallback)(j=>{let ne=g.current;g.current=null,ne&&!ne.dragged&&M()},[M]),F=m==="focused",P=w.canvas.position==="right",Y=w.canvas.layout==="push",N=w.canvas.border??"none",W=(0,lt.useRef)(null),Q=2147483600;(0,lt.useEffect)(()=>{if(!Y)return;let j=document.documentElement,ne=P?"marginRight":"marginLeft",At=w.canvas.transitionDuration??"300ms",ln=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Rp=j.style.transition;if(j.style.transition=`${ne} ${At} ${ln}`,t){let Mp=W.current?.offsetWidth??380;j.style[ne]=`${Mp}px`}else j.style[ne]="0px";return()=>{j.style[ne]="",j.style.transition=Rp}},[Y,t,P,w.canvas.transitionDuration,w.canvas.transitionEasing]),(0,lt.useEffect)(()=>{if(!Y||!t)return;let j=W.current;if(!j)return;let ne=P?"marginRight":"marginLeft",At=new ResizeObserver(([ln])=>{document.documentElement.style[ne]=`${ln.contentRect.width}px`});return At.observe(j),()=>At.disconnect()},[Y,t,P]);let aa={display:"flex",flexDirection:"column",width:F?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let j=w.canvas.transitionDuration??"300ms",ne=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${j} ${ne}, opacity ${j} ease-out`:`transform ${j} ${ne}, opacity ${j} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let j=w.canvas.blur??"blur(24px)",ne=F&&j!=="none"?`${j} saturate(1.2)`:j;return{backdropFilter:ne,WebkitBackdropFilter:ne}})(),...(()=>{if(F||N&&N!=="none")return{};let j=w.canvas.transitionFade??"6%",ne=P?`linear-gradient(to right, transparent, black ${j})`:`linear-gradient(to left, transparent, black ${j})`;return{maskImage:ne,WebkitMaskImage:ne}})(),border:N,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":P?"translateX(120%)":"translateX(-120%)"},qt=(0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:Q},children:(0,ve.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:P?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ve.jsxs)("div",{ref:W,"data-shadow-canvas-id":"overlay-container",style:aa,children:[F&&h&&(0,ve.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ve.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:h})}),(0,ve.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,ve.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):d?(0,ve.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",d]}):F?u.length>0?(0,ve.jsx)(uu,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,ve.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(j=>(0,ve.jsx)(uu,{config:j,surface:"overlay",telemetry:a,style:{width:"100%"}},j.id))})}),l]}),(0,ve.jsx)("div",{onClick:M,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ve.jsxs)(ve.Fragment,{children:[(0,pv.createPortal)((0,ve.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:Q+47},children:[(0,ve.jsx)(Zg,{notifications:C,onDismiss:L,onClickNotification:k,position:w.canvas.position??"right"}),(0,ve.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:P?"2.5rem":void 0,left:P?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:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:g.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:g.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:T,onPointerMove:R,onPointerUp:B,onMouseEnter:j=>{g.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:j=>{g.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ve.jsxs)("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:[(0,ve.jsx)("path",{d:"M18 6L6 18"}),(0,ve.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,ve.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ve.jsxs)("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:[(0,ve.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,ve.jsx)("path",{d:"M5 3v4"}),(0,ve.jsx)("path",{d:"M3 5h4"}),(0,ve.jsx)("path",{d:"M19 17v4"}),(0,ve.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ve.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ve.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,ve.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ve.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:C.length>99?"99+":C.length})]})]})]}),_),(0,pv.createPortal)(qt,_)]}):null}var Nt=K(We(),1);var dI=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function fI({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Nt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Nt.useRef)("[]"),l=(0,Nt.useRef)(null),u=(0,Nt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let h=d.tiles||[];h=await a.filterTiles(h),e&&(h=h.filter(m=>e.shouldRenderRectangle(m))),i(m=>({...m,tiles:dI(h)}))},[a,e]),c=(0,Nt.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();X("SmartCanvas Config","Raw config response",d),l.current=d;let h=d.tiles||[];a?(h=await a.filterTiles(h),e&&(h=h.filter(x=>e.shouldRenderRectangle(x)))):e&&(h=h.filter(x=>e.shouldRenderRectangle(x))),X("SmartCanvas Config",`Tile count after filtering: ${h.length}`);let m=d.actions||[],S=JSON.stringify(m),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:dI(h),actions:b?m:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let h=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",h,d),i(m=>({...m,isLoading:!1,error:h}))}},[e,t,a]);return(0,Nt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Nt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Nt.useMemo)(()=>o,[o])}var ms=K(Me(),1);function hI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g}){return u?(0,ms.jsx)(av,{runtime:u,children:(0,ms.jsx)(pI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g})}):(0,ms.jsx)(pI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g})}function pI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:g}){let[v,y]=(0,Pt.useState)(t.getState().open),_=rv(),[w,C]=(0,Pt.useState)(()=>typeof window<"u"?window.location.href:"/"),L=_?.url??w;(0,Pt.useEffect)(()=>{if(u||typeof window>"u")return;let Y=()=>C(window.location.href);window.addEventListener("popstate",Y),window.addEventListener("hashchange",Y);let N=history.pushState,W=history.replaceState;return history.pushState=function(...Q){N.apply(this,Q),queueMicrotask(Y)},history.replaceState=function(...Q){W.apply(this,Q),queueMicrotask(Y)},()=>{window.removeEventListener("popstate",Y),window.removeEventListener("hashchange",Y),history.pushState=N,history.replaceState=W}},[u]);let k=(0,Pt.useMemo)(()=>e||cs({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),A=fI({fetcher:k,experiments:s,runtime:u,pageUrl:L}),M=A.tiles.length>0&&!A.error;(0,Pt.useEffect)(()=>t.subscribe(Y=>y(Y.open)),[t]),(0,Pt.useEffect)(()=>{!A.isLoading&&!M&&t.getState().open&&t.setOpen(!1)},[t,M,A.isLoading]);let T=(0,Pt.useRef)(f??null),R=(0,Pt.useRef)(!!f),B=(0,Pt.useRef)(0);(0,Pt.useEffect)(()=>{if(!u?.actions)return;if(R.current){A.actions.length>0&&(R.current=!1);return}let Y=++B.current,N=()=>Y!==B.current;return(async()=>{if(T.current){try{await T.current.revertAll()}catch(Q){console.error("[SmartCanvasApp] Failed to revert actions:",Q)}T.current=null}if(!N()&&A.actions.length>0)try{let Q=await u.actions.applyBatch(A.actions);N()?await Q.revertAll():T.current=Q}catch(Q){N()||console.error("[SmartCanvasApp] Failed to apply actions:",Q)}})(),()=>{T.current&&(T.current.revertAll().catch(Q=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",Q)}),T.current=null)}},[u,A.actions,L]),(0,Pt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:F}=ps(),P=A.theme;return!A.isLoading&&!M?null:(0,ms.jsx)(uv,{themeConfig:P,workspaceTheme:g,shadowRoot:F,children:(0,ms.jsx)(cI,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:b??A.launcher?.label,launcherIcon:A.launcher?.icon,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,notificationCount:A.launcher?.notificationCount??A.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:A.displayMode})})}var mv=K(Me(),1),mI="smart-canvas",gI=`
446
446
  :host {
447
447
  font: inherit;
448
448
  color: inherit;
@@ -456,12 +456,12 @@ ${l}
456
456
  *, *::before, *::after {
457
457
  box-sizing: border-box;
458
458
  }
459
- `,Da,jn,Gn,jr,Gr,Wn,Wr,mv=class extends HTMLElement{constructor(){super();cn(this,Da);cn(this,jn);cn(this,Gn);cn(this,jr);cn(this,Gr);cn(this,Wn,null);cn(this,Wr,null);ar(this,Da,this.attachShadow({mode:"open",delegatesFocus:!0})),ar(this,jn,document.createElement("div")),ge(this,jn).setAttribute("part","mount"),ge(this,Da).appendChild(ge(this,jn)),ar(this,Gn,document.createElement("div")),ge(this,Gn).id="portalRoot",ge(this,Da).appendChild(ge(this,Gn)),ar(this,jr,document.createElement("div")),ge(this,jr).id="overlayContainer",Object.assign(ge(this,jr).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,Da).appendChild(ge(this,jr)),ar(this,Gr,XL()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Wn)?.unmount(),ar(this,Wn,null)}getMountNode(){return ge(this,jn)}getController(){return ge(this,Gr)}getPortalRoot(){return ge(this,Gn)}getOverlayContainer(){return ge(this,jr)}getShadowRoot(){return ge(this,Da)}open(){ge(this,Gr).setOpen(!0)}close(){ge(this,Gr).setOpen(!1)}toggle(){ge(this,Gr).toggle()}setOverrideFetcher(a){ge(this,Wr)&&(ar(this,Wr,{...ge(this,Wr),fetcher:a}),this.render())}mountReactApp(a){ar(this,Wr,a),this.render()}render(){!this.isConnected||!ge(this,Wr)||(ge(this,Wn)||ar(this,Wn,(0,vI.createRoot)(ge(this,jn))),ge(this,Wn).render((0,gv.jsx)(KL,{shadowRoot:ge(this,Da),portalRoot:ge(this,Gn),overlayContainer:ge(this,jr),children:(0,gv.jsx)(hI,{...ge(this,Wr),controller:ge(this,Gr),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Da).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(gI),ge(this,Da).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=gI,ge(this,Da).appendChild(a)}}};Da=new WeakMap,jn=new WeakMap,Gn=new WeakMap,jr=new WeakMap,Gr=new WeakMap,Wn=new WeakMap,Wr=new WeakMap;var yI=()=>{typeof window>"u"||customElements.get(mI)||customElements.define(mI,mv)};var vv=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=NL(x)}let a=null,r=null,n=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(x))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();a=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,g)=>`[${g}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await i(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&uf(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=zL();yI();let u=document.createElement("smart-canvas");if(WL(u.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))u.style.setProperty(x,f);let c=()=>{let x=t.target??document.body;x&&x.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),VL(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,m=t.fetcher??cs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=m);let S={fetcher:m,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:n,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:x=>{for(let[f,g]of Object.entries(x))u.style.setProperty(f,g)},getConfig:async()=>{if(r)try{let x=await r();return a=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?a&&await i(a.actions):await s()},setOverrideFetcher:x=>{r=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&uf(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{h?.register?.(x)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(x,f)=>h?.track?(h.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 vv(t)}});var Xn=K(We(),1);var Zn=K(Me(),1);function Bq({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,Xn.useState)(0),o=(0,Xn.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,Xn.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,Xn.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,Xn.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,Zn.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,Zn.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Zn.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Zn.jsx)(uu,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Zn.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Zn.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===r?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>n(s)},i.id))})]}):null}function cu(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function Pq(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let r=t;if(r.tiles||a.push("Config missing required field: tiles"),r.actions||a.push("Config missing required field: actions"),r.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let n=r.schemaVersion||"1.0",o=cu(n),i=cu(qn);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${qn}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!r.schemaVersion?(e.push(`Config schema v${n} is older than SDK v${qn}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:JD(r,n)}):{valid:!0,warnings:e,errors:a}}function JD(t,e){let a={...t};return cu(e).major===1&&(a=eO(a)),a.schemaVersion=qn,a}function eO(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(a=>{let r={...a};return a.experiment&&delete r.experiment,r})),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 Hq(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=cu(a),n=cu(qn);return r.major<n.major||!e.schemaVersion}var bI={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function SI(){return bI}function yv(t){let e=2166136261,a=t.length;for(let r=0;r<a;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function du(t,e,a){return a===2?yv(yv(t+e)+"")%1e4/1e4:a===1?yv(e+t)%1e3/1e3:null}function tO(t){return t<=0?[]:new Array(t).fill(1/t)}function gf(t,e){return t>=e[0]&&t<e[1]}function CI(t,e){let a=du("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function _I(t,e){for(let a=0;a<e.length;a++)if(gf(t,e[a]))return a;return-1}function bv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function vf(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=nO(t,e[n].type,e[n].pattern);if(e[n].include===!1){if(o)return!1}else a=!0,o&&(r=!0)}return r||!a}function aO(t,e,a){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function rO(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&r.push([t.hash,a.hash,!1]),a.searchParams.forEach((n,o)=>{r.push([t.searchParams.get(o)||"",n,!1])}),!r.some(n=>!aO(n[0],n[1],n[2]))}catch{return!1}}function nO(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=bv(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return rO(r,a);return!1}catch{return!1}}function wI(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=tO(t);a=a||r,a.length!==t&&(a=r);let n=a.reduce((i,s)=>s+i,0);(n<.99||n>1.01)&&(a=r);let o=0;return a.map(i=>{let s=o;return o+=i,[s,s+e*i]})}function LI(t,e,a){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let n=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return n.length>0&&n[0]>=0&&n[0]<a?n[0]:null}function II(t){try{return t()}catch(e){return console.error(e),!1}}var xv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function $o(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||bI.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",xv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:xv(n)},r,xv(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function fu(t){return typeof t=="string"?t:JSON.stringify(t)}function va(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(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function AI(){let t;try{t="1.6.4"}catch{t=""}return t}function kI(t,e){let a,r;try{a=new URL(t),r=new URL(e)}catch(n){return console.error(`Unable to merge query strings: ${n}`),e}return a.searchParams.forEach((n,o)=>{r.searchParams.has(o)||r.searchParams.set(o,n)}),r.toString()}function xI(t){return typeof t=="object"&&t!==null}function yf(t){return t.urlPatterns&&t.variations.some(e=>xI(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>xI(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function xf(t,e){return new Promise(a=>{let r=!1,n,o=i=>{r||(r=!0,n&&clearTimeout(n),a(i||null))};e&&(n=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},dr=SI(),gs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>dr.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:r})=>{let n={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(a)};return dr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new dr.EventSource(`${t}/sub/${e}`,{headers:a}):new dr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),sO()):document.visibilityState==="hidden"&&(t=window.setTimeout(iO,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(dr.localStorage=globalThis.localStorage)}catch{}var vs=new Map,EI=!1,Zr=new Map,bf=new Map,ys=new Map,xs=new Set;function RI(t){Object.assign(Rt,t),Rt.backgroundSync||Iv()}async function MI({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Rt.backgroundSync=!1),lO({instance:t,allowStale:r,timeout:e,skipCache:a})}function oO(t){let e=pu(t),a=vs.get(e)||new Set;a.add(t),vs.set(e,a)}function DI(t){vs.forEach(e=>e.delete(t))}function iO(){ys.forEach(t=>{t&&(t.state="idle",wv(t))})}function sO(){ys.forEach(t=>{t&&t.state==="idle"&&Lv(t)})}async function TI(){try{if(!dr.localStorage)return;await dr.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(Zr.entries())))}catch{}}async function lO({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=pu(t),o=Cv(t),i=new Date,s=new Date(i.getTime()-Rt.maxAge+Rt.staleTTL);await uO();let l=!Rt.disableCache&&!r?Zr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&xs.add(n),l.staleAt<i?Sv(t):_v(t),{data:l.data,success:!0,source:"cache"}):await xf(Sv(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function pu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function Cv(t){let e=pu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),n={};r.forEach(s=>{n[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:n,fv:o,url:i})}`}async function uO(){if(!EI){EI=!0;try{if(dr.localStorage){let t=await dr.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Zr.set(a,{...r,staleAt:new Date(r.staleAt)})}),OI()}}}catch{}if(!Rt.disableIdleStreams){let t=gs.startIdleListener();t&&(gs.stopIdleListener=t)}}}function OI(){let t=Array.from(Zr.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Zr.size-Rt.maxEntries),Zr.size);for(let a=0;a<e;a++)Zr.delete(t[a].key)}function BI(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:Zr.get(e);if(o&&r&&o.version===r){o.staleAt=n,TI();return}Rt.disableCache||(Zr.set(e,{data:a,version:r,staleAt:n,sse:xs.has(t)}),OI()),TI();let i=vs.get(t);i&&i.forEach(s=>cO(s,a))}async function cO(t,e){await t.setPayload(e||t.getPayload())}async function Sv(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=pu(t),i=Cv(t),s=bf.get(i);return s||(s=(n?gs.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):gs.fetchFeaturesCall({host:e,clientKey:r,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&xs.add(o),u.json()}).then(u=>(BI(o,i,u),_v(t),bf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(bf.delete(i),{data:null,source:"error",success:!1,error:u})),bf.set(i,s)),s}function _v(t,e=!1){let a=pu(t),r=Cv(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&xs.add(a),Rt.backgroundSync&&xs.has(a)&&dr.EventSource){if(ys.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=vs.get(a);u&&u.forEach(c=>{Sv(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);BI(a,r,u)}s.errors=0}catch{FI(s)}},errors:0,state:"active"};ys.set(a,s),Lv(s)}}function FI(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);wv(t),setTimeout(()=>{["idle","active"].includes(t.state)||Lv(t)},Math.min(e,3e5))}}function wv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Lv(t){t.src=gs.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=()=>FI(t),t.src.onopen=()=>{t.errors=0}}function dO(t,e){wv(t),ys.delete(e)}function Iv(){xs.clear(),ys.forEach(dO),vs.clear(),gs.stopIdleListener()}function Sf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&_v(t,!0),oO(t)}}var fO=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ev={revert:function(){}},Lf=new Map,Tv=new Set;function pO(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function If(t){var e=Lf.get(t);return e||(e={element:t,attributes:{}},Lf.set(t,e)),e}function Af(t,e,a,r,n){var o=a(t),i={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&i._positionTimeout)){e==="position"&&(i._positionTimeout=setTimeout(function(){i._positionTimeout=null},1e3));var s=a(t);e==="position"&&s.parentNode===i.virtualValue.parentNode&&s.insertBeforeNode===i.virtualValue.insertBeforeNode||s!==i.virtualValue&&(i.originalValue=s,n(i))}}),mutationRunner:n,setValue:r,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,pO(e)),i}function kf(t,e){var a=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!a||t.parentNode!==a.parentNode||t.insertBeforeNode!==a.insertBeforeNode)&&(e.isDirty=!0,NI()):t!==a&&(e.isDirty=!0,NI())}function hO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),kf(kO(e),t)}function mO(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),kf(Array.from(e).filter(Boolean).join(" "),t)}function gO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),kf(e,t)}function vO(t){var e=t.parentSelector,a=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var n=a?document.querySelector(a):null;return a&&!n?null:{parentNode:r,insertBeforeNode:n}}function yO(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=vO(r);e=n||e}),kf(e,t)}var xO=function(e){return e.innerHTML},bO=function(e,a){return e.innerHTML=a};function HI(t){var e=If(t);return e.html||(e.html=Af(t,"html",xO,bO,hO)),e.html}var SO=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},CO=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function UI(t){var e=If(t);return e.position||(e.position=Af(t,"position",SO,CO,yO)),e.position}var _O=function(e,a){return a?e.className=a:e.removeAttribute("class")},wO=function(e){return e.className};function qI(t){var e=If(t);return e.classes||(e.classes=Af(t,"class",wO,_O,mO)),e.classes}var LO=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},IO=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function zI(t,e){var a=If(t);return a.attributes[e]||(a.attributes[e]=Af(t,e,LO(e),IO(e),gO)),a.attributes[e]}function AO(t,e){var a=Lf.get(t);if(a)if(e==="html"){var r,n;(r=a.html)==null||(n=r.observer)==null||n.disconnect(),delete a.html}else if(e==="class"){var o,i;(o=a.classes)==null||(i=o.observer)==null||i.disconnect(),delete a.classes}else if(e==="position"){var s,l;(s=a.position)==null||(l=s.observer)==null||l.disconnect(),delete a.position}else{var u,c,d;(u=a.attributes)==null||(c=u[e])==null||(d=c.observer)==null||d.disconnect(),delete a.attributes[e]}}var Cf;function kO(t){return Cf||(Cf=document.createElement("div")),Cf.innerHTML=t,Cf.innerHTML}function _f(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||AO(t,e),a.setValue(t,r)}}function EO(t,e){t.html&&_f(e,"html",t.html),t.classes&&_f(e,"class",t.classes),t.position&&_f(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){_f(e,a,t.attributes[a])})}function NI(){Lf.forEach(EO)}function TO(t,e){var a=null;t.kind==="html"?a=HI(e):t.kind==="class"?a=qI(e):t.kind==="attribute"?a=zI(e,t.attribute):t.kind==="position"&&(a=UI(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function RO(t,e){var a=null;if(t.kind==="html"?a=HI(e):t.kind==="class"?a=qI(e):t.kind==="attribute"?a=zI(e,t.attribute):t.kind==="position"&&(a=UI(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function VI(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(r){e.has(r)||(t.elements.add(r),TO(t,r))})}}function MO(t){t.elements.forEach(function(e){return RO(t,e)}),t.elements.clear(),Tv.delete(t)}function PI(){Tv.forEach(VI)}var Av;function DO(){typeof document>"u"||(Av||(Av=new MutationObserver(function(){PI()})),PI(),Av.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}DO();function Ef(t){return typeof document>"u"?Ev:(Tv.add(t),VI(t),{revert:function(){MO(t)}})}function kv(t,e){return Ef({kind:"html",elements:new Set,mutate:e,selector:t})}function $I(t,e){return Ef({kind:"position",elements:new Set,mutate:e,selector:t})}function hu(t,e){return Ef({kind:"class",elements:new Set,mutate:e,selector:t})}function wf(t,e,a){return fO.test(e)?e==="class"||e==="className"?hu(t,function(r){var n=a(Array.from(r).join(" "));r.clear(),n&&n.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):Ef({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):Ev}function OO(t){var e=t.selector,a=t.action,r=t.value,n=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(n==="html"){if(a==="append")return kv(e,function(s){return s+(r??"")});if(a==="set")return kv(e,function(){return r??""})}else if(n==="class"){if(a==="append")return hu(e,function(s){r&&s.add(r)});if(a==="remove")return hu(e,function(s){r&&s.delete(r)});if(a==="set")return hu(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return $I(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return wf(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return wf(e,n,function(){return r??""});if(a==="remove")return wf(e,n,function(){return null})}return Ev}var BO={html:kv,classes:hu,attribute:wf,position:$I,declarative:OO},jI=BO;var Rv={};function Yn(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!ZI(t,n,a))return!1;break;case"$nor":if(ZI(t,n,a))return!1;break;case"$and":if(!UO(t,n,a))return!1;break;case"$not":if(Yn(t,n,a))return!1;break;default:if(!mu(n,FO(t,r),a))return!1}return!0}function FO(t,e){let a=e.split("."),r=t;for(let n=0;n<a.length;n++)if(r&&typeof r=="object"&&a[n]in r)r=r[a[n]];else return null;return r}function GI(t,e=!1){let a=`${t}${e?"/i":""}`;return Rv[a]||(Rv[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Rv[a]}function mu(t,e,a,r=!1){if(typeof t=="string")return r?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)||!XI(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!HO(n,e,t[n],a))return!1;return!0}function XI(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function NO(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 PO(t,e,a){if(!Array.isArray(t))return!1;let r=XI(e)?n=>mu(e,n,a):n=>Yn(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function bs(t,e,a=!1){if(a){let r=n=>typeof n=="string"?n.toLowerCase():n;return Array.isArray(t)?t.some(n=>e.some(o=>r(n)===r(o))):e.some(n=>r(t)===r(n))}return Array.isArray(t)?t.some(r=>e.includes(r)):e.includes(t)}function WI(t,e,a,r=!1){if(!Array.isArray(t))return!1;for(let n=0;n<e.length;n++){let o=!1;for(let i=0;i<t.length;i++)if(mu(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function HO(t,e,a,r){switch(t){case"$veq":return va(e)===va(a);case"$vne":return va(e)!==va(a);case"$vgt":return va(e)>va(a);case"$vgte":return va(e)>=va(a);case"$vlt":return va(e)<va(a);case"$vlte":return va(e)<=va(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?bs(e,a):!1;case"$ini":return Array.isArray(a)?bs(e,a,!0):!1;case"$inGroup":return bs(e,r[a]||[]);case"$notInGroup":return!bs(e,r[a]||[]);case"$nin":return Array.isArray(a)?!bs(e,a):!1;case"$nini":return Array.isArray(a)?!bs(e,a,!0):!1;case"$not":return!mu(a,e,r);case"$size":return Array.isArray(e)?mu(a,e.length,r):!1;case"$elemMatch":return PO(e,a,r);case"$all":return Array.isArray(a)?WI(e,a,r):!1;case"$alli":return Array.isArray(a)?WI(e,a,r,!0):!1;case"$regex":try{return GI(a).test(e)}catch{return!1}case"$regexi":try{return GI(a,!0).test(e)}catch{return!1}case"$type":return NO(e)===a;default:return console.error("Unknown operator: "+t),!1}}function ZI(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Yn(t,e[r],a))return!0;return!1}function UO(t,e,a){for(let r=0;r<e.length;r++)if(!Yn(t,e[r],a))return!1;return!0}var qO="Feature Evaluated",zO="Experiment Viewed";function VO(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),e}function $O(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 Ss(t){try{await t()}catch{}}function YI(t,e,a){if(t.user.trackedExperiments){let n=Mf(e,a);if(t.user.trackedExperiments.has(n))return[];t.user.trackedExperiments.add(n)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:a,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let n=t.global.trackingCallback;r.push(Ss(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Ss(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Ss(()=>n(zO,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function jO(t,e,a){if(t.user.trackedFeatureUsage){let r=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:a,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;Ss(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Ss(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Ss(()=>r(qO,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function Tf(t,e){if(e.stack.evaluatedFeatures.has(t))return Kn(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=VO(e);if(a.has(t))return Kn(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return Kn(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let n=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(n);let u=Tf(l.id,e);if(u.source==="cyclicPrerequisite")return Kn(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Yn(c,l.condition||{})){if(l.gate)return Kn(e,t,null,"prerequisite");continue e}}if(o.filters&&JI(o.filters,e))continue;if("force"in o){if(o.condition&&!QI(o.condition,e)||!GO(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=>{!YI(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Kn(e,t,o.force,"force",o.id)}if(!o.variations)continue;let i={variations:o.variations,key:o.key||t};"coverage"in o&&(i.coverage=o.coverage),o.weights&&(i.weights=o.weights),o.hashAttribute&&(i.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(i.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(i.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(i.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(i.minBucketVersion=o.minBucketVersion),o.namespace&&(i.namespace=o.namespace),o.meta&&(i.meta=o.meta),o.ranges&&(i.ranges=o.ranges),o.name&&(i.name=o.name),o.phase&&(i.phase=o.phase),o.seed&&(i.seed=o.seed),o.hashVersion&&(i.hashVersion=o.hashVersion),o.filters&&(i.filters=o.filters),o.condition&&(i.condition=o.condition);let{result:s}=Rf(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return Kn(e,t,s.value,"experiment",o.id,i,s)}}return Kn(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Rf(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:$e(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:$e(a,t,-1,!1,e)};if(t=WO(t,a),t.urlPatterns&&!vf(a.user.url||"",t.urlPatterns))return{result:$e(a,t,-1,!1,e)};let o=LI(r,a.user.url||"",n);if(o!==null)return{result:$e(a,t,o,!1,e)};let i=$O(a);if(r in i){let x=i[r];return{result:$e(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:$e(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=jo(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:$e(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=YO({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,d=!!f}if(!c){if(t.filters){if(JI(t.filters,a))return{result:$e(a,t,-1,!1,e)}}else if(t.namespace&&!CI(l,t.namespace))return{result:$e(a,t,-1,!1,e)};if(t.include&&!II(t.include))return{result:$e(a,t,-1,!1,e)};if(t.condition&&!QI(t.condition,a))return{result:$e(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let f of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let g=Tf(f.id,a);if(g.source==="cyclicPrerequisite")return{result:$e(a,t,-1,!1,e)};let v={value:g.value};if(!Yn(v,f.condition||{}))return{result:$e(a,t,-1,!1,e)}}}if(t.groups&&!XO(t.groups,a))return{result:$e(a,t,-1,!1,e)}}if(t.url&&!ZO(t.url,a))return{result:$e(a,t,-1,!1,e)};let h=du(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:$e(a,t,-1,!1,e)};if(!c){let x=t.ranges||wI(n,t.coverage===void 0?1:t.coverage,t.weights);u=_I(h,x)}if(d)return{result:$e(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:$e(a,t,-1,!1,e)};if("force"in t)return{result:$e(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:$e(a,t,-1,!1,e)};if(t.status==="stopped")return{result:$e(a,t,-1,!1,e)};let m=$e(a,t,u,!0,e,h,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:g}=QO(a,s,fu(l),{[Mv(t.key,t.bucketVersion)]:m.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[f]=g,a.user.saveStickyBucketAssignmentDoc(g))}let S=YI(a,t,m);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:m});let b=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:m,trackingCall:b}}function Kn(t,e,a,r,n,o,i){let s={value:a,on:!!a,off:!a,source:r,ruleId:n||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),r!=="override"&&jO(t,e,s),s}function KI(t){return{...t.user.attributes,...t.user.attributeOverrides}}function QI(t,e){return Yn(KI(e),t,e.global.savedGroups||{})}function JI(t,e){return t.some(a=>{let{hashValue:r}=jo(e,a.attribute);if(!r)return!0;let n=du(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>gf(n,o))})}function GO(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=jo(t,a,r);if(!s)return!1;let l=du(e,s,i||1);return l===null?!1:n?gf(l,n):o!==void 0?l<=o:!0}function $e(t,e,a,r,n,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=jo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:n,inExperiment:s,hashUsed:r,variationId:a,value:e.variations[a],hashAttribute:l,hashValue:u,stickyBucketUsed:!!i};return c.name&&(d.name=c.name),o!==void 0&&(d.bucket=o),c.passthrough&&(d.passthrough=c.passthrough),d}function WO(t,e){let a=t.key,r=e.global.overrides;return r&&r[a]&&(t=Object.assign({},t,r[a]),typeof t.url=="string"&&(t.url=bv(t.url))),t}function jo(t,e,a){let r=e||"id",n="",o=KI(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function ZO(t,e){let a=e.user.url;if(!a)return!1;let r=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(r))}function XO(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function YO({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:r,expFallbackAttribute:n,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,r=r||"id",i=i||[];let s=Mv(e,a),l=KO(t,r,n);if(o>0)for(let d=0;d<o;d++){let h=Mv(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[s];if(u===void 0)return{variation:-1};let c=i.findIndex(d=>d.key===u);return c<0?{variation:-1}:{variation:c}}function Mv(t,e){return e=e||0,`${t}__${e}`}function Dv(t,e){return`${t}||${e}`}function KO(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=jo(t,e),o=Dv(r,fu(n)),{hashAttribute:i,hashValue:s}=jo(t,a),l=s?Dv(i,fu(s)):null,u={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[o].assignments||{}),u}function QO(t,e,a,r){let n=Dv(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[n]?t.user.stickyBucketAssignmentDocs[n].assignments||{}:{},i={...o,...r},s=JSON.stringify(o)!==JSON.stringify(i);return{key:n,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function JO(t,e){let a=new Set,r=e&&e.features?e.features:t.global.features||{},n=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let i=r[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),n.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function e1(t,e,a){let r=Ov(t,a);return e.getAllAssignments(r)}function Ov(t,e){let a={};return JO(t,e).forEach(n=>{let{hashValue:o}=jo(t,n);a[n]=fu(o)}),a}async function t1(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await $o(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await $o(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await $o(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function a1(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 Mf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Cs=typeof window<"u"&&typeof document<"u",eB=AI(),gu=class{constructor(e){if(e=e||{},this.version=eB,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 a=!1;try{a=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(a)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 a=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>a.saveAssignments(r)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),Cs&&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 a in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[a];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let a=await t1(e,this._options.decryptionKey);this._decryptedPayload=a,await this.refreshStickyBuckets(a),a.features&&(this._options.features=a.features),a.savedGroups&&(this._options.savedGroups=a.savedGroups),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let a=e.payload;if(a.encryptedExperiments||a.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,a)),this._payload=a,this._decryptedPayload=a,a.features&&(this._options.features=a.features),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,Sf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&RI(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Sf(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return Sf(this,e),await this.setPayload(a||{}),r}}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 a=await this._refresh({...e||{},allowStale:!1});a.data&&await this.setPayload(a.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return a1(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:a,allowStale:r,streaming:n}){if(!this._options.clientKey)throw new Error("Missing clientKey");return MI({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:r,backgroundSync:n??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,a,r){let n=await $o(e,a||this._options.decryptionKey,r);this.setFeatures(JSON.parse(n))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,r){let n=await $o(e,a||this._options.decryptionKey,r);this.setExperiments(JSON.parse(n))}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(a=>{try{a()}catch(r){console.error(r)}}),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,DI(this),e.destroyAllStreams&&Iv(),this.logs=[],Cs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(a=>{a.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,a){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=a,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:a}=Rf(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==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,a){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let n=this._isAutoExperimentBlockedByContext(e),o,i;n?o=$e(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=Rf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&r&&r.valueHash===s)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=yf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?kI(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(vf(u,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=u;let{navigate:c,delay:d}=this._getNavigateFunction();if(c)if(Cs)Promise.all([...i?[xf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(h){console.error(h)}});else try{c(u)}catch(h){console.error(h)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let a=this._activeAutoExperiments.get(e);a&&(a.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let a=this._options.experiments||[],r=new Set(a);this._activeAutoExperiments.forEach((n,o)=>{r.has(o)||(n.undo(),this._activeAutoExperiments.delete(o))});for(let n of a){let o=this._runAutoExperiment(n,e);if(o&&o.inExperiment&&yf(n)==="redirect")break}}_onExperimentEval(e,a){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,r)}_fireSubscriptions(e,a,r){(!r||r.result.inExperiment!==a.inExperiment||r.result.variationId!==a.variationId)&&this._subscriptions.forEach(n=>{try{n(e,a)}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,a){let r=this.evalFeature(e).value;return r===null?a:r}feature(e){return this.evalFeature(e)}evalFeature(e){return Tf(e,this._getEvalContext())}log(e,a){this.debug&&(this._options.log?this._options.log(e,a):console.log(e,a))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(a=>a&&a.experiment&&a.result).map(a=>[Mf(a.experiment,a.result),a]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(a=>{!a||!a.experiment||!a.result?console.error("Invalid deferred tracking call",{call:a}):e.push(this._options.trackingCallback(a.experiment,a.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,a){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:a,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,a||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Mf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Cs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=yf(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let n of e.variations){if(!n||!n.urlRedirect)continue;let o=new URL(n.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!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}:Cs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Cs)return;let a=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),a.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),a.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{a.push(jI.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await e1(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),n=Ov(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var tB="https://experiment.syntrologie.com",Bv=class{constructor(e={}){$(this,"gb");$(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(r,n)=>{e.onExperimentViewed(r.key,n.variationId,typeof n.value=="string"?n.value:`variation_${n.variationId}`)}:void 0;this.gb=new gu({...e,apiHost:e.apiHost??tB,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),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,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let r of Object.keys(e))a[r]=this.gb.getFeatureValue(r,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function Fv(t={}){return new Bv(t)}var r1="syntro_session_metrics",Df=class{constructor(e={}){$(this,"metrics",new Map);$(this,"experiments");$(this,"attributePrefix");$(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let n=(this.metrics.get(e)??0)+a;return this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n),n}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}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 a={};for(let r of e)a[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,r]of this.metrics)e[`${this.attributePrefix}${a}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(r1);if(e){let a=JSON.parse(e);for(let[r,n]of Object.entries(a))this.metrics.set(r,n.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[a,r]of this.metrics)e[a]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(r1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Nv(t={}){return new Df(t)}var p={};DE(p,{BRAND:()=>AB,DIRTY:()=>Go,EMPTY_PATH:()=>oB,INVALID:()=>J,NEVER:()=>dF,OK:()=>Mt,ParseStatus:()=>wt,Schema:()=>ue,ZodAny:()=>eo,ZodArray:()=>Qr,ZodBigInt:()=>Zo,ZodBoolean:()=>Xo,ZodBranded:()=>yu,ZodCatch:()=>ii,ZodDate:()=>Yo,ZodDefault:()=>oi,ZodDiscriminatedUnion:()=>Ff,ZodEffects:()=>Fa,ZodEnum:()=>ri,ZodError:()=>Qt,ZodFirstPartyTypeKind:()=>ee,ZodFunction:()=>Pf,ZodIntersection:()=>ei,ZodIssueCode:()=>O,ZodLazy:()=>ti,ZodLiteral:()=>ai,ZodMap:()=>ks,ZodNaN:()=>Ts,ZodNativeEnum:()=>ni,ZodNever:()=>Ja,ZodNull:()=>Qo,ZodNullable:()=>hr,ZodNumber:()=>Wo,ZodObject:()=>Jt,ZodOptional:()=>Oa,ZodParsedType:()=>V,ZodPipeline:()=>xu,ZodPromise:()=>to,ZodReadonly:()=>si,ZodRecord:()=>Nf,ZodSchema:()=>ue,ZodSet:()=>Es,ZodString:()=>Jn,ZodSymbol:()=>Is,ZodTransformer:()=>Fa,ZodTuple:()=>pr,ZodType:()=>ue,ZodUndefined:()=>Ko,ZodUnion:()=>Jo,ZodUnknown:()=>Kr,ZodVoid:()=>As,addIssueToContext:()=>H,any:()=>FB,array:()=>UB,bigint:()=>RB,boolean:()=>h1,coerce:()=>cF,custom:()=>d1,date:()=>MB,datetimeRegex:()=>u1,defaultErrorMap:()=>Xr,discriminatedUnion:()=>$B,effect:()=>aF,enum:()=>JB,function:()=>YB,getErrorMap:()=>_s,getParsedType:()=>fr,instanceof:()=>EB,intersection:()=>jB,isAborted:()=>Of,isAsync:()=>ws,isDirty:()=>Bf,isValid:()=>Qn,late:()=>kB,lazy:()=>KB,literal:()=>QB,makeIssue:()=>vu,map:()=>ZB,nan:()=>TB,nativeEnum:()=>eF,never:()=>PB,null:()=>BB,nullable:()=>nF,number:()=>p1,object:()=>qB,objectUtil:()=>Pv,oboolean:()=>uF,onumber:()=>lF,optional:()=>rF,ostring:()=>sF,pipeline:()=>iF,preprocess:()=>oF,promise:()=>tF,quotelessJson:()=>aB,record:()=>WB,set:()=>XB,setErrorMap:()=>nB,strictObject:()=>zB,string:()=>f1,symbol:()=>DB,transformer:()=>aF,tuple:()=>GB,undefined:()=>OB,union:()=>VB,unknown:()=>NB,util:()=>fe,void:()=>HB});var fe;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function a(n){throw new Error}t.assertNever=a,t.arrayToEnum=n=>{let o={};for(let i of n)o[i]=i;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),i={};for(let s of o)i[s]=n[s];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(i);return o},t.find=(n,o)=>{for(let i of n)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,o=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(fe||(fe={}));var Pv;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Pv||(Pv={}));var V=fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fr=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 O=fe.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"]),aB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let s=r,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),r}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,fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];a[o]=a[o]||[],a[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Qt.create=t=>new Qt(t);var rB=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===V.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,fe.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:a=`Unrecognized key(s) in object: ${fe.joinValues(t.keys,", ")}`;break;case O.invalid_union:a="Invalid input";break;case O.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${fe.joinValues(t.options)}`;break;case O.invalid_enum_value:a=`Invalid enum value. Expected ${fe.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:a="Invalid function arguments";break;case O.invalid_return_type:a="Invalid function return type";break;case O.invalid_date:a="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:fe.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case O.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case O.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case O.custom:a="Invalid input";break;case O.invalid_intersection_types:a="Intersection results could not be merged";break;case O.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:a="Number must be finite";break;default:a=e.defaultError,fe.assertNever(t)}return{message:a}},Xr=rB;var n1=Xr;function nB(t){n1=t}function _s(){return n1}var vu=t=>{let{data:e,path:a,errorMaps:r,issueData:n}=t,o=[...a,...n.path||[]],i={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...n,path:o,message:s}},oB=[];function H(t,e){let a=_s(),r=vu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Xr?void 0:Xr].filter(n=>!!n)});t.common.issues.push(r)}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,a){let r=[];for(let n of a){if(n.status==="aborted")return J;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let n of a){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let n of a){let{key:o,value:i}=n;if(o.status==="aborted"||i.status==="aborted")return J;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}},J=Object.freeze({status:"aborted"}),Go=t=>({status:"dirty",value:t}),Mt=t=>({status:"valid",value:t}),Of=t=>t.status==="aborted",Bf=t=>t.status==="dirty",Qn=t=>t.status==="valid",ws=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 Ba=class{constructor(e,a,r,n){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=n}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}},o1=(t,e)=>{if(Qn(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 a=new Qt(t.common.issues);return this._error=a,this._error}}};function le(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:n}=t;if(e&&(a||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:n}}var ue=class{get description(){return this._def.description}_getType(e){return fr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:fr(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:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(ws(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){let r={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return o1(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return Qn(r)?{value:r.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(r=>Qn(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(ws(n)?n:Promise.resolve(n));return o1(r,o)}refine(e,a){let r=n=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(n):a;return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:O.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof a=="function"?a(r,n):a),!1))}_refinement(e){return new Fa({schema:this,typeName:ee.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:a=>this["~validate"](a)}}optional(){return Oa.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return to.create(this,this._def)}or(e){return Jo.create([this,e],this._def)}and(e){return ei.create(this,e,this._def)}transform(e){return new Fa({...le(this._def),schema:this,typeName:ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new oi({...le(this._def),innerType:this,defaultValue:a,typeName:ee.ZodDefault})}brand(){return new yu({typeName:ee.ZodBranded,type:this,...le(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ii({...le(this._def),innerType:this,catchValue:a,typeName:ee.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return xu.create(this,e)}readonly(){return si.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iB=/^c[^\s-]{8,}$/i,sB=/^[0-9a-z]+$/,lB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uB=/^[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,cB=/^[a-z0-9_-]{21}$/i,dB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fB=/^[-+]?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)?)??$/,pB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hv,mB=/^(?:(?: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])$/,gB=/^(?:(?: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])$/,vB=/^(([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]))$/,yB=/^(([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])$/,xB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s1="((\\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])))",SB=new RegExp(`^${s1}$`);function l1(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function CB(t){return new RegExp(`^${l1(t)}$`)}function u1(t){let e=`${s1}T${l1(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function _B(t,e){return!!((e==="v4"||!e)&&mB.test(t)||(e==="v6"||!e)&&vB.test(t))}function wB(t,e){if(!dB.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function LB(t,e){return!!((e==="v4"||!e)&&gB.test(t)||(e==="v6"||!e)&&yB.test(t))}var Jn=class t extends ue{_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:O.invalid_type,expected:V.string,received:o.parsedType}),J}let r=new wt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(n=this._getOrReturnCtx(e,n),i?H(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")pB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Hv||(Hv=new RegExp(hB,"u")),Hv.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")uB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")cB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"nanoid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")iB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")sB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:O.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:O.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.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)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?u1(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?SB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CB(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?_B(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?wB(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"jwt",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cidr",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?xB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?bB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64url",code:O.invalid_string,message:o.message}),r.dirty()):fe.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:O.invalid_string,...Z.errToObj(r)})}_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,a){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...Z.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...Z.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...Z.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...Z.errToObj(a)})}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 a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Jn.create=t=>new Jn({checks:[],typeName:ee.ZodString,coerce:t?.coerce??!1,...le(t)});function IB(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=a>r?a:r,o=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return o%i/10**n}var Wo=class t extends ue{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:O.invalid_type,expected:V.number,received:o.parsedType}),J}let r,n=new wt;for(let o of this._def.checks)o.kind==="int"?fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?IB(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_finite,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_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,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}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 a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fe.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Wo.create=t=>new Wo({checks:[],typeName:ee.ZodNumber,coerce:t?.coerce||!1,...le(t)});var Zo=class t extends ue{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 r,n=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.bigint,received:a.parsedType}),J}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_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,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Zo.create=t=>new Zo({checks:[],typeName:ee.ZodBigInt,coerce:t?.coerce??!1,...le(t)});var Xo=class extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.boolean,received:r.parsedType}),J}return Mt(e.data)}};Xo.create=t=>new Xo({typeName:ee.ZodBoolean,coerce:t?.coerce||!1,...le(t)});var Yo=class t extends ue{_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:O.invalid_type,expected:V.date,received:o.parsedType}),J}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_date}),J}let r=new wt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):fe.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}};Yo.create=t=>new Yo({checks:[],coerce:t?.coerce||!1,typeName:ee.ZodDate,...le(t)});var Is=class extends ue{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.symbol,received:r.parsedType}),J}return Mt(e.data)}};Is.create=t=>new Is({typeName:ee.ZodSymbol,...le(t)});var Ko=class extends ue{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.undefined,received:r.parsedType}),J}return Mt(e.data)}};Ko.create=t=>new Ko({typeName:ee.ZodUndefined,...le(t)});var Qo=class extends ue{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.null,received:r.parsedType}),J}return Mt(e.data)}};Qo.create=t=>new Qo({typeName:ee.ZodNull,...le(t)});var eo=class extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return Mt(e.data)}};eo.create=t=>new eo({typeName:ee.ZodAny,...le(t)});var Kr=class extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mt(e.data)}};Kr.create=t=>new Kr({typeName:ee.ZodUnknown,...le(t)});var Ja=class extends ue{_parse(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.never,received:a.parsedType}),J}};Ja.create=t=>new Ja({typeName:ee.ZodNever,...le(t)});var As=class extends ue{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.void,received:r.parsedType}),J}return Mt(e.data)}};As.create=t=>new As({typeName:ee.ZodVoid,...le(t)});var Qr=class t extends ue{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==V.array)return H(a,{code:O.invalid_type,expected:V.array,received:a.parsedType}),J;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(H(a,{code:i?O.too_big:O.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&a.data.length<n.minLength.value&&(H(a,{code:O.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&a.data.length>n.maxLength.value&&(H(a,{code:O.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>n.type._parseAsync(new Ba(a,i,a.path,s)))).then(i=>wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Ba(a,i,a.path,s)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:Z.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:Z.toString(a)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ee.ZodArray,...le(e)});function Ls(t){if(t instanceof Jt){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Oa.create(Ls(r))}return new Jt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Ls(t.element)}):t instanceof Oa?Oa.create(Ls(t.unwrap())):t instanceof hr?hr.create(Ls(t.unwrap())):t instanceof pr?pr.create(t.items.map(e=>Ls(e))):t}var Jt=class t extends ue{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(),a=fe.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==V.object){let u=this._getOrReturnCtx(e);return H(u,{code:O.invalid_type,expected:V.object,received:u.parsedType}),J}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ja&&this._def.unknownKeys==="strip"))for(let u in n.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ba(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Ja){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")s.length>0&&(H(n,{code:O.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of s){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ba(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(r,u)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{let n=this._def.errorMap?.(a,r).message??r.defaultError;return a.code==="unrecognized_keys"?{message:Z.errToObj(e).message??n}:{message:n}}}:{}})}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:ee.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let r of fe.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let r of fe.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return Ls(this)}partial(e){let a={};for(let r of fe.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?a[r]=n:a[r]=n.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let r of fe.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return c1(fe.objectKeys(this.shape))}};Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});var Jo=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function n(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 a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Qt(s.ctx.common.issues));return H(a,{code:O.invalid_union,unionErrors:i}),J}if(a.common.async)return Promise.all(r.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(n);{let o,i=[];for(let l of r){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Qt(l));return H(a,{code:O.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};Jo.create=(t,e)=>new Jo({options:t,typeName:ee.ZodUnion,...le(e)});var Yr=t=>t instanceof ti?Yr(t.schema):t instanceof Fa?Yr(t.innerType()):t instanceof ai?[t.value]:t instanceof ri?t.options:t instanceof ni?fe.objectValues(t.enum):t instanceof oi?Yr(t._def.innerType):t instanceof Ko?[void 0]:t instanceof Qo?[null]:t instanceof Oa?[void 0,...Yr(t.unwrap())]:t instanceof hr?[null,...Yr(t.unwrap())]:t instanceof yu||t instanceof si?Yr(t.unwrap()):t instanceof ii?Yr(t._def.innerType):[],Ff=class t extends ue{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.object)return H(a,{code:O.invalid_type,expected:V.object,received:a.parsedType}),J;let r=this.discriminator,n=a.data[r],o=this.optionsMap.get(n);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(H(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let n=new Map;for(let o of a){let i=Yr(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new t({typeName:ee.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...le(r)})}};function Uv(t,e){let a=fr(t),r=fr(e);if(t===e)return{valid:!0,data:t};if(a===V.object&&r===V.object){let n=fe.objectKeys(e),o=fe.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Uv(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Uv(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ei=class extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Of(o)||Of(i))return J;let s=Uv(o.value,i.value);return s.valid?((Bf(o)||Bf(i))&&a.dirty(),{status:a.value,value:s.data}):(H(r,{code:O.invalid_intersection_types}),J)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ei.create=(t,e,a)=>new ei({left:t,right:e,typeName:ee.ZodIntersection,...le(a)});var pr=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return H(r,{code:O.invalid_type,expected:V.array,received:r.parsedType}),J;if(r.data.length<this._def.items.length)return H(r,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ba(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(a,i)):wt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};pr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pr({items:t,typeName:ee.ZodTuple,rest:null,...le(e)})};var Nf=class t extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return H(r,{code:O.invalid_type,expected:V.object,received:r.parsedType}),J;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ba(r,s,r.path,s)),value:i._parse(new Ba(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?wt.mergeObjectAsync(a,n):wt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof ue?new t({keyType:e,valueType:a,typeName:ee.ZodRecord,...le(r)}):new t({keyType:Jn.create(),valueType:e,typeName:ee.ZodRecord,...le(a)})}},ks=class extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return H(r,{code:O.invalid_type,expected:V.map,received:r.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Ba(r,s,r.path,[u,"key"])),value:o._parse(new Ba(r,l,r.path,[u,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}})}else{let s=new Map;for(let l of i){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};ks.create=(t,e,a)=>new ks({valueType:e,keyType:t,typeName:ee.ZodMap,...le(a)});var Es=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return H(r,{code:O.invalid_type,expected:V.set,received:r.parsedType}),J;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(H(r,{code:O.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),a.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(H(r,{code:O.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),a.dirty());let o=this._def.valueType;function i(l){let u=new Set;for(let c of l){if(c.status==="aborted")return J;c.status==="dirty"&&a.dirty(),u.add(c.value)}return{status:a.value,value:u}}let s=[...r.data.values()].map((l,u)=>o._parse(new Ba(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:Z.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Es.create=(t,e)=>new Es({valueType:t,minSize:null,maxSize:null,typeName:ee.ZodSet,...le(e)});var Pf=class t extends ue{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.function)return H(a,{code:O.invalid_type,expected:V.function,received:a.parsedType}),J;function r(s,l){return vu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,_s(),Xr].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function n(s,l){return vu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,_s(),Xr].filter(u=>!!u),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof to){let s=this;return Mt(async function(...l){let u=new Qt([]),c=await s._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(r(l,m)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw u.addIssue(n(d,m)),u})})}else{let s=this;return Mt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Qt([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Qt([n(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:pr.create(e).rest(Kr.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,a,r){return new t({args:e||pr.create([]).rest(Kr.create()),returns:a||Kr.create(),typeName:ee.ZodFunction,...le(r)})}},ti=class extends ue{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}};ti.create=(t,e)=>new ti({getter:t,typeName:ee.ZodLazy,...le(e)});var ai=class extends ue{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return H(a,{received:a.data,code:O.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}};ai.create=(t,e)=>new ai({value:t,typeName:ee.ZodLiteral,...le(e)});function c1(t,e){return new ri({values:t,typeName:ee.ZodEnum,...le(e)})}var ri=class t extends ue{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return H(a,{expected:fe.joinValues(r),received:a.parsedType,code:O.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return H(a,{received:a.data,code:O.invalid_enum_value,options:r}),J}return Mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return t.create(e,{...this._def,...a})}exclude(e,a=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};ri.create=c1;var ni=class extends ue{_parse(e){let a=fe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let n=fe.objectValues(a);return H(r,{expected:fe.joinValues(n),received:r.parsedType,code:O.invalid_type}),J}if(this._cache||(this._cache=new Set(fe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=fe.objectValues(a);return H(r,{received:r.data,code:O.invalid_enum_value,options:n}),J}return Mt(e.data)}get enum(){return this._def.values}};ni.create=(t,e)=>new ni({values:t,typeName:ee.ZodNativeEnum,...le(e)});var to=class extends ue{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.promise&&a.common.async===!1)return H(a,{code:O.invalid_type,expected:V.promise,received:a.parsedType}),J;let r=a.parsedType===V.promise?a.data:Promise.resolve(a.data);return Mt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};to.create=(t,e)=>new to({type:t,typeName:ee.ZodPromise,...le(e)});var Fa=class extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:i=>{H(r,i),i.fatal?a.abort():a.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(a.value==="aborted")return J;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"?Go(l.value):a.value==="dirty"?Go(l.value):l});{if(a.value==="aborted")return J;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?Go(s.value):a.value==="dirty"?Go(s.value):s}}if(n.type==="refinement"){let i=s=>{let l=n.refinement(s,o);if(r.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(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?J:(s.status==="dirty"&&a.dirty(),i(s.value),{status:a.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?J:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qn(i))return J;let s=n.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Qn(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):J);fe.assertNever(n)}};Fa.create=(t,e,a)=>new Fa({schema:t,typeName:ee.ZodEffects,effect:e,...le(a)});Fa.createWithPreprocess=(t,e,a)=>new Fa({schema:e,effect:{type:"preprocess",transform:t},typeName:ee.ZodEffects,...le(a)});var Oa=class extends ue{_parse(e){return this._getType(e)===V.undefined?Mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:ee.ZodOptional,...le(e)});var hr=class extends ue{_parse(e){return this._getType(e)===V.null?Mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hr.create=(t,e)=>new hr({innerType:t,typeName:ee.ZodNullable,...le(e)});var oi=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};oi.create=(t,e)=>new oi({innerType:t,typeName:ee.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...le(e)});var ii=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ws(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ii.create=(t,e)=>new ii({innerType:t,typeName:ee.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...le(e)});var Ts=class extends ue{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.nan,received:r.parsedType}),J}return{status:"valid",value:e.data}}};Ts.create=t=>new Ts({typeName:ee.ZodNaN,...le(t)});var AB=Symbol("zod_brand"),yu=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},xu=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?J:o.status==="dirty"?(a.dirty(),Go(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?J:n.status==="dirty"?(a.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,a){return new t({in:e,out:a,typeName:ee.ZodPipeline})}},si=class extends ue{_parse(e){let a=this._def.innerType._parse(e),r=n=>(Qn(n)&&(n.value=Object.freeze(n.value)),n);return ws(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};si.create=(t,e)=>new si({innerType:t,typeName:ee.ZodReadonly,...le(e)});function i1(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function d1(t,e={},a){return t?eo.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=i1(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=i1(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):eo.create()}var kB={object:Jt.lazycreate},ee;(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"})(ee||(ee={}));var EB=(t,e={message:`Input not instance of ${t.name}`})=>d1(a=>a instanceof t,e),f1=Jn.create,p1=Wo.create,TB=Ts.create,RB=Zo.create,h1=Xo.create,MB=Yo.create,DB=Is.create,OB=Ko.create,BB=Qo.create,FB=eo.create,NB=Kr.create,PB=Ja.create,HB=As.create,UB=Qr.create,qB=Jt.create,zB=Jt.strictCreate,VB=Jo.create,$B=Ff.create,jB=ei.create,GB=pr.create,WB=Nf.create,ZB=ks.create,XB=Es.create,YB=Pf.create,KB=ti.create,QB=ai.create,JB=ri.create,eF=ni.create,tF=to.create,aF=Fa.create,rF=Oa.create,nF=hr.create,oF=Fa.createWithPreprocess,iF=xu.create,sF=()=>f1().optional(),lF=()=>p1().optional(),uF=()=>h1().optional(),cF={string:(t=>Jn.create({...t,coerce:!0})),number:(t=>Wo.create({...t,coerce:!0})),boolean:(t=>Xo.create({...t,coerce:!0})),bigint:(t=>Zo.create({...t,coerce:!0})),date:(t=>Yo.create({...t,coerce:!0}))};var dF=J;var m1=p.union([p.object({type:p.literal("data"),key:p.string(),value:p.string().optional()}),p.object({type:p.literal("css"),value:p.string()}),p.object({type:p.literal("aria"),role:p.string().optional(),label:p.string().optional()}),p.object({type:p.literal("shadow-css"),value:p.string()}),p.object({type:p.literal("ref"),el:p.any()})]),fF=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:m1,content:p.object({title:p.string().optional(),body:p.string()}),placement:p.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:p.number().optional(),blocking:p.boolean().optional(),trigger:p.enum(["immediate","hover","click"]).optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),pF=p.object({kind:p.literal("highlight"),id:p.string(),anchor:m1,copy:p.string().optional(),ring:p.object({paddingPx:p.number().optional(),radiusPx:p.number().optional()}).optional(),scrim:p.object({opacity:p.number().optional()}).optional(),ringColor:p.string().optional(),blocking:p.boolean().optional(),dismiss:p.object({onClickOutside:p.boolean().optional(),onEsc:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),qv=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([fF,pF]))});function U5(t){return qv.parse(t)}var $5=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=Wg({configUri:t,experiments:e,featureKey:a});if(!n)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(n,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return qv.parse(i)};var Hf=K(We(),1),g1=K($s(),1);function G5({element:t,children:e}){let[a,r]=(0,Hf.useState)(null);return(0,Hf.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,g1.createPortal)(e,a):null}function hF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var zv=class{constructor(){$(this,"sessionId");this.sessionId=hF(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function Vv(){return new zv}var E=typeof window<"u"?window:void 0,It=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(It.self=It),typeof File>"u"&&(It.File=function(){});var fA=Array.prototype,v1=fA.forEach,y1=fA.indexOf,ya=It?.navigator,q=It?.document,ta=It?.location,oy=It?.fetch,iy=It!=null&&It.XMLHttpRequest&&"withCredentials"in new It.XMLHttpRequest?It.XMLHttpRequest:void 0,x1=It?.AbortController,ea=ya?.userAgent,ae=E??{},en={DEBUG:!1,LIB_VERSION:"1.302.2"};function b1(t,e,a,r,n,o,i){try{var s=t[o](i),l=s.value}catch(u){return void a(u)}s.done?e(l):Promise.resolve(l).then(r,n)}function S1(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){b1(o,r,n,i,s,"next",l)}function s(l){b1(o,r,n,i,s,"throw",l)}i(void 0)}))}}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},G.apply(null,arguments)}function pA(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var mF=["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"],C1=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return mF.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},gF=["$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 pe(t,e){return t.indexOf(e)!==-1}var vp=function(t){return t.trim()},sy=function(t){return t.replace(/^\$/,"")},vF=Array.isArray,hA=Object.prototype,mA=hA.hasOwnProperty,yp=hA.toString,Te=vF||function(t){return yp.call(t)==="[object Array]"},so=t=>typeof t=="function",mt=t=>t===Object(t)&&!Te(t),Os=t=>{if(mt(t)){for(var e in t)if(mA.call(t,e))return!1;return!0}return!1},U=t=>t===void 0,ut=t=>yp.call(t)=="[object String]",ly=t=>ut(t)&&t.trim().length===0,nn=t=>t===null,Ie=t=>U(t)||nn(t),yr=t=>yp.call(t)=="[object Number]",lo=t=>yp.call(t)==="[object Boolean]",yF=t=>t instanceof FormData,xF=t=>pe(gF,t);function uy(t){return t===null||typeof t!="object"}function Yf(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function gA(t){return!U(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var bF=[!0,"true",1,"1","yes"],$v=t=>pe(bF,t),SF=[!1,"false",0,"0","no"];function mr(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),yr(t)?t>a?(r.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+n),mr(n||a,e,a,r))}var cy=class{constructor(e){this.t={},this.i=e.i,this.o=mr(e.bucketSize,0,100,e.h),this.m=mr(e.refillRate,0,this.o,e.h),this.S=mr(e.refillInterval,0,864e5,e.h)}$(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.S);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.S}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[n]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},Uf,_1,jv,CF=t=>t instanceof Error;function _F(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return jv&&a.length===_1||(_1=a.length,jv=a.reduce(((r,n)=>{Uf||(Uf={});var o=Uf[n];if(o)r[o[0]]=o[1];else for(var i=t(n),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[n];if(u&&c){r[u]=c,Uf[n]=[u,c];break}}return r}),{})),jv}}var dy=class{constructor(e,a,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=a,this.modifiers=r}buildFromUnknown(e,a){a===void 0&&(a={});var r=a&&a.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(n,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var a=this;return S1((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Te(r.stacktrace.frames)&&(r.stacktrace.frames=yield a.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var a;return{type:"Error",value:"Unknown error",stack:(a=e.syntheticException)==null?void 0:a.stack,synthetic:!0}}parseStacktrace(e,a){var r,n;return e.cause!=null&&(r=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),G({},e,{cause:r,stack:n})}applyChunkIds(e,a){return e.map((r=>(r.filename&&a&&(r.chunk_id=a[r.filename]),r)))}applyCoercers(e,a){for(var r of this.coercers)if(r.match(e))return r.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return S1((function*(){var r=e;for(var n of a.modifiers)r=yield n(r);return r}))()}convertToExceptionList(e,a){var r,n,o,i={type:e.type,value:e.value,mechanism:{type:(r=a.type)!==null&&r!==void 0?r:"generic",handled:(n=a.handled)===null||n===void 0||n,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var s=[i];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,G({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:_F(this.stackParser)}}buildCoercingContext(e,a,r){r===void 0&&(r=0);var n=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return G({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},Ps="?";function fy(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?Ps:a,in_app:!0};return U(r)||(o.lineno=r),U(n)||(o.colno=n),o}var vA=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return a||r?[t.indexOf("@")!==-1?t.split("@")[0]:Ps,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,IF=/\((\S*)(?::(\d+))(?::(\d+))\)/,AF=(t,e)=>{var a=wF.exec(t);if(a){var[,r,n,o]=a;return fy(e,r,Ps,+n,+o)}var i=LF.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=IF.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=vA(i[1]||Ps,i[2]);return fy(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},kF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,TF=(t,e)=>{var a=kF.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=EF.exec(a[3]);r&&(a[1]=a[1]||"eval",a[3]=r[1],a[4]=r[2],a[5]="")}var n=a[3],o=a[1]||Ps;return[o,n]=vA(o,n),fy(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},w1=/\(error: (.*)\)/,L1=50;function RF(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
460
- `),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=w1.test(u)?u.replace(w1,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var h=d(c,t);if(h){i.push(h);break}}if(i.length>=L1)break}}}return(function(m){if(!m.length)return[];var S=Array.from(m);return S.reverse(),S.slice(0,L1).map((b=>{return G({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||Ps});var x}))})(i)}}var py=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=ut(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return Yf(e,"DOMException")}isDOMError(e){return Yf(e,"DOMError")}},hy=class{match(e){return(a=>a instanceof Error)(e)}coerce(e,a){return{type:this.getType(e),value:this.getMessage(e,a),stack:this.getStack(e),cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,a){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},my=class{constructor(){}match(e){return Yf(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var r,n=a.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},MF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,gy=class{match(e){return typeof e=="string"}coerce(e,a){var r,[n,o]=this.getInfos(e);return{type:n??"Error",value:o??e,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var a="Error",r=e,n=e.match(MF);return n&&(a=n[1],r=n[2]),[a,r]}},DF=["fatal","error","warning","log","info","debug"];function yA(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var r=a.length;r>0;r--){var n=a.slice(0,r).join(", ");if(!(n.length>e))return r===a.length||n.length<=e?n:n.slice(0,e)+"..."}return""}var vy=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var r,n=this.getErrorPropertyFromObject(e);return n?a.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=a.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return gA(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var a="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(a+=" with message: '"+e.message+"'"),a}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+yA(e)}isSeverityLevel(e){return ut(e)&&!ly(e)&&DF.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(CF(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},yy=class{match(e){return gA(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+yA(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},xy=class{match(e){return uy(e)}coerce(e,a){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},by=class{match(e){return Yf(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return uy(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}:a.apply(n)}getUnhandledRejectionReason(e){if(uy(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}},xA=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(E&&(en.DEBUG||ae.POSTHOG_DEBUG||a)&&!U(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[n])?E.console[n].__rrweb_original__:E.console[n],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:n=>{r.error("You must initialize PostHog before calling "+n)},createLogger:(n,o)=>xA(t+" "+n,o)};return r},z=xA("[PostHog.js]"),ct=z.createLogger,OF=ct("[ExternalScriptsLoader]"),I1=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return OF.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=q?.querySelectorAll("script");if(r){for(var n,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<r.length;i++)if(n=o())return n.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};ae.__PosthogExtensions__=ae.__PosthogExtensions__||{},ae.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",r);I1(t,o,a)},ae.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);I1(t,r,a)};var Kf={};function uo(t,e,a){if(Te(t)){if(v1&&t.forEach===v1)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(a,t[r],r)===Kf)return}}}function De(t,e,a){if(!Ie(t)){if(Te(t))return uo(t,e,a);if(yF(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Kf)return}else for(var n in t)if(mA.call(t,n)&&e.call(a,t[n],n)===Kf)return}}var Je=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return uo(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},qs=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return uo(a,(function(n){uo(n,(function(o){t.push(o)}))})),t};function Wf(t){for(var e=Object.keys(t),a=e.length,r=new Array(a);a--;)r[a]=[e[a],t[e[a]]];return r}var A1=function(t){try{return t()}catch{return}},BF=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.apply(this,a)}catch(n){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(n)}}},mx=function(t){var e={};return De(t,(function(a,r){(ut(a)&&a.length>0||yr(a))&&(e[r]=a)})),e};function FF(t,e){return a=t,r=o=>ut(o)&&!nn(e)?o.slice(0,e):o,n=new Set,(function o(i,s){return i!==Object(i)?r?r(i,s):i:n.has(i)?void 0:(n.add(i),Te(i)?(l=[],uo(i,(u=>{l.push(o(u))}))):(l={},De(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var NF=["herokuapp.com","vercel.app","netlify.app"];function PF(t){var e=t?.hostname;if(!ut(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of NF)if(a===r)return!1;return!0}function bA(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function nt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var SA="$people_distinct_id",Eu="__alias",Tu="__timers",k1="$autocapture_disabled_server_side",Sy="$heatmaps_enabled_server_side",E1="$exception_capture_enabled_server_side",Cy="$error_tracking_suppression_rules",T1="$error_tracking_capture_extension_exceptions",R1="$web_vitals_enabled_server_side",CA="$dead_clicks_enabled_server_side",M1="$web_vitals_allowed_metrics",Gv="$session_recording_remote_config",Qf="$sesid",_A="$session_is_sampled",Bs="$enabled_feature_flags",Ru="$early_access_features",_y="$feature_flag_details",Mu="$stored_person_properties",ci="$stored_group_properties",wy="$surveys",qf="$surveys_activated",Jf="$flag_call_reported",tn="$user_state",Ly="$client_session_props",Iy="$capture_rate_limit",Ay="$initial_campaign_params",ky="$initial_referrer_info",ep="$initial_person_info",tp="$epp",wA="__POSTHOG_TOOLBAR__",bu="$posthog_cookieless",HF=[SA,Eu,"__cmpns",Tu,"$session_recording_enabled_server_side",Sy,Qf,Bs,Cy,tn,Ru,_y,ci,Mu,wy,Jf,Ly,Iy,Ay,ky,tp,ep];function D1(t){return t instanceof Element&&(t.id===wA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function xp(t){return!!t&&t.nodeType===1}function co(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function LA(t){return!!t&&t.nodeType===3}function IA(t){return!!t&&t.nodeType===11}function gx(t){return t?vp(t).split(/\s+/):[]}function O1(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function ap(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 gx(e)}function AA(t){return Ie(t)?null:vp(t).split(/(\s+)/).filter((e=>Hu(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ju(t){var e="";return Ey(t)&&!MA(t)&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;LA(a)&&a.textContent&&(e+=(r=AA(a.textContent))!==null&&r!==void 0?r:"")})),vp(e)}function kA(t){return U(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var vx=["a","button","form","input","select","textarea","label"];function EA(t,e){if(U(e))return!0;var a,r=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var n of t)if(a=r(n))return a.v;return!1}function TA(t){var e=t.parentNode;return!(!e||!xp(e))&&e}var UF=["next","previous","prev",">","<"],B1=10,F1=[".ph-no-rageclick",".ph-no-capture"];function qF(t,e){if(!E||yx(t))return!1;var a,r,n;if(lo(e)?(a=!!e&&F1,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:F1,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=RA(t,!1);return!(function(i,s){if(i===!1||U(i))return!1;var l;if(i===!0)l=UF;else{if(!Te(i))return!1;if(i.length>B1)return z.error("[PostHog] content_ignorelist array cannot exceed "+B1+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return s.some((u=>{var{safeText:c,ariaLabel:d}=u;return l.some((h=>c.includes(h)||d.includes(h)))}))})(r,o.map((i=>{var s;return{safeText:ju(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!EA(o,a)}var yx=t=>!t||co(t,"html")||!xp(t),RA=(t,e)=>{if(!E||yx(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!co(n,"body");)if(IA(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=TA(n);if(!o)break;if(e||vx.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function zF(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!E||yx(t)||(o=a)!=null&&o.url_allowlist&&!O1(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&O1(a.url_ignorelist))return!1;if((s=a)!=null&&s.dom_event_allowlist){var u=a.dom_event_allowlist;if(u&&!u.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=RA(t,r);if(!(function(S,b){var x=b?.element_allowlist;if(U(x))return!0;var f,g=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(f=g(v))return f.v;return!1})(d,a)||!EA(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var h=E.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=t.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(vx.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function Ey(t){for(var e=t;e.parentNode&&!co(e,"body");e=e.parentNode){var a=ap(e);if(pe(a,"ph-sensitive")||pe(a,"ph-no-capture"))return!1}if(pe(ap(t),"ph-include"))return!0;var r=t.type||"";if(ut(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(ut(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function MA(t){return!!(co(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||co(t,"select")||co(t,"textarea")||t.getAttribute("contenteditable")==="true")}var DA="(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})",VF=new RegExp("^(?:"+DA+")$"),$F=new RegExp(DA),OA="\\d{3}-?\\d{2}-?\\d{4}",jF=new RegExp("^("+OA+")$"),GF=new RegExp("("+OA+")");function Hu(t,e){return e===void 0&&(e=!0),!(Ie(t)||ut(t)&&(t=vp(t),(e?VF:$F).test((t||"").replace(/[- ]/g,""))||(e?jF:GF).test(t)))}function BA(t){var e=ju(t);return Hu(e=(e+" "+FA(t)).trim())?e:""}function FA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=ju(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+FA(a)).trim())}catch(o){z.error("[AutoCapture]",o)}})),e}function WF(t){return(function(e){var a=e.map((r=>{var n,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var s of(r.attr_class.sort(),r.attr_class))i+="."+s.replace(/"/g,"");var l=G({},r.text?{text:r.text}:{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Wf(l).sort(((c,d)=>{var[h]=c,[m]=d;return h.localeCompare(m)})).forEach((c=>{var[d,h]=c;return u[N1(d.toString())]=N1(h.toString())})),i+=":",i+=Wf(u).map((c=>{var[d,h]=c;return d+'="'+h+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var r,n,o={text:(r=a.$el_text)==null?void 0:r.slice(0,400),tag_name:a.tag_name,href:(n=a.attr__href)==null?void 0:n.slice(0,2048),attr_class:ZF(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return Wf(a).filter((i=>{var[s]=i;return s.indexOf("attr__")===0})).forEach((i=>{var[s,l]=i;return o.attributes[s]=l})),o}))})(t))}function N1(t){return t.replace(/"|\\"/g,'\\"')}function ZF(t){var e=t.attr__class;return e?Te(e)?e:gx(e):void 0}var rp=class{constructor(e){this.disabled=e===!1;var a=mt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(a-n.y)<this.thresholdPx&&r-n.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:r}];return!1}},Wv="$copy_autocapture",rn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var np=t=>{var e=q?.createElement("a");return U(e)?null:(e.href=t,e)},XF=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return De(t,(function(o,i){U(o)||U(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),n[n.length]=r+"="+a)})),n.join(e)},op=function(t,e){for(var a,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){a=o;break}}if(!Te(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{z.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Gu=function(t,e,a){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",o=r[1],i=n.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Te(h)&&(e.includes(h[0])?c.push(h[0]+"="+a):c.push(u[d]))}var m=l;return s!=null&&(m+="?"+c.join("&")),o!=null&&(m+="#"+o),m},ip=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},P1=ct("[AutoCapture]");function Zv(t,e){return e.length>t?e.slice(0,t)+"...":e}function YF(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!xp(e));return e}function KF(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};vx.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=Zv(1024,BA(t)):o.$el_text=Zv(1024,ju(t)));var i=ap(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),De(t.attributes,(function(c){var d;if((!MA(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Hu(c.value)&&(d=c.name,!ut(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=gx(h).join(" ")),o["attr__"+c.name]=Zv(1024,h)}}));for(var s=1,l=1,u=t;u=YF(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function QF(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!co(c,"body");)IA(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],m={},S=!1,b=!1;if(De(u,(y=>{var _=Ey(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&Hu(S)&&S),pe(ap(y),"ph-no-capture")&&(b=!0),h.push(KF(y,o,i,s));var w=(function(C){if(!Ey(C))return{};var L={};return De(C.attributes,(function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var A=k.name.replace("data-ph-capture-attribute-",""),M=k.value;A&&M&&Hu(M)&&(L[A]=M)}})),L})(y);Je(m,w)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=BA(t):h[0].$el_text=ju(t)),S){var x,f;h[0].attr__href=S;var g=(x=np(S))==null?void 0:x.host,v=E==null||(f=E.location)==null?void 0:f.host;g&&v&&g!==v&&(d=S)}return{props:Je({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:WF(h)},(a=h[0])!=null&&a.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},m)}}var Ty=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new rp(e.config.rageclick),this.I=null}get F(){var e,a,r=mt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(a=r.url_ignorelist)==null?void 0:a.map((n=>new RegExp(n))),r}C(){if(this.isBrowserSupported()){if(E&&q){var e=r=>{r=r||E?.event;try{this.M(r)}catch(n){P1.error("Failed to capture event",n)}};if(nt(q,"submit",e,{capture:!0}),nt(q,"change",e,{capture:!0}),nt(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||E?.event,this.M(r,Wv)};nt(q,"copy",a,{capture:!0}),nt(q,"cut",a,{capture:!0})}}}else P1.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({[k1]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,r=[];return(a=this.I)==null||a.forEach((n=>{var o=q?.querySelectorAll(n);o?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,a,r=(e=this.instance.persistence)==null?void 0:e.props[k1],n=this.T;if(nn(n)&&!lo(r)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=kA(e);LA(n)&&(n=n.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&qF(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Wv;if(n&&zF(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=QF(n,{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(n);if(l&&l.length>0&&(i.$element_selectors=l),a===Wv){var u,c=AA(E==null||(u=E.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return so(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return yr(t)&&isFinite(t)&&Math.floor(t)===t});var H1="0123456789abcdef",Ry=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,r,n){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||a<0||r<0||n<0||e>0xffffffffffff||a>4095||r>1073741823||n>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|a>>>8,o[7]=a,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+H1.charAt(this.bytes[a]>>>4)+H1.charAt(15&this.bytes[a]),a!==3&&a!==5&&a!==7&&a!==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 a=0;a<16;a++){var r=this.bytes[a]-e.bytes[a];if(r!==0)return Math.sign(r)}return 0}},My=class{constructor(){this.A=0,this.D=0,this.j=new Dy}generate(){var e=this.generateOrAbort();if(U(e)){this.A=0;var a=this.generateOrAbort();if(U(a))throw new Error("Could not generate UUID after timestamp reset");return a}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 Ry.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())}},U1,NA=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};E&&!U(E.crypto)&&crypto.getRandomValues&&(NA=t=>crypto.getRandomValues(t));var Dy=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(NA(this.N),this.U=0),this.N[this.U++]}},io=()=>JF().toString(),JF=()=>(U1||(U1=new My)).generate(),Su="",eN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tN(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=q),Su)return Su;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+io();!Su&&s--;){var u=i.slice(s).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",Su=u)}return Su})(t);if(!a){var r=(n=>{var o=n.match(eN);return o?o[0]:""})(t);r!==a&&z.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var vr={H:()=>!!q,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),r=0;r<a.length;r++){for(var n=a[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(vr.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(q)try{var o="",i="",s=tN(q.location.hostname,r);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}n&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{vr.G(t,"",-1,e)}catch{return}}},Xv=null,Ge={H:function(){if(!nn(Xv))return Xv;var t=!0;if(U(E))t=!1;else try{var e="__mplssupport__";Ge.G(e,"xyz"),Ge.q(e)!=='"xyz"'&&(t=!1),Ge.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Xv=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){Ge.B(e)}return null},W:function(t){try{return JSON.parse(Ge.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Ge.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){Ge.B(e)}}},aN=["distinct_id",Qf,_A,tp,ep],zf=G({},Ge,{W:function(t){try{var e={};try{e=vr.W(t)||{}}catch{}var a=Je(e,JSON.parse(Ge.q(t)||"{}"));return Ge.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{Ge.G(t,e,void 0,void 0,o);var i={};aN.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&vr.G(t,i,a,r,n,o)}catch(s){Ge.B(s)}},V:function(t,e){try{E?.localStorage.removeItem(t),vr.V(t,e)}catch(a){Ge.B(a)}}}),Vf={},rN={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return Vf[t]||null},W:function(t){return Vf[t]||null},G:function(t,e){Vf[t]=e},V:function(t){delete Vf[t]}},li=null,Lt={H:function(){if(!nn(li))return li;if(li=!0,U(E))li=!1;else try{var t="__support__";Lt.G(t,"xyz"),Lt.q(t)!=='"xyz"'&&(li=!1),Lt.V(t)}catch{li=!1}return li},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){Lt.B(e)}return null},W:function(t){try{return JSON.parse(Lt.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Lt.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){Lt.B(e)}}},an=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Oy=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?an.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===an.DENIED||this.consent===an.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===an.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:a,consent_persistence_name:r}=this._instance.config;return r||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return $v(e)?an.GRANTED:pe(SF,e)?an.DENIED:an.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ge:vr;var a=e==="localStorage"?vr:Ge;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut($v(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!bA([ya?.doNotTrack,ya?.msDoNotTrack,ae.doNotTrack],(e=>$v(e)))}},$f=ct("[Dead Clicks]"),nN=()=>!0,oN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(CA)),r=t.instance.config.capture_dead_clicks;return lo(r)?r:!!mt(r)||a},sp=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,r){this.instance=e,this.isEnabled=a,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[CA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?$f.error("failed to load script",n):e()}))}et(){var e;if(q){if(!this.tt&&(e=ae.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=mt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=ae.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),$f.info("starting...")}}else $f.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,$f.info("stopping..."))}},Cu=ct("[ExceptionAutocapture]"),By=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=ae.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=ae.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=ae.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ae.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(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(u){Cu.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[E1]),this.F=this.ht(),this.vt=new cy({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10,refillInterval:1e4,h:Cu}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return mt(e)?a=G({},a,e):(U(e)?this.ut:e)&&(a=G({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Cu.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Cu.error("failed to load script",n);e()}))}lt(){var e,a,r;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[E1]:this.ut}),this.startIfEnabled()}captureException(e){var a,r,n=(a=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(n)?Cu.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function q1(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return so(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var Fy=class{constructor(e){var a;this._instance=e,this.dt=(E==null||(a=E.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(E&&E.history){var r=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||q1(E.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||q1(E.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=E==null||(a=E.location)==null?void 0:a.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(n){z.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};nt(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},Yv=ct("[SegmentIntegration]");function iN(t,e){var a=t.config.segment;if(!a)return e();(function(r,n){var o=r.config.segment;if(!o)return n();var i=l=>{var u=()=>l.anonymousId()||io();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(tn,"identified")),n()},s=o.user();"then"in s&&so(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Yv.warn("This browser does not have Promise support, and can not use the segment integration");var n=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(Yv.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Yv.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var s=r.calculateEventProperties(i,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=>n(o,o.event.event),page:o=>n(o,"$pageview"),identify:o=>n(o,"$identify"),screen:o=>n(o,"$screen")}})(t)).then((()=>{e()}))}))}var PA="posthog-js";function HA(t,e){var{organization:a,projectId:r,prefix:n,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var m=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],b=S.map((f=>G({},f,{stacktrace:f.stacktrace?G({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((g=>G({},g,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:b,$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 a&&r&&(x.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var Ny=class{constructor(e,a,r,n,o,i){this.name=PA,this.setupOnce=function(s){s(HA(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},sN=E!=null&&E.location?ip(E.location.hash,"__posthog")||ip(location.hash,"state"):null,z1="_postHogToolbarParams",V1=ct("[Toolbar]"),oo=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(oo||{}),Py=class{constructor(e){this.instance=e}_t(e){ae.ph_toolbar_state=e}yt(){var e;return(e=ae.ph_toolbar_state)!==null&&e!==void 0?e:oo.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!E||!q)return!1;e=e??E.location,r=r??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var n,o=sN||ip(e.hash,"__posthog")||ip(e.hash,"state"),i=o?A1((()=>JSON.parse(atob(decodeURIComponent(o)))))||A1((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(a.getItem(z1)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=ae.ph_load_toolbar||ae.ph_load_editor;!Ie(a)&&so(a)?a(e,this.instance):V1.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(wA));if(!E||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=G({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(E.localStorage.setItem(z1,JSON.stringify(G({},n,{source:void 0}))),this.yt()===oo.LOADED)this.bt(n);else if(this.yt()===oo.UNINITIALIZED){var o;this._t(oo.LOADING),(o=ae.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return V1.error("[Toolbar] Failed to load",i),void this._t(oo.UNINITIALIZED);this._t(oo.LOADED),this.bt(n)})),nt(E,"turbolinks:load",(()=>{this._t(oo.UNINITIALIZED),this.loadToolbar(n)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,r){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,a,r)}},lN=ct("[TracingHeaders]"),Hy=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;U(this.xt)&&((a=ae.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),U(this.St)&&((r=ae.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return lN.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Na="Mobile",lp="iOS",gr="Android",Uu="Tablet",UA=gr+" "+Uu,qA="iPad",zA="Apple",VA=zA+" Watch",qu="Safari",Hs="BlackBerry",$A="Samsung",jA=$A+"Browser",GA=$A+" Internet",di="Chrome",uN=di+" OS",WA=di+" "+lp,xx="Internet Explorer",ZA=xx+" "+Na,bx="Opera",cN=bx+" Mini",Sx="Edge",XA="Microsoft "+Sx,Fs="Firefox",YA=Fs+" "+lp,zu="Nintendo",Vu="PlayStation",Ns="Xbox",KA=gr+" "+Na,QA=Na+" "+qu,Du="Windows",Uy=Du+" Phone",$1="Nokia",qy="Ouya",JA="Generic",dN=JA+" "+Na.toLowerCase(),ek=JA+" "+Uu.toLowerCase(),zy="Konqueror",Ht="(\\d+(\\.\\d+)?)",Kv=new RegExp("Version/"+Ht),fN=new RegExp(Ns,"i"),pN=new RegExp(Vu+" \\w+","i"),hN=new RegExp(zu+" \\w+","i"),Cx=new RegExp(Hs+"|PlayBook|BB10","i"),mN={"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"},gN=(t,e)=>e&&pe(e,zA)||(function(a){return pe(a,qu)&&!pe(a,di)&&!pe(a,gr)})(t),tk=function(t,e){return e=e||"",pe(t," OPR/")&&pe(t,"Mini")?cN:pe(t," OPR/")?bx:Cx.test(t)?Hs:pe(t,"IE"+Na)||pe(t,"WPDesktop")?ZA:pe(t,jA)?GA:pe(t,Sx)||pe(t,"Edg/")?XA:pe(t,"FBIOS")?"Facebook "+Na:pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?WA:pe(t,"CrMo")||pe(t,di)?di:pe(t,gr)&&pe(t,qu)?KA:pe(t,"FxiOS")?YA:pe(t.toLowerCase(),zy.toLowerCase())?zy:gN(t,e)?pe(t,Na)?QA:qu:pe(t,Fs)?Fs:pe(t,"MSIE")||pe(t,"Trident/")?xx:pe(t,"Gecko")?Fs:""},vN={[ZA]:[new RegExp("rv:"+Ht)],[XA]:[new RegExp(Sx+"?\\/"+Ht)],[di]:[new RegExp("("+di+"|CrMo)\\/"+Ht)],[WA]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[qu]:[Kv],[QA]:[Kv],[bx]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Fs]:[new RegExp(Fs+"\\/"+Ht)],[YA]:[new RegExp("FxiOS\\/"+Ht)],[zy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Hs]:[new RegExp(Hs+" "+Ht),Kv],[KA]:[new RegExp("android\\s"+Ht,"i")],[GA]:[new RegExp(jA+"\\/"+Ht)],[xx]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},yN=function(t,e){var a=tk(t,e),r=vN[a];if(U(r))return null;for(var n=0;n<r.length;n++){var o=r[n],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},j1=[[new RegExp(Ns+"; "+Ns+" (.*?)[);]","i"),t=>[Ns,t&&t[1]||""]],[new RegExp(zu,"i"),[zu,""]],[new RegExp(Vu,"i"),[Vu,""]],[Cx,[Hs,""]],[new RegExp(Du,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Uy,""];if(new RegExp(Na).test(e)&&!/IEMobile\b/.test(e))return[Du+" "+Na,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=mN[r]||"";return/arm/i.test(e)&&(n="RT"),[Du,n]}return[Du,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[lp,e.join(".")]}return[lp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=U(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+gr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+gr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[gr,e.join(".")]}return[gr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var a=[t[1],t[2],t[3]||"0"];e[1]=a.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[uN,""]],[/Linux|debian/i,["Linux",""]]],G1=function(t){return hN.test(t)?zu:pN.test(t)?Vu:fN.test(t)?Ns:new RegExp(qy,"i").test(t)?qy:new RegExp("("+Uy+"|WPDesktop)","i").test(t)?Uy:/iPad/.test(t)?qA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?VA:Cx.test(t)?Hs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp($1,"i").test(t)?$1:/(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(Na).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)?gr:UA:gr:new RegExp("(pda|"+Na+")","i").test(t)?dN:new RegExp(Uu,"i").test(t)&&!new RegExp(Uu+" pc","i").test(t)?ek:""},jf="https?://(.*)",zs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],xN=qs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],zs),Wu="<masked>",bN=["li_fat_id"];function ak(t,e,a){if(!q)return{};var r,n=e?qs([],zs,a||[]):[],o=rk(Gu(q.URL,n,Wu),t),i=(r={},De(bN,(function(s){var l=vr.q(s);r[s]=l||null})),r);return Je(i,o)}function rk(t,e){var a=xN.concat(e||[]),r={};return De(a,(function(n){var o=op(t,n);r[n]=o||null})),r}function nk(t){var e=(function(o){return o?o.search(jf+"google.([^/?]*)")===0?"google":o.search(jf+"bing.com")===0?"bing":o.search(jf+"yahoo.com")===0?"yahoo":o.search(jf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!nn(e)){r.$search_engine=e;var n=q?op(q.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function W1(){return navigator.language||navigator.userLanguage}function ok(){return q?.referrer||"$direct"}function ik(t,e){var a=t?qs([],zs,e||[]):[],r=ta?.href.substring(0,1e3);return{r:ok().substring(0,1e3),u:r?Gu(r,a,Wu):void 0}}function sk(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=np(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=np(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=rk(r);Je(n,i)}if(a){var s=nk(a);Je(n,s)}return n}function lk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function SN(){try{return new Date().getTimezoneOffset()}catch{return}}function CN(t,e){if(!ea)return{};var a,r,n,o=t?qs([],zs,e||[]):[],[i,s]=(function(l){for(var u=0;u<j1.length;u++){var[c,d]=j1[u],h=c.exec(l),m=h&&(so(d)?d(h,l):d);if(m)return m}return["",""]})(ea);return Je(mx({$os:i,$os_version:s,$browser:tk(ea,navigator.vendor),$device:G1(ea),$device_type:(r=ea,n=G1(r),n===qA||n===UA||n==="Kobo"||n==="Kindle Fire"||n===ek?Uu:n===zu||n===Ns||n===Vu||n===qy?"Console":n===VA?"Wearable":n?Na:"Desktop"),$timezone:lk(),$timezone_offset:SN()}),{$current_url:Gu(ta?.href,o,Wu),$host:ta?.host,$pathname:ta?.pathname,$raw_user_agent:ea.length>1e3?ea.substring(0,997)+"...":ea,$browser_version:yN(ea,navigator.vendor),$browser_language:W1(),$browser_language_prefix:(a=W1(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:en.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ao=ct("[Web Vitals]"),Z1=9e5,Vy=class{constructor(e){var a;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(((r,n)=>G({},r,{["$web_vitals_"+n.name+"_event"]:G({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(U(o))ao.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();U(i)||(Ie(r?.name)||Ie(r?.value)?ao.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?ao.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),U(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=U(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(G({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,n,o,i,s=ae.__PosthogExtensions__;U(s)||U(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):ao.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[R1]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=mt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return U(r)?((a=this._instance.persistence)==null?void 0:a.props[M1])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=mt(this._instance.config.capture_performance)&&yr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Z1;return 0<e&&e<=6e4?Z1:e}get isEnabled(){var e=ta?.protocol;if(e!=="http:"&&e!=="https:")return ao.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:lo(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return lo(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(ao.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=mt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=mt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[R1]:a}),this._instance.persistence.register({[M1]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?ao.error("failed to load script",n):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=a?qs([],zs,r||[]):[];return Gu(e,n,Wu)}ao.error("Could not determine current URL")}},_N=ct("[Heatmaps]");function X1(t){return mt(t)&&"clientX"in t&&"clientY"in t&&yr(t.clientX)&&yr(t.clientY)}var $y=class{constructor(e){var a;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((a=this.instance.persistence)==null||!a.props[Sy]),this.rageclicks=new rp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return mt(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 U(this.instance.config.capture_heatmaps)?U(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;_N.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 a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Sy]:a}),this.Et=a,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"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){E&&q&&(this.jt=this.Dt.bind(this),nt(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),nt(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),nt(q,"mousemove",this.Nt,{capture:!0}),this.zt=new sp(this.instance,nN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),nt(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&q&&(this.jt&&E.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&xp(c)&&!co(c,"body");){if(c===u)return!1;if(pe(l,E?.getComputedStyle(c).position))return!0;c=TA(c)}return!1})(kA(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}At(e,a){var r;if(a===void 0&&(a="click"),!D1(e.target)&&X1(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(G({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!D1(e.target)&&X1(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var a=E.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?qs([],zs,n||[]):[],i=Gu(a,o,Wu);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Os(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},jy=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=E?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var r=this.Vt;if(!r)return{$pageview_id:a};var n={$pageview_id:a,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(U(i)||U(s)||U(l)||U(u)||U(c)||U(d))){i=Math.ceil(i),s=Math.ceil(s),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var h=i<=1?1:mr(s/i,0,1,z),m=i<=1?1:mr(l/i,0,1,z),S=u<=1?1:mr(c/u,0,1,z),b=u<=1?1:mr(d/u,0,1,z);n=Je(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},Pa=Uint8Array,Ut=Uint16Array,Us=Uint32Array,_x=new Pa([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]),wx=new Pa([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]),Y1=new Pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uk=function(t,e){for(var a=new Ut(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new Us(a[30]);for(r=1;r<30;++r)for(var o=a[r];o<a[r+1];++o)n[o]=o-a[r]<<5|r;return[a,n]},ck=uk(_x,2),wN=ck[0],Gy=ck[1];wN[28]=258,Gy[258]=28;for(Wy=uk(wx,0)[1],up=new Ut(32768),Oe=0;Oe<32768;++Oe)ro=(43690&Oe)>>>1|(21845&Oe)<<1,ro=(61680&(ro=(52428&ro)>>>2|(13107&ro)<<2))>>>4|(3855&ro)<<4,up[Oe]=((65280&ro)>>>8|(255&ro)<<8)>>>1;var ro,Wy,up,Oe,Fu=function(t,e,a){for(var r=t.length,n=0,o=new Ut(e);n<r;++n)++o[t[n]-1];var i,s=new Ut(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Ut(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],d=s[t[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)i[up[d]>>>l]=u}else for(i=new Ut(r),n=0;n<r;++n)i[n]=up[s[t[n]-1]++]>>>15-t[n];return i},fi=new Pa(288);for(Oe=0;Oe<144;++Oe)fi[Oe]=8;for(Oe=144;Oe<256;++Oe)fi[Oe]=9;for(Oe=256;Oe<280;++Oe)fi[Oe]=7;for(Oe=280;Oe<288;++Oe)fi[Oe]=8;var cp=new Pa(32);for(Oe=0;Oe<32;++Oe)cp[Oe]=5;var LN=Fu(fi,9,0),IN=Fu(cp,5,0),dk=function(t){return(t/8>>0)+(7&t&&1)},fk=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Ut?Ut:t instanceof Us?Us:Pa)(a-e);return r.set(t.subarray(e,a)),r},Jr=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},_u=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8,t[r+2]|=a>>>16},Qv=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,o=a.slice();if(!n)return[new Pa(0),0];if(n==1){var i=new Pa(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,w){return _.f-w.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=n-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(r=1;r<n;++r)o[r].s>h&&(h=o[r].s);var m=new Ut(h+1),S=Zy(a[c-1],m,0);if(S>e){r=0;var b=0,x=S-e,f=1<<x;for(o.sort((function(_,w){return m[w.s]-m[_.s]||_.f-w.f}));r<n;++r){var g=o[r].s;if(!(m[g]>e))break;b+=f-(1<<S-m[g]),m[g]=e}for(b>>>=x;b>0;){var v=o[r].s;m[v]<e?b-=1<<e-m[v]++-1:++r}for(;r>=0&&b;--r){var y=o[r].s;m[y]==e&&(--m[y],++b)}S=e}return[new Pa(m),S]},Zy=function(t,e,a){return t.s==-1?Math.max(Zy(t.l,e,a+1),Zy(t.r,e,a+1)):e[t.s]=a},K1=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Ut(++e),r=0,n=t[0],o=1,i=function(l){a[r++]=l},s=1;s<=e;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=t[s]}return[a.subarray(0,r),e]},wu=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},Xy=function(t,e,a){var r=a.length,n=dk(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<r;++o)t[n+o+4]=a[o];return 8*(n+4+r)},Q1=function(t,e,a,r,n,o,i,s,l,u,c){Jr(e,c++,a),++n[256];for(var d=Qv(n,15),h=d[0],m=d[1],S=Qv(o,15),b=S[0],x=S[1],f=K1(h),g=f[0],v=f[1],y=K1(b),_=y[0],w=y[1],C=new Ut(19),L=0;L<g.length;++L)C[31&g[L]]++;for(L=0;L<_.length;++L)C[31&_[L]]++;for(var k=Qv(C,7),A=k[0],M=k[1],T=19;T>4&&!A[Y1[T-1]];--T);var R,B,F,P,Y=u+5<<3,N=wu(n,fi)+wu(o,cp)+i,W=wu(n,h)+wu(o,b)+i+14+3*T+wu(C,A)+(2*C[16]+3*C[17]+7*C[18]);if(Y<=N&&Y<=W)return Xy(e,c,t.subarray(l,l+u));if(Jr(e,c,1+(W<N)),c+=2,W<N){R=Fu(h,m,0),B=h,F=Fu(b,x,0),P=b;var Q=Fu(A,M,0);for(Jr(e,c,v-257),Jr(e,c+5,w-1),Jr(e,c+10,T-4),c+=14,L=0;L<T;++L)Jr(e,c+3*L,A[Y1[L]]);c+=3*T;for(var aa=[g,_],dt=0;dt<2;++dt){var qt=aa[dt];for(L=0;L<qt.length;++L){var j=31&qt[L];Jr(e,c,Q[j]),c+=A[j],j>15&&(Jr(e,c,qt[L]>>>5&127),c+=qt[L]>>>12)}}}else R=LN,B=fi,F=IN,P=cp;for(L=0;L<s;++L)if(r[L]>255){j=r[L]>>>18&31,_u(e,c,R[j+257]),c+=B[j+257],j>7&&(Jr(e,c,r[L]>>>23&31),c+=_x[j]);var ne=31&r[L];_u(e,c,F[ne]),c+=P[ne],ne>3&&(_u(e,c,r[L]>>>5&8191),c+=wx[ne])}else _u(e,c,R[r[L]]),c+=B[r[L]];return _u(e,c,R[256]),c+B[256]},AN=new Us([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kN=(function(){for(var t=new Us(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),EN=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,h=new Pa(l+d+5*(1+Math.floor(d/7e3))+u),m=h.subarray(l,h.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=Xy(m,S,o.subarray(b,x)):(m[b]=c,S=Xy(m,S,o.subarray(b,d)))}else{for(var f=AN[i-1],g=f>>>13,v=8191&f,y=(1<<s)-1,_=new Ut(32768),w=new Ut(y+1),C=Math.ceil(s/3),L=2*C,k=function(Bp){return(o[Bp]^o[Bp+1]<<C^o[Bp+2]<<L)&y},A=new Us(25e3),M=new Ut(288),T=new Ut(32),R=0,B=0,F=(b=0,0),P=0,Y=0;b<d;++b){var N=k(b),W=32767&b,Q=w[N];if(_[W]=Q,w[N]=W,P<=b){var aa=d-b;if((R>7e3||F>24576)&&aa>423){S=Q1(o,m,0,A,M,T,B,F,Y,b-Y,S),F=R=B=0,Y=b;for(var dt=0;dt<286;++dt)M[dt]=0;for(dt=0;dt<30;++dt)T[dt]=0}var qt=2,j=0,ne=v,At=W-Q&32767;if(aa>2&&N==k(b-At))for(var ln=Math.min(g,aa)-1,Mp=Math.min(32767,b),Dp=Math.min(258,aa);At<=Mp&&--ne&&W!=Q;){if(o[b+qt]==o[b+qt-At]){for(var un=0;un<Dp&&o[b+un]==o[b+un-At];++un);if(un>qt){if(qt=un,j=At,un>ln)break;var IE=Math.min(At,un-2),xb=0;for(dt=0;dt<IE;++dt){var Op=b-At+dt+32768&32767,bb=Op-_[Op]+32768&32767;bb>xb&&(xb=bb,Q=Op)}}}At+=(W=Q)-(Q=_[W])+32768&32767}if(j){A[F++]=268435456|Gy[qt]<<18|Wy[j];var Sb=31&Gy[qt],Cb=31&Wy[j];B+=_x[Sb]+wx[Cb],++M[257+Sb],++T[Cb],P=b+qt,++R}else A[F++]=o[b],++M[o[b]]}}S=Q1(o,m,c,A,M,T,B,F,Y,b-Y,S)}return fk(h,0,l+dk(S)+u)})(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,a,r,!0)},Jv=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function TN(t,e){e===void 0&&(e={});var a=(function(){var s=4294967295;return{p:function(l){for(var u=s,c=0;c<l.length;++c)u=kN[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=EN(t,e,10+((n=e).filename&&n.filename.length+1||0),8),i=o.length;return(function(s,l){var u=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&&Jv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){s[3]=8;for(var c=0;c<=u.length;++c)s[c+10]=u.charCodeAt(c)}})(o,e),Jv(o,i-8,a.d()),Jv(o,i-4,r),o}var RN=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
459
+ `,Da,jn,Gn,jr,Gr,Wn,Wr,hv=class extends HTMLElement{constructor(){super();cn(this,Da);cn(this,jn);cn(this,Gn);cn(this,jr);cn(this,Gr);cn(this,Wn,null);cn(this,Wr,null);ar(this,Da,this.attachShadow({mode:"open",delegatesFocus:!0})),ar(this,jn,document.createElement("div")),ge(this,jn).setAttribute("part","mount"),ge(this,Da).appendChild(ge(this,jn)),ar(this,Gn,document.createElement("div")),ge(this,Gn).id="portalRoot",ge(this,Da).appendChild(ge(this,Gn)),ar(this,jr,document.createElement("div")),ge(this,jr).id="overlayContainer",Object.assign(ge(this,jr).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,Da).appendChild(ge(this,jr)),ar(this,Gr,XL()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Wn)?.unmount(),ar(this,Wn,null)}getMountNode(){return ge(this,jn)}getController(){return ge(this,Gr)}getPortalRoot(){return ge(this,Gn)}getOverlayContainer(){return ge(this,jr)}getShadowRoot(){return ge(this,Da)}open(){ge(this,Gr).setOpen(!0)}close(){ge(this,Gr).setOpen(!1)}toggle(){ge(this,Gr).toggle()}setOverrideFetcher(a){ge(this,Wr)&&(ar(this,Wr,{...ge(this,Wr),fetcher:a}),this.render())}mountReactApp(a){ar(this,Wr,a),this.render()}render(){!this.isConnected||!ge(this,Wr)||(ge(this,Wn)||ar(this,Wn,(0,vI.createRoot)(ge(this,jn))),ge(this,Wn).render((0,mv.jsx)(KL,{shadowRoot:ge(this,Da),portalRoot:ge(this,Gn),overlayContainer:ge(this,jr),children:(0,mv.jsx)(hI,{...ge(this,Wr),controller:ge(this,Gr),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Da).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(gI),ge(this,Da).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=gI,ge(this,Da).appendChild(a)}}};Da=new WeakMap,jn=new WeakMap,Gn=new WeakMap,jr=new WeakMap,Gr=new WeakMap,Wn=new WeakMap,Wr=new WeakMap;var yI=()=>{typeof window>"u"||customElements.get(mI)||customElements.define(mI,hv)};var gv=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=NL(x)}let a=null,r=null,n=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(x))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();a=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,g)=>`[${g}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await i(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&lf(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=zL();yI();let u=document.createElement("smart-canvas");if(WL(u.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))u.style.setProperty(x,f);let c=()=>{let x=t.target??document.body;x&&x.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),VL(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,m=t.fetcher??cs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=m);let S={fetcher:m,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:n,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:x=>{for(let[f,g]of Object.entries(x))u.style.setProperty(f,g)},getConfig:async()=>{if(r)try{let x=await r();return a=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?a&&await i(a.actions):await s()},setOverrideFetcher:x=>{r=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&lf(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{h?.register?.(x)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(x,f)=>h?.track?(h.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 gv(t)}});var Xn=K(We(),1);var Zn=K(Me(),1);function Bq({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,Xn.useState)(0),o=(0,Xn.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,Xn.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,Xn.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,Xn.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,Zn.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,Zn.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Zn.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Zn.jsx)(uu,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Zn.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Zn.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===r?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>n(s)},i.id))})]}):null}function cu(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function Pq(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let r=t;if(r.tiles||a.push("Config missing required field: tiles"),r.actions||a.push("Config missing required field: actions"),r.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let n=r.schemaVersion||"1.0",o=cu(n),i=cu(qn);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${qn}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!r.schemaVersion?(e.push(`Config schema v${n} is older than SDK v${qn}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:JD(r,n)}):{valid:!0,warnings:e,errors:a}}function JD(t,e){let a={...t};return cu(e).major===1&&(a=eO(a)),a.schemaVersion=qn,a}function eO(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(a=>{let r={...a};return a.experiment&&delete r.experiment,r})),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 Hq(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=cu(a),n=cu(qn);return r.major<n.major||!e.schemaVersion}var bI={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function SI(){return bI}function vv(t){let e=2166136261,a=t.length;for(let r=0;r<a;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function du(t,e,a){return a===2?vv(vv(t+e)+"")%1e4/1e4:a===1?vv(e+t)%1e3/1e3:null}function tO(t){return t<=0?[]:new Array(t).fill(1/t)}function mf(t,e){return t>=e[0]&&t<e[1]}function CI(t,e){let a=du("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function _I(t,e){for(let a=0;a<e.length;a++)if(mf(t,e[a]))return a;return-1}function xv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function gf(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=nO(t,e[n].type,e[n].pattern);if(e[n].include===!1){if(o)return!1}else a=!0,o&&(r=!0)}return r||!a}function aO(t,e,a){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function rO(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&r.push([t.hash,a.hash,!1]),a.searchParams.forEach((n,o)=>{r.push([t.searchParams.get(o)||"",n,!1])}),!r.some(n=>!aO(n[0],n[1],n[2]))}catch{return!1}}function nO(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=xv(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return rO(r,a);return!1}catch{return!1}}function wI(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=tO(t);a=a||r,a.length!==t&&(a=r);let n=a.reduce((i,s)=>s+i,0);(n<.99||n>1.01)&&(a=r);let o=0;return a.map(i=>{let s=o;return o+=i,[s,s+e*i]})}function LI(t,e,a){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let n=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return n.length>0&&n[0]>=0&&n[0]<a?n[0]:null}function II(t){try{return t()}catch(e){return console.error(e),!1}}var yv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function $o(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||bI.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",yv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:yv(n)},r,yv(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function fu(t){return typeof t=="string"?t:JSON.stringify(t)}function va(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(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function AI(){let t;try{t="1.6.4"}catch{t=""}return t}function kI(t,e){let a,r;try{a=new URL(t),r=new URL(e)}catch(n){return console.error(`Unable to merge query strings: ${n}`),e}return a.searchParams.forEach((n,o)=>{r.searchParams.has(o)||r.searchParams.set(o,n)}),r.toString()}function xI(t){return typeof t=="object"&&t!==null}function vf(t){return t.urlPatterns&&t.variations.some(e=>xI(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>xI(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function yf(t,e){return new Promise(a=>{let r=!1,n,o=i=>{r||(r=!0,n&&clearTimeout(n),a(i||null))};e&&(n=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},dr=SI(),gs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>dr.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:r})=>{let n={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(a)};return dr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new dr.EventSource(`${t}/sub/${e}`,{headers:a}):new dr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),sO()):document.visibilityState==="hidden"&&(t=window.setTimeout(iO,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(dr.localStorage=globalThis.localStorage)}catch{}var vs=new Map,EI=!1,Zr=new Map,xf=new Map,ys=new Map,xs=new Set;function RI(t){Object.assign(Rt,t),Rt.backgroundSync||Lv()}async function MI({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Rt.backgroundSync=!1),lO({instance:t,allowStale:r,timeout:e,skipCache:a})}function oO(t){let e=pu(t),a=vs.get(e)||new Set;a.add(t),vs.set(e,a)}function DI(t){vs.forEach(e=>e.delete(t))}function iO(){ys.forEach(t=>{t&&(t.state="idle",_v(t))})}function sO(){ys.forEach(t=>{t&&t.state==="idle"&&wv(t)})}async function TI(){try{if(!dr.localStorage)return;await dr.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(Zr.entries())))}catch{}}async function lO({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=pu(t),o=Sv(t),i=new Date,s=new Date(i.getTime()-Rt.maxAge+Rt.staleTTL);await uO();let l=!Rt.disableCache&&!r?Zr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&xs.add(n),l.staleAt<i?bv(t):Cv(t),{data:l.data,success:!0,source:"cache"}):await yf(bv(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function pu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function Sv(t){let e=pu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),n={};r.forEach(s=>{n[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:n,fv:o,url:i})}`}async function uO(){if(!EI){EI=!0;try{if(dr.localStorage){let t=await dr.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Zr.set(a,{...r,staleAt:new Date(r.staleAt)})}),OI()}}}catch{}if(!Rt.disableIdleStreams){let t=gs.startIdleListener();t&&(gs.stopIdleListener=t)}}}function OI(){let t=Array.from(Zr.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Zr.size-Rt.maxEntries),Zr.size);for(let a=0;a<e;a++)Zr.delete(t[a].key)}function BI(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:Zr.get(e);if(o&&r&&o.version===r){o.staleAt=n,TI();return}Rt.disableCache||(Zr.set(e,{data:a,version:r,staleAt:n,sse:xs.has(t)}),OI()),TI();let i=vs.get(t);i&&i.forEach(s=>cO(s,a))}async function cO(t,e){await t.setPayload(e||t.getPayload())}async function bv(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=pu(t),i=Sv(t),s=xf.get(i);return s||(s=(n?gs.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):gs.fetchFeaturesCall({host:e,clientKey:r,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&xs.add(o),u.json()}).then(u=>(BI(o,i,u),Cv(t),xf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(xf.delete(i),{data:null,source:"error",success:!1,error:u})),xf.set(i,s)),s}function Cv(t,e=!1){let a=pu(t),r=Sv(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&xs.add(a),Rt.backgroundSync&&xs.has(a)&&dr.EventSource){if(ys.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=vs.get(a);u&&u.forEach(c=>{bv(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);BI(a,r,u)}s.errors=0}catch{FI(s)}},errors:0,state:"active"};ys.set(a,s),wv(s)}}function FI(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);_v(t),setTimeout(()=>{["idle","active"].includes(t.state)||wv(t)},Math.min(e,3e5))}}function _v(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function wv(t){t.src=gs.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=()=>FI(t),t.src.onopen=()=>{t.errors=0}}function dO(t,e){_v(t),ys.delete(e)}function Lv(){xs.clear(),ys.forEach(dO),vs.clear(),gs.stopIdleListener()}function bf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Cv(t,!0),oO(t)}}var fO=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,kv={revert:function(){}},wf=new Map,Ev=new Set;function pO(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Lf(t){var e=wf.get(t);return e||(e={element:t,attributes:{}},wf.set(t,e)),e}function If(t,e,a,r,n){var o=a(t),i={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&i._positionTimeout)){e==="position"&&(i._positionTimeout=setTimeout(function(){i._positionTimeout=null},1e3));var s=a(t);e==="position"&&s.parentNode===i.virtualValue.parentNode&&s.insertBeforeNode===i.virtualValue.insertBeforeNode||s!==i.virtualValue&&(i.originalValue=s,n(i))}}),mutationRunner:n,setValue:r,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,pO(e)),i}function Af(t,e){var a=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!a||t.parentNode!==a.parentNode||t.insertBeforeNode!==a.insertBeforeNode)&&(e.isDirty=!0,NI()):t!==a&&(e.isDirty=!0,NI())}function hO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Af(kO(e),t)}function mO(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),Af(Array.from(e).filter(Boolean).join(" "),t)}function gO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Af(e,t)}function vO(t){var e=t.parentSelector,a=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var n=a?document.querySelector(a):null;return a&&!n?null:{parentNode:r,insertBeforeNode:n}}function yO(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=vO(r);e=n||e}),Af(e,t)}var xO=function(e){return e.innerHTML},bO=function(e,a){return e.innerHTML=a};function HI(t){var e=Lf(t);return e.html||(e.html=If(t,"html",xO,bO,hO)),e.html}var SO=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},CO=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function UI(t){var e=Lf(t);return e.position||(e.position=If(t,"position",SO,CO,yO)),e.position}var _O=function(e,a){return a?e.className=a:e.removeAttribute("class")},wO=function(e){return e.className};function qI(t){var e=Lf(t);return e.classes||(e.classes=If(t,"class",wO,_O,mO)),e.classes}var LO=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},IO=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function zI(t,e){var a=Lf(t);return a.attributes[e]||(a.attributes[e]=If(t,e,LO(e),IO(e),gO)),a.attributes[e]}function AO(t,e){var a=wf.get(t);if(a)if(e==="html"){var r,n;(r=a.html)==null||(n=r.observer)==null||n.disconnect(),delete a.html}else if(e==="class"){var o,i;(o=a.classes)==null||(i=o.observer)==null||i.disconnect(),delete a.classes}else if(e==="position"){var s,l;(s=a.position)==null||(l=s.observer)==null||l.disconnect(),delete a.position}else{var u,c,d;(u=a.attributes)==null||(c=u[e])==null||(d=c.observer)==null||d.disconnect(),delete a.attributes[e]}}var Sf;function kO(t){return Sf||(Sf=document.createElement("div")),Sf.innerHTML=t,Sf.innerHTML}function Cf(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||AO(t,e),a.setValue(t,r)}}function EO(t,e){t.html&&Cf(e,"html",t.html),t.classes&&Cf(e,"class",t.classes),t.position&&Cf(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){Cf(e,a,t.attributes[a])})}function NI(){wf.forEach(EO)}function TO(t,e){var a=null;t.kind==="html"?a=HI(e):t.kind==="class"?a=qI(e):t.kind==="attribute"?a=zI(e,t.attribute):t.kind==="position"&&(a=UI(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function RO(t,e){var a=null;if(t.kind==="html"?a=HI(e):t.kind==="class"?a=qI(e):t.kind==="attribute"?a=zI(e,t.attribute):t.kind==="position"&&(a=UI(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function VI(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(r){e.has(r)||(t.elements.add(r),TO(t,r))})}}function MO(t){t.elements.forEach(function(e){return RO(t,e)}),t.elements.clear(),Ev.delete(t)}function PI(){Ev.forEach(VI)}var Iv;function DO(){typeof document>"u"||(Iv||(Iv=new MutationObserver(function(){PI()})),PI(),Iv.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}DO();function kf(t){return typeof document>"u"?kv:(Ev.add(t),VI(t),{revert:function(){MO(t)}})}function Av(t,e){return kf({kind:"html",elements:new Set,mutate:e,selector:t})}function $I(t,e){return kf({kind:"position",elements:new Set,mutate:e,selector:t})}function hu(t,e){return kf({kind:"class",elements:new Set,mutate:e,selector:t})}function _f(t,e,a){return fO.test(e)?e==="class"||e==="className"?hu(t,function(r){var n=a(Array.from(r).join(" "));r.clear(),n&&n.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):kf({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):kv}function OO(t){var e=t.selector,a=t.action,r=t.value,n=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(n==="html"){if(a==="append")return Av(e,function(s){return s+(r??"")});if(a==="set")return Av(e,function(){return r??""})}else if(n==="class"){if(a==="append")return hu(e,function(s){r&&s.add(r)});if(a==="remove")return hu(e,function(s){r&&s.delete(r)});if(a==="set")return hu(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return $I(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return _f(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return _f(e,n,function(){return r??""});if(a==="remove")return _f(e,n,function(){return null})}return kv}var BO={html:Av,classes:hu,attribute:_f,position:$I,declarative:OO},jI=BO;var Tv={};function Yn(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!ZI(t,n,a))return!1;break;case"$nor":if(ZI(t,n,a))return!1;break;case"$and":if(!UO(t,n,a))return!1;break;case"$not":if(Yn(t,n,a))return!1;break;default:if(!mu(n,FO(t,r),a))return!1}return!0}function FO(t,e){let a=e.split("."),r=t;for(let n=0;n<a.length;n++)if(r&&typeof r=="object"&&a[n]in r)r=r[a[n]];else return null;return r}function GI(t,e=!1){let a=`${t}${e?"/i":""}`;return Tv[a]||(Tv[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Tv[a]}function mu(t,e,a,r=!1){if(typeof t=="string")return r?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)||!XI(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!HO(n,e,t[n],a))return!1;return!0}function XI(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function NO(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 PO(t,e,a){if(!Array.isArray(t))return!1;let r=XI(e)?n=>mu(e,n,a):n=>Yn(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function bs(t,e,a=!1){if(a){let r=n=>typeof n=="string"?n.toLowerCase():n;return Array.isArray(t)?t.some(n=>e.some(o=>r(n)===r(o))):e.some(n=>r(t)===r(n))}return Array.isArray(t)?t.some(r=>e.includes(r)):e.includes(t)}function WI(t,e,a,r=!1){if(!Array.isArray(t))return!1;for(let n=0;n<e.length;n++){let o=!1;for(let i=0;i<t.length;i++)if(mu(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function HO(t,e,a,r){switch(t){case"$veq":return va(e)===va(a);case"$vne":return va(e)!==va(a);case"$vgt":return va(e)>va(a);case"$vgte":return va(e)>=va(a);case"$vlt":return va(e)<va(a);case"$vlte":return va(e)<=va(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?bs(e,a):!1;case"$ini":return Array.isArray(a)?bs(e,a,!0):!1;case"$inGroup":return bs(e,r[a]||[]);case"$notInGroup":return!bs(e,r[a]||[]);case"$nin":return Array.isArray(a)?!bs(e,a):!1;case"$nini":return Array.isArray(a)?!bs(e,a,!0):!1;case"$not":return!mu(a,e,r);case"$size":return Array.isArray(e)?mu(a,e.length,r):!1;case"$elemMatch":return PO(e,a,r);case"$all":return Array.isArray(a)?WI(e,a,r):!1;case"$alli":return Array.isArray(a)?WI(e,a,r,!0):!1;case"$regex":try{return GI(a).test(e)}catch{return!1}case"$regexi":try{return GI(a,!0).test(e)}catch{return!1}case"$type":return NO(e)===a;default:return console.error("Unknown operator: "+t),!1}}function ZI(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Yn(t,e[r],a))return!0;return!1}function UO(t,e,a){for(let r=0;r<e.length;r++)if(!Yn(t,e[r],a))return!1;return!0}var qO="Feature Evaluated",zO="Experiment Viewed";function VO(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),e}function $O(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 Ss(t){try{await t()}catch{}}function YI(t,e,a){if(t.user.trackedExperiments){let n=Rf(e,a);if(t.user.trackedExperiments.has(n))return[];t.user.trackedExperiments.add(n)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:a,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let n=t.global.trackingCallback;r.push(Ss(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Ss(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Ss(()=>n(zO,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function jO(t,e,a){if(t.user.trackedFeatureUsage){let r=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:a,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;Ss(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Ss(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Ss(()=>r(qO,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function Ef(t,e){if(e.stack.evaluatedFeatures.has(t))return Kn(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=VO(e);if(a.has(t))return Kn(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return Kn(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let n=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(n);let u=Ef(l.id,e);if(u.source==="cyclicPrerequisite")return Kn(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Yn(c,l.condition||{})){if(l.gate)return Kn(e,t,null,"prerequisite");continue e}}if(o.filters&&JI(o.filters,e))continue;if("force"in o){if(o.condition&&!QI(o.condition,e)||!GO(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=>{!YI(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Kn(e,t,o.force,"force",o.id)}if(!o.variations)continue;let i={variations:o.variations,key:o.key||t};"coverage"in o&&(i.coverage=o.coverage),o.weights&&(i.weights=o.weights),o.hashAttribute&&(i.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(i.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(i.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(i.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(i.minBucketVersion=o.minBucketVersion),o.namespace&&(i.namespace=o.namespace),o.meta&&(i.meta=o.meta),o.ranges&&(i.ranges=o.ranges),o.name&&(i.name=o.name),o.phase&&(i.phase=o.phase),o.seed&&(i.seed=o.seed),o.hashVersion&&(i.hashVersion=o.hashVersion),o.filters&&(i.filters=o.filters),o.condition&&(i.condition=o.condition);let{result:s}=Tf(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return Kn(e,t,s.value,"experiment",o.id,i,s)}}return Kn(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Tf(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:$e(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:$e(a,t,-1,!1,e)};if(t=WO(t,a),t.urlPatterns&&!gf(a.user.url||"",t.urlPatterns))return{result:$e(a,t,-1,!1,e)};let o=LI(r,a.user.url||"",n);if(o!==null)return{result:$e(a,t,o,!1,e)};let i=$O(a);if(r in i){let x=i[r];return{result:$e(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:$e(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=jo(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:$e(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=YO({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,d=!!f}if(!c){if(t.filters){if(JI(t.filters,a))return{result:$e(a,t,-1,!1,e)}}else if(t.namespace&&!CI(l,t.namespace))return{result:$e(a,t,-1,!1,e)};if(t.include&&!II(t.include))return{result:$e(a,t,-1,!1,e)};if(t.condition&&!QI(t.condition,a))return{result:$e(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let f of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let g=Ef(f.id,a);if(g.source==="cyclicPrerequisite")return{result:$e(a,t,-1,!1,e)};let v={value:g.value};if(!Yn(v,f.condition||{}))return{result:$e(a,t,-1,!1,e)}}}if(t.groups&&!XO(t.groups,a))return{result:$e(a,t,-1,!1,e)}}if(t.url&&!ZO(t.url,a))return{result:$e(a,t,-1,!1,e)};let h=du(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:$e(a,t,-1,!1,e)};if(!c){let x=t.ranges||wI(n,t.coverage===void 0?1:t.coverage,t.weights);u=_I(h,x)}if(d)return{result:$e(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:$e(a,t,-1,!1,e)};if("force"in t)return{result:$e(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:$e(a,t,-1,!1,e)};if(t.status==="stopped")return{result:$e(a,t,-1,!1,e)};let m=$e(a,t,u,!0,e,h,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:g}=QO(a,s,fu(l),{[Rv(t.key,t.bucketVersion)]:m.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[f]=g,a.user.saveStickyBucketAssignmentDoc(g))}let S=YI(a,t,m);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:m});let b=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:m,trackingCall:b}}function Kn(t,e,a,r,n,o,i){let s={value:a,on:!!a,off:!a,source:r,ruleId:n||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),r!=="override"&&jO(t,e,s),s}function KI(t){return{...t.user.attributes,...t.user.attributeOverrides}}function QI(t,e){return Yn(KI(e),t,e.global.savedGroups||{})}function JI(t,e){return t.some(a=>{let{hashValue:r}=jo(e,a.attribute);if(!r)return!0;let n=du(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>mf(n,o))})}function GO(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=jo(t,a,r);if(!s)return!1;let l=du(e,s,i||1);return l===null?!1:n?mf(l,n):o!==void 0?l<=o:!0}function $e(t,e,a,r,n,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=jo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:n,inExperiment:s,hashUsed:r,variationId:a,value:e.variations[a],hashAttribute:l,hashValue:u,stickyBucketUsed:!!i};return c.name&&(d.name=c.name),o!==void 0&&(d.bucket=o),c.passthrough&&(d.passthrough=c.passthrough),d}function WO(t,e){let a=t.key,r=e.global.overrides;return r&&r[a]&&(t=Object.assign({},t,r[a]),typeof t.url=="string"&&(t.url=xv(t.url))),t}function jo(t,e,a){let r=e||"id",n="",o=KI(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function ZO(t,e){let a=e.user.url;if(!a)return!1;let r=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(r))}function XO(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function YO({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:r,expFallbackAttribute:n,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,r=r||"id",i=i||[];let s=Rv(e,a),l=KO(t,r,n);if(o>0)for(let d=0;d<o;d++){let h=Rv(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[s];if(u===void 0)return{variation:-1};let c=i.findIndex(d=>d.key===u);return c<0?{variation:-1}:{variation:c}}function Rv(t,e){return e=e||0,`${t}__${e}`}function Mv(t,e){return`${t}||${e}`}function KO(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=jo(t,e),o=Mv(r,fu(n)),{hashAttribute:i,hashValue:s}=jo(t,a),l=s?Mv(i,fu(s)):null,u={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[o].assignments||{}),u}function QO(t,e,a,r){let n=Mv(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[n]?t.user.stickyBucketAssignmentDocs[n].assignments||{}:{},i={...o,...r},s=JSON.stringify(o)!==JSON.stringify(i);return{key:n,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function JO(t,e){let a=new Set,r=e&&e.features?e.features:t.global.features||{},n=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let i=r[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),n.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function e1(t,e,a){let r=Dv(t,a);return e.getAllAssignments(r)}function Dv(t,e){let a={};return JO(t,e).forEach(n=>{let{hashValue:o}=jo(t,n);a[n]=fu(o)}),a}async function t1(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await $o(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await $o(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await $o(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function a1(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 Rf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Cs=typeof window<"u"&&typeof document<"u",eB=AI(),gu=class{constructor(e){if(e=e||{},this.version=eB,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 a=!1;try{a=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(a)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 a=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>a.saveAssignments(r)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),Cs&&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 a in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[a];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let a=await t1(e,this._options.decryptionKey);this._decryptedPayload=a,await this.refreshStickyBuckets(a),a.features&&(this._options.features=a.features),a.savedGroups&&(this._options.savedGroups=a.savedGroups),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let a=e.payload;if(a.encryptedExperiments||a.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,a)),this._payload=a,this._decryptedPayload=a,a.features&&(this._options.features=a.features),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,bf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&RI(e.cacheSettings),e.payload)return await this.setPayload(e.payload),bf(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return bf(this,e),await this.setPayload(a||{}),r}}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 a=await this._refresh({...e||{},allowStale:!1});a.data&&await this.setPayload(a.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return a1(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:a,allowStale:r,streaming:n}){if(!this._options.clientKey)throw new Error("Missing clientKey");return MI({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:r,backgroundSync:n??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,a,r){let n=await $o(e,a||this._options.decryptionKey,r);this.setFeatures(JSON.parse(n))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,r){let n=await $o(e,a||this._options.decryptionKey,r);this.setExperiments(JSON.parse(n))}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(a=>{try{a()}catch(r){console.error(r)}}),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,DI(this),e.destroyAllStreams&&Lv(),this.logs=[],Cs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(a=>{a.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,a){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=a,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:a}=Tf(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==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,a){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let n=this._isAutoExperimentBlockedByContext(e),o,i;n?o=$e(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=Tf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&r&&r.valueHash===s)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=vf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?kI(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(gf(u,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=u;let{navigate:c,delay:d}=this._getNavigateFunction();if(c)if(Cs)Promise.all([...i?[yf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(h){console.error(h)}});else try{c(u)}catch(h){console.error(h)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let a=this._activeAutoExperiments.get(e);a&&(a.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let a=this._options.experiments||[],r=new Set(a);this._activeAutoExperiments.forEach((n,o)=>{r.has(o)||(n.undo(),this._activeAutoExperiments.delete(o))});for(let n of a){let o=this._runAutoExperiment(n,e);if(o&&o.inExperiment&&vf(n)==="redirect")break}}_onExperimentEval(e,a){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,r)}_fireSubscriptions(e,a,r){(!r||r.result.inExperiment!==a.inExperiment||r.result.variationId!==a.variationId)&&this._subscriptions.forEach(n=>{try{n(e,a)}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,a){let r=this.evalFeature(e).value;return r===null?a:r}feature(e){return this.evalFeature(e)}evalFeature(e){return Ef(e,this._getEvalContext())}log(e,a){this.debug&&(this._options.log?this._options.log(e,a):console.log(e,a))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(a=>a&&a.experiment&&a.result).map(a=>[Rf(a.experiment,a.result),a]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(a=>{!a||!a.experiment||!a.result?console.error("Invalid deferred tracking call",{call:a}):e.push(this._options.trackingCallback(a.experiment,a.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,a){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:a,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,a||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Rf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Cs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=vf(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let n of e.variations){if(!n||!n.urlRedirect)continue;let o=new URL(n.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!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}:Cs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Cs)return;let a=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),a.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),a.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{a.push(jI.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await e1(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),n=Dv(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var tB="https://experiment.syntrologie.com",Ov=class{constructor(e={}){$(this,"gb");$(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(r,n)=>{e.onExperimentViewed(r.key,n.variationId,typeof n.value=="string"?n.value:`variation_${n.variationId}`)}:void 0;this.gb=new gu({...e,apiHost:e.apiHost??tB,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes({...this.gb.getAttributes(),...e})}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let r of Object.keys(e))a[r]=this.gb.getFeatureValue(r,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function Bv(t={}){return new Ov(t)}var r1="syntro_session_metrics",Mf=class{constructor(e={}){$(this,"metrics",new Map);$(this,"experiments");$(this,"attributePrefix");$(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let n=(this.metrics.get(e)??0)+a;return this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n),n}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}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 a={};for(let r of e)a[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,r]of this.metrics)e[`${this.attributePrefix}${a}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(r1);if(e){let a=JSON.parse(e);for(let[r,n]of Object.entries(a))this.metrics.set(r,n.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[a,r]of this.metrics)e[a]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(r1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Fv(t={}){return new Mf(t)}var p={};DE(p,{BRAND:()=>AB,DIRTY:()=>Go,EMPTY_PATH:()=>oB,INVALID:()=>J,NEVER:()=>dF,OK:()=>Mt,ParseStatus:()=>wt,Schema:()=>ue,ZodAny:()=>eo,ZodArray:()=>Qr,ZodBigInt:()=>Zo,ZodBoolean:()=>Xo,ZodBranded:()=>yu,ZodCatch:()=>ii,ZodDate:()=>Yo,ZodDefault:()=>oi,ZodDiscriminatedUnion:()=>Bf,ZodEffects:()=>Fa,ZodEnum:()=>ri,ZodError:()=>Qt,ZodFirstPartyTypeKind:()=>ee,ZodFunction:()=>Nf,ZodIntersection:()=>ei,ZodIssueCode:()=>O,ZodLazy:()=>ti,ZodLiteral:()=>ai,ZodMap:()=>ks,ZodNaN:()=>Ts,ZodNativeEnum:()=>ni,ZodNever:()=>Ja,ZodNull:()=>Qo,ZodNullable:()=>hr,ZodNumber:()=>Wo,ZodObject:()=>Jt,ZodOptional:()=>Oa,ZodParsedType:()=>V,ZodPipeline:()=>xu,ZodPromise:()=>to,ZodReadonly:()=>si,ZodRecord:()=>Ff,ZodSchema:()=>ue,ZodSet:()=>Es,ZodString:()=>Jn,ZodSymbol:()=>Is,ZodTransformer:()=>Fa,ZodTuple:()=>pr,ZodType:()=>ue,ZodUndefined:()=>Ko,ZodUnion:()=>Jo,ZodUnknown:()=>Kr,ZodVoid:()=>As,addIssueToContext:()=>H,any:()=>FB,array:()=>UB,bigint:()=>RB,boolean:()=>h1,coerce:()=>cF,custom:()=>d1,date:()=>MB,datetimeRegex:()=>u1,defaultErrorMap:()=>Xr,discriminatedUnion:()=>$B,effect:()=>aF,enum:()=>JB,function:()=>YB,getErrorMap:()=>_s,getParsedType:()=>fr,instanceof:()=>EB,intersection:()=>jB,isAborted:()=>Df,isAsync:()=>ws,isDirty:()=>Of,isValid:()=>Qn,late:()=>kB,lazy:()=>KB,literal:()=>QB,makeIssue:()=>vu,map:()=>ZB,nan:()=>TB,nativeEnum:()=>eF,never:()=>PB,null:()=>BB,nullable:()=>nF,number:()=>p1,object:()=>qB,objectUtil:()=>Nv,oboolean:()=>uF,onumber:()=>lF,optional:()=>rF,ostring:()=>sF,pipeline:()=>iF,preprocess:()=>oF,promise:()=>tF,quotelessJson:()=>aB,record:()=>WB,set:()=>XB,setErrorMap:()=>nB,strictObject:()=>zB,string:()=>f1,symbol:()=>DB,transformer:()=>aF,tuple:()=>GB,undefined:()=>OB,union:()=>VB,unknown:()=>NB,util:()=>fe,void:()=>HB});var fe;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function a(n){throw new Error}t.assertNever=a,t.arrayToEnum=n=>{let o={};for(let i of n)o[i]=i;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),i={};for(let s of o)i[s]=n[s];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(i);return o},t.find=(n,o)=>{for(let i of n)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,o=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(fe||(fe={}));var Nv;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Nv||(Nv={}));var V=fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fr=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 O=fe.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"]),aB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let s=r,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),r}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,fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];a[o]=a[o]||[],a[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Qt.create=t=>new Qt(t);var rB=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===V.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,fe.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:a=`Unrecognized key(s) in object: ${fe.joinValues(t.keys,", ")}`;break;case O.invalid_union:a="Invalid input";break;case O.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${fe.joinValues(t.options)}`;break;case O.invalid_enum_value:a=`Invalid enum value. Expected ${fe.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:a="Invalid function arguments";break;case O.invalid_return_type:a="Invalid function return type";break;case O.invalid_date:a="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:fe.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case O.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case O.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case O.custom:a="Invalid input";break;case O.invalid_intersection_types:a="Intersection results could not be merged";break;case O.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:a="Number must be finite";break;default:a=e.defaultError,fe.assertNever(t)}return{message:a}},Xr=rB;var n1=Xr;function nB(t){n1=t}function _s(){return n1}var vu=t=>{let{data:e,path:a,errorMaps:r,issueData:n}=t,o=[...a,...n.path||[]],i={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...n,path:o,message:s}},oB=[];function H(t,e){let a=_s(),r=vu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Xr?void 0:Xr].filter(n=>!!n)});t.common.issues.push(r)}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,a){let r=[];for(let n of a){if(n.status==="aborted")return J;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let n of a){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let n of a){let{key:o,value:i}=n;if(o.status==="aborted"||i.status==="aborted")return J;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}},J=Object.freeze({status:"aborted"}),Go=t=>({status:"dirty",value:t}),Mt=t=>({status:"valid",value:t}),Df=t=>t.status==="aborted",Of=t=>t.status==="dirty",Qn=t=>t.status==="valid",ws=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 Ba=class{constructor(e,a,r,n){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=n}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}},o1=(t,e)=>{if(Qn(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 a=new Qt(t.common.issues);return this._error=a,this._error}}};function le(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:n}=t;if(e&&(a||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:n}}var ue=class{get description(){return this._def.description}_getType(e){return fr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:fr(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:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(ws(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){let r={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return o1(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return Qn(r)?{value:r.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(r=>Qn(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(ws(n)?n:Promise.resolve(n));return o1(r,o)}refine(e,a){let r=n=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(n):a;return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:O.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof a=="function"?a(r,n):a),!1))}_refinement(e){return new Fa({schema:this,typeName:ee.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:a=>this["~validate"](a)}}optional(){return Oa.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return to.create(this,this._def)}or(e){return Jo.create([this,e],this._def)}and(e){return ei.create(this,e,this._def)}transform(e){return new Fa({...le(this._def),schema:this,typeName:ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new oi({...le(this._def),innerType:this,defaultValue:a,typeName:ee.ZodDefault})}brand(){return new yu({typeName:ee.ZodBranded,type:this,...le(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ii({...le(this._def),innerType:this,catchValue:a,typeName:ee.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return xu.create(this,e)}readonly(){return si.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iB=/^c[^\s-]{8,}$/i,sB=/^[0-9a-z]+$/,lB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uB=/^[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,cB=/^[a-z0-9_-]{21}$/i,dB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fB=/^[-+]?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)?)??$/,pB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Pv,mB=/^(?:(?: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])$/,gB=/^(?:(?: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])$/,vB=/^(([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]))$/,yB=/^(([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])$/,xB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s1="((\\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])))",SB=new RegExp(`^${s1}$`);function l1(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function CB(t){return new RegExp(`^${l1(t)}$`)}function u1(t){let e=`${s1}T${l1(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function _B(t,e){return!!((e==="v4"||!e)&&mB.test(t)||(e==="v6"||!e)&&vB.test(t))}function wB(t,e){if(!dB.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function LB(t,e){return!!((e==="v4"||!e)&&gB.test(t)||(e==="v6"||!e)&&yB.test(t))}var Jn=class t extends ue{_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:O.invalid_type,expected:V.string,received:o.parsedType}),J}let r=new wt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(n=this._getOrReturnCtx(e,n),i?H(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")pB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Pv||(Pv=new RegExp(hB,"u")),Pv.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")uB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")cB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"nanoid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")iB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")sB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:O.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:O.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.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)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?u1(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?SB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CB(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?_B(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?wB(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"jwt",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cidr",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?xB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?bB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64url",code:O.invalid_string,message:o.message}),r.dirty()):fe.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:O.invalid_string,...Z.errToObj(r)})}_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,a){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...Z.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...Z.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...Z.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...Z.errToObj(a)})}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 a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Jn.create=t=>new Jn({checks:[],typeName:ee.ZodString,coerce:t?.coerce??!1,...le(t)});function IB(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=a>r?a:r,o=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return o%i/10**n}var Wo=class t extends ue{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:O.invalid_type,expected:V.number,received:o.parsedType}),J}let r,n=new wt;for(let o of this._def.checks)o.kind==="int"?fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?IB(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_finite,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_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,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}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 a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fe.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Wo.create=t=>new Wo({checks:[],typeName:ee.ZodNumber,coerce:t?.coerce||!1,...le(t)});var Zo=class t extends ue{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 r,n=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.bigint,received:a.parsedType}),J}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_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,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Zo.create=t=>new Zo({checks:[],typeName:ee.ZodBigInt,coerce:t?.coerce??!1,...le(t)});var Xo=class extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.boolean,received:r.parsedType}),J}return Mt(e.data)}};Xo.create=t=>new Xo({typeName:ee.ZodBoolean,coerce:t?.coerce||!1,...le(t)});var Yo=class t extends ue{_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:O.invalid_type,expected:V.date,received:o.parsedType}),J}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_date}),J}let r=new wt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):fe.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}};Yo.create=t=>new Yo({checks:[],coerce:t?.coerce||!1,typeName:ee.ZodDate,...le(t)});var Is=class extends ue{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.symbol,received:r.parsedType}),J}return Mt(e.data)}};Is.create=t=>new Is({typeName:ee.ZodSymbol,...le(t)});var Ko=class extends ue{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.undefined,received:r.parsedType}),J}return Mt(e.data)}};Ko.create=t=>new Ko({typeName:ee.ZodUndefined,...le(t)});var Qo=class extends ue{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.null,received:r.parsedType}),J}return Mt(e.data)}};Qo.create=t=>new Qo({typeName:ee.ZodNull,...le(t)});var eo=class extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return Mt(e.data)}};eo.create=t=>new eo({typeName:ee.ZodAny,...le(t)});var Kr=class extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mt(e.data)}};Kr.create=t=>new Kr({typeName:ee.ZodUnknown,...le(t)});var Ja=class extends ue{_parse(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.never,received:a.parsedType}),J}};Ja.create=t=>new Ja({typeName:ee.ZodNever,...le(t)});var As=class extends ue{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.void,received:r.parsedType}),J}return Mt(e.data)}};As.create=t=>new As({typeName:ee.ZodVoid,...le(t)});var Qr=class t extends ue{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==V.array)return H(a,{code:O.invalid_type,expected:V.array,received:a.parsedType}),J;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(H(a,{code:i?O.too_big:O.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&a.data.length<n.minLength.value&&(H(a,{code:O.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&a.data.length>n.maxLength.value&&(H(a,{code:O.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>n.type._parseAsync(new Ba(a,i,a.path,s)))).then(i=>wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Ba(a,i,a.path,s)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:Z.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:Z.toString(a)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ee.ZodArray,...le(e)});function Ls(t){if(t instanceof Jt){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Oa.create(Ls(r))}return new Jt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Ls(t.element)}):t instanceof Oa?Oa.create(Ls(t.unwrap())):t instanceof hr?hr.create(Ls(t.unwrap())):t instanceof pr?pr.create(t.items.map(e=>Ls(e))):t}var Jt=class t extends ue{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(),a=fe.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==V.object){let u=this._getOrReturnCtx(e);return H(u,{code:O.invalid_type,expected:V.object,received:u.parsedType}),J}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ja&&this._def.unknownKeys==="strip"))for(let u in n.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ba(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Ja){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")s.length>0&&(H(n,{code:O.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of s){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ba(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(r,u)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{let n=this._def.errorMap?.(a,r).message??r.defaultError;return a.code==="unrecognized_keys"?{message:Z.errToObj(e).message??n}:{message:n}}}:{}})}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:ee.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let r of fe.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let r of fe.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return Ls(this)}partial(e){let a={};for(let r of fe.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?a[r]=n:a[r]=n.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let r of fe.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return c1(fe.objectKeys(this.shape))}};Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Ja.create(),typeName:ee.ZodObject,...le(e)});var Jo=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function n(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 a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Qt(s.ctx.common.issues));return H(a,{code:O.invalid_union,unionErrors:i}),J}if(a.common.async)return Promise.all(r.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(n);{let o,i=[];for(let l of r){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Qt(l));return H(a,{code:O.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};Jo.create=(t,e)=>new Jo({options:t,typeName:ee.ZodUnion,...le(e)});var Yr=t=>t instanceof ti?Yr(t.schema):t instanceof Fa?Yr(t.innerType()):t instanceof ai?[t.value]:t instanceof ri?t.options:t instanceof ni?fe.objectValues(t.enum):t instanceof oi?Yr(t._def.innerType):t instanceof Ko?[void 0]:t instanceof Qo?[null]:t instanceof Oa?[void 0,...Yr(t.unwrap())]:t instanceof hr?[null,...Yr(t.unwrap())]:t instanceof yu||t instanceof si?Yr(t.unwrap()):t instanceof ii?Yr(t._def.innerType):[],Bf=class t extends ue{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.object)return H(a,{code:O.invalid_type,expected:V.object,received:a.parsedType}),J;let r=this.discriminator,n=a.data[r],o=this.optionsMap.get(n);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(H(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let n=new Map;for(let o of a){let i=Yr(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new t({typeName:ee.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...le(r)})}};function Hv(t,e){let a=fr(t),r=fr(e);if(t===e)return{valid:!0,data:t};if(a===V.object&&r===V.object){let n=fe.objectKeys(e),o=fe.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Hv(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Hv(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ei=class extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Df(o)||Df(i))return J;let s=Hv(o.value,i.value);return s.valid?((Of(o)||Of(i))&&a.dirty(),{status:a.value,value:s.data}):(H(r,{code:O.invalid_intersection_types}),J)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ei.create=(t,e,a)=>new ei({left:t,right:e,typeName:ee.ZodIntersection,...le(a)});var pr=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return H(r,{code:O.invalid_type,expected:V.array,received:r.parsedType}),J;if(r.data.length<this._def.items.length)return H(r,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ba(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(a,i)):wt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};pr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pr({items:t,typeName:ee.ZodTuple,rest:null,...le(e)})};var Ff=class t extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return H(r,{code:O.invalid_type,expected:V.object,received:r.parsedType}),J;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ba(r,s,r.path,s)),value:i._parse(new Ba(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?wt.mergeObjectAsync(a,n):wt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof ue?new t({keyType:e,valueType:a,typeName:ee.ZodRecord,...le(r)}):new t({keyType:Jn.create(),valueType:e,typeName:ee.ZodRecord,...le(a)})}},ks=class extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return H(r,{code:O.invalid_type,expected:V.map,received:r.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Ba(r,s,r.path,[u,"key"])),value:o._parse(new Ba(r,l,r.path,[u,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}})}else{let s=new Map;for(let l of i){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};ks.create=(t,e,a)=>new ks({valueType:e,keyType:t,typeName:ee.ZodMap,...le(a)});var Es=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return H(r,{code:O.invalid_type,expected:V.set,received:r.parsedType}),J;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(H(r,{code:O.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),a.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(H(r,{code:O.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),a.dirty());let o=this._def.valueType;function i(l){let u=new Set;for(let c of l){if(c.status==="aborted")return J;c.status==="dirty"&&a.dirty(),u.add(c.value)}return{status:a.value,value:u}}let s=[...r.data.values()].map((l,u)=>o._parse(new Ba(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:Z.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Es.create=(t,e)=>new Es({valueType:t,minSize:null,maxSize:null,typeName:ee.ZodSet,...le(e)});var Nf=class t extends ue{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.function)return H(a,{code:O.invalid_type,expected:V.function,received:a.parsedType}),J;function r(s,l){return vu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,_s(),Xr].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function n(s,l){return vu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,_s(),Xr].filter(u=>!!u),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof to){let s=this;return Mt(async function(...l){let u=new Qt([]),c=await s._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(r(l,m)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw u.addIssue(n(d,m)),u})})}else{let s=this;return Mt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Qt([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Qt([n(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:pr.create(e).rest(Kr.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,a,r){return new t({args:e||pr.create([]).rest(Kr.create()),returns:a||Kr.create(),typeName:ee.ZodFunction,...le(r)})}},ti=class extends ue{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}};ti.create=(t,e)=>new ti({getter:t,typeName:ee.ZodLazy,...le(e)});var ai=class extends ue{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return H(a,{received:a.data,code:O.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}};ai.create=(t,e)=>new ai({value:t,typeName:ee.ZodLiteral,...le(e)});function c1(t,e){return new ri({values:t,typeName:ee.ZodEnum,...le(e)})}var ri=class t extends ue{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return H(a,{expected:fe.joinValues(r),received:a.parsedType,code:O.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return H(a,{received:a.data,code:O.invalid_enum_value,options:r}),J}return Mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return t.create(e,{...this._def,...a})}exclude(e,a=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};ri.create=c1;var ni=class extends ue{_parse(e){let a=fe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let n=fe.objectValues(a);return H(r,{expected:fe.joinValues(n),received:r.parsedType,code:O.invalid_type}),J}if(this._cache||(this._cache=new Set(fe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=fe.objectValues(a);return H(r,{received:r.data,code:O.invalid_enum_value,options:n}),J}return Mt(e.data)}get enum(){return this._def.values}};ni.create=(t,e)=>new ni({values:t,typeName:ee.ZodNativeEnum,...le(e)});var to=class extends ue{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.promise&&a.common.async===!1)return H(a,{code:O.invalid_type,expected:V.promise,received:a.parsedType}),J;let r=a.parsedType===V.promise?a.data:Promise.resolve(a.data);return Mt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};to.create=(t,e)=>new to({type:t,typeName:ee.ZodPromise,...le(e)});var Fa=class extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:i=>{H(r,i),i.fatal?a.abort():a.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(a.value==="aborted")return J;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"?Go(l.value):a.value==="dirty"?Go(l.value):l});{if(a.value==="aborted")return J;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?Go(s.value):a.value==="dirty"?Go(s.value):s}}if(n.type==="refinement"){let i=s=>{let l=n.refinement(s,o);if(r.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(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?J:(s.status==="dirty"&&a.dirty(),i(s.value),{status:a.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?J:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qn(i))return J;let s=n.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Qn(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):J);fe.assertNever(n)}};Fa.create=(t,e,a)=>new Fa({schema:t,typeName:ee.ZodEffects,effect:e,...le(a)});Fa.createWithPreprocess=(t,e,a)=>new Fa({schema:e,effect:{type:"preprocess",transform:t},typeName:ee.ZodEffects,...le(a)});var Oa=class extends ue{_parse(e){return this._getType(e)===V.undefined?Mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:ee.ZodOptional,...le(e)});var hr=class extends ue{_parse(e){return this._getType(e)===V.null?Mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hr.create=(t,e)=>new hr({innerType:t,typeName:ee.ZodNullable,...le(e)});var oi=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};oi.create=(t,e)=>new oi({innerType:t,typeName:ee.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...le(e)});var ii=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ws(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ii.create=(t,e)=>new ii({innerType:t,typeName:ee.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...le(e)});var Ts=class extends ue{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return H(r,{code:O.invalid_type,expected:V.nan,received:r.parsedType}),J}return{status:"valid",value:e.data}}};Ts.create=t=>new Ts({typeName:ee.ZodNaN,...le(t)});var AB=Symbol("zod_brand"),yu=class extends ue{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},xu=class t extends ue{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?J:o.status==="dirty"?(a.dirty(),Go(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?J:n.status==="dirty"?(a.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,a){return new t({in:e,out:a,typeName:ee.ZodPipeline})}},si=class extends ue{_parse(e){let a=this._def.innerType._parse(e),r=n=>(Qn(n)&&(n.value=Object.freeze(n.value)),n);return ws(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};si.create=(t,e)=>new si({innerType:t,typeName:ee.ZodReadonly,...le(e)});function i1(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function d1(t,e={},a){return t?eo.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=i1(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=i1(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):eo.create()}var kB={object:Jt.lazycreate},ee;(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"})(ee||(ee={}));var EB=(t,e={message:`Input not instance of ${t.name}`})=>d1(a=>a instanceof t,e),f1=Jn.create,p1=Wo.create,TB=Ts.create,RB=Zo.create,h1=Xo.create,MB=Yo.create,DB=Is.create,OB=Ko.create,BB=Qo.create,FB=eo.create,NB=Kr.create,PB=Ja.create,HB=As.create,UB=Qr.create,qB=Jt.create,zB=Jt.strictCreate,VB=Jo.create,$B=Bf.create,jB=ei.create,GB=pr.create,WB=Ff.create,ZB=ks.create,XB=Es.create,YB=Nf.create,KB=ti.create,QB=ai.create,JB=ri.create,eF=ni.create,tF=to.create,aF=Fa.create,rF=Oa.create,nF=hr.create,oF=Fa.createWithPreprocess,iF=xu.create,sF=()=>f1().optional(),lF=()=>p1().optional(),uF=()=>h1().optional(),cF={string:(t=>Jn.create({...t,coerce:!0})),number:(t=>Wo.create({...t,coerce:!0})),boolean:(t=>Xo.create({...t,coerce:!0})),bigint:(t=>Zo.create({...t,coerce:!0})),date:(t=>Yo.create({...t,coerce:!0}))};var dF=J;var m1=p.union([p.object({type:p.literal("data"),key:p.string(),value:p.string().optional()}),p.object({type:p.literal("css"),value:p.string()}),p.object({type:p.literal("aria"),role:p.string().optional(),label:p.string().optional()}),p.object({type:p.literal("shadow-css"),value:p.string()}),p.object({type:p.literal("ref"),el:p.any()})]),fF=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:m1,content:p.object({title:p.string().optional(),body:p.string()}),placement:p.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:p.number().optional(),blocking:p.boolean().optional(),trigger:p.enum(["immediate","hover","click"]).optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),pF=p.object({kind:p.literal("highlight"),id:p.string(),anchor:m1,copy:p.string().optional(),ring:p.object({paddingPx:p.number().optional(),radiusPx:p.number().optional()}).optional(),scrim:p.object({opacity:p.number().optional()}).optional(),ringColor:p.string().optional(),blocking:p.boolean().optional(),dismiss:p.object({onClickOutside:p.boolean().optional(),onEsc:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),Uv=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([fF,pF]))});function U5(t){return Uv.parse(t)}var $5=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=Gg({configUri:t,experiments:e,featureKey:a});if(!n)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(n,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return Uv.parse(i)};var Pf=K(We(),1),g1=K($s(),1);function G5({element:t,children:e}){let[a,r]=(0,Pf.useState)(null);return(0,Pf.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,g1.createPortal)(e,a):null}function hF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var qv=class{constructor(){$(this,"sessionId");this.sessionId=hF(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function zv(){return new qv}var E=typeof window<"u"?window:void 0,It=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(It.self=It),typeof File>"u"&&(It.File=function(){});var fA=Array.prototype,v1=fA.forEach,y1=fA.indexOf,ya=It?.navigator,q=It?.document,ta=It?.location,ny=It?.fetch,oy=It!=null&&It.XMLHttpRequest&&"withCredentials"in new It.XMLHttpRequest?It.XMLHttpRequest:void 0,x1=It?.AbortController,ea=ya?.userAgent,ae=E??{},en={DEBUG:!1,LIB_VERSION:"1.302.2"};function b1(t,e,a,r,n,o,i){try{var s=t[o](i),l=s.value}catch(u){return void a(u)}s.done?e(l):Promise.resolve(l).then(r,n)}function S1(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){b1(o,r,n,i,s,"next",l)}function s(l){b1(o,r,n,i,s,"throw",l)}i(void 0)}))}}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},G.apply(null,arguments)}function pA(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var mF=["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"],C1=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return mF.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},gF=["$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 pe(t,e){return t.indexOf(e)!==-1}var gp=function(t){return t.trim()},iy=function(t){return t.replace(/^\$/,"")},vF=Array.isArray,hA=Object.prototype,mA=hA.hasOwnProperty,vp=hA.toString,Te=vF||function(t){return vp.call(t)==="[object Array]"},so=t=>typeof t=="function",mt=t=>t===Object(t)&&!Te(t),Os=t=>{if(mt(t)){for(var e in t)if(mA.call(t,e))return!1;return!0}return!1},U=t=>t===void 0,ut=t=>vp.call(t)=="[object String]",sy=t=>ut(t)&&t.trim().length===0,nn=t=>t===null,Ie=t=>U(t)||nn(t),yr=t=>vp.call(t)=="[object Number]",lo=t=>vp.call(t)==="[object Boolean]",yF=t=>t instanceof FormData,xF=t=>pe(gF,t);function ly(t){return t===null||typeof t!="object"}function Xf(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function gA(t){return!U(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var bF=[!0,"true",1,"1","yes"],Vv=t=>pe(bF,t),SF=[!1,"false",0,"0","no"];function mr(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),yr(t)?t>a?(r.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+n),mr(n||a,e,a,r))}var uy=class{constructor(e){this.t={},this.i=e.i,this.o=mr(e.bucketSize,0,100,e.h),this.m=mr(e.refillRate,0,this.o,e.h),this.S=mr(e.refillInterval,0,864e5,e.h)}$(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.S);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.S}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[n]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},Hf,_1,$v,CF=t=>t instanceof Error;function _F(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return $v&&a.length===_1||(_1=a.length,$v=a.reduce(((r,n)=>{Hf||(Hf={});var o=Hf[n];if(o)r[o[0]]=o[1];else for(var i=t(n),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[n];if(u&&c){r[u]=c,Hf[n]=[u,c];break}}return r}),{})),$v}}var cy=class{constructor(e,a,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=a,this.modifiers=r}buildFromUnknown(e,a){a===void 0&&(a={});var r=a&&a.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(n,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var a=this;return S1((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Te(r.stacktrace.frames)&&(r.stacktrace.frames=yield a.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var a;return{type:"Error",value:"Unknown error",stack:(a=e.syntheticException)==null?void 0:a.stack,synthetic:!0}}parseStacktrace(e,a){var r,n;return e.cause!=null&&(r=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),G({},e,{cause:r,stack:n})}applyChunkIds(e,a){return e.map((r=>(r.filename&&a&&(r.chunk_id=a[r.filename]),r)))}applyCoercers(e,a){for(var r of this.coercers)if(r.match(e))return r.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return S1((function*(){var r=e;for(var n of a.modifiers)r=yield n(r);return r}))()}convertToExceptionList(e,a){var r,n,o,i={type:e.type,value:e.value,mechanism:{type:(r=a.type)!==null&&r!==void 0?r:"generic",handled:(n=a.handled)===null||n===void 0||n,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var s=[i];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,G({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:_F(this.stackParser)}}buildCoercingContext(e,a,r){r===void 0&&(r=0);var n=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return G({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},Ps="?";function dy(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?Ps:a,in_app:!0};return U(r)||(o.lineno=r),U(n)||(o.colno=n),o}var vA=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return a||r?[t.indexOf("@")!==-1?t.split("@")[0]:Ps,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,IF=/\((\S*)(?::(\d+))(?::(\d+))\)/,AF=(t,e)=>{var a=wF.exec(t);if(a){var[,r,n,o]=a;return dy(e,r,Ps,+n,+o)}var i=LF.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=IF.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=vA(i[1]||Ps,i[2]);return dy(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},kF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,TF=(t,e)=>{var a=kF.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=EF.exec(a[3]);r&&(a[1]=a[1]||"eval",a[3]=r[1],a[4]=r[2],a[5]="")}var n=a[3],o=a[1]||Ps;return[o,n]=vA(o,n),dy(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},w1=/\(error: (.*)\)/,L1=50;function RF(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
460
+ `),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=w1.test(u)?u.replace(w1,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var h=d(c,t);if(h){i.push(h);break}}if(i.length>=L1)break}}}return(function(m){if(!m.length)return[];var S=Array.from(m);return S.reverse(),S.slice(0,L1).map((b=>{return G({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||Ps});var x}))})(i)}}var fy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=ut(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return Xf(e,"DOMException")}isDOMError(e){return Xf(e,"DOMError")}},py=class{match(e){return(a=>a instanceof Error)(e)}coerce(e,a){return{type:this.getType(e),value:this.getMessage(e,a),stack:this.getStack(e),cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,a){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},hy=class{constructor(){}match(e){return Xf(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var r,n=a.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},MF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,my=class{match(e){return typeof e=="string"}coerce(e,a){var r,[n,o]=this.getInfos(e);return{type:n??"Error",value:o??e,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var a="Error",r=e,n=e.match(MF);return n&&(a=n[1],r=n[2]),[a,r]}},DF=["fatal","error","warning","log","info","debug"];function yA(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var r=a.length;r>0;r--){var n=a.slice(0,r).join(", ");if(!(n.length>e))return r===a.length||n.length<=e?n:n.slice(0,e)+"..."}return""}var gy=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var r,n=this.getErrorPropertyFromObject(e);return n?a.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=a.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return gA(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var a="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(a+=" with message: '"+e.message+"'"),a}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+yA(e)}isSeverityLevel(e){return ut(e)&&!sy(e)&&DF.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(CF(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},vy=class{match(e){return gA(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+yA(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},yy=class{match(e){return ly(e)}coerce(e,a){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},xy=class{match(e){return Xf(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return ly(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}:a.apply(n)}getUnhandledRejectionReason(e){if(ly(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}},xA=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(E&&(en.DEBUG||ae.POSTHOG_DEBUG||a)&&!U(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[n])?E.console[n].__rrweb_original__:E.console[n],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:n=>{r.error("You must initialize PostHog before calling "+n)},createLogger:(n,o)=>xA(t+" "+n,o)};return r},z=xA("[PostHog.js]"),ct=z.createLogger,OF=ct("[ExternalScriptsLoader]"),I1=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return OF.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=q?.querySelectorAll("script");if(r){for(var n,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<r.length;i++)if(n=o())return n.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};ae.__PosthogExtensions__=ae.__PosthogExtensions__||{},ae.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",r);I1(t,o,a)},ae.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);I1(t,r,a)};var Yf={};function uo(t,e,a){if(Te(t)){if(v1&&t.forEach===v1)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(a,t[r],r)===Yf)return}}}function De(t,e,a){if(!Ie(t)){if(Te(t))return uo(t,e,a);if(yF(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Yf)return}else for(var n in t)if(mA.call(t,n)&&e.call(a,t[n],n)===Yf)return}}var Je=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return uo(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},qs=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return uo(a,(function(n){uo(n,(function(o){t.push(o)}))})),t};function Gf(t){for(var e=Object.keys(t),a=e.length,r=new Array(a);a--;)r[a]=[e[a],t[e[a]]];return r}var A1=function(t){try{return t()}catch{return}},BF=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.apply(this,a)}catch(n){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(n)}}},hx=function(t){var e={};return De(t,(function(a,r){(ut(a)&&a.length>0||yr(a))&&(e[r]=a)})),e};function FF(t,e){return a=t,r=o=>ut(o)&&!nn(e)?o.slice(0,e):o,n=new Set,(function o(i,s){return i!==Object(i)?r?r(i,s):i:n.has(i)?void 0:(n.add(i),Te(i)?(l=[],uo(i,(u=>{l.push(o(u))}))):(l={},De(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var NF=["herokuapp.com","vercel.app","netlify.app"];function PF(t){var e=t?.hostname;if(!ut(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of NF)if(a===r)return!1;return!0}function bA(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function nt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var SA="$people_distinct_id",Eu="__alias",Tu="__timers",k1="$autocapture_disabled_server_side",by="$heatmaps_enabled_server_side",E1="$exception_capture_enabled_server_side",Sy="$error_tracking_suppression_rules",T1="$error_tracking_capture_extension_exceptions",R1="$web_vitals_enabled_server_side",CA="$dead_clicks_enabled_server_side",M1="$web_vitals_allowed_metrics",jv="$session_recording_remote_config",Kf="$sesid",_A="$session_is_sampled",Bs="$enabled_feature_flags",Ru="$early_access_features",Cy="$feature_flag_details",Mu="$stored_person_properties",ci="$stored_group_properties",_y="$surveys",Uf="$surveys_activated",Qf="$flag_call_reported",tn="$user_state",wy="$client_session_props",Ly="$capture_rate_limit",Iy="$initial_campaign_params",Ay="$initial_referrer_info",Jf="$initial_person_info",ep="$epp",wA="__POSTHOG_TOOLBAR__",bu="$posthog_cookieless",HF=[SA,Eu,"__cmpns",Tu,"$session_recording_enabled_server_side",by,Kf,Bs,Sy,tn,Ru,Cy,ci,Mu,_y,Qf,wy,Ly,Iy,Ay,ep,Jf];function D1(t){return t instanceof Element&&(t.id===wA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function yp(t){return!!t&&t.nodeType===1}function co(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function LA(t){return!!t&&t.nodeType===3}function IA(t){return!!t&&t.nodeType===11}function mx(t){return t?gp(t).split(/\s+/):[]}function O1(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function tp(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 mx(e)}function AA(t){return Ie(t)?null:gp(t).split(/(\s+)/).filter((e=>Hu(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ju(t){var e="";return ky(t)&&!MA(t)&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;LA(a)&&a.textContent&&(e+=(r=AA(a.textContent))!==null&&r!==void 0?r:"")})),gp(e)}function kA(t){return U(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var gx=["a","button","form","input","select","textarea","label"];function EA(t,e){if(U(e))return!0;var a,r=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var n of t)if(a=r(n))return a.v;return!1}function TA(t){var e=t.parentNode;return!(!e||!yp(e))&&e}var UF=["next","previous","prev",">","<"],B1=10,F1=[".ph-no-rageclick",".ph-no-capture"];function qF(t,e){if(!E||vx(t))return!1;var a,r,n;if(lo(e)?(a=!!e&&F1,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:F1,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=RA(t,!1);return!(function(i,s){if(i===!1||U(i))return!1;var l;if(i===!0)l=UF;else{if(!Te(i))return!1;if(i.length>B1)return z.error("[PostHog] content_ignorelist array cannot exceed "+B1+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return s.some((u=>{var{safeText:c,ariaLabel:d}=u;return l.some((h=>c.includes(h)||d.includes(h)))}))})(r,o.map((i=>{var s;return{safeText:ju(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!EA(o,a)}var vx=t=>!t||co(t,"html")||!yp(t),RA=(t,e)=>{if(!E||vx(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!co(n,"body");)if(IA(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=TA(n);if(!o)break;if(e||gx.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function zF(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!E||vx(t)||(o=a)!=null&&o.url_allowlist&&!O1(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&O1(a.url_ignorelist))return!1;if((s=a)!=null&&s.dom_event_allowlist){var u=a.dom_event_allowlist;if(u&&!u.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=RA(t,r);if(!(function(S,b){var x=b?.element_allowlist;if(U(x))return!0;var f,g=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(f=g(v))return f.v;return!1})(d,a)||!EA(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var h=E.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=t.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(gx.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function ky(t){for(var e=t;e.parentNode&&!co(e,"body");e=e.parentNode){var a=tp(e);if(pe(a,"ph-sensitive")||pe(a,"ph-no-capture"))return!1}if(pe(tp(t),"ph-include"))return!0;var r=t.type||"";if(ut(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(ut(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function MA(t){return!!(co(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||co(t,"select")||co(t,"textarea")||t.getAttribute("contenteditable")==="true")}var DA="(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})",VF=new RegExp("^(?:"+DA+")$"),$F=new RegExp(DA),OA="\\d{3}-?\\d{2}-?\\d{4}",jF=new RegExp("^("+OA+")$"),GF=new RegExp("("+OA+")");function Hu(t,e){return e===void 0&&(e=!0),!(Ie(t)||ut(t)&&(t=gp(t),(e?VF:$F).test((t||"").replace(/[- ]/g,""))||(e?jF:GF).test(t)))}function BA(t){var e=ju(t);return Hu(e=(e+" "+FA(t)).trim())?e:""}function FA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=ju(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+FA(a)).trim())}catch(o){z.error("[AutoCapture]",o)}})),e}function WF(t){return(function(e){var a=e.map((r=>{var n,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var s of(r.attr_class.sort(),r.attr_class))i+="."+s.replace(/"/g,"");var l=G({},r.text?{text:r.text}:{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Gf(l).sort(((c,d)=>{var[h]=c,[m]=d;return h.localeCompare(m)})).forEach((c=>{var[d,h]=c;return u[N1(d.toString())]=N1(h.toString())})),i+=":",i+=Gf(u).map((c=>{var[d,h]=c;return d+'="'+h+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var r,n,o={text:(r=a.$el_text)==null?void 0:r.slice(0,400),tag_name:a.tag_name,href:(n=a.attr__href)==null?void 0:n.slice(0,2048),attr_class:ZF(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return Gf(a).filter((i=>{var[s]=i;return s.indexOf("attr__")===0})).forEach((i=>{var[s,l]=i;return o.attributes[s]=l})),o}))})(t))}function N1(t){return t.replace(/"|\\"/g,'\\"')}function ZF(t){var e=t.attr__class;return e?Te(e)?e:mx(e):void 0}var ap=class{constructor(e){this.disabled=e===!1;var a=mt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(a-n.y)<this.thresholdPx&&r-n.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:r}];return!1}},Gv="$copy_autocapture",rn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var rp=t=>{var e=q?.createElement("a");return U(e)?null:(e.href=t,e)},XF=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return De(t,(function(o,i){U(o)||U(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),n[n.length]=r+"="+a)})),n.join(e)},np=function(t,e){for(var a,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){a=o;break}}if(!Te(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{z.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Gu=function(t,e,a){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",o=r[1],i=n.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Te(h)&&(e.includes(h[0])?c.push(h[0]+"="+a):c.push(u[d]))}var m=l;return s!=null&&(m+="?"+c.join("&")),o!=null&&(m+="#"+o),m},op=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},P1=ct("[AutoCapture]");function Wv(t,e){return e.length>t?e.slice(0,t)+"...":e}function YF(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!yp(e));return e}function KF(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};gx.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=Wv(1024,BA(t)):o.$el_text=Wv(1024,ju(t)));var i=tp(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),De(t.attributes,(function(c){var d;if((!MA(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Hu(c.value)&&(d=c.name,!ut(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=mx(h).join(" ")),o["attr__"+c.name]=Wv(1024,h)}}));for(var s=1,l=1,u=t;u=YF(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function QF(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!co(c,"body");)IA(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],m={},S=!1,b=!1;if(De(u,(y=>{var _=ky(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&Hu(S)&&S),pe(tp(y),"ph-no-capture")&&(b=!0),h.push(KF(y,o,i,s));var w=(function(C){if(!ky(C))return{};var L={};return De(C.attributes,(function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var A=k.name.replace("data-ph-capture-attribute-",""),M=k.value;A&&M&&Hu(M)&&(L[A]=M)}})),L})(y);Je(m,w)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=BA(t):h[0].$el_text=ju(t)),S){var x,f;h[0].attr__href=S;var g=(x=rp(S))==null?void 0:x.host,v=E==null||(f=E.location)==null?void 0:f.host;g&&v&&g!==v&&(d=S)}return{props:Je({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:WF(h)},(a=h[0])!=null&&a.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},m)}}var Ey=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new ap(e.config.rageclick),this.I=null}get F(){var e,a,r=mt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(a=r.url_ignorelist)==null?void 0:a.map((n=>new RegExp(n))),r}C(){if(this.isBrowserSupported()){if(E&&q){var e=r=>{r=r||E?.event;try{this.M(r)}catch(n){P1.error("Failed to capture event",n)}};if(nt(q,"submit",e,{capture:!0}),nt(q,"change",e,{capture:!0}),nt(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||E?.event,this.M(r,Gv)};nt(q,"copy",a,{capture:!0}),nt(q,"cut",a,{capture:!0})}}}else P1.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({[k1]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,r=[];return(a=this.I)==null||a.forEach((n=>{var o=q?.querySelectorAll(n);o?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,a,r=(e=this.instance.persistence)==null?void 0:e.props[k1],n=this.T;if(nn(n)&&!lo(r)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=kA(e);LA(n)&&(n=n.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&qF(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Gv;if(n&&zF(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=QF(n,{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(n);if(l&&l.length>0&&(i.$element_selectors=l),a===Gv){var u,c=AA(E==null||(u=E.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return so(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return yr(t)&&isFinite(t)&&Math.floor(t)===t});var H1="0123456789abcdef",Ty=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,r,n){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||a<0||r<0||n<0||e>0xffffffffffff||a>4095||r>1073741823||n>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|a>>>8,o[7]=a,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+H1.charAt(this.bytes[a]>>>4)+H1.charAt(15&this.bytes[a]),a!==3&&a!==5&&a!==7&&a!==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 a=0;a<16;a++){var r=this.bytes[a]-e.bytes[a];if(r!==0)return Math.sign(r)}return 0}},Ry=class{constructor(){this.A=0,this.D=0,this.j=new My}generate(){var e=this.generateOrAbort();if(U(e)){this.A=0;var a=this.generateOrAbort();if(U(a))throw new Error("Could not generate UUID after timestamp reset");return a}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 Ty.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())}},U1,NA=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};E&&!U(E.crypto)&&crypto.getRandomValues&&(NA=t=>crypto.getRandomValues(t));var My=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(NA(this.N),this.U=0),this.N[this.U++]}},io=()=>JF().toString(),JF=()=>(U1||(U1=new Ry)).generate(),Su="",eN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tN(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=q),Su)return Su;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+io();!Su&&s--;){var u=i.slice(s).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",Su=u)}return Su})(t);if(!a){var r=(n=>{var o=n.match(eN);return o?o[0]:""})(t);r!==a&&z.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var vr={H:()=>!!q,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),r=0;r<a.length;r++){for(var n=a[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(vr.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(q)try{var o="",i="",s=tN(q.location.hostname,r);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}n&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{vr.G(t,"",-1,e)}catch{return}}},Zv=null,Ge={H:function(){if(!nn(Zv))return Zv;var t=!0;if(U(E))t=!1;else try{var e="__mplssupport__";Ge.G(e,"xyz"),Ge.q(e)!=='"xyz"'&&(t=!1),Ge.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Zv=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){Ge.B(e)}return null},W:function(t){try{return JSON.parse(Ge.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Ge.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){Ge.B(e)}}},aN=["distinct_id",Kf,_A,ep,Jf],qf=G({},Ge,{W:function(t){try{var e={};try{e=vr.W(t)||{}}catch{}var a=Je(e,JSON.parse(Ge.q(t)||"{}"));return Ge.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{Ge.G(t,e,void 0,void 0,o);var i={};aN.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&vr.G(t,i,a,r,n,o)}catch(s){Ge.B(s)}},V:function(t,e){try{E?.localStorage.removeItem(t),vr.V(t,e)}catch(a){Ge.B(a)}}}),zf={},rN={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return zf[t]||null},W:function(t){return zf[t]||null},G:function(t,e){zf[t]=e},V:function(t){delete zf[t]}},li=null,Lt={H:function(){if(!nn(li))return li;if(li=!0,U(E))li=!1;else try{var t="__support__";Lt.G(t,"xyz"),Lt.q(t)!=='"xyz"'&&(li=!1),Lt.V(t)}catch{li=!1}return li},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){Lt.B(e)}return null},W:function(t){try{return JSON.parse(Lt.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Lt.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){Lt.B(e)}}},an=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Dy=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?an.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===an.DENIED||this.consent===an.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===an.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:a,consent_persistence_name:r}=this._instance.config;return r||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Vv(e)?an.GRANTED:pe(SF,e)?an.DENIED:an.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ge:vr;var a=e==="localStorage"?vr:Ge;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Vv(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!bA([ya?.doNotTrack,ya?.msDoNotTrack,ae.doNotTrack],(e=>Vv(e)))}},Vf=ct("[Dead Clicks]"),nN=()=>!0,oN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(CA)),r=t.instance.config.capture_dead_clicks;return lo(r)?r:!!mt(r)||a},ip=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,r){this.instance=e,this.isEnabled=a,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[CA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?Vf.error("failed to load script",n):e()}))}et(){var e;if(q){if(!this.tt&&(e=ae.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=mt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=ae.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),Vf.info("starting...")}}else Vf.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Vf.info("stopping..."))}},Cu=ct("[ExceptionAutocapture]"),Oy=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=ae.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=ae.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=ae.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ae.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(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(u){Cu.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[E1]),this.F=this.ht(),this.vt=new uy({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10,refillInterval:1e4,h:Cu}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return mt(e)?a=G({},a,e):(U(e)?this.ut:e)&&(a=G({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Cu.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Cu.error("failed to load script",n);e()}))}lt(){var e,a,r;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[E1]:this.ut}),this.startIfEnabled()}captureException(e){var a,r,n=(a=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(n)?Cu.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function q1(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return so(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var By=class{constructor(e){var a;this._instance=e,this.dt=(E==null||(a=E.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(E&&E.history){var r=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||q1(E.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||q1(E.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=E==null||(a=E.location)==null?void 0:a.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(n){z.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};nt(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},Xv=ct("[SegmentIntegration]");function iN(t,e){var a=t.config.segment;if(!a)return e();(function(r,n){var o=r.config.segment;if(!o)return n();var i=l=>{var u=()=>l.anonymousId()||io();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(tn,"identified")),n()},s=o.user();"then"in s&&so(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Xv.warn("This browser does not have Promise support, and can not use the segment integration");var n=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(Xv.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Xv.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var s=r.calculateEventProperties(i,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=>n(o,o.event.event),page:o=>n(o,"$pageview"),identify:o=>n(o,"$identify"),screen:o=>n(o,"$screen")}})(t)).then((()=>{e()}))}))}var PA="posthog-js";function HA(t,e){var{organization:a,projectId:r,prefix:n,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var m=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],b=S.map((f=>G({},f,{stacktrace:f.stacktrace?G({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((g=>G({},g,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:b,$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 a&&r&&(x.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var Fy=class{constructor(e,a,r,n,o,i){this.name=PA,this.setupOnce=function(s){s(HA(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},sN=E!=null&&E.location?op(E.location.hash,"__posthog")||op(location.hash,"state"):null,z1="_postHogToolbarParams",V1=ct("[Toolbar]"),oo=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(oo||{}),Ny=class{constructor(e){this.instance=e}_t(e){ae.ph_toolbar_state=e}yt(){var e;return(e=ae.ph_toolbar_state)!==null&&e!==void 0?e:oo.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!E||!q)return!1;e=e??E.location,r=r??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var n,o=sN||op(e.hash,"__posthog")||op(e.hash,"state"),i=o?A1((()=>JSON.parse(atob(decodeURIComponent(o)))))||A1((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(a.getItem(z1)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=ae.ph_load_toolbar||ae.ph_load_editor;!Ie(a)&&so(a)?a(e,this.instance):V1.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(wA));if(!E||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=G({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(E.localStorage.setItem(z1,JSON.stringify(G({},n,{source:void 0}))),this.yt()===oo.LOADED)this.bt(n);else if(this.yt()===oo.UNINITIALIZED){var o;this._t(oo.LOADING),(o=ae.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return V1.error("[Toolbar] Failed to load",i),void this._t(oo.UNINITIALIZED);this._t(oo.LOADED),this.bt(n)})),nt(E,"turbolinks:load",(()=>{this._t(oo.UNINITIALIZED),this.loadToolbar(n)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,r){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,a,r)}},lN=ct("[TracingHeaders]"),Py=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;U(this.xt)&&((a=ae.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),U(this.St)&&((r=ae.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return lN.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Na="Mobile",sp="iOS",gr="Android",Uu="Tablet",UA=gr+" "+Uu,qA="iPad",zA="Apple",VA=zA+" Watch",qu="Safari",Hs="BlackBerry",$A="Samsung",jA=$A+"Browser",GA=$A+" Internet",di="Chrome",uN=di+" OS",WA=di+" "+sp,yx="Internet Explorer",ZA=yx+" "+Na,xx="Opera",cN=xx+" Mini",bx="Edge",XA="Microsoft "+bx,Fs="Firefox",YA=Fs+" "+sp,zu="Nintendo",Vu="PlayStation",Ns="Xbox",KA=gr+" "+Na,QA=Na+" "+qu,Du="Windows",Hy=Du+" Phone",$1="Nokia",Uy="Ouya",JA="Generic",dN=JA+" "+Na.toLowerCase(),ek=JA+" "+Uu.toLowerCase(),qy="Konqueror",Ht="(\\d+(\\.\\d+)?)",Yv=new RegExp("Version/"+Ht),fN=new RegExp(Ns,"i"),pN=new RegExp(Vu+" \\w+","i"),hN=new RegExp(zu+" \\w+","i"),Sx=new RegExp(Hs+"|PlayBook|BB10","i"),mN={"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"},gN=(t,e)=>e&&pe(e,zA)||(function(a){return pe(a,qu)&&!pe(a,di)&&!pe(a,gr)})(t),tk=function(t,e){return e=e||"",pe(t," OPR/")&&pe(t,"Mini")?cN:pe(t," OPR/")?xx:Sx.test(t)?Hs:pe(t,"IE"+Na)||pe(t,"WPDesktop")?ZA:pe(t,jA)?GA:pe(t,bx)||pe(t,"Edg/")?XA:pe(t,"FBIOS")?"Facebook "+Na:pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?WA:pe(t,"CrMo")||pe(t,di)?di:pe(t,gr)&&pe(t,qu)?KA:pe(t,"FxiOS")?YA:pe(t.toLowerCase(),qy.toLowerCase())?qy:gN(t,e)?pe(t,Na)?QA:qu:pe(t,Fs)?Fs:pe(t,"MSIE")||pe(t,"Trident/")?yx:pe(t,"Gecko")?Fs:""},vN={[ZA]:[new RegExp("rv:"+Ht)],[XA]:[new RegExp(bx+"?\\/"+Ht)],[di]:[new RegExp("("+di+"|CrMo)\\/"+Ht)],[WA]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[qu]:[Yv],[QA]:[Yv],[xx]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Fs]:[new RegExp(Fs+"\\/"+Ht)],[YA]:[new RegExp("FxiOS\\/"+Ht)],[qy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Hs]:[new RegExp(Hs+" "+Ht),Yv],[KA]:[new RegExp("android\\s"+Ht,"i")],[GA]:[new RegExp(jA+"\\/"+Ht)],[yx]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},yN=function(t,e){var a=tk(t,e),r=vN[a];if(U(r))return null;for(var n=0;n<r.length;n++){var o=r[n],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},j1=[[new RegExp(Ns+"; "+Ns+" (.*?)[);]","i"),t=>[Ns,t&&t[1]||""]],[new RegExp(zu,"i"),[zu,""]],[new RegExp(Vu,"i"),[Vu,""]],[Sx,[Hs,""]],[new RegExp(Du,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Hy,""];if(new RegExp(Na).test(e)&&!/IEMobile\b/.test(e))return[Du+" "+Na,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=mN[r]||"";return/arm/i.test(e)&&(n="RT"),[Du,n]}return[Du,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[sp,e.join(".")]}return[sp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=U(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+gr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+gr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[gr,e.join(".")]}return[gr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var a=[t[1],t[2],t[3]||"0"];e[1]=a.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[uN,""]],[/Linux|debian/i,["Linux",""]]],G1=function(t){return hN.test(t)?zu:pN.test(t)?Vu:fN.test(t)?Ns:new RegExp(Uy,"i").test(t)?Uy:new RegExp("("+Hy+"|WPDesktop)","i").test(t)?Hy:/iPad/.test(t)?qA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?VA:Sx.test(t)?Hs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp($1,"i").test(t)?$1:/(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(Na).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)?gr:UA:gr:new RegExp("(pda|"+Na+")","i").test(t)?dN:new RegExp(Uu,"i").test(t)&&!new RegExp(Uu+" pc","i").test(t)?ek:""},$f="https?://(.*)",zs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],xN=qs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],zs),Wu="<masked>",bN=["li_fat_id"];function ak(t,e,a){if(!q)return{};var r,n=e?qs([],zs,a||[]):[],o=rk(Gu(q.URL,n,Wu),t),i=(r={},De(bN,(function(s){var l=vr.q(s);r[s]=l||null})),r);return Je(i,o)}function rk(t,e){var a=xN.concat(e||[]),r={};return De(a,(function(n){var o=np(t,n);r[n]=o||null})),r}function nk(t){var e=(function(o){return o?o.search($f+"google.([^/?]*)")===0?"google":o.search($f+"bing.com")===0?"bing":o.search($f+"yahoo.com")===0?"yahoo":o.search($f+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!nn(e)){r.$search_engine=e;var n=q?np(q.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function W1(){return navigator.language||navigator.userLanguage}function ok(){return q?.referrer||"$direct"}function ik(t,e){var a=t?qs([],zs,e||[]):[],r=ta?.href.substring(0,1e3);return{r:ok().substring(0,1e3),u:r?Gu(r,a,Wu):void 0}}function sk(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=rp(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=rp(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=rk(r);Je(n,i)}if(a){var s=nk(a);Je(n,s)}return n}function lk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function SN(){try{return new Date().getTimezoneOffset()}catch{return}}function CN(t,e){if(!ea)return{};var a,r,n,o=t?qs([],zs,e||[]):[],[i,s]=(function(l){for(var u=0;u<j1.length;u++){var[c,d]=j1[u],h=c.exec(l),m=h&&(so(d)?d(h,l):d);if(m)return m}return["",""]})(ea);return Je(hx({$os:i,$os_version:s,$browser:tk(ea,navigator.vendor),$device:G1(ea),$device_type:(r=ea,n=G1(r),n===qA||n===UA||n==="Kobo"||n==="Kindle Fire"||n===ek?Uu:n===zu||n===Ns||n===Vu||n===Uy?"Console":n===VA?"Wearable":n?Na:"Desktop"),$timezone:lk(),$timezone_offset:SN()}),{$current_url:Gu(ta?.href,o,Wu),$host:ta?.host,$pathname:ta?.pathname,$raw_user_agent:ea.length>1e3?ea.substring(0,997)+"...":ea,$browser_version:yN(ea,navigator.vendor),$browser_language:W1(),$browser_language_prefix:(a=W1(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:en.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ao=ct("[Web Vitals]"),Z1=9e5,zy=class{constructor(e){var a;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(((r,n)=>G({},r,{["$web_vitals_"+n.name+"_event"]:G({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(U(o))ao.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();U(i)||(Ie(r?.name)||Ie(r?.value)?ao.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?ao.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),U(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=U(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(G({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,n,o,i,s=ae.__PosthogExtensions__;U(s)||U(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):ao.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[R1]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=mt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return U(r)?((a=this._instance.persistence)==null?void 0:a.props[M1])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=mt(this._instance.config.capture_performance)&&yr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Z1;return 0<e&&e<=6e4?Z1:e}get isEnabled(){var e=ta?.protocol;if(e!=="http:"&&e!=="https:")return ao.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:lo(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return lo(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(ao.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=mt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=mt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[R1]:a}),this._instance.persistence.register({[M1]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?ao.error("failed to load script",n):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=a?qs([],zs,r||[]):[];return Gu(e,n,Wu)}ao.error("Could not determine current URL")}},_N=ct("[Heatmaps]");function X1(t){return mt(t)&&"clientX"in t&&"clientY"in t&&yr(t.clientX)&&yr(t.clientY)}var Vy=class{constructor(e){var a;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((a=this.instance.persistence)==null||!a.props[by]),this.rageclicks=new ap(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return mt(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 U(this.instance.config.capture_heatmaps)?U(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;_N.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 a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[by]:a}),this.Et=a,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"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){E&&q&&(this.jt=this.Dt.bind(this),nt(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),nt(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),nt(q,"mousemove",this.Nt,{capture:!0}),this.zt=new ip(this.instance,nN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),nt(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&q&&(this.jt&&E.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&yp(c)&&!co(c,"body");){if(c===u)return!1;if(pe(l,E?.getComputedStyle(c).position))return!0;c=TA(c)}return!1})(kA(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}At(e,a){var r;if(a===void 0&&(a="click"),!D1(e.target)&&X1(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(G({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!D1(e.target)&&X1(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var a=E.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?qs([],zs,n||[]):[],i=Gu(a,o,Wu);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Os(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},$y=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=E?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var r=this.Vt;if(!r)return{$pageview_id:a};var n={$pageview_id:a,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(U(i)||U(s)||U(l)||U(u)||U(c)||U(d))){i=Math.ceil(i),s=Math.ceil(s),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var h=i<=1?1:mr(s/i,0,1,z),m=i<=1?1:mr(l/i,0,1,z),S=u<=1?1:mr(c/u,0,1,z),b=u<=1?1:mr(d/u,0,1,z);n=Je(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},Pa=Uint8Array,Ut=Uint16Array,Us=Uint32Array,Cx=new Pa([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]),_x=new Pa([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]),Y1=new Pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uk=function(t,e){for(var a=new Ut(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new Us(a[30]);for(r=1;r<30;++r)for(var o=a[r];o<a[r+1];++o)n[o]=o-a[r]<<5|r;return[a,n]},ck=uk(Cx,2),wN=ck[0],jy=ck[1];wN[28]=258,jy[258]=28;for(Gy=uk(_x,0)[1],lp=new Ut(32768),Oe=0;Oe<32768;++Oe)ro=(43690&Oe)>>>1|(21845&Oe)<<1,ro=(61680&(ro=(52428&ro)>>>2|(13107&ro)<<2))>>>4|(3855&ro)<<4,lp[Oe]=((65280&ro)>>>8|(255&ro)<<8)>>>1;var ro,Gy,lp,Oe,Fu=function(t,e,a){for(var r=t.length,n=0,o=new Ut(e);n<r;++n)++o[t[n]-1];var i,s=new Ut(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Ut(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],d=s[t[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)i[lp[d]>>>l]=u}else for(i=new Ut(r),n=0;n<r;++n)i[n]=lp[s[t[n]-1]++]>>>15-t[n];return i},fi=new Pa(288);for(Oe=0;Oe<144;++Oe)fi[Oe]=8;for(Oe=144;Oe<256;++Oe)fi[Oe]=9;for(Oe=256;Oe<280;++Oe)fi[Oe]=7;for(Oe=280;Oe<288;++Oe)fi[Oe]=8;var up=new Pa(32);for(Oe=0;Oe<32;++Oe)up[Oe]=5;var LN=Fu(fi,9,0),IN=Fu(up,5,0),dk=function(t){return(t/8>>0)+(7&t&&1)},fk=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Ut?Ut:t instanceof Us?Us:Pa)(a-e);return r.set(t.subarray(e,a)),r},Jr=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},_u=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8,t[r+2]|=a>>>16},Kv=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,o=a.slice();if(!n)return[new Pa(0),0];if(n==1){var i=new Pa(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,w){return _.f-w.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=n-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(r=1;r<n;++r)o[r].s>h&&(h=o[r].s);var m=new Ut(h+1),S=Wy(a[c-1],m,0);if(S>e){r=0;var b=0,x=S-e,f=1<<x;for(o.sort((function(_,w){return m[w.s]-m[_.s]||_.f-w.f}));r<n;++r){var g=o[r].s;if(!(m[g]>e))break;b+=f-(1<<S-m[g]),m[g]=e}for(b>>>=x;b>0;){var v=o[r].s;m[v]<e?b-=1<<e-m[v]++-1:++r}for(;r>=0&&b;--r){var y=o[r].s;m[y]==e&&(--m[y],++b)}S=e}return[new Pa(m),S]},Wy=function(t,e,a){return t.s==-1?Math.max(Wy(t.l,e,a+1),Wy(t.r,e,a+1)):e[t.s]=a},K1=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Ut(++e),r=0,n=t[0],o=1,i=function(l){a[r++]=l},s=1;s<=e;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=t[s]}return[a.subarray(0,r),e]},wu=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},Zy=function(t,e,a){var r=a.length,n=dk(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<r;++o)t[n+o+4]=a[o];return 8*(n+4+r)},Q1=function(t,e,a,r,n,o,i,s,l,u,c){Jr(e,c++,a),++n[256];for(var d=Kv(n,15),h=d[0],m=d[1],S=Kv(o,15),b=S[0],x=S[1],f=K1(h),g=f[0],v=f[1],y=K1(b),_=y[0],w=y[1],C=new Ut(19),L=0;L<g.length;++L)C[31&g[L]]++;for(L=0;L<_.length;++L)C[31&_[L]]++;for(var k=Kv(C,7),A=k[0],M=k[1],T=19;T>4&&!A[Y1[T-1]];--T);var R,B,F,P,Y=u+5<<3,N=wu(n,fi)+wu(o,up)+i,W=wu(n,h)+wu(o,b)+i+14+3*T+wu(C,A)+(2*C[16]+3*C[17]+7*C[18]);if(Y<=N&&Y<=W)return Zy(e,c,t.subarray(l,l+u));if(Jr(e,c,1+(W<N)),c+=2,W<N){R=Fu(h,m,0),B=h,F=Fu(b,x,0),P=b;var Q=Fu(A,M,0);for(Jr(e,c,v-257),Jr(e,c+5,w-1),Jr(e,c+10,T-4),c+=14,L=0;L<T;++L)Jr(e,c+3*L,A[Y1[L]]);c+=3*T;for(var aa=[g,_],dt=0;dt<2;++dt){var qt=aa[dt];for(L=0;L<qt.length;++L){var j=31&qt[L];Jr(e,c,Q[j]),c+=A[j],j>15&&(Jr(e,c,qt[L]>>>5&127),c+=qt[L]>>>12)}}}else R=LN,B=fi,F=IN,P=up;for(L=0;L<s;++L)if(r[L]>255){j=r[L]>>>18&31,_u(e,c,R[j+257]),c+=B[j+257],j>7&&(Jr(e,c,r[L]>>>23&31),c+=Cx[j]);var ne=31&r[L];_u(e,c,F[ne]),c+=P[ne],ne>3&&(_u(e,c,r[L]>>>5&8191),c+=_x[ne])}else _u(e,c,R[r[L]]),c+=B[r[L]];return _u(e,c,R[256]),c+B[256]},AN=new Us([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kN=(function(){for(var t=new Us(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),EN=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,h=new Pa(l+d+5*(1+Math.floor(d/7e3))+u),m=h.subarray(l,h.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=Zy(m,S,o.subarray(b,x)):(m[b]=c,S=Zy(m,S,o.subarray(b,d)))}else{for(var f=AN[i-1],g=f>>>13,v=8191&f,y=(1<<s)-1,_=new Ut(32768),w=new Ut(y+1),C=Math.ceil(s/3),L=2*C,k=function(Op){return(o[Op]^o[Op+1]<<C^o[Op+2]<<L)&y},A=new Us(25e3),M=new Ut(288),T=new Ut(32),R=0,B=0,F=(b=0,0),P=0,Y=0;b<d;++b){var N=k(b),W=32767&b,Q=w[N];if(_[W]=Q,w[N]=W,P<=b){var aa=d-b;if((R>7e3||F>24576)&&aa>423){S=Q1(o,m,0,A,M,T,B,F,Y,b-Y,S),F=R=B=0,Y=b;for(var dt=0;dt<286;++dt)M[dt]=0;for(dt=0;dt<30;++dt)T[dt]=0}var qt=2,j=0,ne=v,At=W-Q&32767;if(aa>2&&N==k(b-At))for(var ln=Math.min(g,aa)-1,Rp=Math.min(32767,b),Mp=Math.min(258,aa);At<=Rp&&--ne&&W!=Q;){if(o[b+qt]==o[b+qt-At]){for(var un=0;un<Mp&&o[b+un]==o[b+un-At];++un);if(un>qt){if(qt=un,j=At,un>ln)break;var IE=Math.min(At,un-2),xb=0;for(dt=0;dt<IE;++dt){var Dp=b-At+dt+32768&32767,bb=Dp-_[Dp]+32768&32767;bb>xb&&(xb=bb,Q=Dp)}}}At+=(W=Q)-(Q=_[W])+32768&32767}if(j){A[F++]=268435456|jy[qt]<<18|Gy[j];var Sb=31&jy[qt],Cb=31&Gy[j];B+=Cx[Sb]+_x[Cb],++M[257+Sb],++T[Cb],P=b+qt,++R}else A[F++]=o[b],++M[o[b]]}}S=Q1(o,m,c,A,M,T,B,F,Y,b-Y,S)}return fk(h,0,l+dk(S)+u)})(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,a,r,!0)},Qv=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function TN(t,e){e===void 0&&(e={});var a=(function(){var s=4294967295;return{p:function(l){for(var u=s,c=0;c<l.length;++c)u=kN[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=EN(t,e,10+((n=e).filename&&n.filename.length+1||0),8),i=o.length;return(function(s,l){var u=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&&Qv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){s[3]=8;for(var c=0;c<=u.length;++c)s[c+10]=u.charCodeAt(c)}})(o,e),Qv(o,i-8,a.d()),Qv(o,i-4,r),o}var RN=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
461
461
  `).replace(/\r/g,`
462
- `)).length,n=0;n<r;n++){var i=t.charCodeAt(n),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),nn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},MN=!!iy||!!oy,J1="text/plain",dp=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=G({},e),s=(r=o?.split("&").map((u=>{var c,[d,h]=u.split("="),m=a&&(c=i[d])!==null&&c!==void 0?c:h;return delete i[d],d+"="+m})))!==null&&r!==void 0?r:[],l=XF(i);return l&&s.push(l),n+"?"+s.join("&")},Ou=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),ey=t=>{var{data:e,compression:a}=t;if(e){if(a===rn.GZipJS){var r=TN((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Pa(l.length+(l.length>>>1)),h=0,m=function(f){d[h++]=f},S=0;S<c;++S){if(h+5>d.length){var b=new Pa(h+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?m(x):x<2048?(m(192|x>>>6),m(128|63&x)):x>55295&&x<57344?(m(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),m(128|x>>>12&63),m(128|x>>>6&63),m(128|63&x)):(m(224|x>>>12),m(128|x>>>6&63),m(128|63&x))}return fk(d,0,h)})(Ou(e)),{mtime:0}),n=new Blob([r],{type:J1});return{contentType:J1,body:n,estimatedSize:n.size}}if(a===rn.Base64){var o=(function(l){var u,c,d,h,m,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",g=[];if(!l)return l;l=RN(l);do u=(m=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=m>>12&63,d=m>>6&63,h=63&m,g[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(h);while(b<l.length);switch(f=g.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Ou(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ou(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Ou(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Zf=[];oy&&Zf.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=ey(t))!==null&&e!==void 0?e:{},i=new Headers;De(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(x1){var u=new x1;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}oy(s,G({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:n,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var h={statusCode:c.status,text:d};if(c.status===200)try{h.json=JSON.parse(d)}catch(m){z.error(m)}t.callback==null||t.callback(h)})))).catch((c=>{z.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),iy&&Zf.push({transport:"XHR",method:t=>{var e,a=new iy;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=ey(t))!==null&&e!==void 0?e:{};De(t.headers,(function(o,i){a.setRequestHeader(i,o)})),r&&a.setRequestHeader("Content-Type",r),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(n)}}),ya!=null&&ya.sendBeacon&&Zf.push({transport:"sendBeacon",method:t=>{var e=dp(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=ey(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;ya.sendBeacon(e,o)}catch{}}});var fp=function(t,e){if(!(function(a){try{new RegExp(a)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function eA(t,e,a){return Ou({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var pk={exact:(t,e)=>e.some((a=>t.some((r=>a===r)))),is_not:(t,e)=>e.every((a=>t.every((r=>a!==r)))),regex:(t,e)=>e.some((a=>t.some((r=>fp(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!fp(a,r))))),icontains:(t,e)=>e.map(Gf).some((a=>t.map(Gf).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(Gf).every((a=>t.map(Gf).every((r=>!a.includes(r)))))},Gf=t=>t.toLowerCase();function hk(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(U(o)||nn(o))return!1;var i=[String(o)],s=pk[n.operator];return!!s&&s(n.values,i)}))}var ty=ct("[Error tracking]"),Yy=class{constructor(e){var a,r;this.Jt=[],this.Kt=new dy([new py,new by,new my,new hy,new yy,new vy,new gy,new xy],RF("web:javascript",AF,TF)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(Cy))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,r,n,o=(a=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&a!==void 0?a:[],i=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[Cy]:this.Jt,[T1]:i})}get Yt(){var e,a=!!this._instance.get_property(T1),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void ty.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void ty.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void ty.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 a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return ut(o)&&o.length>0&&r.$exception_types.push(o),ut(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var n=r.values.map((o=>{var i,s=pk[o.operator],l=Te(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var r,n;return(r=(n=a.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,r,n,o,i=(a=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(n=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}Xt(e){return!Ie(e)&&Te(e)}},er=ct("[FeatureFlags]"),Lu=ct("[FeatureFlags]",{debugEnabled:!0}),ay="$active_feature_flags",Rs="$override_feature_flags",tA="$feature_flag_payloads",Iu="$override_feature_flag_payloads",aA="$feature_flag_request_id",rA="$feature_flag_evaluated_at",nA=t=>{var e={};for(var[a,r]of Wf(t||{}))r&&(e[a]=r);return e},DN=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var r;return[a,(r=e[a].variant)!==null&&r!==void 0?r:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var r;return(r=e[a].metadata)==null?void 0:r.payload})).map((a=>{var r;return[a,(r=e[a].metadata)==null?void 0:r.payload]})))):er.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},ON=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Ky=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((a=>{var r=a&&typeof a=="string"&&a.trim().length>0;return r||er.error("Invalid evaluation environment found:",a,"Expected non-empty string"),r})):[]}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(_y),a=this._instance.get_property(Rs),r=this._instance.get_property(Iu);if(!r&&!a)return e||{};var n=Je({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=n[i],c=a?.[i],d=U(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,h=U(c)?u.variant:typeof c=="string"?c:void 0,m=r?.[i],S=G({},u,{enabled:d,variant:d?h??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),h!==u?.variant&&(S.original_variant=u?.variant),m&&(S.metadata=G({},u?.metadata,{payload:m,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(er.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Bs),a=this._instance.get_property(Rs);if(!a)return e||{};for(var r=Je({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(tA),a=this._instance.get_property(Iu);if(!a)return e||{};for(var r=Je({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.ii=!0),r}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 a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={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:G({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Mu)||{}),group_properties:this._instance.get_property(ci)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);n&&(r.timezone=lk()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,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((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(ON.FeatureFlags))er.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;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(aA)||void 0,i=this._instance.get_property(rA)||void 0,s=this._instance.get_property(Jf)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,h,m,S,b,x;Te(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Jf]:s});var f=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};U(f==null||(d=f.metadata)==null?void 0:d.version)||(g.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(m=f.reason)==null?void 0:m.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(g.$feature_flag_reason=y),f!=null&&(b=f.metadata)!=null&&b.id&&(g.$feature_flag_id=f.metadata.id),U(f?.original_variant)&&U(f?.original_enabled)||(g.$feature_flag_original_response=U(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(g.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",g)}return r}er.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,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(n.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return U(r)?void 0:!!r}er.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((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=DN(i),h=d.flags,m=d.featureFlags,S=d.featureFlagPayloads;if(m){var b=i.requestId,x=i.evaluatedAt;if(Te(m)){er.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(m)for(var g=0;g<m.length;g++)f[m[g]]=!0;s&&s.register({[ay]:m,[Bs]:f})}else{var v=m,y=S,_=h;i.errorsWhileComputingFlags&&(v=G({},l,v),y=G({},u,y),_=G({},c,_)),s&&s.register(G({[ay]:Object.keys(nA(v)),[Bs]:v||{},[tA]:y||{},[_y]:_||{}},b?{[aA]:b}:{},x?{[rA]:x}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),er.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return er.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Rs),this._instance.persistence.unregister(Iu),this.pi(),Lu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.ii=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Rs),Lu.info("Flag overrides cleared");else if(r.flags){if(Te(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Rs]:n})}else this._instance.persistence.register({[Rs]:r.flags});Lu.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Iu),Lu.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Iu]:r.payloads}),Lu.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:r}=this.gi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Ru)||[]).find((u=>u.flagKey===e)),i={["$feature_enrollment/"+e]:a},s={$feature_flag:e,$feature_enrollment:a,$set:i};o&&(s.$early_access_feature_name=o.name),r&&(s.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=G({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[ay]:Object.keys(nA(l)),[Bs]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Ru),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Ru),(l=this._instance.persistence)==null||l.register({[Ru]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((r=>a[r])),flagVariants:Object.keys(a).filter((r=>a[r])).reduce(((r,n)=>(r[n]=a[n],r)),{})}}pi(e){var{flags:a,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Mu)||{};this._instance.register({[Mu]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Mu)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(ci)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=G({},r[n],e[n]),delete e[n]})),this._instance.register({[ci]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(ci)||{};this._instance.register({[ci]:G({},a,{[e]:{}})})}else this._instance.unregister(ci)}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}},BN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Nu=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,G({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){BN.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&Ge.H()?Ge:a==="localstorage+cookie"&&zf.H()?zf:a==="sessionstorage"&&Lt.H()?Lt:a==="memory"?rN:a==="cookie"?vr:zf.H()?zf:vr}properties(){var e={};return De(this.props,(function(a,r){if(r===Bs&&mt(a))for(var n=Object.keys(a),o=0;o<n.length;o++)e["$feature/"+n[o]]=a[n[o]];else s=r,l=!1,(nn(i=HF)?l:y1&&i.indexOf===y1?i.indexOf(s)!=-1:(De(i,(function(u){if(l||(l=u===s))return Kf})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Je({},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,a,r){if(mt(e)){U(a)&&(a="None"),this.xi=U(r)?this.$i:r;var n=!1;if(De(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,n=!0)})),n)return this.save(),!0}return!1}register(e,a){if(mt(e)){this.xi=U(a)?this.$i:a;var r=!1;if(De(e,((n,o)=>{e.hasOwnProperty(o)&&this.props[o]!==n&&(this.props[o]=n,r=!0)})),r)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=ak(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Os(mx(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?nk(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ok(),$referring_domain:q!=null&&q.referrer&&((e=np(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Ay]||this.props[ky]||this.register_once({[ep]:ik(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};De([ky,Ay],(i=>{var s=this.props[i];s&&De(s,(function(l,u){e["$initial_"+sy(u)]=l}))}));var a,r,n=this.props[ep];if(n){var o=(a=sk(n),r={},De(a,(function(i,s){r["$initial_"+sy(s)]=i})),r);Je(e,o)}return e}safe_merge(e){return De(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var n=this.bi(e),o=this.props;this.clear(),this.Y=n,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,a){var r=this.props[Tu]||{};r[e]=a,this.props[Tu]=r,this.save()}remove_event_timer(e){var a=(this.props[Tu]||{})[e];return U(a)||(delete this.props[Tu][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},Au=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),Y5=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),K5=(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})({}),Q5=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),ry=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),J5=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),ez=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),tz=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Xf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),oA=(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})({}),mk=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),$u=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.ki[e]||[])r(a);for(var n of this.ki["*"]||[])n(e,a)}};function Ms(t,e,a){if(Ie(t))return!1;switch(a){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Qy=class{constructor(e){this.Pi=new $u,this.Ti=(a,r)=>this.Ri(a,r)&&this.Ii(a,r)&&this.Fi(a,r)&&this.Ci(a,r),this.Ri=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!U((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!U((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(o)}}on(e,a){var r;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((n=>{this.Di(a,n)&&this.Pi.emit("actionCaptured",n.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!Ms(n,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var r;if(a==null||!a.href)return!0;var n=this.zi(e);if(n.length>0)return n.some((s=>Ms(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Ms((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var r;if(a==null||!a.text)return!0;var n=this.zi(e);if(n.length>0)return n.some((u=>Ms(u.text,a.text,a.text_matching||"exact")||Ms(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],h=/(?::|")text="(.*?)"/g;!Ie(c=h.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Ms(u,i,s))))}Ui(e,a){var r,n;if(a==null||!a.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||hk(a.properties.reduce(((r,n)=>{var o=Te(n.value)?n.value.map(String):n.value!=null?[String(n.value)]:[];return r[n.key]={values:o,operator:n.operator||"exact"},r}),{}),e?.properties)}},_e=ct("[Surveys]"),Jy="seenSurvey_",FN=(t,e)=>{var a="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(a="$survey_"+e+"/"+t.id+"/"+t.current_iteration),a},iA=t=>{var e=""+Jy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Jy+t.id+"_"+t.current_iteration),e},NN=[ry.Popover,ry.Widget,ry.API],PN={ignoreConditions:!1,ignoreDelay:!1,displayType:mk.Popover},ex=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&hk(e.propertyFilters,a?.properties)}Gi(e,a){var r=new Map;return e.forEach((n=>{var o;(o=n.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=r.get(i.name)||[];s.push(n.id),r.set(i.name,s)}}))})),r}Vi(e,a,r){var n,o=(r===Au.Activation?this.Hi:this.Bi).get(e),i=[];return(n=this._instance)==null||n.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;U((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((r=>{var n,o;return((n=r.conditions)==null?void 0:n.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Qy(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),a.forEach((r=>{var n,o,i,s,l;r.conditions&&(n=r.conditions)!=null&&n.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(r.id),this.qi.set(u.name,c||[r.id])}})))})))}Ji(e){var a,r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(r.length!==0||n.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,Au.Activation),this.Bi=this.Gi(e,Au.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[qf])||[];if(Xf.SHOWN===e&&a&&n.length>0){var o;_e.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:n});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=n.indexOf(i);s>=0&&(n.splice(s,1),this.Xi(n))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,Au.Cancellation);l.length>0&&(_e.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,h=n.indexOf(c.id);h>=0&&n.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){_e.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,Au.Activation);this.Xi(n.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,r=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[qf])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;_e.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[qf]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[qf];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},tx=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 a=e.surveys;if(Ie(a))return _e.warn("Flags not loaded yet. Not loading surveys.");var r=Te(a);this.Zi=r?a.length>0:a,_e.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(Jy)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)_e.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)_e.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())_e.info("Not loading surveys in cookieless mode without consent.");else{var e=ae?.__PosthogExtensions__;if(e){if(!U(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,a);var n=e.loadExternalDependency;if(!n)return void this.se("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else _e.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new ex(this._instance),_e.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){_e.error(e,a),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return _e.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(wy);if(r&&!a)return e(r,{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:n=>{var o;this.te=!1;var i=n.statusCode;if(i!==200||!n.json){var s="Surveys API could not be loaded, status: "+i;return _e.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var m;return!((m=h.conditions)==null||(m=m.events)==null||(m=m.values)==null||!m.length)})(d)||(function(h){var m;return!((m=h.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[wy]:u}),e(u,{isLoaded:!0})}})}catch(n){throw this.te=!1,n}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){_e.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ie(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);_e.warn("init was not called")}oe(e){var a=null;return this.getSurveys((r=>{var n;a=(n=r.find((o=>o.id===e)))!==null&&n!==void 0?n:null})),a}ae(e){if(Ie(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.oe(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ie(this._surveyManager))return _e.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ae(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return Ie(this._surveyManager)?(_e.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((n=>{var o,i=(o=n.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(NN.includes(n.type)){var o=q?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(_e.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;_e.info("Rendering survey "+n.id+" with delay of "+((i=n.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(n,o),_e.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);_e.warn("Survey element not found")}else _e.warn("Surveys of type "+n.type+" cannot be rendered in the app");else _e.warn("Survey not found")}}displaySurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=this.oe(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=G({},n,{appearance:G({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void _e.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==mk.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else _e.warn("Survey not found")}}cancelPendingSurvey(e){Ie(this._surveyManager)?_e.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},sA=ct("[RateLimiter]"),ax=class{constructor(e){var a,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{sA.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void sA.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(r=this.instance.persistence)==null?void 0:r.get_property(Iy))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.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,(n=this.instance.persistence)==null||n.set_property(Iy,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},ui=ct("[RemoteConfig]"),rx=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ae._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(ui.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:a=>{e(a.json)}})}load(){try{if(this.remoteConfig)return ui.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void ui.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return ui.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((a=>{this.fi(a)}));this.fi(e)}))}catch(e){ui.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()):ui.info("__preview_remote_config is disabled. Logging config instead",e):ui.error("Failed to fetch remote config from PostHog.")}},nx=3e3,ox=class{constructor(e,a){this.he=!0,this.ve=[],this.de=mr(a?.flush_interval_ms||nx,250,5e3,z.createLogger("flush interval"),nx),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(G({},r,{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 a=this._e(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Te(o.data)&&De(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var n in a)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return De(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;U(e[o])&&(e[o]=G({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},HN=["retriesPerformedSoFar"],ix=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!U(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},nt(E,"online",this.we),nt(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=pA(e,HN);yr(a)&&a>0&&(r.url=dp(r.url,{retry_count:a})),this._instance.ci(G({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(G({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var r=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),n=Date.now()+r;this.ve.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),z.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(),a=[],r=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,U(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(G({},e,{transport:"sendBeacon"}))}catch(a){z.error(a)}this.ve=[]}},sx=class{constructor(e){this.ke=()=>{var a,r,n,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(n=this.Pe.maxContentY)!==null&&n!==void 0?n:0),this.Pe.maxContentHeight=Math.max(c,(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(){nt(E,"scroll",this.ke,{capture:!0}),nt(E,"scrollend",this.ke,{capture:!0}),nt(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.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 a of e){var r=E?.document.querySelector(a);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},UN=t=>ik(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),pp=class{constructor(e,a,r,n){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Ly]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||UN,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Ly]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?sk(a):{$referring_domain:a.referringDomain,$pathname:a.initialPathName,utm_source:a.utm_source,utm_campaign:a.utm_campaign,utm_medium:a.utm_medium,utm_content:a.utm_content,utm_term:a.utm_term}:{}}getSessionProps(){var e={};return De(mx(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+sy(r)]=a})),e}},ny=ct("[SessionId]"),hp=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,r){var n;if(this.Oe=[],this.Ae=void 0,this.Me=new $u,this.De=(c,d)=>Math.abs(c-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=a||io,this.Ue=r||io;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mr(i,60,36e3,ny.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=Lt.W(this.He),l=Lt.W(this.Be);s&&!l?this.je=s:Lt.V(this.He),Lt.G(this.Be,!0)}if((n=this.F.bootstrap)!=null&&n.sessionID)try{var u=(c=>{var d=c.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(),u)}catch(c){ny.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Lt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Lt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Lt.W(this.He):null}We(e,a,r){e===this.Le&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[Qf]:[a,e,r]}))}Ke(){var e=this.Fe.props[Qf];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&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Lt.V(this.Be)},nt(E,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=a||new Date().getTime(),[n,o,i]=this.Ke(),s=this.Je(),l=yr(i)&&i>0&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(r,n);c||d||l?(o=this.Ne(),s=this.Ue(),ny.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.Ue(),u=!0);var h=n===0||!e||l?r:n,m=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,h,m),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},qN=["$set_once","$set"],no=ct("[SiteApps]"),lx=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var r=this.globalsForEvent(a);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=ae._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 a,r,n,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,m]of Object.entries(d))u[h]={id:c[h],type:h,properties:m};var{$set_once:S,$set:b}=e;return{event:G({},pA(e,qN),{properties:G({},e.properties,b?{$set:G({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:G({},(n=(o=e.properties)==null?void 0:o.$set_once)!==null&&n!==void 0?n:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],r=()=>{var s;!a.errored&&this.Xe.length&&(no.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,no.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),n&&r()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),n=!0}catch(s){no.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){no.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(a)}catch(n){no.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var a,r,n,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;ae["__$$ph_site_app_"+u]=o._instance,(c=ae.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return no.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},gk=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&C1(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>C1(n?.brand,e))))return!0}catch{}return!!t.webdriver},Bu=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),lA="i.posthog.com",ux=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,a=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return a||(a=this.apiHost.replace("."+lA,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Bu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Bu.EU:this.er[this.apiHost]=Bu.CUSTOM),this.er[this.apiHost]}endpointFor(e,a){if(a===void 0&&(a=""),a&&(a=a[0]==="/"?a:"/"+a),e==="ui")return this.uiHost+a;if(e==="flags")return this.flagsApiHost+a;if(this.region===Bu.CUSTOM)return this.apiHost+a;var r=lA+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},zN={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&fp(e.href,t),not_regex:(t,e)=>!!E&&!fp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},cx=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ut(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}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(Ie(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.sr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=op(e?.search,"__experiment_id"),r=op(e?.search,"__experiment_variant");a&&r&&(t.rr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.lr(parseInt(a),r,n)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!a)return e(n);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 i=o.json.experiments||[];return e(i)}})}lr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.rr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.nr(n[0].name,a,n[0].variants[a].transforms))}static ar(e){return!Ie(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.url))return!0;var r,n,o,i=t.getWindowLocation();return!!i&&((r=e.conditions)==null||!r.url||zN[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static hr(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.utm))return!0;var r=ak();if(r.utm_source){var n,o,i,s,l,u,c,d,h=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,m=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==r.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,b=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return h&&S&&b&&m}return!1}static rr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];z.info("[WebExperiments] "+e,r)}nr(e,a,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",n);var i=(o=document)==null?void 0:o.querySelectorAll(n.selector);i?.forEach((s=>{var l=s;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return ya&&this._instance?gk(ya,this._instance.config.custom_blocked_useragents):void 0}},VN=ct("[PostHog ExternalIntegrations]"),$N={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},dx=class{constructor(e){this._instance=e}it(e,a){var r;(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return VN.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=ae.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it($N[i],(()=>{var c;(c=ae.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=ae.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=ae.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,n]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(r)}}},fx="[SessionRecording]",ku=ct(fx),mp=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 ku.error("started without valid sessionManager"),new Error(fx+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(fx+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(Gv))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!U(Object.assign)&&!U(Array.from);this.cr&&r?(this.gr(e),ku.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(ae!=null&&(a=ae.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=ae.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=ae.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return ku.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,a;(e=this.pr)==null||e.call(this),this.pr=void 0,(a=this.vr)==null||a.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(_A)}br(e){if(this._instance.persistence){var a,r,n=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Ie(s)?null:parseFloat(s);Ie(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[Gv]:G({enabled:!!i},i,{networkPayloadCapture:G({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:U(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:ku.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,a):ku.warn("log called before recorder was ready")}get mr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Gv);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=ae.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=ae.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,a))}},Pu={},px=()=>{},Ds="posthog",vk=!MN&&ea?.indexOf("MSIE")===-1&&ea?.indexOf("Mozilla")===-1,uA=t=>{var e;return G({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:PF(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:px,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:ta&&ut(ta?.search)&&ta.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:(E==null||(e=E.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:a=>{var r="Bad HTTP status: "+a.statusCode+" "+a.text;z.error(r)},get_device_id:a=>a,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:nx},error_tracking:{},_onCapture:px,__preview_eager_load_replay:!1},(a=>({rageclick:!(a&&a>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(a&&a>="2025-05-24")||"history_change",session_recording:a&&a>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},cA=t=>{var e={};U(t.process_person)||(e.person_profiles=t.process_person),U(t.xhr_headers)||(e.request_headers=t.xhr_headers),U(t.cookie_name)||(e.persistence_name=t.cookie_name),U(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),U(t.store_google)||(e.save_campaign_params=t.store_google),U(t.verbose)||(e.debug=t.verbose);var a=Je({},e,t);return Te(t.property_blacklist)&&(U(t.property_denylist)?a.property_denylist=t.property_blacklist:Te(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),a},hx=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},gp=class t{get decideEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new hx,this.Sr=!1,this.version=en.LIB_VERSION,this.Er=new $u,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uA(),this.SentryIntegration=Ny,this.sentryIntegration=e=>(function(a,r){var n=HA(a,r);return{name:PA,processEvent:o=>n(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 Ky(this),this.toolbar=new Py(this),this.scrollManager=new sx(this),this.pageViewManager=new jy(this),this.surveys=new tx(this),this.experiments=new cx(this),this.exceptions=new Yy(this),this.rateLimiter=new ax(this),this.requestRouter=new ux(this),this.consent=new Oy(this),this.externalIntegrations=new dx(this),this.people={set:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Ds){var n,o=(n=Pu[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),Pu[r]=o,Pu[Ds][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),U(e)||ly(e))return z.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={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(Je({},uA(a.defaults),cA(a),{name:r,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:rn.GZipJS;var o=this.Cr();this.persistence=new Nu(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(G({},this.config,{persistence:"sessionStorage"}),o);var i=G({},this.persistence.props),s=G({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new ox((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new ix(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 hp(this),this.sessionPropsManager=new pp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),en.DEBUG=en.DEBUG||this.config.debug,en.DEBUG&&z.info("Starting in debug mode",{this:this,config:a,thisC:G({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(io()),h=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(tn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:h})}if(this.jr()){var m,S,b=Object.keys(((m=a.bootstrap)==null?void 0:m.featureFlags)||{}).filter((g=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[g])})).reduce(((g,v)=>{var y;return g[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,g}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((g=>b[g])).reduce(((g,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(g[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:bu,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(io());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(tn,"anonymous")}return nt(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?iN(this,(()=>this.Lr())):this.Lr(),so(this.config._onCapture)&&this.config._onCapture!==px&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&z.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 a=performance.now();this.historyAutocapture=new Fy(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Hy(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new lx(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new mp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Ty(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new $y(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Vy(this)})),r.push((()=>{this.exceptionObserver=new By(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new sp(this,oN),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var n=this.Nr;this.Nr=void 0,this.fi(n)}})),this.Ur(r,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){z.error("Error initializing extension:",o)}}var n=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:n}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!q||!q.body)return z.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=pe(e.supportedCompression,rn.GZipJS)?rn.GZipJS:pe(e.supportedCompression,rn.Base64)?rn.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(n=this.sessionRecording)==null||n.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new rx(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()&&uo(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,a;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(a=this.Ar)==null||a.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(vk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=dp(e.url,{ip:this.config.ip?1:0}),e.headers=G({},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,(a=>{var r,n,o,i=G({},a);i.timeout=i.timeout||6e4,i.url=dp(i.url,{_:new Date().getTime().toString(),ver:en.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Zf.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=bA(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&n!==void 0?n:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(G({},e,{callback:a=>{var r,n;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((r=(n=this.config).on_request_error)==null||r.call(n,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,r=[],n=[],o=[];uo(e,(s=>{s&&(a=s[0],Te(a)?o.push(s):so(s)?s.call(this):Te(s)&&a==="alias"?r.push(s):Te(s)&&a.indexOf("capture")!==-1&&so(this[a])?o.push(s):n.push(s))}));var i=function(s,l){uo(s,(function(u){if(Te(u[0])){var c=l;De(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(r,this),i(n,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!U(e)&&ut(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ut(a?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$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=r?.timestamp||s,u=io(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,a||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),i&&(c.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(c.$set=r?.$set);var d,h=this.qr(r?.$set_once);if(h&&(c.$set_once=h),(c=FF(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,U(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Xf.DISMISSED||e===Xf.SENT){var m=a?.[oA.SURVEY_ID],S=a?.[oA.SURVEY_ITERATION];d={id:m,current_iteration:S},localStorage.getItem(iA(d))||localStorage.setItem(iA(d),"true"),c.$set=G({},c.$set,{[FN({id:m,current_iteration:S},e===Xf.SENT?"responded":"dismissed")]:!0})}var b=G({},c.properties.$set,c.$set);if(Os(b)||this.setPersonPropertiesForFlags(b),!Ie(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var f={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(f):this.Mr.enqueue(f),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=G({},a);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=G({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ut(s.distinct_id)&&!yr(s.distinct_id)||ly(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=CN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Je(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Je(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(m=this.Ar)==null?void 0:m.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Bu.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),s=Je(s,u),e==="$pageview"&&q&&(s.title=q.title),!U(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ea&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Je({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Te(this.config.property_denylist)?De(this.config.property_denylist,(function(f){delete s[f]})):z.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&&(z.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 a;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=Je({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Os(o)?void 0:o}register(e,a){var r;(r=this.persistence)==null||r.register(e,a)}register_once(e,a,r){var n;(n=this.persistence)==null||n.register_once(e,a,r)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,r)}getEarlyAccessFeatures(e,a,r){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,r)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,r;return(a=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=PN),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,r){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(yr(e)&&(e=e.toString(),z.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()))z.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!==bu){if(this.Vr("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Eu)&&(this.unregister(Eu),this.register({distinct_id:e}));var i=(this.persistence.get_property(tn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(tn,"identified"),this.setPersonPropertiesForFlags(G({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=eA(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Jf))}}else z.critical('The string "'+bu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=eA(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(G({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){if(this.Vr("posthog.group")){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:G({},n,{[e]:a})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===a||r||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(tn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:bu,$device_id:null},"");else{var s=this.config.get_device_id(io());this.register_once({distinct_id:s,$device_id:e?s:i},"")}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,a;return(e=(a=this.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:a,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&r){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return n;n+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return n}alias(e,a){return e===this.get_property(SA)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(U(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Eu,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=G({},this.config);if(mt(e)){var r,n,o,i,s;Je(this.config,cA(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(G({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);lo(u)&&(this.config.debug=u),lo(this.config.debug)&&(this.config.debug?(en.DEBUG=!0,Ge.H()&&Ge.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:a,newConfig:G({},this.config)})):(en.DEBUG=!1,Ge.H()&&Ge.V("ph_debug"))),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,r={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,o,i,s,l;(n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),r.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,a){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(G({},n,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Ds;return a!==Ds&&(a=Ds+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(tn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(tn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Os(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Eu])&&((a=this.persistence)==null||(a=a.props)==null||!a[tp]))}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"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(tp,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,r,n,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((n=this.sessionPersistence)==null||n.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var r,n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new hp(this),this.persistence&&(this.sessionPropsManager=new pp(this,this.sessionManager,this.persistence)),this.sessionRecording=new mp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(U(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e?.captureEventName)!==null&&n!==void 0?n:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;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:bu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.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===an.GRANTED?"granted":e===an.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 ya?gk(ya,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),nt(q,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.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,a,r,n,o,i,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?(z.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):(r="advanced_disable_decide",n=!1,o=z,i=(a="advanced_disable_flags")in(e=l)&&!U(e[a]),s=r in e&&!U(e[r]),i?e[a]:s?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[r]):n)}Wr(e){if(Ie(this.config.before_send))return e;var a=Te(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Ie(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return xF(e.event)?z.warn(o+". This can cause unexpected behavior."):z.info(o),null}r.properties&&!Os(r.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(r)})}Rr(e){var a=lo(e)&&!e,r=Ge.H()&&Ge.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=BF(t.prototype[e[a]])})(gp,["identify"]);var dA,yk=(dA=Pu[Ds]=new gp,(function(){function t(){t.done||(t.done=!0,vk=!1,De(Pu,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():nt(q,"DOMContentLoaded",t,{capture:!1}):E&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),dA);var Lx=class{constructor(e={}){this.options=e;$(this,"client");$(this,"featureFlagsCallback");$(this,"captureCallback");$(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 a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(n=>{n==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():n==="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 a=e.enableFeatureFlags??!0,r=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=yk.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,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:n=>{if(a&&this.featureFlagsCallback){n.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&n.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},r)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[r,n]of Object.entries(e))r.startsWith("in_segment_")&&(a[r]=n===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,r){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,r){let n=`$experiment_${e}`;this.register({[n]:r??`variation_${a}`,[`${n}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:r??`variation_${a}`})}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 Ix(t={}){return new Lx(t)}var Ax=async(t,e)=>{let a=[];if(e.applyAction)for(let r of t.actions){let n=await e.applyAction(r);a.push(n)}return{cleanup:async()=>{for(let r=a.length-1;r>=0;r--)try{await a[r].revert()}catch{}}}},kx=async(t,e)=>{let a=[];if(e.applyAction){let r=t.actions.map(n=>e.applyAction(n));if(t.waitFor==="any"){let n=await Promise.race(r);a.push(n);let o=await Promise.allSettled(r);for(let i of o)i.status==="fulfilled"&&i.value!==n&&a.push(i.value)}else{let n=await Promise.all(r);a.push(...n)}}return{cleanup:async()=>{for(let r of a)try{await r.revert()}catch{}}}},Ex=async(t,e)=>{let a,r,n=!1,o={cleanup:()=>{n=!0,r&&clearTimeout(r),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{n||i()}),t.durationMs!==void 0&&(r=setTimeout(()=>{n||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{r=setTimeout(()=>{n||i()},t.durationMs)}),o};var bp=class{constructor(){$(this,"executors",new Map);for(let{kind:e,executor:a}of Cg)this.registerCore(e,a);for(let{kind:e,executor:a}of Og)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",Ax),this.registerCore("core:parallel",kx),this.registerCore("core:wait",Ex)}registerCore(e,a,r){this.executors.set(e,{kind:e,executor:a,schema:r,source:"core",isBuiltIn:!0})}register(e,a,r,n="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${n})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${n})`),this.executors.set(e,{kind:e,executor:a,schema:r,source:n,isBuiltIn:o})}unregister(e){let a=this.executors.get(e);return a?a.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[a,r]of this.executors.entries())r.source===e&&this.executors.delete(a)}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 a=[];if(!e||typeof e!="object")return a.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:a,warnings:[]};let{kind:r}=e;if(!r||typeof r!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let n=this.executors.get(r);if(!n)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(n.schema){let o=n.schema.safeParse(e);if(!o.success){for(let i of o.error.issues)a.push({code:"SCHEMA_VALIDATION_ERROR",message:i.message,field:i.path.join(".")});return{valid:!1,errors:a,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)}},on=new bp;function jN(t){return on.get(t)}function Tx(t){return on.has(t)}var GN=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),xk=5e4,bk=50;function po(t){let e=[],a=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:a};let{kind:r}=t;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!Tx(r)&&r!=="core:mountWidget"){let n=on.list();return console.error(`[ActionValidation] Unknown action kind: "${r}". Registered kinds (${n.length}): [${n.join(", ")}]. This usually means the app that provides "${r}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":fo(t,e,a);break;case"overlays:badge":fo(t,e,a),WN(t,e,a);break;case"overlays:tooltip":fo(t,e,a),ZN(t,e,a);break;case"overlays:modal":oP(t,e,a);break;case"content:insertHtml":fo(t,e,a),XN(t,e,a);break;case"content:setText":fo(t,e,a),YN(t,e,a);break;case"content:setAttr":fo(t,e,a),KN(t,e,a);break;case"content:addClass":case"content:removeClass":fo(t,e,a),QN(t,e,a);break;case"content:setStyle":fo(t,e,a),JN(t,e,a);break;case"core:mountWidget":eP(t,e,a);break;case"core:wait":tP(t,e,a);break;case"core:sequence":aP(t,e,a);break;case"core:parallel":rP(t,e,a);break;case"core:tour":iP(t,e,a);break;case"navigation:navigate":nP(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function fo(t,e,a){let r=t.anchorId;if(!r||typeof r!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!r.selector||typeof r.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):r.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),r.route===void 0||r.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 n=Array.isArray(r.route)?r.route:[r.route];for(let o of n)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 WN(t,e,a){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&a.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function ZN(t,e,a){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 XN(t,e,a){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>xk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${xk}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function YN(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function KN(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(GN.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 QN(t,e,a){!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)||a.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function JN(t,e,a){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>bk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${bk}`,field:"styles"});for(let[n,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${n}`,field:`styles.${n}`})}}function eP(t,e,a){(!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 tP(t,e,a){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 aP(t,e,a){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&&a.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let n=po(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function rP(t,e,a){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&&a.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 r=0;r<t.actions.length;r++){let n=po(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function nP(t,e,a){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function oP(t,e,a){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 r=0;r<t.ctaButtons.length;r++){let n=t.ctaButtons[r];(!n.label||typeof n.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!n.actionId||typeof n.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function iP(t,e,a){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 r=new Set;for(let n=0;n<t.steps.length;n++){let o=t.steps[n];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${n} requires 'id' property`,field:`steps[${n}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${n}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${n} requires 'action' property`,field:`steps[${n}].action`});else{let i=po(o.action);for(let s of i.errors)e.push({...s,field:`steps[${n}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Rx(t){let e=[],a=[];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:a};for(let r=0;r<t.length;r++){let n=po(t[r]);if(!n.valid){let o=t[r];console.error(`[ActionValidation] Action [${r}] failed validation:`,`kind="${o?.kind??"undefined"}"`,n.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of n.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of n.warnings)a.push({...o,suggestion:o.suggestion?`Action ${r}: ${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(r=>`${r.field??"?"}: ${r.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var sP=0;function Mx(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=on,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function h(){return`action-${++sP}`}function m(C,L){a&&a.publish(C,L)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:h,publishEvent:m,adaptiveId:i,applyAction:g,subscribeEvent:a?(C,L)=>a.subscribe({names:[C]},k=>L(k.props)):void 0,subscribeNavigation:l}}async function b(C,L){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let k=r.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return L.publishEvent("action.applied",{id:L.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{k.unmount()},updateFn:A=>{if("widget"in A&&A.widget){let M=A.widget;M.props&&k.update({type:"widget",widgetId:C.widget.widgetId,config:M.props})}}}}async function x(C,L){if(C.kind==="core:mountWidget")return b(C,L);let k=s.get(C.kind);if(!k){let A="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${A}]`),new Error(`No executor for action kind: ${C.kind}`)}return k(C,L)}function f(C,L,k,A){if(!u)return;let M=[],T=async()=>{let R=c.get(C);if(!R)return;let F=u.evaluateSync(k).value;if(R.state==="applied"&&!F){try{await R.cleanup()}catch(P){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,P)}R.state="deferred",R.cleanup=()=>{},R.updateFn=void 0,m("action.deferred",{id:C,kind:L.kind})}else if(R.state==="deferred"&&F)try{let P=S(),Y=await x(L,P);R.state="applied",R.cleanup=Y.cleanup,R.updateFn=Y.updateFn,R.appliedTs=Date.now(),m("action.applied",{id:C,kind:L.kind,anchorId:"anchorId"in L?L.anchorId:void 0})}catch(P){console.error(`[ActionEngine] Error applying deferred action ${C}:`,P),R.state="failed"}};u.context&&M.push(u.context.subscribe(T)),u.accumulator&&M.push(u.accumulator.subscribe(T)),d.set(C,M)}async function g(C){let L=po(C);if(!L.valid){let F=L.errors.map(P=>P.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,F,C),new Error(`Action validation failed: ${F}`)}let k=h(),A=C.triggerWhen;if(A&&u&&!u.evaluateSync(A).value){let P={id:k,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(k,P);let Y={id:k,action:C,async revert(){let N=c.get(k);if(!N)return;let W=d.get(k);if(W){for(let Q of W)Q();d.delete(k)}N.state="reverted",c.delete(k)},isApplied(){return c.get(k)?.state==="applied"},async update(N){let W=c.get(k);if(!W||W.state!=="applied")throw new Error("Cannot update action that is not applied");if(W.updateFn)await W.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return f(k,C,A,Y),Y}let M=S(),T=await x(C,M),R={id:k,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:T.cleanup,updateFn:T.updateFn};c.set(k,R),m("action.applied",{id:k,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let B={id:k,action:C,async revert(){let F=c.get(k);if(!F||F.state!=="applied")return;let P=d.get(k);if(P){for(let Y of P)Y();d.delete(k)}try{await F.cleanup(),F.state="reverted",m("action.reverted",{id:k,kind:C.kind})}catch(Y){throw F.state="failed",m("action.failed",{id:k,kind:C.kind,error:String(Y)}),Y}finally{c.delete(k)}},isApplied(){return c.get(k)?.state==="applied"},async update(F){let P=c.get(k);if(!P||P.state!=="applied")throw new Error("Cannot update action that is not applied");if(P.updateFn)await P.updateFn(F);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return A&&u&&f(k,C,A,B),B}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(R=>R.kind).join(", "));let L=Rx(C);if(!L.valid){let R=L.errors.map(B=>B.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,R,`
462
+ `)).length,n=0;n<r;n++){var i=t.charCodeAt(n),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),nn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},MN=!!oy||!!ny,J1="text/plain",cp=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=G({},e),s=(r=o?.split("&").map((u=>{var c,[d,h]=u.split("="),m=a&&(c=i[d])!==null&&c!==void 0?c:h;return delete i[d],d+"="+m})))!==null&&r!==void 0?r:[],l=XF(i);return l&&s.push(l),n+"?"+s.join("&")},Ou=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),Jv=t=>{var{data:e,compression:a}=t;if(e){if(a===rn.GZipJS){var r=TN((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Pa(l.length+(l.length>>>1)),h=0,m=function(f){d[h++]=f},S=0;S<c;++S){if(h+5>d.length){var b=new Pa(h+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?m(x):x<2048?(m(192|x>>>6),m(128|63&x)):x>55295&&x<57344?(m(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),m(128|x>>>12&63),m(128|x>>>6&63),m(128|63&x)):(m(224|x>>>12),m(128|x>>>6&63),m(128|63&x))}return fk(d,0,h)})(Ou(e)),{mtime:0}),n=new Blob([r],{type:J1});return{contentType:J1,body:n,estimatedSize:n.size}}if(a===rn.Base64){var o=(function(l){var u,c,d,h,m,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",g=[];if(!l)return l;l=RN(l);do u=(m=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=m>>12&63,d=m>>6&63,h=63&m,g[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(h);while(b<l.length);switch(f=g.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Ou(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ou(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Ou(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Wf=[];ny&&Wf.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=Jv(t))!==null&&e!==void 0?e:{},i=new Headers;De(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(x1){var u=new x1;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}ny(s,G({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:n,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var h={statusCode:c.status,text:d};if(c.status===200)try{h.json=JSON.parse(d)}catch(m){z.error(m)}t.callback==null||t.callback(h)})))).catch((c=>{z.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),oy&&Wf.push({transport:"XHR",method:t=>{var e,a=new oy;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=Jv(t))!==null&&e!==void 0?e:{};De(t.headers,(function(o,i){a.setRequestHeader(i,o)})),r&&a.setRequestHeader("Content-Type",r),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(n)}}),ya!=null&&ya.sendBeacon&&Wf.push({transport:"sendBeacon",method:t=>{var e=cp(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=Jv(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;ya.sendBeacon(e,o)}catch{}}});var dp=function(t,e){if(!(function(a){try{new RegExp(a)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function eA(t,e,a){return Ou({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var pk={exact:(t,e)=>e.some((a=>t.some((r=>a===r)))),is_not:(t,e)=>e.every((a=>t.every((r=>a!==r)))),regex:(t,e)=>e.some((a=>t.some((r=>dp(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!dp(a,r))))),icontains:(t,e)=>e.map(jf).some((a=>t.map(jf).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(jf).every((a=>t.map(jf).every((r=>!a.includes(r)))))},jf=t=>t.toLowerCase();function hk(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(U(o)||nn(o))return!1;var i=[String(o)],s=pk[n.operator];return!!s&&s(n.values,i)}))}var ey=ct("[Error tracking]"),Xy=class{constructor(e){var a,r;this.Jt=[],this.Kt=new cy([new fy,new xy,new hy,new py,new vy,new gy,new my,new yy],RF("web:javascript",AF,TF)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(Sy))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,r,n,o=(a=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&a!==void 0?a:[],i=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[Sy]:this.Jt,[T1]:i})}get Yt(){var e,a=!!this._instance.get_property(T1),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void ey.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void ey.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void ey.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 a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return ut(o)&&o.length>0&&r.$exception_types.push(o),ut(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var n=r.values.map((o=>{var i,s=pk[o.operator],l=Te(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var r,n;return(r=(n=a.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,r,n,o,i=(a=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(n=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}Xt(e){return!Ie(e)&&Te(e)}},er=ct("[FeatureFlags]"),Lu=ct("[FeatureFlags]",{debugEnabled:!0}),ty="$active_feature_flags",Rs="$override_feature_flags",tA="$feature_flag_payloads",Iu="$override_feature_flag_payloads",aA="$feature_flag_request_id",rA="$feature_flag_evaluated_at",nA=t=>{var e={};for(var[a,r]of Gf(t||{}))r&&(e[a]=r);return e},DN=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var r;return[a,(r=e[a].variant)!==null&&r!==void 0?r:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var r;return(r=e[a].metadata)==null?void 0:r.payload})).map((a=>{var r;return[a,(r=e[a].metadata)==null?void 0:r.payload]})))):er.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},ON=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Yy=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((a=>{var r=a&&typeof a=="string"&&a.trim().length>0;return r||er.error("Invalid evaluation environment found:",a,"Expected non-empty string"),r})):[]}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(Cy),a=this._instance.get_property(Rs),r=this._instance.get_property(Iu);if(!r&&!a)return e||{};var n=Je({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=n[i],c=a?.[i],d=U(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,h=U(c)?u.variant:typeof c=="string"?c:void 0,m=r?.[i],S=G({},u,{enabled:d,variant:d?h??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),h!==u?.variant&&(S.original_variant=u?.variant),m&&(S.metadata=G({},u?.metadata,{payload:m,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(er.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Bs),a=this._instance.get_property(Rs);if(!a)return e||{};for(var r=Je({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(tA),a=this._instance.get_property(Iu);if(!a)return e||{};for(var r=Je({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.ii=!0),r}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 a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={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:G({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Mu)||{}),group_properties:this._instance.get_property(ci)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);n&&(r.timezone=lk()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,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((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(ON.FeatureFlags))er.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;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(aA)||void 0,i=this._instance.get_property(rA)||void 0,s=this._instance.get_property(Qf)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,h,m,S,b,x;Te(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Qf]:s});var f=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};U(f==null||(d=f.metadata)==null?void 0:d.version)||(g.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(m=f.reason)==null?void 0:m.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(g.$feature_flag_reason=y),f!=null&&(b=f.metadata)!=null&&b.id&&(g.$feature_flag_id=f.metadata.id),U(f?.original_variant)&&U(f?.original_enabled)||(g.$feature_flag_original_response=U(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(g.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",g)}return r}er.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,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(n.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return U(r)?void 0:!!r}er.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((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=DN(i),h=d.flags,m=d.featureFlags,S=d.featureFlagPayloads;if(m){var b=i.requestId,x=i.evaluatedAt;if(Te(m)){er.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(m)for(var g=0;g<m.length;g++)f[m[g]]=!0;s&&s.register({[ty]:m,[Bs]:f})}else{var v=m,y=S,_=h;i.errorsWhileComputingFlags&&(v=G({},l,v),y=G({},u,y),_=G({},c,_)),s&&s.register(G({[ty]:Object.keys(nA(v)),[Bs]:v||{},[tA]:y||{},[Cy]:_||{}},b?{[aA]:b}:{},x?{[rA]:x}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),er.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return er.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Rs),this._instance.persistence.unregister(Iu),this.pi(),Lu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.ii=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Rs),Lu.info("Flag overrides cleared");else if(r.flags){if(Te(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Rs]:n})}else this._instance.persistence.register({[Rs]:r.flags});Lu.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Iu),Lu.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Iu]:r.payloads}),Lu.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:r}=this.gi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Ru)||[]).find((u=>u.flagKey===e)),i={["$feature_enrollment/"+e]:a},s={$feature_flag:e,$feature_enrollment:a,$set:i};o&&(s.$early_access_feature_name=o.name),r&&(s.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=G({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[ty]:Object.keys(nA(l)),[Bs]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Ru),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Ru),(l=this._instance.persistence)==null||l.register({[Ru]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((r=>a[r])),flagVariants:Object.keys(a).filter((r=>a[r])).reduce(((r,n)=>(r[n]=a[n],r)),{})}}pi(e){var{flags:a,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Mu)||{};this._instance.register({[Mu]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Mu)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(ci)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=G({},r[n],e[n]),delete e[n]})),this._instance.register({[ci]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(ci)||{};this._instance.register({[ci]:G({},a,{[e]:{}})})}else this._instance.unregister(ci)}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}},BN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Nu=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,G({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){BN.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&Ge.H()?Ge:a==="localstorage+cookie"&&qf.H()?qf:a==="sessionstorage"&&Lt.H()?Lt:a==="memory"?rN:a==="cookie"?vr:qf.H()?qf:vr}properties(){var e={};return De(this.props,(function(a,r){if(r===Bs&&mt(a))for(var n=Object.keys(a),o=0;o<n.length;o++)e["$feature/"+n[o]]=a[n[o]];else s=r,l=!1,(nn(i=HF)?l:y1&&i.indexOf===y1?i.indexOf(s)!=-1:(De(i,(function(u){if(l||(l=u===s))return Yf})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Je({},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,a,r){if(mt(e)){U(a)&&(a="None"),this.xi=U(r)?this.$i:r;var n=!1;if(De(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,n=!0)})),n)return this.save(),!0}return!1}register(e,a){if(mt(e)){this.xi=U(a)?this.$i:a;var r=!1;if(De(e,((n,o)=>{e.hasOwnProperty(o)&&this.props[o]!==n&&(this.props[o]=n,r=!0)})),r)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=ak(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Os(hx(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?nk(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ok(),$referring_domain:q!=null&&q.referrer&&((e=rp(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Iy]||this.props[Ay]||this.register_once({[Jf]:ik(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};De([Ay,Iy],(i=>{var s=this.props[i];s&&De(s,(function(l,u){e["$initial_"+iy(u)]=l}))}));var a,r,n=this.props[Jf];if(n){var o=(a=sk(n),r={},De(a,(function(i,s){r["$initial_"+iy(s)]=i})),r);Je(e,o)}return e}safe_merge(e){return De(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var n=this.bi(e),o=this.props;this.clear(),this.Y=n,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,a){var r=this.props[Tu]||{};r[e]=a,this.props[Tu]=r,this.save()}remove_event_timer(e){var a=(this.props[Tu]||{})[e];return U(a)||(delete this.props[Tu][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},Au=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),Y5=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),K5=(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})({}),Q5=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),ay=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),J5=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),ez=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),tz=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Zf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),oA=(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})({}),mk=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),$u=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.ki[e]||[])r(a);for(var n of this.ki["*"]||[])n(e,a)}};function Ms(t,e,a){if(Ie(t))return!1;switch(a){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Ky=class{constructor(e){this.Pi=new $u,this.Ti=(a,r)=>this.Ri(a,r)&&this.Ii(a,r)&&this.Fi(a,r)&&this.Ci(a,r),this.Ri=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!U((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!U((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(o)}}on(e,a){var r;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((n=>{this.Di(a,n)&&this.Pi.emit("actionCaptured",n.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!Ms(n,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var r;if(a==null||!a.href)return!0;var n=this.zi(e);if(n.length>0)return n.some((s=>Ms(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Ms((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var r;if(a==null||!a.text)return!0;var n=this.zi(e);if(n.length>0)return n.some((u=>Ms(u.text,a.text,a.text_matching||"exact")||Ms(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],h=/(?::|")text="(.*?)"/g;!Ie(c=h.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Ms(u,i,s))))}Ui(e,a){var r,n;if(a==null||!a.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||hk(a.properties.reduce(((r,n)=>{var o=Te(n.value)?n.value.map(String):n.value!=null?[String(n.value)]:[];return r[n.key]={values:o,operator:n.operator||"exact"},r}),{}),e?.properties)}},_e=ct("[Surveys]"),Qy="seenSurvey_",FN=(t,e)=>{var a="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(a="$survey_"+e+"/"+t.id+"/"+t.current_iteration),a},iA=t=>{var e=""+Qy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Qy+t.id+"_"+t.current_iteration),e},NN=[ay.Popover,ay.Widget,ay.API],PN={ignoreConditions:!1,ignoreDelay:!1,displayType:mk.Popover},Jy=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&hk(e.propertyFilters,a?.properties)}Gi(e,a){var r=new Map;return e.forEach((n=>{var o;(o=n.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=r.get(i.name)||[];s.push(n.id),r.set(i.name,s)}}))})),r}Vi(e,a,r){var n,o=(r===Au.Activation?this.Hi:this.Bi).get(e),i=[];return(n=this._instance)==null||n.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;U((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((r=>{var n,o;return((n=r.conditions)==null?void 0:n.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Ky(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),a.forEach((r=>{var n,o,i,s,l;r.conditions&&(n=r.conditions)!=null&&n.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(r.id),this.qi.set(u.name,c||[r.id])}})))})))}Ji(e){var a,r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(r.length!==0||n.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,Au.Activation),this.Bi=this.Gi(e,Au.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Uf])||[];if(Zf.SHOWN===e&&a&&n.length>0){var o;_e.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:n});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=n.indexOf(i);s>=0&&(n.splice(s,1),this.Xi(n))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,Au.Cancellation);l.length>0&&(_e.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,h=n.indexOf(c.id);h>=0&&n.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){_e.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,Au.Activation);this.Xi(n.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,r=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[Uf])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;_e.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[Uf]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Uf];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},ex=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 a=e.surveys;if(Ie(a))return _e.warn("Flags not loaded yet. Not loading surveys.");var r=Te(a);this.Zi=r?a.length>0:a,_e.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(Qy)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)_e.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)_e.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())_e.info("Not loading surveys in cookieless mode without consent.");else{var e=ae?.__PosthogExtensions__;if(e){if(!U(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,a);var n=e.loadExternalDependency;if(!n)return void this.se("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else _e.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new Jy(this._instance),_e.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){_e.error(e,a),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return _e.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(_y);if(r&&!a)return e(r,{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:n=>{var o;this.te=!1;var i=n.statusCode;if(i!==200||!n.json){var s="Surveys API could not be loaded, status: "+i;return _e.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var m;return!((m=h.conditions)==null||(m=m.events)==null||(m=m.values)==null||!m.length)})(d)||(function(h){var m;return!((m=h.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[_y]:u}),e(u,{isLoaded:!0})}})}catch(n){throw this.te=!1,n}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){_e.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ie(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);_e.warn("init was not called")}oe(e){var a=null;return this.getSurveys((r=>{var n;a=(n=r.find((o=>o.id===e)))!==null&&n!==void 0?n:null})),a}ae(e){if(Ie(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.oe(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ie(this._surveyManager))return _e.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ae(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return Ie(this._surveyManager)?(_e.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((n=>{var o,i=(o=n.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(NN.includes(n.type)){var o=q?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(_e.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;_e.info("Rendering survey "+n.id+" with delay of "+((i=n.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(n,o),_e.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);_e.warn("Survey element not found")}else _e.warn("Surveys of type "+n.type+" cannot be rendered in the app");else _e.warn("Survey not found")}}displaySurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=this.oe(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=G({},n,{appearance:G({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void _e.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==mk.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else _e.warn("Survey not found")}}cancelPendingSurvey(e){Ie(this._surveyManager)?_e.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},sA=ct("[RateLimiter]"),tx=class{constructor(e){var a,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{sA.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void sA.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(r=this.instance.persistence)==null?void 0:r.get_property(Ly))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.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,(n=this.instance.persistence)==null||n.set_property(Ly,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},ui=ct("[RemoteConfig]"),ax=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ae._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=ae.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(ui.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:a=>{e(a.json)}})}load(){try{if(this.remoteConfig)return ui.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void ui.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return ui.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((a=>{this.fi(a)}));this.fi(e)}))}catch(e){ui.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()):ui.info("__preview_remote_config is disabled. Logging config instead",e):ui.error("Failed to fetch remote config from PostHog.")}},rx=3e3,nx=class{constructor(e,a){this.he=!0,this.ve=[],this.de=mr(a?.flush_interval_ms||rx,250,5e3,z.createLogger("flush interval"),rx),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(G({},r,{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 a=this._e(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Te(o.data)&&De(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var n in a)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return De(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;U(e[o])&&(e[o]=G({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},HN=["retriesPerformedSoFar"],ox=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!U(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},nt(E,"online",this.we),nt(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=pA(e,HN);yr(a)&&a>0&&(r.url=cp(r.url,{retry_count:a})),this._instance.ci(G({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(G({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var r=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),n=Date.now()+r;this.ve.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),z.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(),a=[],r=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,U(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(G({},e,{transport:"sendBeacon"}))}catch(a){z.error(a)}this.ve=[]}},ix=class{constructor(e){this.ke=()=>{var a,r,n,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(n=this.Pe.maxContentY)!==null&&n!==void 0?n:0),this.Pe.maxContentHeight=Math.max(c,(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(){nt(E,"scroll",this.ke,{capture:!0}),nt(E,"scrollend",this.ke,{capture:!0}),nt(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.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 a of e){var r=E?.document.querySelector(a);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},UN=t=>ik(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),fp=class{constructor(e,a,r,n){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[wy]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||UN,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[wy]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?sk(a):{$referring_domain:a.referringDomain,$pathname:a.initialPathName,utm_source:a.utm_source,utm_campaign:a.utm_campaign,utm_medium:a.utm_medium,utm_content:a.utm_content,utm_term:a.utm_term}:{}}getSessionProps(){var e={};return De(hx(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+iy(r)]=a})),e}},ry=ct("[SessionId]"),pp=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,r){var n;if(this.Oe=[],this.Ae=void 0,this.Me=new $u,this.De=(c,d)=>Math.abs(c-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=a||io,this.Ue=r||io;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mr(i,60,36e3,ry.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=Lt.W(this.He),l=Lt.W(this.Be);s&&!l?this.je=s:Lt.V(this.He),Lt.G(this.Be,!0)}if((n=this.F.bootstrap)!=null&&n.sessionID)try{var u=(c=>{var d=c.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(),u)}catch(c){ry.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Lt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Lt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Lt.W(this.He):null}We(e,a,r){e===this.Le&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[Kf]:[a,e,r]}))}Ke(){var e=this.Fe.props[Kf];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&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Lt.V(this.Be)},nt(E,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=a||new Date().getTime(),[n,o,i]=this.Ke(),s=this.Je(),l=yr(i)&&i>0&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(r,n);c||d||l?(o=this.Ne(),s=this.Ue(),ry.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.Ue(),u=!0);var h=n===0||!e||l?r:n,m=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,h,m),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},qN=["$set_once","$set"],no=ct("[SiteApps]"),sx=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var r=this.globalsForEvent(a);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=ae._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 a,r,n,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,m]of Object.entries(d))u[h]={id:c[h],type:h,properties:m};var{$set_once:S,$set:b}=e;return{event:G({},pA(e,qN),{properties:G({},e.properties,b?{$set:G({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:G({},(n=(o=e.properties)==null?void 0:o.$set_once)!==null&&n!==void 0?n:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],r=()=>{var s;!a.errored&&this.Xe.length&&(no.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,no.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),n&&r()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),n=!0}catch(s){no.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){no.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(a)}catch(n){no.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var a,r,n,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;ae["__$$ph_site_app_"+u]=o._instance,(c=ae.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return no.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},gk=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&C1(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>C1(n?.brand,e))))return!0}catch{}return!!t.webdriver},Bu=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),lA="i.posthog.com",lx=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,a=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return a||(a=this.apiHost.replace("."+lA,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Bu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Bu.EU:this.er[this.apiHost]=Bu.CUSTOM),this.er[this.apiHost]}endpointFor(e,a){if(a===void 0&&(a=""),a&&(a=a[0]==="/"?a:"/"+a),e==="ui")return this.uiHost+a;if(e==="flags")return this.flagsApiHost+a;if(this.region===Bu.CUSTOM)return this.apiHost+a;var r=lA+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},zN={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&dp(e.href,t),not_regex:(t,e)=>!!E&&!dp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},ux=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ut(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}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(Ie(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.sr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=np(e?.search,"__experiment_id"),r=np(e?.search,"__experiment_variant");a&&r&&(t.rr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.lr(parseInt(a),r,n)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!a)return e(n);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 i=o.json.experiments||[];return e(i)}})}lr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.rr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.nr(n[0].name,a,n[0].variants[a].transforms))}static ar(e){return!Ie(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.url))return!0;var r,n,o,i=t.getWindowLocation();return!!i&&((r=e.conditions)==null||!r.url||zN[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static hr(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.utm))return!0;var r=ak();if(r.utm_source){var n,o,i,s,l,u,c,d,h=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,m=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==r.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,b=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return h&&S&&b&&m}return!1}static rr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];z.info("[WebExperiments] "+e,r)}nr(e,a,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",n);var i=(o=document)==null?void 0:o.querySelectorAll(n.selector);i?.forEach((s=>{var l=s;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return ya&&this._instance?gk(ya,this._instance.config.custom_blocked_useragents):void 0}},VN=ct("[PostHog ExternalIntegrations]"),$N={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},cx=class{constructor(e){this._instance=e}it(e,a){var r;(r=ae.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return VN.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=ae.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it($N[i],(()=>{var c;(c=ae.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=ae.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=ae.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,n]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(r)}}},dx="[SessionRecording]",ku=ct(dx),hp=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 ku.error("started without valid sessionManager"),new Error(dx+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(dx+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(jv))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!U(Object.assign)&&!U(Array.from);this.cr&&r?(this.gr(e),ku.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(ae!=null&&(a=ae.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=ae.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=ae.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return ku.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,a;(e=this.pr)==null||e.call(this),this.pr=void 0,(a=this.vr)==null||a.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(_A)}br(e){if(this._instance.persistence){var a,r,n=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Ie(s)?null:parseFloat(s);Ie(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[jv]:G({enabled:!!i},i,{networkPayloadCapture:G({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:U(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:ku.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,a):ku.warn("log called before recorder was ready")}get mr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(jv);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=ae.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=ae.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,a))}},Pu={},fx=()=>{},Ds="posthog",vk=!MN&&ea?.indexOf("MSIE")===-1&&ea?.indexOf("Mozilla")===-1,uA=t=>{var e;return G({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:PF(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:fx,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:ta&&ut(ta?.search)&&ta.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:(E==null||(e=E.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:a=>{var r="Bad HTTP status: "+a.statusCode+" "+a.text;z.error(r)},get_device_id:a=>a,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:rx},error_tracking:{},_onCapture:fx,__preview_eager_load_replay:!1},(a=>({rageclick:!(a&&a>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(a&&a>="2025-05-24")||"history_change",session_recording:a&&a>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},cA=t=>{var e={};U(t.process_person)||(e.person_profiles=t.process_person),U(t.xhr_headers)||(e.request_headers=t.xhr_headers),U(t.cookie_name)||(e.persistence_name=t.cookie_name),U(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),U(t.store_google)||(e.save_campaign_params=t.store_google),U(t.verbose)||(e.debug=t.verbose);var a=Je({},e,t);return Te(t.property_blacklist)&&(U(t.property_denylist)?a.property_denylist=t.property_blacklist:Te(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),a},px=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},mp=class t{get decideEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new px,this.Sr=!1,this.version=en.LIB_VERSION,this.Er=new $u,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uA(),this.SentryIntegration=Fy,this.sentryIntegration=e=>(function(a,r){var n=HA(a,r);return{name:PA,processEvent:o=>n(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 Yy(this),this.toolbar=new Ny(this),this.scrollManager=new ix(this),this.pageViewManager=new $y(this),this.surveys=new ex(this),this.experiments=new ux(this),this.exceptions=new Xy(this),this.rateLimiter=new tx(this),this.requestRouter=new lx(this),this.consent=new Dy(this),this.externalIntegrations=new cx(this),this.people={set:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Ds){var n,o=(n=Pu[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),Pu[r]=o,Pu[Ds][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),U(e)||sy(e))return z.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={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(Je({},uA(a.defaults),cA(a),{name:r,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:rn.GZipJS;var o=this.Cr();this.persistence=new Nu(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(G({},this.config,{persistence:"sessionStorage"}),o);var i=G({},this.persistence.props),s=G({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new nx((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new ox(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 pp(this),this.sessionPropsManager=new fp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),en.DEBUG=en.DEBUG||this.config.debug,en.DEBUG&&z.info("Starting in debug mode",{this:this,config:a,thisC:G({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(io()),h=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(tn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:h})}if(this.jr()){var m,S,b=Object.keys(((m=a.bootstrap)==null?void 0:m.featureFlags)||{}).filter((g=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[g])})).reduce(((g,v)=>{var y;return g[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,g}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((g=>b[g])).reduce(((g,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(g[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:bu,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(io());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(tn,"anonymous")}return nt(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?iN(this,(()=>this.Lr())):this.Lr(),so(this.config._onCapture)&&this.config._onCapture!==fx&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&z.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 a=performance.now();this.historyAutocapture=new By(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Py(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new sx(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new hp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Ey(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Vy(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new zy(this)})),r.push((()=>{this.exceptionObserver=new Oy(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new ip(this,oN),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var n=this.Nr;this.Nr=void 0,this.fi(n)}})),this.Ur(r,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){z.error("Error initializing extension:",o)}}var n=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:n}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!q||!q.body)return z.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=pe(e.supportedCompression,rn.GZipJS)?rn.GZipJS:pe(e.supportedCompression,rn.Base64)?rn.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(n=this.sessionRecording)==null||n.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new ax(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()&&uo(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,a;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(a=this.Ar)==null||a.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(vk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=cp(e.url,{ip:this.config.ip?1:0}),e.headers=G({},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,(a=>{var r,n,o,i=G({},a);i.timeout=i.timeout||6e4,i.url=cp(i.url,{_:new Date().getTime().toString(),ver:en.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Wf.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=bA(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&n!==void 0?n:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(G({},e,{callback:a=>{var r,n;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((r=(n=this.config).on_request_error)==null||r.call(n,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,r=[],n=[],o=[];uo(e,(s=>{s&&(a=s[0],Te(a)?o.push(s):so(s)?s.call(this):Te(s)&&a==="alias"?r.push(s):Te(s)&&a.indexOf("capture")!==-1&&so(this[a])?o.push(s):n.push(s))}));var i=function(s,l){uo(s,(function(u){if(Te(u[0])){var c=l;De(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(r,this),i(n,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!U(e)&&ut(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ut(a?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$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=r?.timestamp||s,u=io(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,a||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),i&&(c.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(c.$set=r?.$set);var d,h=this.qr(r?.$set_once);if(h&&(c.$set_once=h),(c=FF(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,U(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Zf.DISMISSED||e===Zf.SENT){var m=a?.[oA.SURVEY_ID],S=a?.[oA.SURVEY_ITERATION];d={id:m,current_iteration:S},localStorage.getItem(iA(d))||localStorage.setItem(iA(d),"true"),c.$set=G({},c.$set,{[FN({id:m,current_iteration:S},e===Zf.SENT?"responded":"dismissed")]:!0})}var b=G({},c.properties.$set,c.$set);if(Os(b)||this.setPersonPropertiesForFlags(b),!Ie(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var f={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(f):this.Mr.enqueue(f),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=G({},a);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=G({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ut(s.distinct_id)&&!yr(s.distinct_id)||sy(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=CN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Je(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Je(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(m=this.Ar)==null?void 0:m.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Bu.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),s=Je(s,u),e==="$pageview"&&q&&(s.title=q.title),!U(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ea&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Je({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Te(this.config.property_denylist)?De(this.config.property_denylist,(function(f){delete s[f]})):z.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&&(z.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 a;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=Je({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Os(o)?void 0:o}register(e,a){var r;(r=this.persistence)==null||r.register(e,a)}register_once(e,a,r){var n;(n=this.persistence)==null||n.register_once(e,a,r)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,r)}getEarlyAccessFeatures(e,a,r){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,r)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,r;return(a=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=PN),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,r){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(yr(e)&&(e=e.toString(),z.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()))z.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!==bu){if(this.Vr("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Eu)&&(this.unregister(Eu),this.register({distinct_id:e}));var i=(this.persistence.get_property(tn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(tn,"identified"),this.setPersonPropertiesForFlags(G({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=eA(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Qf))}}else z.critical('The string "'+bu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=eA(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(G({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){if(this.Vr("posthog.group")){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:G({},n,{[e]:a})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===a||r||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(tn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:bu,$device_id:null},"");else{var s=this.config.get_device_id(io());this.register_once({distinct_id:s,$device_id:e?s:i},"")}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,a;return(e=(a=this.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:a,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&r){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return n;n+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return n}alias(e,a){return e===this.get_property(SA)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(U(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Eu,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=G({},this.config);if(mt(e)){var r,n,o,i,s;Je(this.config,cA(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(G({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);lo(u)&&(this.config.debug=u),lo(this.config.debug)&&(this.config.debug?(en.DEBUG=!0,Ge.H()&&Ge.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:a,newConfig:G({},this.config)})):(en.DEBUG=!1,Ge.H()&&Ge.V("ph_debug"))),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,r={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,o,i,s,l;(n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),r.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,a){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(G({},n,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Ds;return a!==Ds&&(a=Ds+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(tn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(tn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Os(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Eu])&&((a=this.persistence)==null||(a=a.props)==null||!a[ep]))}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"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(ep,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,r,n,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((n=this.sessionPersistence)==null||n.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var r,n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new pp(this),this.persistence&&(this.sessionPropsManager=new fp(this,this.sessionManager,this.persistence)),this.sessionRecording=new hp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(U(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e?.captureEventName)!==null&&n!==void 0?n:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;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:bu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.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===an.GRANTED?"granted":e===an.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 ya?gk(ya,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),nt(q,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.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,a,r,n,o,i,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?(z.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):(r="advanced_disable_decide",n=!1,o=z,i=(a="advanced_disable_flags")in(e=l)&&!U(e[a]),s=r in e&&!U(e[r]),i?e[a]:s?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[r]):n)}Wr(e){if(Ie(this.config.before_send))return e;var a=Te(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Ie(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return xF(e.event)?z.warn(o+". This can cause unexpected behavior."):z.info(o),null}r.properties&&!Os(r.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(r)})}Rr(e){var a=lo(e)&&!e,r=Ge.H()&&Ge.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=BF(t.prototype[e[a]])})(mp,["identify"]);var dA,yk=(dA=Pu[Ds]=new mp,(function(){function t(){t.done||(t.done=!0,vk=!1,De(Pu,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():nt(q,"DOMContentLoaded",t,{capture:!1}):E&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),dA);var wx=class{constructor(e={}){this.options=e;$(this,"client");$(this,"featureFlagsCallback");$(this,"captureCallback");$(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 a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(n=>{n==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():n==="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 a=e.enableFeatureFlags??!0,r=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=yk.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,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:n=>{if(a&&this.featureFlagsCallback){n.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&n.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},r)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[r,n]of Object.entries(e))r.startsWith("in_segment_")&&(a[r]=n===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,r){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,r){let n=`$experiment_${e}`;this.register({[n]:r??`variation_${a}`,[`${n}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:r??`variation_${a}`})}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 Lx(t={}){return new wx(t)}var Ix=async(t,e)=>{let a=[];if(e.applyAction)for(let r of t.actions){let n=await e.applyAction(r);a.push(n)}return{cleanup:async()=>{for(let r=a.length-1;r>=0;r--)try{await a[r].revert()}catch{}}}},Ax=async(t,e)=>{let a=[];if(e.applyAction){let r=t.actions.map(n=>e.applyAction(n));if(t.waitFor==="any"){let n=await Promise.race(r);a.push(n);let o=await Promise.allSettled(r);for(let i of o)i.status==="fulfilled"&&i.value!==n&&a.push(i.value)}else{let n=await Promise.all(r);a.push(...n)}}return{cleanup:async()=>{for(let r of a)try{await r.revert()}catch{}}}},kx=async(t,e)=>{let a,r,n=!1,o={cleanup:()=>{n=!0,r&&clearTimeout(r),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{n||i()}),t.durationMs!==void 0&&(r=setTimeout(()=>{n||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{r=setTimeout(()=>{n||i()},t.durationMs)}),o};var xp=class{constructor(){$(this,"executors",new Map);for(let{kind:e,executor:a}of Sg)this.registerCore(e,a);for(let{kind:e,executor:a}of Dg)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",Ix),this.registerCore("core:parallel",Ax),this.registerCore("core:wait",kx)}registerCore(e,a,r){this.executors.set(e,{kind:e,executor:a,schema:r,source:"core",isBuiltIn:!0})}register(e,a,r,n="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${n})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${n})`),this.executors.set(e,{kind:e,executor:a,schema:r,source:n,isBuiltIn:o})}unregister(e){let a=this.executors.get(e);return a?a.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[a,r]of this.executors.entries())r.source===e&&this.executors.delete(a)}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 a=[];if(!e||typeof e!="object")return a.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:a,warnings:[]};let{kind:r}=e;if(!r||typeof r!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let n=this.executors.get(r);if(!n)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(n.schema){let o=n.schema.safeParse(e);if(!o.success){for(let i of o.error.issues)a.push({code:"SCHEMA_VALIDATION_ERROR",message:i.message,field:i.path.join(".")});return{valid:!1,errors:a,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)}},on=new xp;function jN(t){return on.get(t)}function Ex(t){return on.has(t)}var GN=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),xk=5e4,bk=50;function po(t){let e=[],a=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:a};let{kind:r}=t;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!Ex(r)&&r!=="core:mountWidget"){let n=on.list();return console.error(`[ActionValidation] Unknown action kind: "${r}". Registered kinds (${n.length}): [${n.join(", ")}]. This usually means the app that provides "${r}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":fo(t,e,a);break;case"overlays:badge":fo(t,e,a),WN(t,e,a);break;case"overlays:tooltip":fo(t,e,a),ZN(t,e,a);break;case"overlays:modal":oP(t,e,a);break;case"content:insertHtml":fo(t,e,a),XN(t,e,a);break;case"content:setText":fo(t,e,a),YN(t,e,a);break;case"content:setAttr":fo(t,e,a),KN(t,e,a);break;case"content:addClass":case"content:removeClass":fo(t,e,a),QN(t,e,a);break;case"content:setStyle":fo(t,e,a),JN(t,e,a);break;case"core:mountWidget":eP(t,e,a);break;case"core:wait":tP(t,e,a);break;case"core:sequence":aP(t,e,a);break;case"core:parallel":rP(t,e,a);break;case"core:tour":iP(t,e,a);break;case"navigation:navigate":nP(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function fo(t,e,a){let r=t.anchorId;if(!r||typeof r!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!r.selector||typeof r.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):r.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),r.route===void 0||r.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 n=Array.isArray(r.route)?r.route:[r.route];for(let o of n)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 WN(t,e,a){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&a.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function ZN(t,e,a){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 XN(t,e,a){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>xk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${xk}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function YN(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function KN(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(GN.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 QN(t,e,a){!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)||a.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function JN(t,e,a){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>bk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${bk}`,field:"styles"});for(let[n,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${n}`,field:`styles.${n}`})}}function eP(t,e,a){(!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 tP(t,e,a){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 aP(t,e,a){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&&a.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let n=po(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function rP(t,e,a){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&&a.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 r=0;r<t.actions.length;r++){let n=po(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function nP(t,e,a){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function oP(t,e,a){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 r=0;r<t.ctaButtons.length;r++){let n=t.ctaButtons[r];(!n.label||typeof n.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!n.actionId||typeof n.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function iP(t,e,a){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 r=new Set;for(let n=0;n<t.steps.length;n++){let o=t.steps[n];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${n} requires 'id' property`,field:`steps[${n}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${n}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${n} requires 'action' property`,field:`steps[${n}].action`});else{let i=po(o.action);for(let s of i.errors)e.push({...s,field:`steps[${n}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Tx(t){let e=[],a=[];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:a};for(let r=0;r<t.length;r++){let n=po(t[r]);if(!n.valid){let o=t[r];console.error(`[ActionValidation] Action [${r}] failed validation:`,`kind="${o?.kind??"undefined"}"`,n.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of n.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of n.warnings)a.push({...o,suggestion:o.suggestion?`Action ${r}: ${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(r=>`${r.field??"?"}: ${r.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var sP=0;function Rx(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=on,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function h(){return`action-${++sP}`}function m(C,L){a&&a.publish(C,L)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:h,publishEvent:m,adaptiveId:i,applyAction:g,subscribeEvent:a?(C,L)=>a.subscribe({names:[C]},k=>L(k.props)):void 0,subscribeNavigation:l}}async function b(C,L){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let k=r.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return L.publishEvent("action.applied",{id:L.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{k.unmount()},updateFn:A=>{if("widget"in A&&A.widget){let M=A.widget;M.props&&k.update({type:"widget",widgetId:C.widget.widgetId,config:M.props})}}}}async function x(C,L){if(C.kind==="core:mountWidget")return b(C,L);let k=s.get(C.kind);if(!k){let A="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${A}]`),new Error(`No executor for action kind: ${C.kind}`)}return k(C,L)}function f(C,L,k,A){if(!u)return;let M=[],T=async()=>{let R=c.get(C);if(!R)return;let F=u.evaluateSync(k).value;if(R.state==="applied"&&!F){try{await R.cleanup()}catch(P){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,P)}R.state="deferred",R.cleanup=()=>{},R.updateFn=void 0,m("action.deferred",{id:C,kind:L.kind})}else if(R.state==="deferred"&&F)try{let P=S(),Y=await x(L,P);R.state="applied",R.cleanup=Y.cleanup,R.updateFn=Y.updateFn,R.appliedTs=Date.now(),m("action.applied",{id:C,kind:L.kind,anchorId:"anchorId"in L?L.anchorId:void 0})}catch(P){console.error(`[ActionEngine] Error applying deferred action ${C}:`,P),R.state="failed"}};u.context&&M.push(u.context.subscribe(T)),u.accumulator&&M.push(u.accumulator.subscribe(T)),d.set(C,M)}async function g(C){let L=po(C);if(!L.valid){let F=L.errors.map(P=>P.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,F,C),new Error(`Action validation failed: ${F}`)}let k=h(),A=C.triggerWhen;if(A&&u&&!u.evaluateSync(A).value){let P={id:k,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(k,P);let Y={id:k,action:C,async revert(){let N=c.get(k);if(!N)return;let W=d.get(k);if(W){for(let Q of W)Q();d.delete(k)}N.state="reverted",c.delete(k)},isApplied(){return c.get(k)?.state==="applied"},async update(N){let W=c.get(k);if(!W||W.state!=="applied")throw new Error("Cannot update action that is not applied");if(W.updateFn)await W.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return f(k,C,A,Y),Y}let M=S(),T=await x(C,M),R={id:k,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:T.cleanup,updateFn:T.updateFn};c.set(k,R),m("action.applied",{id:k,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let B={id:k,action:C,async revert(){let F=c.get(k);if(!F||F.state!=="applied")return;let P=d.get(k);if(P){for(let Y of P)Y();d.delete(k)}try{await F.cleanup(),F.state="reverted",m("action.reverted",{id:k,kind:C.kind})}catch(Y){throw F.state="failed",m("action.failed",{id:k,kind:C.kind,error:String(Y)}),Y}finally{c.delete(k)}},isApplied(){return c.get(k)?.state==="applied"},async update(F){let P=c.get(k);if(!P||P.state!=="applied")throw new Error("Cannot update action that is not applied");if(P.updateFn)await P.updateFn(F);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(k)?.state??"reverted"}};return A&&u&&f(k,C,A,B),B}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(R=>R.kind).join(", "));let L=Tx(C);if(!L.valid){let R=L.errors.map(B=>B.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,R,`
463
463
  Actions:`,C.map((B,F)=>` [${F}] ${B.kind} ${B.anchorId?`anchor="${typeof B.anchorId=="string"?B.anchorId:B.anchorId.selector}"`:""} ${B.label?`label="${B.label}"`:""}`).join(`
464
- `)),new Error(`Batch validation failed: ${R}`)}let k=h(),A=[],M=[];try{for(let R of C){let B=await g(R);A.push(B),M.push(B)}}catch(R){console.error(`[ActionEngine] Batch apply FAILED at action ${M.length+1}/${C.length}.`,`Successfully applied: ${M.length}. Rolling back...`,R);for(let B of M)try{await B.revert()}catch{}throw R}return{id:k,handles:A,async revertAll(){for(let R=A.length-1;R>=0;R--)try{await A[R].revert()}catch(B){console.error(`[ActionEngine] Error reverting action ${A[R].id}:`,B)}},isApplied(){return A.every(R=>R.isApplied())}}}function y(C){return po(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function w(){for(let C of d.values())for(let L of C)try{L()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(L){console.error("[ActionEngine] Error during cleanup:",L)}c.clear()}return{apply:g,applyBatch:v,validate:y,getActive:_,destroy:w}}var lP=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Dx=p.object({type:p.literal("page_url"),url:p.string()}),Ox=p.object({type:p.literal("route"),routeId:p.string()}),Bx=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),Fx=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),Nx=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),Px=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),Hx=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),Ux=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),qx=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),zx=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),Zu=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),Xu=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),Zu).optional()}),Vx=p.object({type:p.literal("event_count"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0),withinMs:p.number().positive().optional(),counter:Xu.optional()}),ho=p.discriminatedUnion("type",[Dx,Ox,Bx,Fx,Nx,Px,Hx,Ux,qx,zx,Vx]),Yu=p.object({conditions:p.array(ho),value:p.unknown()}),Ku=p.object({type:p.literal("rules"),rules:p.array(Yu),default:p.unknown()}),Qu=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),Ju=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),ec=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),tc=p.discriminatedUnion("type",[Ku,Qu,Ju,ec]),Sp=tc.nullable().optional(),uP=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),cP=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var Sk=p.object({include:p.array(p.string()).optional().describe("URL patterns where this tile appears. Supports *, **, :param wildcards. Use sparingly \u2014 mostly to isolate to specific webapp functionality. Omit to appear on all routes."),exclude:p.array(p.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),Cp=p.object({routes:Sk,onlyIfPopulated:p.boolean().optional().describe("When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Useful for tiles with all-deferred FAQ questions or nav tips. Default: false.")});function Ez(t){return ho.safeParse(t)}function Tz(t){return tc.safeParse(t)}function Rz(t){return Cp.safeParse(t)}var Mz=[{defName:"matchOp",schema:Zu},{defName:"counterDef",schema:Xu},{defName:"activationConfig",schema:Cp},{defName:"routeFilter",schema:Sk},{defName:"ruleStrategy",schema:Ku},{defName:"scoreStrategy",schema:Qu},{defName:"modelStrategy",schema:Ju},{defName:"externalStrategy",schema:ec},{defName:"rule",schema:Yu},{defName:"condition",schema:ho}];var $x=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),dP=p.object({on:p.string(),title:p.string(),body:p.string().optional(),icon:p.string().optional(),ttl:p.number().optional(),cooldown:p.number().optional(),deepLink:$x.optional()}).strict(),fP=p.object({id:p.string(),title:p.string().optional(),subtitle:p.string().optional(),icon:p.string().optional(),priority:p.number().optional(),widget:p.string(),props:p.record(p.unknown()).optional(),activation:Cp.optional(),notifications:p.array(dP).optional()}).strict(),pP=p.object({position:p.enum(["left","right"]).optional(),layout:p.enum(["overlay","push"]).optional(),background:p.string().optional(),blur:p.string().optional(),border:p.string().optional(),width:p.string().optional(),transitionDuration:p.string().optional(),transitionEasing:p.string().optional(),transitionFade:p.string().optional()}),hP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),color:p.string().optional(),size:p.string().optional(),shadow:p.string().optional(),borderRadius:p.string().optional()}),mP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),shadow:p.string().optional(),titleColor:p.string().optional(),textColor:p.string().optional(),iconBackground:p.string().optional(),iconShadow:p.string().optional(),headerPadding:p.string().optional(),bodyPadding:p.string().optional(),gap:p.string().optional()}),gP=p.object({background:p.string().optional(),textColor:p.string().optional(),titleColor:p.string().optional(),arrowColor:p.string().optional(),arrowSize:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),scrimOpacity:p.string().optional(),highlightRing:p.string().optional()}),vP=p.object({background:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),successColor:p.string().optional(),warningColor:p.string().optional(),errorColor:p.string().optional(),iconBackground:p.string().optional(),progressGradient:p.string().optional()}),yP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),itemDivider:p.string().optional(),itemGap:p.string().optional(),itemPadding:p.string().optional(),itemFontSize:p.string().optional(),bodyPadding:p.string().optional(),bodyFontSize:p.string().optional(),categoryPadding:p.string().optional(),categoryGap:p.string().optional(),categoryFontSize:p.string().optional(),searchBackground:p.string().optional(),searchColor:p.string().optional(),chevronColor:p.string().optional()}),xP=p.object({mode:p.enum(["dark","light"]).optional(),fontFamily:p.string().optional(),colorPrimary:p.string().optional(),colorPrimaryHover:p.string().optional(),borderRadius:p.string().optional(),canvas:pP.optional(),launcher:hP.optional(),tile:mP.optional(),overlay:gP.optional(),notification:vP.optional(),content:yP.optional()}).strict(),bP=p.object({enabled:p.boolean().optional(),label:p.string().optional(),icon:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),Nz=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(fP),actions:p.array(p.any()),theme:xP.optional(),launcher:bP.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:ho.optional()})])).optional()}).passthrough().optional()}).strict();var gt={triggerWhen:Sp},Ha=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Ck=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),_k=p.enum(["top-left","top-right","bottom-left","bottom-right"]),wk=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Gx=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),Lk=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(Gx).optional()}).strict(),Ik=p.object({title:p.string().optional(),body:p.string()}).strict(),Ak=p.enum(["before","after","prepend","append","replace"]),kk=p.enum(["immediate","hover","click"]),Ek=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),Tk=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),Rk=p.enum(["auto","smooth","instant"]),jx=p.enum(["start","center","end","nearest"]),Mk=p.object({kind:p.literal("content:setText"),anchorId:Ha,text:p.string(),label:p.string().optional()}).extend(gt).strict(),Dk=p.object({kind:p.literal("content:setAttr"),anchorId:Ha,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(gt).strict(),Ok=p.object({kind:p.literal("content:addClass"),anchorId:Ha,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Bk=p.object({kind:p.literal("content:removeClass"),anchorId:Ha,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Fk=p.object({kind:p.literal("content:setStyle"),anchorId:Ha,styles:p.record(p.string()),label:p.string().optional()}).extend(gt).strict(),Nk=p.object({kind:p.literal("content:insertHtml"),anchorId:Ha,html:p.string(),position:Ak,deepLink:$x.optional(),label:p.string().optional()}).extend(gt).strict(),Pk=p.object({kind:p.literal("overlays:highlight"),anchorId:Ha,style:Ck.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Hk=p.object({kind:p.literal("overlays:pulse"),anchorId:Ha,duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Uk=p.object({kind:p.literal("overlays:badge"),anchorId:Ha,content:p.string(),position:_k.optional(),label:p.string().optional()}).extend(gt).strict(),qk=p.object({kind:p.literal("overlays:tooltip"),anchorId:Ha,content:Lk,trigger:kk.optional(),placement:wk.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),zk=p.object({kind:p.literal("overlays:modal"),content:Ik,size:p.enum(["sm","md","lg"]).optional(),blocking:p.boolean().optional(),scrim:p.object({opacity:p.number().min(0).max(1).optional()}).strict().optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().min(0).optional()}).strict().optional(),ctaButtons:p.array(Gx).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Vk=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Ha,behavior:Rk.optional(),block:jx.optional(),inline:jx.optional(),label:p.string().optional()}).extend(gt).strict(),$k=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(gt).strict(),jk=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:Ek,label:p.string().optional()}).extend(gt).strict(),Gk=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Wk=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(gt).strict(),Zk=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(gt).strict(),Xk=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(Tk).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(gt).passthrough(),SP=[{defName:"setText",schema:Mk},{defName:"setAttr",schema:Dk},{defName:"addClass",schema:Ok},{defName:"removeClass",schema:Bk},{defName:"setStyle",schema:Fk},{defName:"insertHtml",schema:Nk},{defName:"highlight",schema:Pk},{defName:"pulse",schema:Hk},{defName:"badge",schema:Uk},{defName:"tooltip",schema:qk},{defName:"modal",schema:zk},{defName:"scrollTo",schema:Vk},{defName:"navigate",schema:$k},{defName:"mountWidget",schema:jk},{defName:"wait",schema:Gk},{defName:"sequence",schema:Wk},{defName:"parallel",schema:Zk},{defName:"tour",schema:Xk}];function Wx(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,r=new Map,n=new Map,o=null,i=!1;function s(x){if(!e)return null;try{return e.querySelector(x)}catch{return null}}function l(){for(let[x,f]of r){let g=s(x);if(g){for(let v of f)clearTimeout(v.timer),v.resolve(g);r.delete(x)}}for(let[x,f]of n){let g=s(x);if(g){for(let v of f)v.cancelled||v.cb(g);n.delete(x)}}r.size===0&&n.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(x,f){let g=r.get(x);g&&(g.delete(f),g.size===0&&r.delete(x)),r.size===0&&n.size===0&&c()}function h(x,f){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let g=s(x);if(g)return Promise.resolve(g);let v=f??a;return new Promise((y,_)=>{let w={resolve:y,reject:_,timer:setTimeout(()=>{d(x,w),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=r.get(x);C||(C=new Set,r.set(x,C)),C.add(w),u()})}function m(x,f){if(i)return()=>{};let g=s(x);if(g)return f(g),()=>{};let v={cb:f,cancelled:!1},y=n.get(x);return y||(y=new Set,n.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=n.get(x);_&&(_.delete(v),_.size===0&&n.delete(x)),r.size===0&&n.size===0&&c()}}function S(){let x=0;for(let f of r.values())x+=f.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let f of r.values())for(let g of f)clearTimeout(g.timer),g.reject(x);r.clear(),n.clear()}return{resolve:s,waitFor:h,onAppear:m,pendingCount:S,destroy:b}}function CP(){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 Zx(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let r of e.exclude)if(Yk(a,r))return}if(e.include){for(let r of e.include)if(Yk(a,r))return r;return}return a}function Yk(t,e){let a=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(a===r)return!0;let n=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(a)}var _p=class{constructor(e){$(this,"context");$(this,"previousContext");$(this,"listeners",new Set);$(this,"telemetry");$(this,"routes");$(this,"navigation");$(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=CP(),this.previousContext={...this.context},e.telemetry?.getSessionId){let a=e.telemetry.getSessionId();a&&(this.context.session.sessionId=a)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Zx(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 a=Zx(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}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,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}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:a}=document,r=Zx(e,this.routes),n={url:e,title:a,routeId:r};(n.url!==this.context.page.url||n.title!==this.context.page.title||n.routeId!==this.context.page.routeId)&&(n.url!==this.context.page.url&&this.addPageToHistory(n.url),this.updateContext({page:n}))}addPageToHistory(e){let a={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],a];r.length>50&&r.shift(),this.context.session.pageHistory=r}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(a){console.error("[ContextManager] Listener error:",a)}}};function Xx(t){return new _p(t)}var _P=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),wP=p.object({url:p.string(),ts:p.number()}),LP=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(wP).optional()}),IP=p.object({width:p.number(),height:p.number()}),AP=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),kP=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:AP.optional()}),EP=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),TP=p.object({page:_P,session:LP,viewport:IP,anchors:p.array(kP).optional(),augmented:EP.optional()});function e6(t){return TP.safeParse(t)}function Kk(t,e){let{context:a,state:r,events:n}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url.split("?")[0].split("#")[0],s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",i=a.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return i?.visible===!0;case"present":return i?.present===!0;case"absent":return!i?.present;default:return!1}}case"event_occurred":{if(!n)return!1;let o=t.withinMs??6e4;return n.hasRecentEvent(t.eventName,o)}case"state_equals":return r?.getValue?r.getValue(t.key)===t.value:!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){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(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let i=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Qk(t,e){let a=[];for(let r of t.conditions){let n=Kk(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function wp(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=Qk(r,e);if(n)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function Lp(t,e){let{context:a}=e,r=a.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function Jk(t,e){let{state:a,events:r,sessionMetrics:n,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>n?.get(i)??0,getValue:i=>a.session.get(i)??a.user.get(i)}:void 0,events:r?{hasRecentEvent:(i,s)=>r.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function eE(t,e,a={}){let r=Jk(e,a);switch(t.type){case"rules":return wp(t,r);case"score":return Lp(t,r);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 tE(t,e,a={}){let r=Jk(e,a);switch(t.type){case"rules":return wp(t,r);case"score":return Lp(t,r);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 Yx(t){return{evaluate:(e,a)=>eE(e,a,t),evaluateSync:(e,a)=>tE(e,a,t)}}function Kx(t){let{eventBus:e,stateStore:a}=t,r=new Map,n=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of r.values()){if(!d.predicate(u))continue;let h=i.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(u.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),i.set(d.stateKey,h),c=!0}if(c)for(let d of n)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let h=`ev:${u}`,m=r.get(h);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}r.set(h,{stateKey:h,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,h=i.get(d);if(!h)return 0;if(c===void 0||!h.timestamps)return h.count;let m=Date.now()-c;return h.timestamps.filter(S=>S>=m).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}function Qx(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Ip=class{constructor(e={}){$(this,"subscriptions",new Set);$(this,"history",[]);$(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let r,n;typeof e=="function"?(r=void 0,n=e):(r=e,n=a);let o={filter:r,callback:n};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,r="canvas"){let n={ts:Date.now(),name:e,source:r,props:a,schemaVersion:hs};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Qx(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>Qx(n,e))),a&&a>0&&(r=r.slice(-a)),r}hasRecentEvent(e,a,r){let n=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=n&&(r===void 0||o.source===r))}countRecentEvents(e,a){let r=this.history.filter(n=>Qx(n,e));if(a!==void 0){let n=Date.now()-a;r=r.filter(o=>o.ts>=n)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function ac(t={}){return new Ip(t)}var aE={$autocapture:"ui.click",$click:Ce.UI_CLICK,$scroll:Ce.UI_SCROLL,$input:Ce.UI_INPUT,$change:Ce.UI_CHANGE,$submit:Ce.UI_SUBMIT,$pageview:Ce.NAV_PAGE_VIEW,$pageleave:Ce.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function RP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(aE[e])return aE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Ce.UI_SUBMIT:r==="change"?Ce.UI_CHANGE:a==="input"||a==="textarea"?Ce.UI_INPUT:Ce.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function MP(t){let e={},a=t.properties||{},r=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:r?.[0]?.tag_name&&(e.tagName=r[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function rE(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:RP(t),source:"posthog",props:MP(t),schemaVersion:hs}}function nE(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 Jx(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(nE(r)){let n=rE(r);t(n)}}}var oE=p.enum(["posthog","canvas","derived"]),DP=p.object({ts:p.number(),name:p.string(),source:oE,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),OP=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(oE).optional()});function w6(t){return DP.safeParse(t)}function L6(t){return OP.safeParse(t)}var rc=class{constructor(){$(this,"listeners",new Set);$(this,"capturedPushState");$(this,"capturedReplaceState");$(this,"wasNative");$(this,"destroyed",!1);$(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,a){if(!this.destroyed)for(let r of this.listeners)try{r(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var eb="cooldown:";function iE(t){return{set(e,a){let r=eb+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=eb+e,r=t.get(a);if(r===void 0)return 0;let n=r-Date.now();return n<=0?(t.remove(a),0):n},clear(e){let a=eb+e;t.remove(a)}}}var nc="dismissed:";function sE(t,e){return{mark(a,r=!1){let n=nc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=nc+a;return t.has(r)||e.has(r)},clear(a){let r=nc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(nc)&&t.remove(a);for(let a of e.keys())a.startsWith(nc)&&e.remove(a)}}}var tb="freq:";function lE(t){function e(a){let r=tb+a,n=t.get(r);if(n){if(n.resetAt&&Date.now()>=n.resetAt){t.remove(r);return}return n}}return{increment(a,r){let n=tb+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(n,s),i},count(a){return e(a)?.count??0},reset(a){let r=tb+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var BP="syntro";function ab(t,e){let a=`${e}:`;return{get(r){if(t)try{let n=t.getItem(a+r);if(!n)return;let o=JSON.parse(n);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+r);return}return o.value}catch{return}},set(r,n,o){if(t)try{let i={value:n,expiresAt:o?Date.now()+o:void 0};t.setItem(a+r,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(r){t&&t.removeItem(a+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let n=0;n<t.length;n++){let o=t.key(n);o?.startsWith(a)&&r.push(o.slice(a.length))}return r},clear(){if(!t)return;let r=this.keys();for(let n of r)t.removeItem(a+n)}}}function oc(t){let e=new Map,a=`${t}:`;return{get(r){let n=e.get(a+r);if(n){if(n.expiresAt&&Date.now()>=n.expiresAt){e.delete(a+r);return}return n.value}},set(r,n,o){e.set(a+r,{value:n,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(a+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let n of e.keys())n.startsWith(a)&&r.push(n.slice(a.length));return r},clear(){for(let r of e.keys())r.startsWith(a)&&e.delete(r)}}}var Ap=class{constructor(e={}){$(this,"session");$(this,"user");$(this,"dismissals");$(this,"cooldowns");$(this,"frequency");$(this,"namespace");$(this,"namespacedStorages",new Map);this.namespace=e.namespace??BP;let a=r=>typeof r=="object"&&r!==null&&typeof r.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?ab(window.sessionStorage,this.namespace):oc(this.namespace),this.user=a(window.localStorage)?ab(window.localStorage,this.namespace):oc(this.namespace)):(this.session=oc(this.namespace),this.user=oc(this.namespace)),this.dismissals=sE(this.session,this.user),this.cooldowns=iE(this.user),this.frequency=lE(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?ab(sessionStorage,a):oc(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function rb(t={}){return new Ap(t)}function ic(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function kp(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var uE={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"}},sc={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:[]},cE={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function nb(t,e,a){let r=uE[e];Object.assign(t.style,r),a&&(a.maxWidth&&(t.style.maxWidth=a.maxWidth),a.maxHeight&&(t.style.maxHeight=a.maxHeight),a.minWidth&&(t.style.minWidth=a.minWidth),a.minHeight&&(t.style.minHeight=a.minHeight))}function ob(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[Qd(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(ef()),a.shift!==!1&&n.push(Jd({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Kd(e,t,async()=>{let{x:i,y:s,strategy:l}=await tf(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function ib(t,e,a="append"){return t.style.position="relative",t.style.display="inline-block",a==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function sb(t,e){return e==="none"||sc[e].length===0?null:t.animate(sc[e],cE)}function lb(t,e){if(e==="none"||sc[e].length===0)return Promise.resolve();let a=[...sc[e]].reverse(),r=t.animate(a,cE);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function ub(t,e){let a=document.createElement("div");return a.setAttribute("data-syntro-surface",t),a.setAttribute("data-syntro-mount-id",e),a.className="syntro-surface",Object.assign(a.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),a}function cb(t){switch(ic(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 dE(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),u=document.createElement("div");return u.append(l),u.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,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"]),i=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){i.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),h=c.startsWith("on"),m=(c==="href"||c==="src")&&d.startsWith("javascript:");(h||m)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(r.firstChild,a.innerHTML)}var FP=0;function db(t){let{overlayRoot:e,eventBus:a,anchorResolver:r,defaultAnimation:n="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++FP}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let w=x(y);for(let C of _)try{C(w)}catch(L){console.error("[Surfaces] State callback error:",L)}}}let h=new Map;function m(y,_,w){switch(_.type){case"html":y.innerHTML=dE(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return w&&h.set(w,C),()=>{C.unmount(),w&&h.delete(w)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.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){let C=u(),L=ic(y),k=w?.priority??0,A=w?.animation??n,M=w?.exclusive??!0,T=i.get(y);if(T&&M){if(T.options.priority>k)throw new Error(`Slot ${y} is occupied by higher priority content (${T.options.priority} > ${k})`);b(T)}let R=ub(y,C);R.style.zIndex=String(cb(y));let B;if(L==="static")nb(R,y,w?.constraints),e.appendChild(R);else if(L==="inline"){let N=kp(y);if(!N)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let W=r({selector:N,route:"**"});if(!W)throw new Error(`Anchor not found for inline slot: ${N}`);B=ib(R,W)}else if(L==="adjacent"){let N=kp(y);if(!N)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let W=r({selector:N,route:"**"});if(!W)throw new Error(`Anchor not found for adjacent slot: ${N}`);e.appendChild(R),B=ob(R,W,w?.position??{placement:"bottom"})}let F=m(R,_,C);sb(R,A);let P={id:C,slot:y,content:_,options:{priority:k,exclusive:M,animation:A,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:R,cleanup:()=>{B?.(),F?.()},mountedAt:Date.now()};return i.set(y,P),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:w?.adaptiveId}),d(y),{id:C,update(N){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");let Q=h.get(C);if(Q){if(N.type==="widget"){Q.update(N.config),W.content=N;return}Q.unmount(),h.delete(C)}W.container.innerHTML="";let aa=m(W.container,N,C);if(W.content=N,aa){let dt=W.cleanup;W.cleanup=()=>{dt?.(),aa()}}},setOptions(N){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");N.priority!==void 0&&(W.options.priority=N.priority),N.animation!==void 0&&(W.options.animation=N.animation),N.constraints&&L==="static"&&(N.constraints.maxWidth&&(W.container.style.maxWidth=N.constraints.maxWidth),N.constraints.maxHeight&&(W.container.style.maxHeight=N.constraints.maxHeight),N.constraints.minWidth&&(W.container.style.minWidth=N.constraints.minWidth),N.constraints.minHeight&&(W.container.style.minHeight=N.constraints.minHeight)),d(y)},async unmount(){let N=i.get(y);!N||N.id!==C||await b(N)},isMounted(){return i.get(y)?.id===C},getContainer(){let N=i.get(y);return N?.id===C?N.container:null}}}async function b(y){await lb(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function x(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function f(y,_){let w=l.get(y);return w||(w=new Set,l.set(y,w)),w.add(_),()=>{w?.delete(_),w?.size===0&&l.delete(y)}}function g(y,_){let w=i.get(y);return w?_!==void 0?_>=w.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:x,onStateChange:f,canMount:g,destroy:v}}var Ep=class{constructor(){$(this,"widgets",new Map);$(this,"mountedWidgets",new Map);$(this,"mountIdCounter",0);$(this,"runtimeRef");$(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,r="custom",n){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:a,source:r,metadata:n}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.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[a,r]of this.widgets.entries())r.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,r){let n=this.widgets.get(e);if(!n)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...r,runtime:this.runtimeRef},s=n.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(n.widget.update)n.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},h=n.widget.mount(a,d);c.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(a=>a.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let a of this.listeners)try{a(e)}catch(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},fb=new Ep;var pE="2.0.0";function NP(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let r=a.replace(/\/$/,"")||"/";if(e.exclude){for(let n of e.exclude)if(pb(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(pb(r,n))return!0;return!1}return!0}function pb(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let r=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function fE(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>pb(a,n))}function hb(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??fb,s=t.executors??on,l=t.apps??Jl,u=new rc,c=Xx({telemetry:e,routes:r,navigation:u}),d=t.events??ac(),h=rb({namespace:o}),m=Kx({eventBus:d,stateStore:h}),S=Yx({state:h,events:d,sessionMetrics:a,accumulator:m}),b=ZL(),x=Wx(),f=C=>fE(C)?x.resolve(C.selector):null,g=async(C,L)=>{if(!fE(C))return null;try{return await x.waitFor(C.selector,L)}catch{return null}},v=db({overlayRoot:b,eventBus:d,anchorResolver:f,widgetRegistry:i}),y=Mx({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:g,executorRegistry:s,subscribeNavigation:C=>u.subscribe(C),runtime:{evaluateSync:C=>S.evaluateSync(C,c.get()),context:c,accumulator:m}}),_;if(a){a.increment("page_views");let C=typeof window<"u"?window.location.pathname:"/";_=u.subscribe((L,k)=>{if(k!=="replaceState")try{let A=new URL(L).pathname;A!==C&&(C=A,a.increment("page_views"))}catch{}})}let w={telemetry:e,context:c,events:d,state:h,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:m,anchorResolver:x,navigation:u,version:pE,mode:n,async evaluate(C){return S.evaluate(C,c.get())},evaluateSync(C){return S.evaluateSync(C,c.get())},async filterTiles(C){let L=c.get().page.url,k=[];for(let A of C){let M=A.activation;if(!M){k.push(A);continue}if(NP(L,M.routes)){if(M.onlyIfPopulated){let T=A.props?.actions??[];if(T.length>0&&!T.some(B=>B.triggerWhen?S.evaluateSync(B.triggerWhen,c.get()).value:!0))continue}k.push(A)}}return k},setRoutes(C){c.setRoutes(C)},destroy(){l.unbind().catch(C=>{console.error("[Runtime] Error unbinding apps registry:",C)}),_?.(),x.destroy(),m.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(w),i.bindRuntime(w),w}var PP=p.object({value:p.unknown(),expiresAt:p.number().optional()}),HP=p.object({count:p.number(),resetAt:p.number().optional()});function kV(t){return PP.safeParse(t)}function EV(t){return HP.safeParse(t)}var hE={growthbook:t=>Fv({...t,autoInit:!0})};function mE(t,e){let a=hE[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(hE).join(", ")}`);return a(e)}var UP=["cdn.syntrologie.com","localhost","127.0.0.1"];function qP(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):UP.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var mb=class{constructor(e){$(this,"name","cdn");$(this,"url");$(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!qP(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),a=await fetch(this.url,{credentials:"omit",cache:"default"});if(!a.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${a.status})`);let r=await a.text();if(this.integrity){let l=await zP(r),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let n=JSON.parse(r),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:n,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function zP(t){let a=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",a),n=new Uint8Array(r);return btoa(String.fromCharCode(...n))}function gE(t){return new mb(t)}var VP="syntro_exp",$P="syntro_var",gb=class{constructor(e){$(this,"name","experiments");$(this,"client");$(this,"featureKey");$(this,"manifestKey");$(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 n=new URLSearchParams(window.location.search),o=n.get(VP),i=n.get($P);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,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 n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:sf(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix))}return[]}};function vE(t){return new gb(t)}var jP="https://cdn.syntrologie.com/configs",yE={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return gE({baseUrl:t.baseUrl??jP,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return vE({featureKey:t.featureKey})}};function xE(t,e={}){let a=yE[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(yE).join(", ")}`);return a(e)}var bE={posthog:t=>Ix(t),noop:()=>Vv()};function SE(t,e){let a=bE[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(bE).join(", ")}`);return a(e)}var vb="syn_";function Tp(t){if(!t.startsWith(vb))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(vb.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(a),n=JSON.parse(r);if(n.v!==1)throw new Error(`Unsupported token version: ${n.v}`);return n}function yb(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return vb+a}function sn(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 GP(){if(typeof window>"u")return X("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="editor");return X("Syntro Bootstrap","isEditorMode:",a),a}function WP(){if(typeof window>"u")return X("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="audit");return X("Syntro Bootstrap","isAuditMode:",a),a}function ZP(){if(typeof window>"u")return X("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="review");return X("Syntro Bootstrap","isReviewMode:",a),a}var CE="syntro_segment_attributes";function XP(){if(typeof window>"u")return{};try{let t=localStorage.getItem(CE);if(t){let e=JSON.parse(t);return X("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ga("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function YP(t){if(!(typeof window>"u"))try{localStorage.setItem(CE,JSON.stringify(t)),X("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ga("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function KP(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}function QP(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let r=e.get(a);r&&(t[a]=r)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname}catch{}return t}async function JP(t){jg(),X("Syntro Bootstrap","====== INIT ======"),X("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=GP(),a=WP(),r=ZP(),n=e?"editor":a?"audit":r?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${a}, review=${r}, sdkMode=${n}`),console.log("[DIAG] editorSource:",zn()),console.log("[DIAG] editorConf:",Vo()),X("Syntro Bootstrap","SDK mode:",n??"normal"),!n&&typeof window<"u"){let T=!!window.__SYNTRO_EDITOR_PARAMS__,R=!!window.__SYNTRO_AUDIT_LEGEND__,B=!!window.__SYNTRO_REVIEW_DATA__;if(T||R||B){let F=[T&&"__SYNTRO_EDITOR_PARAMS__",R&&"__SYNTRO_AUDIT_LEGEND__",B&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${F.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&&n){let R=Vo()?.syntro_token;R?.startsWith("syn_")&&(o=R,X("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${n} mode)`))}let i;if(o)if(o.startsWith("syn_"))X("Syntro Bootstrap","Token starts with syn_, decoding..."),i=Tp(o),jg(i.d);else if(n)X("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${n} mode)`);else throw lf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),lf("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(n)X("Syntro Bootstrap",`\u2713 No token, but ${n} mode - proceeding`);else throw lf("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=sn("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||sn("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,l=sn("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||sn("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,u=sn("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||sn("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,c=XP(),d=QP(),h={...d,...c};X("Syntro Bootstrap","Phase 1: Browser metadata:",d),X("Syntro Bootstrap","Phase 1: Cached segment attributes:",c);let m,S=ac();console.log("[Syntro Bootstrap] EventBus created");let b=Jx(T=>{S.publishEvent(T)}),x=T=>{X("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let R=KP(T);if(X("Syntro Bootstrap","Segment flags from PostHog:",R),YP(R),m){let B=g?.getAll?.()??{},F={...d,...B,...R};X("Syntro Bootstrap","Updating GrowthBook with attributes:",F),m.setAttributes?.(F)}},f;if(i?.t){let T=i.t==="noop"?"noop":"posthog";f=SE(T,{apiKey:i.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:x,onCapture:b}),console.log(`[Syntro Bootstrap] Telemetry client created (${T}) with EventBus wiring`)}let g;i?.e&&(m=mE("growthbook",{clientKey:i.e,apiHost:s,attributes:h,onExperimentViewed:f?.trackExperiment?(T,R,B)=>{f.trackExperiment(T,R,B)}:void 0})),g=Nv({experiments:m,onMetricChange:(T,R)=>{X("Syntro Bootstrap",`Session metric changed: ${T} = ${R}`)}}),X("Syntro Bootstrap","SessionMetricTracker created");let v="production";e?v="editor":a?v="audit":sn("NODE_ENV")==="development"&&(v="development");let y=hb({telemetry:f,sessionMetrics:g,mode:v,events:S});X("Syntro Bootstrap","Runtime created:",{version:y.version,mode:y.mode,hasContext:!!y.context,hasEvents:!!y.events,hasState:!!y.state}),X("Syntro Bootstrap","Core app executors already registered");let _=t.cdnBase||sn("NEXT_PUBLIC_SYNTRO_CDN_BASE")||sn("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",w=Hg({cdnBase:_,registry:y.apps,onLoadStart:T=>{X("Syntro Bootstrap",`Loading app from CDN: ${T}`)},onLoadEnd:(T,R,B)=>{R?X("Syntro Bootstrap",`App loaded successfully: ${T}`):ga("Syntro Bootstrap",`Failed to load app: ${T}`,B)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:y.apps,runtime:y,version:y.version},X("Syntro Bootstrap","Global SynOS object exposed"));let C=y.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${C.length} apps in registry:`,C.map(T=>`${T.manifest.id}(${T.state})`).join(", "));for(let T of C)if(T.state==="registered")try{await y.apps.activate(T.manifest.id),console.log(`[DIAG] Activated: ${T.manifest.id} \u2192 widgets: [${y.widgets.list().join(", ")}]`)}catch(R){console.error(`[DIAG] FAILED to activate: ${T.manifest.id}`,R),ga("Syntro Bootstrap",`Failed to auto-activate built-in app: ${T.manifest.id}`,R)}if(console.log(`[DIAG] Activation complete. Total widgets: [${y.widgets.list().join(", ")}]`),m?.refreshFeatures)try{await m.refreshFeatures(),X("Syntro Bootstrap","GrowthBook features loaded")}catch(T){ga("Syntro Bootstrap","Failed to load GrowthBook features:",T)}let L;if(t.fetcher)L=t.fetcher;else if(i?.f){let T=xE(i.f,i.o??{});L=async()=>{let R=await T.fetch();return{...R.config,tiles:R.config.tiles??[]}}}else m&&(L=cs({experiments:m}));let k=new Set,A=L?async()=>{let T=await L();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${T.tiles?.length??0},`,`actions=${T.actions?.length??0},`,`theme=${T.theme?.name??"none"}`),T.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",T.actions.map((F,P)=>`[${P}] ${F.kind}${F.anchorId?` anchor="${typeof F.anchorId=="string"?F.anchorId:F.anchorId.selector}"`:""}${F.label?` "${F.label}"`:""}`).join(", "));let R=T,B=w.getRequiredApps(R);return B.length>0?console.log("[Syntro Bootstrap] Required external apps:",B.join(", ")):X("Syntro Bootstrap","No external apps required (all executors are built-in)"),B.length>0&&await w.loadAppsForConfig(R).then(async P=>{let Y=P.filter(Q=>Q.success),N=P.filter(Q=>!Q.success);Y.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${Y.map(Q=>Q.appId).join(", ")}`);let W=N.filter(Q=>!k.has(Q.appId));W.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",W.map(Q=>`${Q.appId} (${Q.error})`).join(", ")),W.forEach(Q=>k.add(Q.appId)));for(let Q of B)if(y.apps.has(Q))try{await y.apps.activate(Q),console.log(`[Syntro Bootstrap] App activated: ${Q}`)}catch(aa){console.error(`[Syntro Bootstrap] Failed to activate app: ${Q}`,aa)}else console.error(`[Syntro Bootstrap] App "${Q}" required by config but NOT registered.`,`Available apps: [${Array.from(y.apps.list?.()??[]).join(", ")}]`)}),T}:void 0;return{canvas:await vv({...t.canvas,fetcher:A,integrations:{experiments:m,telemetry:f},editorUrl:u,runtime:y}),runtime:y,experiments:m,telemetry:f,sessionMetrics:g,appLoader:w}}var _E={init:JP,encodeToken:yb,decodeToken:Tp};typeof window<"u"&&(window.Syntro=_E);var wE="2026-03-06T13:50:58.236Z (441a6ae52a)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${wE}`);let t=window.SynOS,e=t?.appRegistry||Jl;window.SynOS={...t,appRegistry:e,_runtimeBuild:wE,React:LE.default,ReactDOM:{...eH,createPortal:Rp.createPortal,flushSync:Rp.flushSync}},BL(e)}export{sc as ANIMATION_KEYFRAMES,Cp as ActivationConfigZ,Ok as AddClassZ,Ha as AnchorIdZ,kP as AnchorStateZ,Bx as AnchorVisibleConditionZ,rf as AppRegistry,EP as AugmentationZ,_k as BadgePositionZ,Uk as BadgeZ,AP as BoundingBoxZ,au as CanvasEvents,qv as CanvasRecipeZ,ho as ConditionZ,_p as ContextManager,qx as CooldownActiveConditionZ,Xu as CounterDefZ,Gx as CtaButtonZ,Qg as DEFAULT_COOLDOWN,Kg as DEFAULT_TTL,tc as DecisionStrategyZ,Ux as DismissedConditionZ,hs as EVENT_SCHEMA_VERSION,Ip as EventBus,Vx as EventCountConditionZ,OP as EventFilterZ,Fx as EventOccurredConditionZ,oE as EventSourceZ,bp as ExecutorRegistry,ec as ExternalStrategyZ,HP as FrequencyEntryZ,zx as FrequencyLimitConditionZ,pF as HighlightStepZ,Ck as HighlightStyleZ,Pk as HighlightZ,Nk as InsertHtmlZ,Ak as InsertPositionZ,Yg as MAX_VISIBLE_TOASTS,Zu as MatchOpZ,Ik as ModalContentZ,zk as ModalZ,Ju as ModelStrategyZ,jk as MountWidgetZ,$k as NavigateZ,rc as NavigationMonitor,DP as NormalizedEventZ,Xg as NotificationToastStack,_P as PageContextZ,wP as PageHistoryEntryZ,Dx as PageUrlConditionZ,Zk as ParallelZ,wk as PlacementZ,Hk as PulseZ,wE as RUNTIME_SDK_BUILD,pE as RUNTIME_VERSION,Bk as RemoveClassZ,Ox as RouteConditionZ,Sk as RouteFilterZ,Ku as RuleStrategyZ,Yu as RuleZ,TP as RuntimeContextZ,rv as RuntimeProvider,qn as SDK_SCHEMA_VERSION,Gg as SDK_VERSION,uE as STATIC_SLOT_STYLES,Qu as ScoreStrategyZ,Rk as ScrollBehaviorZ,jx as ScrollLogicalPositionZ,Vk as ScrollToZ,m1 as SelectorZ,Wk as SequenceZ,LP as SessionContextZ,Hx as SessionMetricConditionZ,Df as SessionMetricTracker,Dk as SetAttrZ,Fk as SetStyleZ,Mk as SetTextZ,cI as ShadowCanvasOverlay,KL as ShadowRootProvider,hI as SmartCanvasApp,Zg as SmartCanvasController,mv as SmartCanvasElement,G5 as SmartCanvasPortal,Ce as StandardEvents,Nx as StateEqualsConditionZ,Ap as StateStore,PP as StoredValueZ,_E as Syntro,uu as TileCard,Bq as TileWheel,Lk as TooltipContentZ,fF as TooltipStepZ,kk as TooltipTriggerZ,qk as TooltipZ,Tk as TourStepForSchemaZ,Xk as TourZ,Sp as TriggerWhenZ,Px as ViewportConditionZ,IP as ViewportContextZ,Gk as WaitZ,Ek as WidgetConfigZ,Ep as WidgetRegistry,Jl as appRegistry,nb as applyStaticSlotStyles,Ng as cleanupAppContext,_g as contentRuntime,SP as coreActionStepSchemas,Mx as createActionEngine,Wx as createAnchorResolver,Fg as createAppContext,Hg as createAppLoader,cs as createCanvasConfigFetcher,Xx as createContextManager,Yx as createDecisionEngine,Kx as createEventAccumulator,ac as createEventBus,Fv as createGrowthBookClient,Vv as createNoopClient,$5 as createOverlayRecipeFetcher,Ix as createPostHogClient,Jx as createPostHogNormalizer,Nv as createSessionMetricTracker,vv as createSmartCanvas,XL as createSmartCanvasController,hb as createSmartCanvasRuntime,rb as createStateStore,ub as createSurfaceContainer,db as createSurfaces,Mz as decisionSchemas,Tp as decodeToken,yb as encodeToken,eE as evaluate,Kk as evaluateCondition,Qk as evaluateRule,wp as evaluateRuleStrategy,Lp as evaluateScoreStrategy,tE as evaluateSync,on as executorRegistry,eD as getAntiFlickerSnippet,bL as getAppIdFromActionKind,Pg as getAppIdFromWidgetId,jN as getExecutor,kp as getSlotAnchorId,ic as getSlotType,cb as getSlotZIndex,Tx as hasExecutor,df as interpolateTemplate,xL as isCoreActionKind,Jg as matchEvent,Hq as needsMigration,rE as normalizePostHogEvent,Bg as overlaysRuntime,cu as parseVersion,sb as playEnterAnimation,lb as playExitAnimation,uf as registerConfigPredicates,yI as registerSmartCanvasElement,Wg as resolveConfigUri,ob as setupAdjacentPositioning,ib as setupInlinePositioning,nE as shouldNormalizeEvent,ND as useDecision,ev as useNotifications,tv as useNotifyWatcher,nv as usePageContext,Vr as useRuntime,pf as useRuntimeContext,BD as useRuntimeEvents,FD as useRuntimeState,DD as useSessionContext,fI as useShadowCanvasConfig,ps as useShadowRoot,OD as useViewportContext,po as validateAction,Rx as validateActions,Rz as validateActivationConfig,Ez as validateCondition,Pq as validateConfig,L6 as validateEventFilter,EV as validateFrequencyEntry,w6 as validateNormalizedEvent,U5 as validateRecipe,e6 as validateRuntimeContext,kV as validateStoredValue,Tz as validateStrategy,fb as widgetRegistry};
464
+ `)),new Error(`Batch validation failed: ${R}`)}let k=h(),A=[],M=[];try{for(let R of C){let B=await g(R);A.push(B),M.push(B)}}catch(R){console.error(`[ActionEngine] Batch apply FAILED at action ${M.length+1}/${C.length}.`,`Successfully applied: ${M.length}. Rolling back...`,R);for(let B of M)try{await B.revert()}catch{}throw R}return{id:k,handles:A,async revertAll(){for(let R=A.length-1;R>=0;R--)try{await A[R].revert()}catch(B){console.error(`[ActionEngine] Error reverting action ${A[R].id}:`,B)}},isApplied(){return A.every(R=>R.isApplied())}}}function y(C){return po(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function w(){for(let C of d.values())for(let L of C)try{L()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(L){console.error("[ActionEngine] Error during cleanup:",L)}c.clear()}return{apply:g,applyBatch:v,validate:y,getActive:_,destroy:w}}var lP=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Mx=p.object({type:p.literal("page_url"),url:p.string()}),Dx=p.object({type:p.literal("route"),routeId:p.string()}),Ox=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),Bx=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),Fx=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),Nx=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),Px=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),Hx=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),Ux=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),qx=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),Zu=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),Xu=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),Zu).optional()}),zx=p.object({type:p.literal("event_count"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0),withinMs:p.number().positive().optional(),counter:Xu.optional()}),ho=p.discriminatedUnion("type",[Mx,Dx,Ox,Bx,Fx,Nx,Px,Hx,Ux,qx,zx]),Yu=p.object({conditions:p.array(ho),value:p.unknown()}),Ku=p.object({type:p.literal("rules"),rules:p.array(Yu),default:p.unknown()}),Qu=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),Ju=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),ec=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),tc=p.discriminatedUnion("type",[Ku,Qu,Ju,ec]),bp=tc.nullable().optional(),uP=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),cP=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var Sk=p.object({include:p.array(p.string()).optional().describe("URL patterns where this tile appears. Supports *, **, :param wildcards. Use sparingly \u2014 mostly to isolate to specific webapp functionality. Omit to appear on all routes."),exclude:p.array(p.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),Sp=p.object({routes:Sk,onlyIfPopulated:p.boolean().optional().describe("When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Useful for tiles with all-deferred FAQ questions or nav tips. Default: false.")});function Ez(t){return ho.safeParse(t)}function Tz(t){return tc.safeParse(t)}function Rz(t){return Sp.safeParse(t)}var Mz=[{defName:"matchOp",schema:Zu},{defName:"counterDef",schema:Xu},{defName:"activationConfig",schema:Sp},{defName:"routeFilter",schema:Sk},{defName:"ruleStrategy",schema:Ku},{defName:"scoreStrategy",schema:Qu},{defName:"modelStrategy",schema:Ju},{defName:"externalStrategy",schema:ec},{defName:"rule",schema:Yu},{defName:"condition",schema:ho}];var Vx=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),dP=p.object({on:p.string(),title:p.string(),body:p.string().optional(),icon:p.string().optional(),ttl:p.number().optional(),cooldown:p.number().optional(),deepLink:Vx.optional()}).strict(),fP=p.object({id:p.string(),title:p.string().optional(),subtitle:p.string().optional(),icon:p.string().optional(),priority:p.number().optional(),widget:p.string(),props:p.record(p.unknown()).optional(),activation:Sp.optional(),notifications:p.array(dP).optional()}).strict(),pP=p.object({position:p.enum(["left","right"]).optional(),layout:p.enum(["overlay","push"]).optional(),background:p.string().optional(),blur:p.string().optional(),border:p.string().optional(),width:p.string().optional(),transitionDuration:p.string().optional(),transitionEasing:p.string().optional(),transitionFade:p.string().optional()}),hP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),color:p.string().optional(),size:p.string().optional(),shadow:p.string().optional(),borderRadius:p.string().optional()}),mP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),shadow:p.string().optional(),titleColor:p.string().optional(),textColor:p.string().optional(),iconBackground:p.string().optional(),iconShadow:p.string().optional(),headerPadding:p.string().optional(),bodyPadding:p.string().optional(),gap:p.string().optional()}),gP=p.object({background:p.string().optional(),textColor:p.string().optional(),titleColor:p.string().optional(),arrowColor:p.string().optional(),arrowSize:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),scrimOpacity:p.string().optional(),highlightRing:p.string().optional()}),vP=p.object({background:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),successColor:p.string().optional(),warningColor:p.string().optional(),errorColor:p.string().optional(),iconBackground:p.string().optional(),progressGradient:p.string().optional()}),yP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),itemDivider:p.string().optional(),itemGap:p.string().optional(),itemPadding:p.string().optional(),itemFontSize:p.string().optional(),bodyPadding:p.string().optional(),bodyFontSize:p.string().optional(),categoryPadding:p.string().optional(),categoryGap:p.string().optional(),categoryFontSize:p.string().optional(),searchBackground:p.string().optional(),searchColor:p.string().optional(),chevronColor:p.string().optional()}),xP=p.object({mode:p.enum(["dark","light"]).optional(),fontFamily:p.string().optional(),colorPrimary:p.string().optional(),colorPrimaryHover:p.string().optional(),borderRadius:p.string().optional(),canvas:pP.optional(),launcher:hP.optional(),tile:mP.optional(),overlay:gP.optional(),notification:vP.optional(),content:yP.optional()}).strict(),bP=p.object({enabled:p.boolean().optional(),label:p.string().optional(),icon:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),Nz=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(fP),actions:p.array(p.any()),theme:xP.optional(),launcher:bP.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:ho.optional()})])).optional()}).passthrough().optional()}).strict();var gt={triggerWhen:bp},Ha=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Ck=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),_k=p.enum(["top-left","top-right","bottom-left","bottom-right"]),wk=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),jx=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),Lk=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(jx).optional()}).strict(),Ik=p.object({title:p.string().optional(),body:p.string()}).strict(),Ak=p.enum(["before","after","prepend","append","replace"]),kk=p.enum(["immediate","hover","click"]),Ek=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),Tk=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),Rk=p.enum(["auto","smooth","instant"]),$x=p.enum(["start","center","end","nearest"]),Mk=p.object({kind:p.literal("content:setText"),anchorId:Ha,text:p.string(),label:p.string().optional()}).extend(gt).strict(),Dk=p.object({kind:p.literal("content:setAttr"),anchorId:Ha,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(gt).strict(),Ok=p.object({kind:p.literal("content:addClass"),anchorId:Ha,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Bk=p.object({kind:p.literal("content:removeClass"),anchorId:Ha,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Fk=p.object({kind:p.literal("content:setStyle"),anchorId:Ha,styles:p.record(p.string()),label:p.string().optional()}).extend(gt).strict(),Nk=p.object({kind:p.literal("content:insertHtml"),anchorId:Ha,html:p.string(),position:Ak,deepLink:Vx.optional(),label:p.string().optional()}).extend(gt).strict(),Pk=p.object({kind:p.literal("overlays:highlight"),anchorId:Ha,style:Ck.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Hk=p.object({kind:p.literal("overlays:pulse"),anchorId:Ha,duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Uk=p.object({kind:p.literal("overlays:badge"),anchorId:Ha,content:p.string(),position:_k.optional(),label:p.string().optional()}).extend(gt).strict(),qk=p.object({kind:p.literal("overlays:tooltip"),anchorId:Ha,content:Lk,trigger:kk.optional(),placement:wk.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),zk=p.object({kind:p.literal("overlays:modal"),content:Ik,size:p.enum(["sm","md","lg"]).optional(),blocking:p.boolean().optional(),scrim:p.object({opacity:p.number().min(0).max(1).optional()}).strict().optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().min(0).optional()}).strict().optional(),ctaButtons:p.array(jx).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Vk=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Ha,behavior:Rk.optional(),block:$x.optional(),inline:$x.optional(),label:p.string().optional()}).extend(gt).strict(),$k=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(gt).strict(),jk=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:Ek,label:p.string().optional()}).extend(gt).strict(),Gk=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Wk=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(gt).strict(),Zk=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(gt).strict(),Xk=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(Tk).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(gt).passthrough(),SP=[{defName:"setText",schema:Mk},{defName:"setAttr",schema:Dk},{defName:"addClass",schema:Ok},{defName:"removeClass",schema:Bk},{defName:"setStyle",schema:Fk},{defName:"insertHtml",schema:Nk},{defName:"highlight",schema:Pk},{defName:"pulse",schema:Hk},{defName:"badge",schema:Uk},{defName:"tooltip",schema:qk},{defName:"modal",schema:zk},{defName:"scrollTo",schema:Vk},{defName:"navigate",schema:$k},{defName:"mountWidget",schema:jk},{defName:"wait",schema:Gk},{defName:"sequence",schema:Wk},{defName:"parallel",schema:Zk},{defName:"tour",schema:Xk}];function Gx(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,r=new Map,n=new Map,o=null,i=!1;function s(x){if(!e)return null;try{return e.querySelector(x)}catch{return null}}function l(){for(let[x,f]of r){let g=s(x);if(g){for(let v of f)clearTimeout(v.timer),v.resolve(g);r.delete(x)}}for(let[x,f]of n){let g=s(x);if(g){for(let v of f)v.cancelled||v.cb(g);n.delete(x)}}r.size===0&&n.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(x,f){let g=r.get(x);g&&(g.delete(f),g.size===0&&r.delete(x)),r.size===0&&n.size===0&&c()}function h(x,f){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let g=s(x);if(g)return Promise.resolve(g);let v=f??a;return new Promise((y,_)=>{let w={resolve:y,reject:_,timer:setTimeout(()=>{d(x,w),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=r.get(x);C||(C=new Set,r.set(x,C)),C.add(w),u()})}function m(x,f){if(i)return()=>{};let g=s(x);if(g)return f(g),()=>{};let v={cb:f,cancelled:!1},y=n.get(x);return y||(y=new Set,n.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=n.get(x);_&&(_.delete(v),_.size===0&&n.delete(x)),r.size===0&&n.size===0&&c()}}function S(){let x=0;for(let f of r.values())x+=f.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let f of r.values())for(let g of f)clearTimeout(g.timer),g.reject(x);r.clear(),n.clear()}return{resolve:s,waitFor:h,onAppear:m,pendingCount:S,destroy:b}}function CP(){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 Wx(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let r of e.exclude)if(Yk(a,r))return}if(e.include){for(let r of e.include)if(Yk(a,r))return r;return}return a}function Yk(t,e){let a=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(a===r)return!0;let n=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(a)}var Cp=class{constructor(e){$(this,"context");$(this,"previousContext");$(this,"listeners",new Set);$(this,"telemetry");$(this,"routes");$(this,"navigation");$(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=CP(),this.previousContext={...this.context},e.telemetry?.getSessionId){let a=e.telemetry.getSessionId();a&&(this.context.session.sessionId=a)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Wx(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 a=Wx(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}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,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}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:a}=document,r=Wx(e,this.routes),n={url:e,title:a,routeId:r};(n.url!==this.context.page.url||n.title!==this.context.page.title||n.routeId!==this.context.page.routeId)&&(n.url!==this.context.page.url&&this.addPageToHistory(n.url),this.updateContext({page:n}))}addPageToHistory(e){let a={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],a];r.length>50&&r.shift(),this.context.session.pageHistory=r}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(a){console.error("[ContextManager] Listener error:",a)}}};function Zx(t){return new Cp(t)}var _P=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),wP=p.object({url:p.string(),ts:p.number()}),LP=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(wP).optional()}),IP=p.object({width:p.number(),height:p.number()}),AP=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),kP=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:AP.optional()}),EP=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),TP=p.object({page:_P,session:LP,viewport:IP,anchors:p.array(kP).optional(),augmented:EP.optional()});function e6(t){return TP.safeParse(t)}function Kk(t,e){let{context:a,state:r,events:n}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url.split("?")[0].split("#")[0],s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",i=a.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return i?.visible===!0;case"present":return i?.present===!0;case"absent":return!i?.present;default:return!1}}case"event_occurred":{if(!n)return!1;let o=t.withinMs??6e4;return n.hasRecentEvent(t.eventName,o)}case"state_equals":return r?.getValue?r.getValue(t.key)===t.value:!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){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(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let i=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Qk(t,e){let a=[];for(let r of t.conditions){let n=Kk(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function _p(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=Qk(r,e);if(n)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function wp(t,e){let{context:a}=e,r=a.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function Jk(t,e){let{state:a,events:r,sessionMetrics:n,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>n?.get(i)??0,getValue:i=>a.session.get(i)??a.user.get(i)}:void 0,events:r?{hasRecentEvent:(i,s)=>r.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function eE(t,e,a={}){let r=Jk(e,a);switch(t.type){case"rules":return _p(t,r);case"score":return wp(t,r);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 tE(t,e,a={}){let r=Jk(e,a);switch(t.type){case"rules":return _p(t,r);case"score":return wp(t,r);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 Xx(t){return{evaluate:(e,a)=>eE(e,a,t),evaluateSync:(e,a)=>tE(e,a,t)}}function Yx(t){let{eventBus:e,stateStore:a}=t,r=new Map,n=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of r.values()){if(!d.predicate(u))continue;let h=i.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(u.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),i.set(d.stateKey,h),c=!0}if(c)for(let d of n)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let h=`ev:${u}`,m=r.get(h);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}r.set(h,{stateKey:h,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,h=i.get(d);if(!h)return 0;if(c===void 0||!h.timestamps)return h.count;let m=Date.now()-c;return h.timestamps.filter(S=>S>=m).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}function Kx(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Lp=class{constructor(e={}){$(this,"subscriptions",new Set);$(this,"history",[]);$(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let r,n;typeof e=="function"?(r=void 0,n=e):(r=e,n=a);let o={filter:r,callback:n};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,r="canvas"){let n={ts:Date.now(),name:e,source:r,props:a,schemaVersion:hs};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Kx(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>Kx(n,e))),a&&a>0&&(r=r.slice(-a)),r}hasRecentEvent(e,a,r){let n=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=n&&(r===void 0||o.source===r))}countRecentEvents(e,a){let r=this.history.filter(n=>Kx(n,e));if(a!==void 0){let n=Date.now()-a;r=r.filter(o=>o.ts>=n)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function ac(t={}){return new Lp(t)}var aE={$autocapture:"ui.click",$click:Ce.UI_CLICK,$scroll:Ce.UI_SCROLL,$input:Ce.UI_INPUT,$change:Ce.UI_CHANGE,$submit:Ce.UI_SUBMIT,$pageview:Ce.NAV_PAGE_VIEW,$pageleave:Ce.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function RP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(aE[e])return aE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Ce.UI_SUBMIT:r==="change"?Ce.UI_CHANGE:a==="input"||a==="textarea"?Ce.UI_INPUT:Ce.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function MP(t){let e={},a=t.properties||{},r=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:r?.[0]?.tag_name&&(e.tagName=r[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function rE(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:RP(t),source:"posthog",props:MP(t),schemaVersion:hs}}function nE(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 Qx(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(nE(r)){let n=rE(r);t(n)}}}var oE=p.enum(["posthog","canvas","derived"]),DP=p.object({ts:p.number(),name:p.string(),source:oE,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),OP=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(oE).optional()});function w6(t){return DP.safeParse(t)}function L6(t){return OP.safeParse(t)}var rc=class{constructor(){$(this,"listeners",new Set);$(this,"capturedPushState");$(this,"capturedReplaceState");$(this,"wasNative");$(this,"destroyed",!1);$(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,a){if(!this.destroyed)for(let r of this.listeners)try{r(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var Jx="cooldown:";function iE(t){return{set(e,a){let r=Jx+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=Jx+e,r=t.get(a);if(r===void 0)return 0;let n=r-Date.now();return n<=0?(t.remove(a),0):n},clear(e){let a=Jx+e;t.remove(a)}}}var nc="dismissed:";function sE(t,e){return{mark(a,r=!1){let n=nc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=nc+a;return t.has(r)||e.has(r)},clear(a){let r=nc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(nc)&&t.remove(a);for(let a of e.keys())a.startsWith(nc)&&e.remove(a)}}}var eb="freq:";function lE(t){function e(a){let r=eb+a,n=t.get(r);if(n){if(n.resetAt&&Date.now()>=n.resetAt){t.remove(r);return}return n}}return{increment(a,r){let n=eb+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(n,s),i},count(a){return e(a)?.count??0},reset(a){let r=eb+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var BP="syntro";function tb(t,e){let a=`${e}:`;return{get(r){if(t)try{let n=t.getItem(a+r);if(!n)return;let o=JSON.parse(n);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+r);return}return o.value}catch{return}},set(r,n,o){if(t)try{let i={value:n,expiresAt:o?Date.now()+o:void 0};t.setItem(a+r,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(r){t&&t.removeItem(a+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let n=0;n<t.length;n++){let o=t.key(n);o?.startsWith(a)&&r.push(o.slice(a.length))}return r},clear(){if(!t)return;let r=this.keys();for(let n of r)t.removeItem(a+n)}}}function ab(t){let e=new Map,a=`${t}:`;return{get(r){let n=e.get(a+r);if(n){if(n.expiresAt&&Date.now()>=n.expiresAt){e.delete(a+r);return}return n.value}},set(r,n,o){e.set(a+r,{value:n,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(a+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let n of e.keys())n.startsWith(a)&&r.push(n.slice(a.length));return r},clear(){for(let r of e.keys())r.startsWith(a)&&e.delete(r)}}}var Ip=class{constructor(e={}){$(this,"session");$(this,"user");$(this,"dismissals");$(this,"cooldowns");$(this,"frequency");$(this,"namespace");$(this,"namespacedStorages",new Map);this.namespace=e.namespace??BP,typeof window<"u"?(this.session=tb(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=tb(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=ab(this.namespace),this.user=ab(this.namespace)),this.dismissals=sE(this.session,this.user),this.cooldowns=iE(this.user),this.frequency=lE(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?tb(sessionStorage,a):ab(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function rb(t={}){return new Ip(t)}function oc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Ap(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var uE={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"}},ic={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:[]},cE={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function nb(t,e,a){let r=uE[e];Object.assign(t.style,r),a&&(a.maxWidth&&(t.style.maxWidth=a.maxWidth),a.maxHeight&&(t.style.maxHeight=a.maxHeight),a.minWidth&&(t.style.minWidth=a.minWidth),a.minHeight&&(t.style.minHeight=a.minHeight))}function ob(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[Kd(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(Jd()),a.shift!==!1&&n.push(Qd({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Yd(e,t,async()=>{let{x:i,y:s,strategy:l}=await ef(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function ib(t,e,a="append"){return t.style.position="relative",t.style.display="inline-block",a==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function sb(t,e){return e==="none"||ic[e].length===0?null:t.animate(ic[e],cE)}function lb(t,e){if(e==="none"||ic[e].length===0)return Promise.resolve();let a=[...ic[e]].reverse(),r=t.animate(a,cE);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function ub(t,e){let a=document.createElement("div");return a.setAttribute("data-syntro-surface",t),a.setAttribute("data-syntro-mount-id",e),a.className="syntro-surface",Object.assign(a.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),a}function cb(t){switch(oc(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 dE(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),u=document.createElement("div");return u.append(l),u.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,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"]),i=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){i.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),h=c.startsWith("on"),m=(c==="href"||c==="src")&&d.startsWith("javascript:");(h||m)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(r.firstChild,a.innerHTML)}var FP=0;function db(t){let{overlayRoot:e,eventBus:a,anchorResolver:r,defaultAnimation:n="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++FP}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let w=x(y);for(let C of _)try{C(w)}catch(L){console.error("[Surfaces] State callback error:",L)}}}let h=new Map;function m(y,_,w){switch(_.type){case"html":y.innerHTML=dE(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return w&&h.set(w,C),()=>{C.unmount(),w&&h.delete(w)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.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){let C=u(),L=oc(y),k=w?.priority??0,A=w?.animation??n,M=w?.exclusive??!0,T=i.get(y);if(T&&M){if(T.options.priority>k)throw new Error(`Slot ${y} is occupied by higher priority content (${T.options.priority} > ${k})`);b(T)}let R=ub(y,C);R.style.zIndex=String(cb(y));let B;if(L==="static")nb(R,y,w?.constraints),e.appendChild(R);else if(L==="inline"){let N=Ap(y);if(!N)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let W=r({selector:N,route:"**"});if(!W)throw new Error(`Anchor not found for inline slot: ${N}`);B=ib(R,W)}else if(L==="adjacent"){let N=Ap(y);if(!N)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let W=r({selector:N,route:"**"});if(!W)throw new Error(`Anchor not found for adjacent slot: ${N}`);e.appendChild(R),B=ob(R,W,w?.position??{placement:"bottom"})}let F=m(R,_,C);sb(R,A);let P={id:C,slot:y,content:_,options:{priority:k,exclusive:M,animation:A,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:R,cleanup:()=>{B?.(),F?.()},mountedAt:Date.now()};return i.set(y,P),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:w?.adaptiveId}),d(y),{id:C,update(N){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");let Q=h.get(C);if(Q){if(N.type==="widget"){Q.update(N.config),W.content=N;return}Q.unmount(),h.delete(C)}W.container.innerHTML="";let aa=m(W.container,N,C);if(W.content=N,aa){let dt=W.cleanup;W.cleanup=()=>{dt?.(),aa()}}},setOptions(N){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");N.priority!==void 0&&(W.options.priority=N.priority),N.animation!==void 0&&(W.options.animation=N.animation),N.constraints&&L==="static"&&(N.constraints.maxWidth&&(W.container.style.maxWidth=N.constraints.maxWidth),N.constraints.maxHeight&&(W.container.style.maxHeight=N.constraints.maxHeight),N.constraints.minWidth&&(W.container.style.minWidth=N.constraints.minWidth),N.constraints.minHeight&&(W.container.style.minHeight=N.constraints.minHeight)),d(y)},async unmount(){let N=i.get(y);!N||N.id!==C||await b(N)},isMounted(){return i.get(y)?.id===C},getContainer(){let N=i.get(y);return N?.id===C?N.container:null}}}async function b(y){await lb(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function x(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function f(y,_){let w=l.get(y);return w||(w=new Set,l.set(y,w)),w.add(_),()=>{w?.delete(_),w?.size===0&&l.delete(y)}}function g(y,_){let w=i.get(y);return w?_!==void 0?_>=w.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:x,onStateChange:f,canMount:g,destroy:v}}var kp=class{constructor(){$(this,"widgets",new Map);$(this,"mountedWidgets",new Map);$(this,"mountIdCounter",0);$(this,"runtimeRef");$(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,r="custom",n){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:a,source:r,metadata:n}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.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[a,r]of this.widgets.entries())r.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,r){let n=this.widgets.get(e);if(!n)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...r,runtime:this.runtimeRef},s=n.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(n.widget.update)n.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},h=n.widget.mount(a,d);c.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(a=>a.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let a of this.listeners)try{a(e)}catch(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},fb=new kp;var pE="2.0.0";function NP(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let r=a.replace(/\/$/,"")||"/";if(e.exclude){for(let n of e.exclude)if(pb(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(pb(r,n))return!0;return!1}return!0}function pb(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let r=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function fE(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>pb(a,n))}function hb(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??fb,s=t.executors??on,l=t.apps??Jl,u=new rc,c=Zx({telemetry:e,routes:r,navigation:u}),d=t.events??ac(),h=rb({namespace:o}),m=Yx({eventBus:d,stateStore:h}),S=Xx({state:h,events:d,sessionMetrics:a,accumulator:m}),b=ZL(),x=Gx(),f=C=>fE(C)?x.resolve(C.selector):null,g=async(C,L)=>{if(!fE(C))return null;try{return await x.waitFor(C.selector,L)}catch{return null}},v=db({overlayRoot:b,eventBus:d,anchorResolver:f,widgetRegistry:i}),y=Rx({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:g,executorRegistry:s,subscribeNavigation:C=>u.subscribe(C),runtime:{evaluateSync:C=>S.evaluateSync(C,c.get()),context:c,accumulator:m}}),_;if(a){a.increment("page_views");let C=typeof window<"u"?window.location.pathname:"/";_=u.subscribe((L,k)=>{if(k!=="replaceState")try{let A=new URL(L).pathname;A!==C&&(C=A,a.increment("page_views"))}catch{}})}let w={telemetry:e,context:c,events:d,state:h,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:m,anchorResolver:x,navigation:u,version:pE,mode:n,async evaluate(C){return S.evaluate(C,c.get())},evaluateSync(C){return S.evaluateSync(C,c.get())},async filterTiles(C){let L=c.get().page.url,k=[];for(let A of C){let M=A.activation;if(!M){k.push(A);continue}if(NP(L,M.routes)){if(M.onlyIfPopulated){let T=A.props?.actions??[];if(T.length>0&&!T.some(B=>B.triggerWhen?S.evaluateSync(B.triggerWhen,c.get()).value:!0))continue}k.push(A)}}return k},setRoutes(C){c.setRoutes(C)},destroy(){l.unbind().catch(C=>{console.error("[Runtime] Error unbinding apps registry:",C)}),_?.(),x.destroy(),m.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(w),i.bindRuntime(w),w}var PP=p.object({value:p.unknown(),expiresAt:p.number().optional()}),HP=p.object({count:p.number(),resetAt:p.number().optional()});function kV(t){return PP.safeParse(t)}function EV(t){return HP.safeParse(t)}var hE={growthbook:t=>Bv({...t,autoInit:!0})};function mE(t,e){let a=hE[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(hE).join(", ")}`);return a(e)}var UP=["cdn.syntrologie.com","localhost","127.0.0.1"];function qP(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):UP.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var mb=class{constructor(e){$(this,"name","cdn");$(this,"url");$(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!qP(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),a=await fetch(this.url,{credentials:"omit",cache:"default"});if(!a.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${a.status})`);let r=await a.text();if(this.integrity){let l=await zP(r),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let n=JSON.parse(r),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:n,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function zP(t){let a=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",a),n=new Uint8Array(r);return btoa(String.fromCharCode(...n))}function gE(t){return new mb(t)}var VP="syntro_exp",$P="syntro_var",gb=class{constructor(e){$(this,"name","experiments");$(this,"client");$(this,"featureKey");$(this,"manifestKey");$(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 n=new URLSearchParams(window.location.search),o=n.get(VP),i=n.get($P);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix||this.client.getAllFeatures){let n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:of(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.client.getAllFeatures){let e=this.client.getAllFeatures();return this.variantFlagPrefix?Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix)):Object.keys(e)}return[]}};function vE(t){return new gb(t)}var jP="https://cdn.syntrologie.com/configs",yE={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return gE({baseUrl:t.baseUrl??jP,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return vE({featureKey:t.featureKey})}};function xE(t,e={}){let a=yE[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(yE).join(", ")}`);return a(e)}var bE={posthog:t=>Lx(t),noop:()=>zv()};function SE(t,e){let a=bE[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(bE).join(", ")}`);return a(e)}var vb="syn_";function Ep(t){if(!t.startsWith(vb))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(vb.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(a),n=JSON.parse(r);if(n.v!==1)throw new Error(`Unsupported token version: ${n.v}`);return n}function yb(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return vb+a}function sn(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 GP(){if(typeof window>"u")return X("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="editor");return X("Syntro Bootstrap","isEditorMode:",a),a}function WP(){if(typeof window>"u")return X("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="audit");return X("Syntro Bootstrap","isAuditMode:",a),a}function ZP(){if(typeof window>"u")return X("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Vo(),a=!!(zn()?.token&&t?.mode==="review");return X("Syntro Bootstrap","isReviewMode:",a),a}var CE="syntro_segment_attributes";function XP(){if(typeof window>"u")return{};try{let t=localStorage.getItem(CE);if(t){let e=JSON.parse(t);return X("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ga("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function YP(t){if(!(typeof window>"u"))try{localStorage.setItem(CE,JSON.stringify(t)),X("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ga("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function KP(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}function QP(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let r=e.get(a);r&&(t[a]=r)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname}catch{}return t}async function JP(t){$g(),X("Syntro Bootstrap","====== INIT ======"),X("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=GP(),a=WP(),r=ZP(),n=e?"editor":a?"audit":r?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${a}, review=${r}, sdkMode=${n}`),console.log("[DIAG] editorSource:",zn()),console.log("[DIAG] editorConf:",Vo()),X("Syntro Bootstrap","SDK mode:",n??"normal"),!n&&typeof window<"u"){let T=!!window.__SYNTRO_EDITOR_PARAMS__,R=!!window.__SYNTRO_AUDIT_LEGEND__,B=!!window.__SYNTRO_REVIEW_DATA__;if(T||R||B){let F=[T&&"__SYNTRO_EDITOR_PARAMS__",R&&"__SYNTRO_AUDIT_LEGEND__",B&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${F.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&&n){let R=Vo()?.syntro_token;R?.startsWith("syn_")&&(o=R,X("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${n} mode)`))}let i;if(o)if(o.startsWith("syn_"))X("Syntro Bootstrap","Token starts with syn_, decoding..."),i=Ep(o),$g(i.d);else if(n)X("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${n} mode)`);else throw sf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),sf("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(n)X("Syntro Bootstrap",`\u2713 No token, but ${n} mode - proceeding`);else throw sf("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=sn("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||sn("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,l=sn("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||sn("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,u=sn("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||sn("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,c=XP(),d=QP(),h={...d,...c};X("Syntro Bootstrap","Phase 1: Browser metadata:",d),X("Syntro Bootstrap","Phase 1: Cached segment attributes:",c);let m,S=ac();console.log("[Syntro Bootstrap] EventBus created");let b=Qx(T=>{S.publishEvent(T)}),x=T=>{X("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let R=KP(T);if(X("Syntro Bootstrap","Segment flags from PostHog:",R),YP(R),m){let B=g?.getAll?.()??{},F={...d,...B,...R};X("Syntro Bootstrap","Updating GrowthBook with attributes:",F),m.setAttributes?.(F)}},f;if(i?.t){let T=i.t==="noop"?"noop":"posthog";f=SE(T,{apiKey:i.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:x,onCapture:b}),console.log(`[Syntro Bootstrap] Telemetry client created (${T}) with EventBus wiring`)}let g;i?.e&&(m=mE("growthbook",{clientKey:i.e,apiHost:s,attributes:h,onExperimentViewed:f?.trackExperiment?(T,R,B)=>{f.trackExperiment(T,R,B)}:void 0})),g=Fv({experiments:m,onMetricChange:(T,R)=>{X("Syntro Bootstrap",`Session metric changed: ${T} = ${R}`)}}),X("Syntro Bootstrap","SessionMetricTracker created");let v="production";e?v="editor":a?v="audit":sn("NODE_ENV")==="development"&&(v="development");let y=hb({telemetry:f,sessionMetrics:g,mode:v,events:S});X("Syntro Bootstrap","Runtime created:",{version:y.version,mode:y.mode,hasContext:!!y.context,hasEvents:!!y.events,hasState:!!y.state}),X("Syntro Bootstrap","Core app executors already registered");let _=t.cdnBase||sn("NEXT_PUBLIC_SYNTRO_CDN_BASE")||sn("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",w=Pg({cdnBase:_,registry:y.apps,onLoadStart:T=>{X("Syntro Bootstrap",`Loading app from CDN: ${T}`)},onLoadEnd:(T,R,B)=>{R?X("Syntro Bootstrap",`App loaded successfully: ${T}`):ga("Syntro Bootstrap",`Failed to load app: ${T}`,B)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:y.apps,runtime:y,version:y.version},X("Syntro Bootstrap","Global SynOS object exposed"));let C=y.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${C.length} apps in registry:`,C.map(T=>`${T.manifest.id}(${T.state})`).join(", "));for(let T of C)if(T.state==="registered")try{await y.apps.activate(T.manifest.id),console.log(`[DIAG] Activated: ${T.manifest.id} \u2192 widgets: [${y.widgets.list().join(", ")}]`)}catch(R){console.error(`[DIAG] FAILED to activate: ${T.manifest.id}`,R),ga("Syntro Bootstrap",`Failed to auto-activate built-in app: ${T.manifest.id}`,R)}if(console.log(`[DIAG] Activation complete. Total widgets: [${y.widgets.list().join(", ")}]`),m?.refreshFeatures)try{await m.refreshFeatures(),X("Syntro Bootstrap","GrowthBook features loaded")}catch(T){ga("Syntro Bootstrap","Failed to load GrowthBook features:",T)}let L;if(t.fetcher)L=t.fetcher;else if(i?.f){let T=xE(i.f,i.o??{});L=async()=>{let R=await T.fetch();return{...R.config,tiles:R.config.tiles??[]}}}else m&&(L=cs({experiments:m}));let k=new Set,A=L?async()=>{let T=await L();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${T.tiles?.length??0},`,`actions=${T.actions?.length??0},`,`theme=${T.theme?.name??"none"}`),T.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",T.actions.map((F,P)=>`[${P}] ${F.kind}${F.anchorId?` anchor="${typeof F.anchorId=="string"?F.anchorId:F.anchorId.selector}"`:""}${F.label?` "${F.label}"`:""}`).join(", "));let R=T,B=w.getRequiredApps(R);return B.length>0?console.log("[Syntro Bootstrap] Required external apps:",B.join(", ")):X("Syntro Bootstrap","No external apps required (all executors are built-in)"),B.length>0&&await w.loadAppsForConfig(R).then(async P=>{let Y=P.filter(Q=>Q.success),N=P.filter(Q=>!Q.success);Y.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${Y.map(Q=>Q.appId).join(", ")}`);let W=N.filter(Q=>!k.has(Q.appId));W.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",W.map(Q=>`${Q.appId} (${Q.error})`).join(", ")),W.forEach(Q=>k.add(Q.appId)));for(let Q of B)if(y.apps.has(Q))try{await y.apps.activate(Q),console.log(`[Syntro Bootstrap] App activated: ${Q}`)}catch(aa){console.error(`[Syntro Bootstrap] Failed to activate app: ${Q}`,aa)}else console.error(`[Syntro Bootstrap] App "${Q}" required by config but NOT registered.`,`Available apps: [${Array.from(y.apps.list?.()??[]).join(", ")}]`)}),T}:void 0;return{canvas:await gv({...t.canvas,fetcher:A,integrations:{experiments:m,telemetry:f},editorUrl:u,runtime:y}),runtime:y,experiments:m,telemetry:f,sessionMetrics:g,appLoader:w}}var _E={init:JP,encodeToken:yb,decodeToken:Ep};typeof window<"u"&&(window.Syntro=_E);var wE="2026-03-06T18:10:53.087Z (83c283f0a7)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${wE}`);let t=window.SynOS,e=t?.appRegistry||Jl;window.SynOS={...t,appRegistry:e,_runtimeBuild:wE,React:LE.default,ReactDOM:{...eH,createPortal:Tp.createPortal,flushSync:Tp.flushSync}},BL(e)}export{ic as ANIMATION_KEYFRAMES,Sp as ActivationConfigZ,Ok as AddClassZ,Ha as AnchorIdZ,kP as AnchorStateZ,Ox as AnchorVisibleConditionZ,af as AppRegistry,EP as AugmentationZ,_k as BadgePositionZ,Uk as BadgeZ,AP as BoundingBoxZ,au as CanvasEvents,Uv as CanvasRecipeZ,ho as ConditionZ,Cp as ContextManager,Ux as CooldownActiveConditionZ,Xu as CounterDefZ,jx as CtaButtonZ,Kg as DEFAULT_COOLDOWN,Yg as DEFAULT_TTL,tc as DecisionStrategyZ,Hx as DismissedConditionZ,hs as EVENT_SCHEMA_VERSION,Lp as EventBus,zx as EventCountConditionZ,OP as EventFilterZ,Bx as EventOccurredConditionZ,oE as EventSourceZ,xp as ExecutorRegistry,ec as ExternalStrategyZ,HP as FrequencyEntryZ,qx as FrequencyLimitConditionZ,pF as HighlightStepZ,Ck as HighlightStyleZ,Pk as HighlightZ,Nk as InsertHtmlZ,Ak as InsertPositionZ,Xg as MAX_VISIBLE_TOASTS,Zu as MatchOpZ,Ik as ModalContentZ,zk as ModalZ,Ju as ModelStrategyZ,jk as MountWidgetZ,$k as NavigateZ,rc as NavigationMonitor,DP as NormalizedEventZ,Zg as NotificationToastStack,_P as PageContextZ,wP as PageHistoryEntryZ,Mx as PageUrlConditionZ,Zk as ParallelZ,wk as PlacementZ,Hk as PulseZ,wE as RUNTIME_SDK_BUILD,pE as RUNTIME_VERSION,Bk as RemoveClassZ,Dx as RouteConditionZ,Sk as RouteFilterZ,Ku as RuleStrategyZ,Yu as RuleZ,TP as RuntimeContextZ,av as RuntimeProvider,qn as SDK_SCHEMA_VERSION,jg as SDK_VERSION,uE as STATIC_SLOT_STYLES,Qu as ScoreStrategyZ,Rk as ScrollBehaviorZ,$x as ScrollLogicalPositionZ,Vk as ScrollToZ,m1 as SelectorZ,Wk as SequenceZ,LP as SessionContextZ,Px as SessionMetricConditionZ,Mf as SessionMetricTracker,Dk as SetAttrZ,Fk as SetStyleZ,Mk as SetTextZ,cI as ShadowCanvasOverlay,KL as ShadowRootProvider,hI as SmartCanvasApp,Wg as SmartCanvasController,hv as SmartCanvasElement,G5 as SmartCanvasPortal,Ce as StandardEvents,Fx as StateEqualsConditionZ,Ip as StateStore,PP as StoredValueZ,_E as Syntro,uu as TileCard,Bq as TileWheel,Lk as TooltipContentZ,fF as TooltipStepZ,kk as TooltipTriggerZ,qk as TooltipZ,Tk as TourStepForSchemaZ,Xk as TourZ,bp as TriggerWhenZ,Nx as ViewportConditionZ,IP as ViewportContextZ,Gk as WaitZ,Ek as WidgetConfigZ,kp as WidgetRegistry,Jl as appRegistry,nb as applyStaticSlotStyles,Fg as cleanupAppContext,Cg as contentRuntime,SP as coreActionStepSchemas,Rx as createActionEngine,Gx as createAnchorResolver,Bg as createAppContext,Pg as createAppLoader,cs as createCanvasConfigFetcher,Zx as createContextManager,Xx as createDecisionEngine,Yx as createEventAccumulator,ac as createEventBus,Bv as createGrowthBookClient,zv as createNoopClient,$5 as createOverlayRecipeFetcher,Lx as createPostHogClient,Qx as createPostHogNormalizer,Fv as createSessionMetricTracker,gv as createSmartCanvas,XL as createSmartCanvasController,hb as createSmartCanvasRuntime,rb as createStateStore,ub as createSurfaceContainer,db as createSurfaces,Mz as decisionSchemas,Ep as decodeToken,yb as encodeToken,eE as evaluate,Kk as evaluateCondition,Qk as evaluateRule,_p as evaluateRuleStrategy,wp as evaluateScoreStrategy,tE as evaluateSync,on as executorRegistry,eD as getAntiFlickerSnippet,bL as getAppIdFromActionKind,Ng as getAppIdFromWidgetId,jN as getExecutor,Ap as getSlotAnchorId,oc as getSlotType,cb as getSlotZIndex,Ex as hasExecutor,cf as interpolateTemplate,xL as isCoreActionKind,Qg as matchEvent,Hq as needsMigration,rE as normalizePostHogEvent,Og as overlaysRuntime,cu as parseVersion,sb as playEnterAnimation,lb as playExitAnimation,lf as registerConfigPredicates,yI as registerSmartCanvasElement,Gg as resolveConfigUri,ob as setupAdjacentPositioning,ib as setupInlinePositioning,nE as shouldNormalizeEvent,ND as useDecision,Jg as useNotifications,ev as useNotifyWatcher,rv as usePageContext,Vr as useRuntime,ff as useRuntimeContext,BD as useRuntimeEvents,FD as useRuntimeState,DD as useSessionContext,fI as useShadowCanvasConfig,ps as useShadowRoot,OD as useViewportContext,po as validateAction,Tx as validateActions,Rz as validateActivationConfig,Ez as validateCondition,Pq as validateConfig,L6 as validateEventFilter,EV as validateFrequencyEntry,w6 as validateNormalizedEvent,U5 as validateRecipe,e6 as validateRuntimeContext,kV as validateStoredValue,Tz as validateStrategy,fb as widgetRegistry};
465
465
  /*! Bundled license information:
466
466
 
467
467
  react/cjs/react.production.js: