@syntrologie/runtime-sdk 2.4.0-canary.21 → 2.4.0-canary.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/schema.d.ts +3603 -36279
- package/dist/actions/schema.js +2 -2
- package/dist/{chunk-2UYZ5DWI.js → chunk-5SKKLUOS.js} +42 -4
- package/dist/chunk-5SKKLUOS.js.map +7 -0
- package/dist/{chunk-IPU3WVPY.js → chunk-FFIHKDHW.js} +217 -32
- package/dist/chunk-FFIHKDHW.js.map +7 -0
- package/dist/{chunk-HF3D7YFQ.js → chunk-MCX3AKSH.js} +21 -23
- package/dist/chunk-MCX3AKSH.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -1
- package/dist/config/schema.d.ts +890 -96
- package/dist/config/schema.js +3 -1
- package/dist/hooks/useShadowCanvasConfig.d.ts +3 -1
- package/dist/index.js +65 -64
- package/dist/index.js.map +2 -2
- package/dist/react.js +3 -3
- package/dist/smart-canvas.esm.js +62 -47
- package/dist/smart-canvas.esm.js.map +3 -3
- package/dist/smart-canvas.js +334 -113
- package/dist/smart-canvas.js.map +3 -3
- package/dist/smart-canvas.min.js +61 -46
- package/dist/smart-canvas.min.js.map +3 -3
- package/dist/theme/types.d.ts +2 -1
- package/dist/version.d.ts +1 -1
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +1333 -388
- package/dist/chunk-2UYZ5DWI.js.map +0 -7
- package/dist/chunk-HF3D7YFQ.js.map +0 -7
- package/dist/chunk-IPU3WVPY.js.map +0 -7
package/dist/smart-canvas.min.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var SyntrologieSDK=(()=>{var kR=Object.create;var el=Object.defineProperty;var RR=Object.getOwnPropertyDescriptor;var OR=Object.getOwnPropertyNames;var MR=Object.getPrototypeOf,NR=Object.prototype.hasOwnProperty;var J0=t=>{throw TypeError(t)};var DR=(t,e,n)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Xn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),e_=(t,e)=>{for(var n in e)el(t,n,{get:e[n],enumerable:!0})},t_=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of OR(e))!NR.call(t,r)&&r!==n&&el(t,r,{get:()=>e[r],enumerable:!(i=RR(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?kR(MR(t)):{},t_(e||!t||!t.__esModule?el(n,"default",{value:t,enumerable:!0}):n,t)),LR=t=>t_(el({},"__esModule",{value:!0}),t);var P=(t,e,n)=>DR(t,typeof e!="symbol"?e+"":e,n),n_=(t,e,n)=>e.has(t)||J0("Cannot "+n);var ge=(t,e,n)=>(n_(t,e,"read from private field"),n?n.call(t):e.get(t)),cr=(t,e,n)=>e.has(t)?J0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kn=(t,e,n,i)=>(n_(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var p_=Xn(ie=>{"use strict";var Eh=Symbol.for("react.transitional.element"),IR=Symbol.for("react.portal"),HR=Symbol.for("react.fragment"),zR=Symbol.for("react.strict_mode"),BR=Symbol.for("react.profiler"),FR=Symbol.for("react.consumer"),$R=Symbol.for("react.context"),UR=Symbol.for("react.forward_ref"),VR=Symbol.for("react.suspense"),jR=Symbol.for("react.memo"),s_=Symbol.for("react.lazy"),PR=Symbol.for("react.activity"),i_=Symbol.iterator;function qR(t){return t===null||typeof t!="object"?null:(t=i_&&t[i_]||t["@@iterator"],typeof t=="function"?t:null)}var l_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c_=Object.assign,u_={};function pa(t,e,n){this.props=t,this.context=e,this.refs=u_,this.updater=n||l_}pa.prototype.isReactComponent={};pa.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")};pa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function d_(){}d_.prototype=pa.prototype;function Ch(t,e,n){this.props=t,this.context=e,this.refs=u_,this.updater=n||l_}var Ah=Ch.prototype=new d_;Ah.constructor=Ch;c_(Ah,pa.prototype);Ah.isPureReactComponent=!0;var r_=Array.isArray;function wh(){}var De={H:null,A:null,T:null,S:null},f_=Object.prototype.hasOwnProperty;function Th(t,e,n){var i=n.ref;return{$$typeof:Eh,type:t,key:e,ref:i!==void 0?i:null,props:n}}function ZR(t,e){return Th(t.type,e,t.props)}function kh(t){return typeof t=="object"&&t!==null&&t.$$typeof===Eh}function GR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var o_=/\/+/g;function xh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?GR(""+t.key):e.toString(36)}function YR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(wh,wh):(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 fa(t,e,n,i,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Eh:case IR:a=!0;break;case s_:return a=t._init,fa(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+xh(t,0):i,r_(r)?(n="",a!=null&&(n=a.replace(o_,"$&/")+"/"),fa(r,e,n,"",function(c){return c})):r!=null&&(kh(r)&&(r=ZR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(o_,"$&/")+"/")+a)),e.push(r)),1;a=0;var s=i===""?".":i+":";if(r_(t))for(var l=0;l<t.length;l++)i=t[l],o=s+xh(i,l),a+=fa(i,e,n,o,r);else if(l=qR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,o=s+xh(i,l++),a+=fa(i,e,n,o,r);else if(o==="object"){if(typeof t.then=="function")return fa(YR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function du(t,e,n){if(t==null)return t;var i=[],r=0;return fa(t,i,"","",function(o){return e.call(n,o,r++)}),i}function WR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var a_=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)},XR={map:du,forEach:function(t,e,n){du(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return du(t,function(){e++}),e},toArray:function(t){return du(t,function(e){return e})||[]},only:function(t){if(!kh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ie.Activity=PR;ie.Children=XR;ie.Component=pa;ie.Fragment=HR;ie.Profiler=BR;ie.PureComponent=Ch;ie.StrictMode=zR;ie.Suspense=VR;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=De;ie.__COMPILER_RUNTIME={__proto__:null,c:function(t){return De.H.useMemoCache(t)}};ie.cache=function(t){return function(){return t.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=c_({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!f_.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return Th(t.type,r,i)};ie.createContext=function(t){return t={$$typeof:$R,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:FR,_context:t},t};ie.createElement=function(t,e,n){var i,r={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)f_.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return Th(t,o,r)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(t){return{$$typeof:UR,render:t}};ie.isValidElement=kh;ie.lazy=function(t){return{$$typeof:s_,_payload:{_status:-1,_result:t},_init:WR}};ie.memo=function(t,e){return{$$typeof:jR,type:t,compare:e===void 0?null:e}};ie.startTransition=function(t){var e=De.T,n={};De.T=n;try{var i=t(),r=De.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(wh,a_)}catch(o){a_(o)}finally{e!==null&&n.types!==null&&(e.types=n.types),De.T=e}};ie.unstable_useCacheRefresh=function(){return De.H.useCacheRefresh()};ie.use=function(t){return De.H.use(t)};ie.useActionState=function(t,e,n){return De.H.useActionState(t,e,n)};ie.useCallback=function(t,e){return De.H.useCallback(t,e)};ie.useContext=function(t){return De.H.useContext(t)};ie.useDebugValue=function(){};ie.useDeferredValue=function(t,e){return De.H.useDeferredValue(t,e)};ie.useEffect=function(t,e){return De.H.useEffect(t,e)};ie.useEffectEvent=function(t){return De.H.useEffectEvent(t)};ie.useId=function(){return De.H.useId()};ie.useImperativeHandle=function(t,e,n){return De.H.useImperativeHandle(t,e,n)};ie.useInsertionEffect=function(t,e){return De.H.useInsertionEffect(t,e)};ie.useLayoutEffect=function(t,e){return De.H.useLayoutEffect(t,e)};ie.useMemo=function(t,e){return De.H.useMemo(t,e)};ie.useOptimistic=function(t,e){return De.H.useOptimistic(t,e)};ie.useReducer=function(t,e,n){return De.H.useReducer(t,e,n)};ie.useRef=function(t){return De.H.useRef(t)};ie.useState=function(t){return De.H.useState(t)};ie.useSyncExternalStore=function(t,e,n){return De.H.useSyncExternalStore(t,e,n)};ie.useTransition=function(){return De.H.useTransition()};ie.version="19.2.4"});var Qe=Xn(($I,h_)=>{"use strict";h_.exports=p_()});var m_=Xn(Dt=>{"use strict";var KR=Qe();function g_(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ur(){}var Nt={d:{f:ur,r:function(){throw Error(g_(522))},D:ur,C:ur,L:ur,m:ur,X:ur,S:ur,M:ur},p:0,findDOMNode:null},QR=Symbol.for("react.portal");function JR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var tl=KR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function fu(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Nt;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(g_(299));return JR(t,e,null,n)};Dt.flushSync=function(t){var e=tl.T,n=Nt.p;try{if(tl.T=null,Nt.p=2,t)return t()}finally{tl.T=e,Nt.p=n,Nt.d.f()}};Dt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Nt.d.C(t,e))};Dt.prefetchDNS=function(t){typeof t=="string"&&Nt.d.D(t)};Dt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=fu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Nt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:o}):n==="script"&&Nt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Dt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=fu(e.as,e.crossOrigin);Nt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Nt.d.M(t)};Dt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=fu(n,e.crossOrigin);Nt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Dt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=fu(e.as,e.crossOrigin);Nt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Nt.d.m(t)};Dt.requestFormReset=function(t){Nt.d.r(t)};Dt.unstable_batchedUpdates=function(t,e){return t(e)};Dt.useFormState=function(t,e,n){return tl.H.useFormState(t,e,n)};Dt.useFormStatus=function(){return tl.H.useHostTransitionStatus()};Dt.version="19.2.4"});var nl=Xn((VI,y_)=>{"use strict";function v_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v_)}catch(t){console.error(t)}}v_(),y_.exports=m_()});var k_=Xn(ze=>{"use strict";function Nh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<pu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Qn(t){return t.length===0?null:t[0]}function gu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,o=r>>>1;i<o;){var a=2*(i+1)-1,s=t[a],l=a+1,c=t[l];if(0>pu(s,n))l<r&&0>pu(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[a]=n,i=a);else if(l<r&&0>pu(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function pu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(b_=performance,ze.unstable_now=function(){return b_.now()}):(Rh=Date,__=Rh.now(),ze.unstable_now=function(){return Rh.now()-__});var b_,Rh,__,vi=[],dr=[],e2=1,mn=null,At=3,Dh=!1,il=!1,rl=!1,Lh=!1,w_=typeof setTimeout=="function"?setTimeout:null,E_=typeof clearTimeout=="function"?clearTimeout:null,S_=typeof setImmediate<"u"?setImmediate:null;function hu(t){for(var e=Qn(dr);e!==null;){if(e.callback===null)gu(dr);else if(e.startTime<=t)gu(dr),e.sortIndex=e.expirationTime,Nh(vi,e);else break;e=Qn(dr)}}function Ih(t){if(rl=!1,hu(t),!il)if(Qn(vi)!==null)il=!0,ga||(ga=!0,ha());else{var e=Qn(dr);e!==null&&Hh(Ih,e.startTime-t)}}var ga=!1,ol=-1,C_=5,A_=-1;function T_(){return Lh?!0:!(ze.unstable_now()-A_<C_)}function Oh(){if(Lh=!1,ga){var t=ze.unstable_now();A_=t;var e=!0;try{e:{il=!1,rl&&(rl=!1,E_(ol),ol=-1),Dh=!0;var n=At;try{t:{for(hu(t),mn=Qn(vi);mn!==null&&!(mn.expirationTime>t&&T_());){var i=mn.callback;if(typeof i=="function"){mn.callback=null,At=mn.priorityLevel;var r=i(mn.expirationTime<=t);if(t=ze.unstable_now(),typeof r=="function"){mn.callback=r,hu(t),e=!0;break t}mn===Qn(vi)&&gu(vi),hu(t)}else gu(vi);mn=Qn(vi)}if(mn!==null)e=!0;else{var o=Qn(dr);o!==null&&Hh(Ih,o.startTime-t),e=!1}}break e}finally{mn=null,At=n,Dh=!1}e=void 0}}finally{e?ha():ga=!1}}}var ha;typeof S_=="function"?ha=function(){S_(Oh)}:typeof MessageChannel<"u"?(Mh=new MessageChannel,x_=Mh.port2,Mh.port1.onmessage=Oh,ha=function(){x_.postMessage(null)}):ha=function(){w_(Oh,0)};var Mh,x_;function Hh(t,e){ol=w_(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C_=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return At};ze.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var n=At;At=e;try{return t()}finally{At=n}};ze.unstable_requestPaint=function(){Lh=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=At;At=t;try{return e()}finally{At=n}};ze.unstable_scheduleCallback=function(t,e,n){var i=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:e2++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,Nh(dr,t),Qn(vi)===null&&t===Qn(dr)&&(rl?(E_(ol),ol=-1):rl=!0,Hh(Ih,n-i))):(t.sortIndex=r,Nh(vi,t),il||Dh||(il=!0,ga||(ga=!0,ha()))),t};ze.unstable_shouldYield=T_;ze.unstable_wrapCallback=function(t){var e=At;return function(){var n=At;At=e;try{return t.apply(this,arguments)}finally{At=n}}}});var O_=Xn((PI,R_)=>{"use strict";R_.exports=k_()});var V1=Xn($d=>{"use strict";var ot=O_(),nx=Qe(),t2=nl();function M(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ix(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ql(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function rx(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 ox(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 M_(t){if(ql(t)!==t)throw Error(M(188))}function n2(t){var e=t.alternate;if(!e){if(e=ql(t),e===null)throw Error(M(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return M_(r),t;if(o===i)return M_(r),e;o=o.sibling}throw Error(M(188))}if(n.return!==i.return)n=r,i=o;else{for(var a=!1,s=r.child;s;){if(s===n){a=!0,n=r,i=o;break}if(s===i){a=!0,i=r,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,i=r;break}if(s===i){a=!0,i=o,n=r;break}s=s.sibling}if(!a)throw Error(M(189))}}if(n.alternate!==i)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?t:e}function ax(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=ax(t),e!==null)return e;t=t.sibling}return null}var He=Object.assign,i2=Symbol.for("react.element"),mu=Symbol.for("react.transitional.element"),pl=Symbol.for("react.portal"),Sa=Symbol.for("react.fragment"),sx=Symbol.for("react.strict_mode"),mg=Symbol.for("react.profiler"),lx=Symbol.for("react.consumer"),Ci=Symbol.for("react.context"),dm=Symbol.for("react.forward_ref"),vg=Symbol.for("react.suspense"),yg=Symbol.for("react.suspense_list"),fm=Symbol.for("react.memo"),fr=Symbol.for("react.lazy"),bg=Symbol.for("react.activity"),r2=Symbol.for("react.memo_cache_sentinel"),N_=Symbol.iterator;function al(t){return t===null||typeof t!="object"?null:(t=N_&&t[N_]||t["@@iterator"],typeof t=="function"?t:null)}var o2=Symbol.for("react.client.reference");function _g(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===o2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Sa:return"Fragment";case mg:return"Profiler";case sx:return"StrictMode";case vg:return"Suspense";case yg:return"SuspenseList";case bg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case pl:return"Portal";case Ci:return t.displayName||"Context";case lx:return(t._context.displayName||"Context")+".Consumer";case dm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case fm:return e=t.displayName||null,e!==null?e:_g(t.type)||"Memo";case fr:e=t._payload,t=t._init;try{return _g(t(e))}catch{}}return null}var hl=Array.isArray,Q=nx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=t2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ho={pending:!1,data:null,method:null,action:null},Sg=[],xa=-1;function ii(t){return{current:t}}function ft(t){0>xa||(t.current=Sg[xa],Sg[xa]=null,xa--)}function Oe(t,e){xa++,Sg[xa]=t.current,t.current=e}var ni=ii(null),Ml=ii(null),wr=ii(null),Wu=ii(null);function Xu(t,e){switch(Oe(wr,e),Oe(Ml,t),Oe(ni,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?FS(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=FS(e),t=k1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ft(ni),Oe(ni,t)}function $a(){ft(ni),ft(Ml),ft(wr)}function xg(t){t.memoizedState!==null&&Oe(Wu,t);var e=ni.current,n=k1(e,t.type);e!==n&&(Oe(Ml,t),Oe(ni,n))}function Ku(t){Ml.current===t&&(ft(ni),ft(Ml)),Wu.current===t&&(ft(Wu),Vl._currentValue=ho)}var zh,D_;function co(t){if(zh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);zh=e&&e[1]||"",D_=-1<n.stack.indexOf(`
|
|
1
|
+
var SyntrologieSDK=(()=>{var TR=Object.create;var Js=Object.defineProperty;var RR=Object.getOwnPropertyDescriptor;var OR=Object.getOwnPropertyNames;var MR=Object.getPrototypeOf,NR=Object.prototype.hasOwnProperty;var J0=t=>{throw TypeError(t)};var DR=(t,e,n)=>e in t?Js(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ei=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),e_=(t,e)=>{for(var n in e)Js(t,n,{get:e[n],enumerable:!0})},t_=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of OR(e))!NR.call(t,r)&&r!==n&&Js(t,r,{get:()=>e[r],enumerable:!(i=RR(e,r))||i.enumerable});return t};var Q=(t,e,n)=>(n=t!=null?TR(MR(t)):{},t_(e||!t||!t.__esModule?Js(n,"default",{value:t,enumerable:!0}):n,t)),LR=t=>t_(Js({},"__esModule",{value:!0}),t);var P=(t,e,n)=>DR(t,typeof e!="symbol"?e+"":e,n),n_=(t,e,n)=>e.has(t)||J0("Cannot "+n);var ge=(t,e,n)=>(n_(t,e,"read from private field"),n?n.call(t):e.get(t)),ur=(t,e,n)=>e.has(t)?J0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ti=(t,e,n,i)=>(n_(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var p_=ei(re=>{"use strict";var Eh=Symbol.for("react.transitional.element"),IR=Symbol.for("react.portal"),HR=Symbol.for("react.fragment"),zR=Symbol.for("react.strict_mode"),BR=Symbol.for("react.profiler"),$R=Symbol.for("react.consumer"),FR=Symbol.for("react.context"),UR=Symbol.for("react.forward_ref"),VR=Symbol.for("react.suspense"),jR=Symbol.for("react.memo"),s_=Symbol.for("react.lazy"),PR=Symbol.for("react.activity"),i_=Symbol.iterator;function qR(t){return t===null||typeof t!="object"?null:(t=i_&&t[i_]||t["@@iterator"],typeof t=="function"?t:null)}var l_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c_=Object.assign,u_={};function fa(t,e,n){this.props=t,this.context=e,this.refs=u_,this.updater=n||l_}fa.prototype.isReactComponent={};fa.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")};fa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function d_(){}d_.prototype=fa.prototype;function Ch(t,e,n){this.props=t,this.context=e,this.refs=u_,this.updater=n||l_}var Ah=Ch.prototype=new d_;Ah.constructor=Ch;c_(Ah,fa.prototype);Ah.isPureReactComponent=!0;var r_=Array.isArray;function wh(){}var De={H:null,A:null,T:null,S:null},f_=Object.prototype.hasOwnProperty;function kh(t,e,n){var i=n.ref;return{$$typeof:Eh,type:t,key:e,ref:i!==void 0?i:null,props:n}}function ZR(t,e){return kh(t.type,e,t.props)}function Th(t){return typeof t=="object"&&t!==null&&t.$$typeof===Eh}function GR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var o_=/\/+/g;function Sh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?GR(""+t.key):e.toString(36)}function YR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(wh,wh):(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 da(t,e,n,i,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Eh:case IR:a=!0;break;case s_:return a=t._init,da(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+Sh(t,0):i,r_(r)?(n="",a!=null&&(n=a.replace(o_,"$&/")+"/"),da(r,e,n,"",function(c){return c})):r!=null&&(Th(r)&&(r=ZR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(o_,"$&/")+"/")+a)),e.push(r)),1;a=0;var s=i===""?".":i+":";if(r_(t))for(var l=0;l<t.length;l++)i=t[l],o=s+Sh(i,l),a+=da(i,e,n,o,r);else if(l=qR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,o=s+Sh(i,l++),a+=da(i,e,n,o,r);else if(o==="object"){if(typeof t.then=="function")return da(YR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function du(t,e,n){if(t==null)return t;var i=[],r=0;return da(t,i,"","",function(o){return e.call(n,o,r++)}),i}function WR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var a_=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)},XR={map:du,forEach:function(t,e,n){du(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return du(t,function(){e++}),e},toArray:function(t){return du(t,function(e){return e})||[]},only:function(t){if(!Th(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};re.Activity=PR;re.Children=XR;re.Component=fa;re.Fragment=HR;re.Profiler=BR;re.PureComponent=Ch;re.StrictMode=zR;re.Suspense=VR;re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=De;re.__COMPILER_RUNTIME={__proto__:null,c:function(t){return De.H.useMemoCache(t)}};re.cache=function(t){return function(){return t.apply(null,arguments)}};re.cacheSignal=function(){return null};re.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=c_({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!f_.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return kh(t.type,r,i)};re.createContext=function(t){return t={$$typeof:FR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:$R,_context:t},t};re.createElement=function(t,e,n){var i,r={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)f_.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return kh(t,o,r)};re.createRef=function(){return{current:null}};re.forwardRef=function(t){return{$$typeof:UR,render:t}};re.isValidElement=Th;re.lazy=function(t){return{$$typeof:s_,_payload:{_status:-1,_result:t},_init:WR}};re.memo=function(t,e){return{$$typeof:jR,type:t,compare:e===void 0?null:e}};re.startTransition=function(t){var e=De.T,n={};De.T=n;try{var i=t(),r=De.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(wh,a_)}catch(o){a_(o)}finally{e!==null&&n.types!==null&&(e.types=n.types),De.T=e}};re.unstable_useCacheRefresh=function(){return De.H.useCacheRefresh()};re.use=function(t){return De.H.use(t)};re.useActionState=function(t,e,n){return De.H.useActionState(t,e,n)};re.useCallback=function(t,e){return De.H.useCallback(t,e)};re.useContext=function(t){return De.H.useContext(t)};re.useDebugValue=function(){};re.useDeferredValue=function(t,e){return De.H.useDeferredValue(t,e)};re.useEffect=function(t,e){return De.H.useEffect(t,e)};re.useEffectEvent=function(t){return De.H.useEffectEvent(t)};re.useId=function(){return De.H.useId()};re.useImperativeHandle=function(t,e,n){return De.H.useImperativeHandle(t,e,n)};re.useInsertionEffect=function(t,e){return De.H.useInsertionEffect(t,e)};re.useLayoutEffect=function(t,e){return De.H.useLayoutEffect(t,e)};re.useMemo=function(t,e){return De.H.useMemo(t,e)};re.useOptimistic=function(t,e){return De.H.useOptimistic(t,e)};re.useReducer=function(t,e,n){return De.H.useReducer(t,e,n)};re.useRef=function(t){return De.H.useRef(t)};re.useState=function(t){return De.H.useState(t)};re.useSyncExternalStore=function(t,e,n){return De.H.useSyncExternalStore(t,e,n)};re.useTransition=function(){return De.H.useTransition()};re.version="19.2.4"});var Ke=ei((UI,h_)=>{"use strict";h_.exports=p_()});var m_=ei(Nt=>{"use strict";var KR=Ke();function g_(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function dr(){}var Mt={d:{f:dr,r:function(){throw Error(g_(522))},D:dr,C:dr,L:dr,m:dr,X:dr,S:dr,M:dr},p:0,findDOMNode:null},QR=Symbol.for("react.portal");function JR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var el=KR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function fu(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Nt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mt;Nt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(g_(299));return JR(t,e,null,n)};Nt.flushSync=function(t){var e=el.T,n=Mt.p;try{if(el.T=null,Mt.p=2,t)return t()}finally{el.T=e,Mt.p=n,Mt.d.f()}};Nt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Mt.d.C(t,e))};Nt.prefetchDNS=function(t){typeof t=="string"&&Mt.d.D(t)};Nt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=fu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Mt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:o}):n==="script"&&Mt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Nt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=fu(e.as,e.crossOrigin);Mt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Mt.d.M(t)};Nt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=fu(n,e.crossOrigin);Mt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Nt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=fu(e.as,e.crossOrigin);Mt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Mt.d.m(t)};Nt.requestFormReset=function(t){Mt.d.r(t)};Nt.unstable_batchedUpdates=function(t,e){return t(e)};Nt.useFormState=function(t,e,n){return el.H.useFormState(t,e,n)};Nt.useFormStatus=function(){return el.H.useHostTransitionStatus()};Nt.version="19.2.4"});var tl=ei((jI,y_)=>{"use strict";function v_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v_)}catch(t){console.error(t)}}v_(),y_.exports=m_()});var T_=ei(ze=>{"use strict";function Nh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<pu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function ni(t){return t.length===0?null:t[0]}function gu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,o=r>>>1;i<o;){var a=2*(i+1)-1,s=t[a],l=a+1,c=t[l];if(0>pu(s,n))l<r&&0>pu(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[a]=n,i=a);else if(l<r&&0>pu(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function pu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(b_=performance,ze.unstable_now=function(){return b_.now()}):(Rh=Date,__=Rh.now(),ze.unstable_now=function(){return Rh.now()-__});var b_,Rh,__,_i=[],fr=[],e2=1,yn=null,At=3,Dh=!1,nl=!1,il=!1,Lh=!1,w_=typeof setTimeout=="function"?setTimeout:null,E_=typeof clearTimeout=="function"?clearTimeout:null,x_=typeof setImmediate<"u"?setImmediate:null;function hu(t){for(var e=ni(fr);e!==null;){if(e.callback===null)gu(fr);else if(e.startTime<=t)gu(fr),e.sortIndex=e.expirationTime,Nh(_i,e);else break;e=ni(fr)}}function Ih(t){if(il=!1,hu(t),!nl)if(ni(_i)!==null)nl=!0,ha||(ha=!0,pa());else{var e=ni(fr);e!==null&&Hh(Ih,e.startTime-t)}}var ha=!1,rl=-1,C_=5,A_=-1;function k_(){return Lh?!0:!(ze.unstable_now()-A_<C_)}function Oh(){if(Lh=!1,ha){var t=ze.unstable_now();A_=t;var e=!0;try{e:{nl=!1,il&&(il=!1,E_(rl),rl=-1),Dh=!0;var n=At;try{t:{for(hu(t),yn=ni(_i);yn!==null&&!(yn.expirationTime>t&&k_());){var i=yn.callback;if(typeof i=="function"){yn.callback=null,At=yn.priorityLevel;var r=i(yn.expirationTime<=t);if(t=ze.unstable_now(),typeof r=="function"){yn.callback=r,hu(t),e=!0;break t}yn===ni(_i)&&gu(_i),hu(t)}else gu(_i);yn=ni(_i)}if(yn!==null)e=!0;else{var o=ni(fr);o!==null&&Hh(Ih,o.startTime-t),e=!1}}break e}finally{yn=null,At=n,Dh=!1}e=void 0}}finally{e?pa():ha=!1}}}var pa;typeof x_=="function"?pa=function(){x_(Oh)}:typeof MessageChannel<"u"?(Mh=new MessageChannel,S_=Mh.port2,Mh.port1.onmessage=Oh,pa=function(){S_.postMessage(null)}):pa=function(){w_(Oh,0)};var Mh,S_;function Hh(t,e){rl=w_(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C_=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return At};ze.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var n=At;At=e;try{return t()}finally{At=n}};ze.unstable_requestPaint=function(){Lh=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=At;At=t;try{return e()}finally{At=n}};ze.unstable_scheduleCallback=function(t,e,n){var i=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:e2++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,Nh(fr,t),ni(_i)===null&&t===ni(fr)&&(il?(E_(rl),rl=-1):il=!0,Hh(Ih,n-i))):(t.sortIndex=r,Nh(_i,t),nl||Dh||(nl=!0,ha||(ha=!0,pa()))),t};ze.unstable_shouldYield=k_;ze.unstable_wrapCallback=function(t){var e=At;return function(){var n=At;At=e;try{return t.apply(this,arguments)}finally{At=n}}}});var O_=ei((qI,R_)=>{"use strict";R_.exports=T_()});var V1=ei(Fd=>{"use strict";var ot=O_(),nS=Ke(),t2=tl();function M(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function iS(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Pl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function rS(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 oS(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 M_(t){if(Pl(t)!==t)throw Error(M(188))}function n2(t){var e=t.alternate;if(!e){if(e=Pl(t),e===null)throw Error(M(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return M_(r),t;if(o===i)return M_(r),e;o=o.sibling}throw Error(M(188))}if(n.return!==i.return)n=r,i=o;else{for(var a=!1,s=r.child;s;){if(s===n){a=!0,n=r,i=o;break}if(s===i){a=!0,i=r,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,i=r;break}if(s===i){a=!0,i=o,n=r;break}s=s.sibling}if(!a)throw Error(M(189))}}if(n.alternate!==i)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?t:e}function aS(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=aS(t),e!==null)return e;t=t.sibling}return null}var He=Object.assign,i2=Symbol.for("react.element"),mu=Symbol.for("react.transitional.element"),fl=Symbol.for("react.portal"),_a=Symbol.for("react.fragment"),sS=Symbol.for("react.strict_mode"),mg=Symbol.for("react.profiler"),lS=Symbol.for("react.consumer"),Ti=Symbol.for("react.context"),dm=Symbol.for("react.forward_ref"),vg=Symbol.for("react.suspense"),yg=Symbol.for("react.suspense_list"),fm=Symbol.for("react.memo"),pr=Symbol.for("react.lazy"),bg=Symbol.for("react.activity"),r2=Symbol.for("react.memo_cache_sentinel"),N_=Symbol.iterator;function ol(t){return t===null||typeof t!="object"?null:(t=N_&&t[N_]||t["@@iterator"],typeof t=="function"?t:null)}var o2=Symbol.for("react.client.reference");function _g(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===o2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _a:return"Fragment";case mg:return"Profiler";case sS:return"StrictMode";case vg:return"Suspense";case yg:return"SuspenseList";case bg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case fl:return"Portal";case Ti:return t.displayName||"Context";case lS:return(t._context.displayName||"Context")+".Consumer";case dm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case fm:return e=t.displayName||null,e!==null?e:_g(t.type)||"Memo";case pr:e=t._payload,t=t._init;try{return _g(t(e))}catch{}}return null}var pl=Array.isArray,ee=nS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=t2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,go={pending:!1,data:null,method:null,action:null},xg=[],xa=-1;function si(t){return{current:t}}function pt(t){0>xa||(t.current=xg[xa],xg[xa]=null,xa--)}function Oe(t,e){xa++,xg[xa]=t.current,t.current=e}var ai=si(null),Ol=si(null),Er=si(null),Wu=si(null);function Xu(t,e){switch(Oe(Er,e),Oe(Ol,t),Oe(ai,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?$x(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=$x(e),t=T1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}pt(ai),Oe(ai,t)}function $a(){pt(ai),pt(Ol),pt(Er)}function Sg(t){t.memoizedState!==null&&Oe(Wu,t);var e=ai.current,n=T1(e,t.type);e!==n&&(Oe(Ol,t),Oe(ai,n))}function Ku(t){Ol.current===t&&(pt(ai),pt(Ol)),Wu.current===t&&(pt(Wu),Ul._currentValue=go)}var zh,D_;function uo(t){if(zh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);zh=e&&e[1]||"",D_=-1<n.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+zh+t+D_}var Bh=!1;function
|
|
3
|
+
`+zh+t+D_}var Bh=!1;function $h(t,e){if(!t||Bh)return"";Bh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(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]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var l=a.split(`
|
|
4
4
|
`),c=s.split(`
|
|
5
5
|
`);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
|
|
6
|
-
`+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{Bh=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?
|
|
6
|
+
`+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{Bh=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?uo(n):""}function a2(t,e){switch(t.tag){case 26:case 27:case 5:return uo(t.type);case 16:return uo("Lazy");case 13:return t.child!==e&&e!==null?uo("Suspense Fallback"):uo("Suspense");case 19:return uo("SuspenseList");case 0:case 15:return $h(t.type,!1);case 11:return $h(t.type.render,!1);case 1:return $h(t.type,!0);case 31:return uo("Activity");default:return""}}function L_(t){try{var e="",n=null;do e+=a2(t,n),n=t,t=t.return;while(t);return e}catch(i){return`
|
|
7
7
|
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}}var wg=Object.prototype.hasOwnProperty,pm=ot.unstable_scheduleCallback,$h=ot.unstable_cancelCallback,s2=ot.unstable_shouldYield,l2=ot.unstable_requestPaint,rn=ot.unstable_now,c2=ot.unstable_getCurrentPriorityLevel,cx=ot.unstable_ImmediatePriority,ux=ot.unstable_UserBlockingPriority,Qu=ot.unstable_NormalPriority,u2=ot.unstable_LowPriority,dx=ot.unstable_IdlePriority,d2=ot.log,f2=ot.unstable_setDisableYieldValue,Zl=null,on=null;function yr(t){if(typeof d2=="function"&&f2(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Zl,t)}catch{}}var an=Math.clz32?Math.clz32:g2,p2=Math.log,h2=Math.LN2;function g2(t){return t>>>=0,t===0?32:31-(p2(t)/h2|0)|0}var vu=256,yu=262144,bu=4194304;function uo(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ed(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,o=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~o,i!==0?r=uo(i):(a&=s,a!==0?r=uo(a):n||(n=s&~t,n!==0&&(r=uo(n))))):(s=i&~o,s!==0?r=uo(s):a!==0?r=uo(a):n||(n=i&~t,n!==0&&(r=uo(n)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,n=e&-e,o>=n||o===32&&(n&4194048)!==0)?e:r}function Gl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function m2(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 fx(){var t=bu;return bu<<=1,(bu&62914560)===0&&(bu=4194304),t}function Uh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Yl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function v2(t,e,n,i,r,o){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-an(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var m=h[u];m!==null&&(m.lane&=-536870913)}n&=~d}i!==0&&px(t,i,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(a&~e))}function px(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function hx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function gx(t,e){var n=e&-e;return n=(n&42)!==0?1:hm(n),(n&(t.suspendedLanes|e))!==0?0:n}function hm(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 gm(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function mx(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:F1(t.type))}function I_(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var Hr=Math.random().toString(36).slice(2),mt="__reactFiber$"+Hr,jt="__reactProps$"+Hr,Ka="__reactContainer$"+Hr,Eg="__reactEvents$"+Hr,y2="__reactListeners$"+Hr,b2="__reactHandles$"+Hr,H_="__reactResources$"+Hr,Wl="__reactMarker$"+Hr;function mm(t){delete t[mt],delete t[jt],delete t[Eg],delete t[y2],delete t[b2]}function wa(t){var e=t[mt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ka]||n[mt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=PS(t);t!==null;){if(n=t[mt])return n;t=PS(t)}return e}t=n,n=t.parentNode}return null}function Qa(t){if(t=t[mt]||t[Ka]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function gl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Da(t){var e=t[H_];return e||(e=t[H_]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function dt(t){t[Wl]=!0}var vx=new Set,yx={};function Eo(t,e){Ua(t,e),Ua(t+"Capture",e)}function Ua(t,e){for(yx[t]=e,t=0;t<e.length;t++)vx.add(e[t])}var _2=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]*$"),z_={},B_={};function S2(t){return wg.call(B_,t)?!0:wg.call(z_,t)?!1:_2.test(t)?B_[t]=!0:(z_[t]=!0,!1)}function Lu(t,e,n){if(S2(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function _u(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function yi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function yn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function bx(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function x2(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,o=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Cg(t){if(!t._valueTracker){var e=bx(t)?"checked":"value";t._valueTracker=x2(t,e,""+t[e])}}function _x(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=bx(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Ju(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 w2=/[\n"\\]/g;function Sn(t){return t.replace(w2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Ag(t,e,n,i,r,o,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+yn(e)):t.value!==""+yn(e)&&(t.value=""+yn(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?Tg(t,a,yn(e)):n!=null?Tg(t,a,yn(n)):i!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+yn(s):t.removeAttribute("name")}function Sx(t,e,n,i,r,o,a,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Cg(t);return}n=n!=null?""+yn(n):"",e=e!=null?""+yn(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),Cg(t)}function Tg(t,e,n){e==="number"&&Ju(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function La(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+yn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function xx(t,e,n){if(e!=null&&(e=""+yn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+yn(n):""}function wx(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(M(92));if(hl(i)){if(1<i.length)throw Error(M(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=yn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),Cg(t)}function Va(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var E2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function F_(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||E2.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Ex(t,e,n){if(e!=null&&typeof e!="object")throw Error(M(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&F_(t,r,i)}else for(var o in e)e.hasOwnProperty(o)&&F_(t,o,e[o])}function vm(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 C2=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"]]),A2=/^[\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 Iu(t){return A2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ai(){}var kg=null;function ym(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ea=null,Ia=null;function $_(t){var e=Qa(t);if(e&&(t=e.stateNode)){var n=t[jt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Ag(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Sn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[jt]||null;if(!r)throw Error(M(90));Ag(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&_x(i)}break e;case"textarea":xx(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&La(t,!!n.multiple,e,!1)}}}var Vh=!1;function Cx(t,e,n){if(Vh)return t(e,n);Vh=!0;try{var i=t(e);return i}finally{if(Vh=!1,(Ea!==null||Ia!==null)&&(Hd(),Ea&&(e=Ea,t=Ia,Ia=Ea=null,$_(e),t)))for(e=0;e<t.length;e++)$_(t[e])}}function Nl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[jt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(M(231,e,typeof n));return n}var Mi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rg=!1;if(Mi)try{ma={},Object.defineProperty(ma,"passive",{get:function(){Rg=!0}}),window.addEventListener("test",ma,ma),window.removeEventListener("test",ma,ma)}catch{Rg=!1}var ma,br=null,bm=null,Hu=null;function Ax(){if(Hu)return Hu;var t,e=bm,n=e.length,i,r="value"in br?br.value:br.textContent,o=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[o-i];i++);return Hu=r.slice(t,1<i?1-i:void 0)}function zu(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 Su(){return!0}function U_(){return!1}function Pt(t){function e(n,i,r,o,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Su:U_,this.isPropagationStopped=U_,this}return He(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Su)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Su)},persist:function(){},isPersistent:Su}),e}var Co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=Pt(Co),Xl=He({},Co,{view:0,detail:0}),T2=Pt(Xl),jh,Ph,sl,Ad=He({},Xl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_m,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!==sl&&(sl&&t.type==="mousemove"?(jh=t.screenX-sl.screenX,Ph=t.screenY-sl.screenY):Ph=jh=0,sl=t),jh)},movementY:function(t){return"movementY"in t?t.movementY:Ph}}),V_=Pt(Ad),k2=He({},Ad,{dataTransfer:0}),R2=Pt(k2),O2=He({},Xl,{relatedTarget:0}),qh=Pt(O2),M2=He({},Co,{animationName:0,elapsedTime:0,pseudoElement:0}),N2=Pt(M2),D2=He({},Co,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),L2=Pt(D2),I2=He({},Co,{data:0}),j_=Pt(I2),H2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},z2={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"},B2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=B2[t])?!!e[t]:!1}function _m(){return F2}var $2=He({},Xl,{key:function(t){if(t.key){var e=H2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?z2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_m,charCode:function(t){return t.type==="keypress"?zu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),U2=Pt($2),V2=He({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P_=Pt(V2),j2=He({},Xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_m}),P2=Pt(j2),q2=He({},Co,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z2=Pt(q2),G2=He({},Ad,{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}),Y2=Pt(G2),W2=He({},Co,{newState:0,oldState:0}),X2=Pt(W2),K2=[9,13,27,32],Sm=Mi&&"CompositionEvent"in window,yl=null;Mi&&"documentMode"in document&&(yl=document.documentMode);var Q2=Mi&&"TextEvent"in window&&!yl,Tx=Mi&&(!Sm||yl&&8<yl&&11>=yl),q_=" ",Z_=!1;function kx(t,e){switch(t){case"keyup":return K2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ca=!1;function J2(t,e){switch(t){case"compositionend":return Rx(e);case"keypress":return e.which!==32?null:(Z_=!0,q_);case"textInput":return t=e.data,t===q_&&Z_?null:t;default:return null}}function eO(t,e){if(Ca)return t==="compositionend"||!Sm&&kx(t,e)?(t=Ax(),Hu=bm=br=null,Ca=!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 Tx&&e.locale!=="ko"?null:e.data;default:return null}}var tO={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 G_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tO[t.type]:e==="textarea"}function Ox(t,e,n,i){Ea?Ia?Ia.push(i):Ia=[i]:Ea=i,e=vd(e,"onChange"),0<e.length&&(n=new Cd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var bl=null,Dl=null;function nO(t){C1(t,0)}function Td(t){var e=gl(t);if(_x(e))return t}function Y_(t,e){if(t==="change")return e}var Mx=!1;Mi&&(Mi?(wu="oninput"in document,wu||(Zh=document.createElement("div"),Zh.setAttribute("oninput","return;"),wu=typeof Zh.oninput=="function"),xu=wu):xu=!1,Mx=xu&&(!document.documentMode||9<document.documentMode));var xu,wu,Zh;function W_(){bl&&(bl.detachEvent("onpropertychange",Nx),Dl=bl=null)}function Nx(t){if(t.propertyName==="value"&&Td(Dl)){var e=[];Ox(e,Dl,t,ym(t)),Cx(nO,e)}}function iO(t,e,n){t==="focusin"?(W_(),bl=e,Dl=n,bl.attachEvent("onpropertychange",Nx)):t==="focusout"&&W_()}function rO(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Td(Dl)}function oO(t,e){if(t==="click")return Td(e)}function aO(t,e){if(t==="input"||t==="change")return Td(e)}function sO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ln=typeof Object.is=="function"?Object.is:sO;function Ll(t,e){if(ln(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!wg.call(e,r)||!ln(t[r],e[r]))return!1}return!0}function X_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function K_(t,e){var n=X_(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=X_(n)}}function Dx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Dx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Lx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ju(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ju(t.document)}return e}function xm(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 lO=Mi&&"documentMode"in document&&11>=document.documentMode,Aa=null,Og=null,_l=null,Mg=!1;function Q_(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mg||Aa==null||Aa!==Ju(i)||(i=Aa,"selectionStart"in i&&xm(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),_l&&Ll(_l,i)||(_l=i,i=vd(Og,"onSelect"),0<i.length&&(e=new Cd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Aa)))}function lo(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ta={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionrun:lo("Transition","TransitionRun"),transitionstart:lo("Transition","TransitionStart"),transitioncancel:lo("Transition","TransitionCancel"),transitionend:lo("Transition","TransitionEnd")},Gh={},Ix={};Mi&&(Ix=document.createElement("div").style,"AnimationEvent"in window||(delete Ta.animationend.animation,delete Ta.animationiteration.animation,delete Ta.animationstart.animation),"TransitionEvent"in window||delete Ta.transitionend.transition);function Ao(t){if(Gh[t])return Gh[t];if(!Ta[t])return t;var e=Ta[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Ix)return Gh[t]=e[n];return t}var Hx=Ao("animationend"),zx=Ao("animationiteration"),Bx=Ao("animationstart"),cO=Ao("transitionrun"),uO=Ao("transitionstart"),dO=Ao("transitioncancel"),Fx=Ao("transitionend"),$x=new Map,Ng="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(" ");Ng.push("scrollEnd");function Fn(t,e){$x.set(t,e),Eo(e,[t])}var ed=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)},vn=[],ka=0,wm=0;function kd(){for(var t=ka,e=wm=ka=0;e<t;){var n=vn[e];vn[e++]=null;var i=vn[e];vn[e++]=null;var r=vn[e];vn[e++]=null;var o=vn[e];if(vn[e++]=null,i!==null&&r!==null){var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}o!==0&&Ux(n,r,o)}}function Rd(t,e,n,i){vn[ka++]=t,vn[ka++]=e,vn[ka++]=n,vn[ka++]=i,wm|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Em(t,e,n,i){return Rd(t,e,n,i),td(t)}function To(t,e){return Rd(t,null,null,e),td(t)}function Ux(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,o=t.return;o!==null;)o.childLanes|=n,i=o.alternate,i!==null&&(i.childLanes|=n),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-an(n),t=o.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),o):null}function td(t){if(50<Rl)throw Rl=0,Jg=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ra={};function fO(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,i){return new fO(t,e,n,i)}function Cm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ki(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function Vx(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Bu(t,e,n,i,r,o){var a=0;if(i=t,typeof t=="function")Cm(t)&&(a=1);else if(typeof t=="string")a=gM(t,n,ni.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case bg:return t=tn(31,n,e,r),t.elementType=bg,t.lanes=o,t;case Sa:return go(n.children,r,o,e);case sx:a=8,r|=24;break;case mg:return t=tn(12,n,e,r|2),t.elementType=mg,t.lanes=o,t;case vg:return t=tn(13,n,e,r),t.elementType=vg,t.lanes=o,t;case yg:return t=tn(19,n,e,r),t.elementType=yg,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ci:a=10;break e;case lx:a=9;break e;case dm:a=11;break e;case fm:a=14;break e;case fr:a=16,i=null;break e}a=29,n=Error(M(130,t===null?"null":typeof t,"")),i=null}return e=tn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function go(t,e,n,i){return t=tn(7,t,i,e),t.lanes=n,t}function Yh(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function jx(t){var e=tn(18,null,null,0);return e.stateNode=t,e}function Wh(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var J_=new WeakMap;function xn(t,e){if(typeof t=="object"&&t!==null){var n=J_.get(t);return n!==void 0?n:(e={value:t,source:e,stack:L_(e)},J_.set(t,e),e)}return{value:t,source:e,stack:L_(e)}}var Oa=[],Ma=0,nd=null,Il=0,bn=[],_n=0,Nr=null,Jn=1,ei="";function wi(t,e){Oa[Ma++]=Il,Oa[Ma++]=nd,nd=t,Il=e}function Px(t,e,n){bn[_n++]=Jn,bn[_n++]=ei,bn[_n++]=Nr,Nr=t;var i=Jn;t=ei;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(e)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Jn=1<<32-an(e)+r|n<<r|i,ei=o+t}else Jn=1<<o|n<<r|i,ei=t}function Am(t){t.return!==null&&(wi(t,1),Px(t,1,0))}function Tm(t){for(;t===nd;)nd=Oa[--Ma],Oa[Ma]=null,Il=Oa[--Ma],Oa[Ma]=null;for(;t===Nr;)Nr=bn[--_n],bn[_n]=null,ei=bn[--_n],bn[_n]=null,Jn=bn[--_n],bn[_n]=null}function qx(t,e){bn[_n++]=Jn,bn[_n++]=ei,bn[_n++]=Nr,Jn=e.id,ei=e.overflow,Nr=t}var vt=null,Ie=null,he=!1,Er=null,wn=!1,Dg=Error(M(519));function Dr(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(xn(e,t)),Dg}function eS(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mt]=t,e[jt]=i,n){case"dialog":le("cancel",e),le("close",e);break;case"iframe":case"object":case"embed":le("load",e);break;case"video":case"audio":for(n=0;n<$l.length;n++)le($l[n],e);break;case"source":le("error",e);break;case"img":case"image":case"link":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"input":le("invalid",e),Sx(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":le("invalid",e);break;case"textarea":le("invalid",e),wx(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||T1(e.textContent,n)?(i.popover!=null&&(le("beforetoggle",e),le("toggle",e)),i.onScroll!=null&&le("scroll",e),i.onScrollEnd!=null&&le("scrollend",e),i.onClick!=null&&(e.onclick=Ai),e=!0):e=!1,e||Dr(t,!0)}function tS(t){for(vt=t.return;vt;)switch(vt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:vt=vt.return}}function va(t){if(t!==vt)return!1;if(!he)return tS(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||rm(t.type,t.memoizedProps)),n=!n),n&&Ie&&Dr(t),tS(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=jS(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=jS(t)}else e===27?(e=Ie,zr(t.type)?(t=lm,lm=null,Ie=t):Ie=e):Ie=vt?Cn(t.stateNode.nextSibling):null;return!0}function bo(){Ie=vt=null,he=!1}function Xh(){var t=Er;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),Er=null),t}function Hl(t){Er===null?Er=[t]:Er.push(t)}var Lg=ii(null),ko=null,Ti=null;function hr(t,e,n){Oe(Lg,e._currentValue),e._currentValue=n}function Ri(t){t._currentValue=Lg.current,ft(Lg)}function Ig(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Hg(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var a=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Ig(o.return,n,t),i||(a=null);break e}o=s.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(M(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ig(a,n,t),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===t){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ja(t,e,n,i){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(M(387));if(a=a.memoizedProps,a!==null){var s=r.type;ln(r.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(r===Wu.current){if(a=r.alternate,a===null)throw Error(M(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Vl):t=[Vl])}r=r.return}t!==null&&Hg(e,t,n,i),e.flags|=262144}function id(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _o(t){ko=t,Ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yt(t){return Zx(ko,t)}function Eu(t,e){return ko===null&&_o(t),Zx(t,e)}function Zx(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ti===null){if(t===null)throw Error(M(308));Ti=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ti=Ti.next=e;return n}var pO=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},hO=ot.unstable_scheduleCallback,gO=ot.unstable_NormalPriority,tt={$$typeof:Ci,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function km(){return{controller:new pO,data:new Map,refCount:0}}function Kl(t){t.refCount--,t.refCount===0&&hO(gO,function(){t.controller.abort()})}var Sl=null,zg=0,ja=0,Ha=null;function mO(t,e){if(Sl===null){var n=Sl=[];zg=0,ja=Jm(),Ha={status:"pending",value:void 0,then:function(i){n.push(i)}}}return zg++,e.then(nS,nS),e}function nS(){if(--zg===0&&Sl!==null){Ha!==null&&(Ha.status="fulfilled");var t=Sl;Sl=null,ja=0,Ha=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function vO(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var iS=Q.S;Q.S=function(t,e){a1=rn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&mO(t,e),iS!==null&&iS(t,e)};var mo=ii(null);function Rm(){var t=mo.current;return t!==null?t:Ae.pooledCache}function Fu(t,e){e===null?Oe(mo,mo.current):Oe(mo,e.pool)}function Gx(){var t=Rm();return t===null?null:{parent:tt._currentValue,pool:t}}var es=Error(M(460)),Om=Error(M(474)),Od=Error(M(542)),rd={then:function(){}};function rS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Yx(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Ai,Ai),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,aS(t),t;default:if(typeof e.status=="string")e.then(Ai,Ai);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(M(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,aS(t),t}throw vo=e,es}}function fo(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(vo=n,es):n}}var vo=null;function oS(){if(vo===null)throw Error(M(459));var t=vo;return vo=null,t}function aS(t){if(t===es||t===Od)throw Error(M(483))}var za=null,zl=0;function Cu(t){var e=zl;return zl+=1,za===null&&(za=[]),Yx(za,t,e)}function ll(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Au(t,e){throw e.$$typeof===i2?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Wx(t){function e(f,p){if(t){var v=f.deletions;v===null?(f.deletions=[p],f.flags|=16):v.push(p)}}function n(f,p){if(!t)return null;for(;p!==null;)e(f,p),p=p.sibling;return null}function i(f){for(var p=new Map;f!==null;)f.key!==null?p.set(f.key,f):p.set(f.index,f),f=f.sibling;return p}function r(f,p){return f=ki(f,p),f.index=0,f.sibling=null,f}function o(f,p,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<p?(f.flags|=67108866,p):v):(f.flags|=67108866,p)):(f.flags|=1048576,p)}function a(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,p,v,y){return p===null||p.tag!==6?(p=Yh(v,f.mode,y),p.return=f,p):(p=r(p,v),p.return=f,p)}function l(f,p,v,y){var w=v.type;return w===Sa?u(f,p,v.props.children,y,v.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===fr&&fo(w)===p.type)?(p=r(p,v.props),ll(p,v),p.return=f,p):(p=Bu(v.type,v.key,v.props,null,f.mode,y),ll(p,v),p.return=f,p)}function c(f,p,v,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=Wh(v,f.mode,y),p.return=f,p):(p=r(p,v.children||[]),p.return=f,p)}function u(f,p,v,y,w){return p===null||p.tag!==7?(p=go(v,f.mode,y,w),p.return=f,p):(p=r(p,v),p.return=f,p)}function d(f,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Yh(""+p,f.mode,v),p.return=f,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case mu:return v=Bu(p.type,p.key,p.props,null,f.mode,v),ll(v,p),v.return=f,v;case pl:return p=Wh(p,f.mode,v),p.return=f,p;case fr:return p=fo(p),d(f,p,v)}if(hl(p)||al(p))return p=go(p,f.mode,v,null),p.return=f,p;if(typeof p.then=="function")return d(f,Cu(p),v);if(p.$$typeof===Ci)return d(f,Eu(f,p),v);Au(f,p)}return null}function h(f,p,v,y){var w=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:s(f,p,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case mu:return v.key===w?l(f,p,v,y):null;case pl:return v.key===w?c(f,p,v,y):null;case fr:return v=fo(v),h(f,p,v,y)}if(hl(v)||al(v))return w!==null?null:u(f,p,v,y,null);if(typeof v.then=="function")return h(f,p,Cu(v),y);if(v.$$typeof===Ci)return h(f,p,Eu(f,v),y);Au(f,v)}return null}function m(f,p,v,y,w){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(p,f,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case mu:return f=f.get(y.key===null?v:y.key)||null,l(p,f,y,w);case pl:return f=f.get(y.key===null?v:y.key)||null,c(p,f,y,w);case fr:return y=fo(y),m(f,p,v,y,w)}if(hl(y)||al(y))return f=f.get(v)||null,u(p,f,y,w,null);if(typeof y.then=="function")return m(f,p,v,Cu(y),w);if(y.$$typeof===Ci)return m(f,p,v,Eu(p,y),w);Au(p,y)}return null}function S(f,p,v,y){for(var w=null,A=null,x=p,T=p=0,k=null;x!==null&&T<v.length;T++){x.index>T?(k=x,x=null):k=x.sibling;var E=h(f,x,v[T],y);if(E===null){x===null&&(x=k);break}t&&x&&E.alternate===null&&e(f,x),p=o(E,p,T),A===null?w=E:A.sibling=E,A=E,x=k}if(T===v.length)return n(f,x),he&&wi(f,T),w;if(x===null){for(;T<v.length;T++)x=d(f,v[T],y),x!==null&&(p=o(x,p,T),A===null?w=x:A.sibling=x,A=x);return he&&wi(f,T),w}for(x=i(x);T<v.length;T++)k=m(x,f,T,v[T],y),k!==null&&(t&&k.alternate!==null&&x.delete(k.key===null?T:k.key),p=o(k,p,T),A===null?w=k:A.sibling=k,A=k);return t&&x.forEach(function(R){return e(f,R)}),he&&wi(f,T),w}function _(f,p,v,y){if(v==null)throw Error(M(151));for(var w=null,A=null,x=p,T=p=0,k=null,E=v.next();x!==null&&!E.done;T++,E=v.next()){x.index>T?(k=x,x=null):k=x.sibling;var R=h(f,x,E.value,y);if(R===null){x===null&&(x=k);break}t&&x&&R.alternate===null&&e(f,x),p=o(R,p,T),A===null?w=R:A.sibling=R,A=R,x=k}if(E.done)return n(f,x),he&&wi(f,T),w;if(x===null){for(;!E.done;T++,E=v.next())E=d(f,E.value,y),E!==null&&(p=o(E,p,T),A===null?w=E:A.sibling=E,A=E);return he&&wi(f,T),w}for(x=i(x);!E.done;T++,E=v.next())E=m(x,f,T,E.value,y),E!==null&&(t&&E.alternate!==null&&x.delete(E.key===null?T:E.key),p=o(E,p,T),A===null?w=E:A.sibling=E,A=E);return t&&x.forEach(function(D){return e(f,D)}),he&&wi(f,T),w}function b(f,p,v,y){if(typeof v=="object"&&v!==null&&v.type===Sa&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case mu:e:{for(var w=v.key;p!==null;){if(p.key===w){if(w=v.type,w===Sa){if(p.tag===7){n(f,p.sibling),y=r(p,v.props.children),y.return=f,f=y;break e}}else if(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===fr&&fo(w)===p.type){n(f,p.sibling),y=r(p,v.props),ll(y,v),y.return=f,f=y;break e}n(f,p);break}else e(f,p);p=p.sibling}v.type===Sa?(y=go(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Bu(v.type,v.key,v.props,null,f.mode,y),ll(y,v),y.return=f,f=y)}return a(f);case pl:e:{for(w=v.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(f,p.sibling),y=r(p,v.children||[]),y.return=f,f=y;break e}else{n(f,p);break}else e(f,p);p=p.sibling}y=Wh(v,f.mode,y),y.return=f,f=y}return a(f);case fr:return v=fo(v),b(f,p,v,y)}if(hl(v))return S(f,p,v,y);if(al(v)){if(w=al(v),typeof w!="function")throw Error(M(150));return v=w.call(v),_(f,p,v,y)}if(typeof v.then=="function")return b(f,p,Cu(v),y);if(v.$$typeof===Ci)return b(f,p,Eu(f,v),y);Au(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(n(f,p.sibling),y=r(p,v),y.return=f,f=y):(n(f,p),y=Yh(v,f.mode,y),y.return=f,f=y),a(f)):n(f,p)}return function(f,p,v,y){try{zl=0;var w=b(f,p,v,y);return za=null,w}catch(x){if(x===es||x===Od)throw x;var A=tn(29,x,null,f.mode);return A.lanes=y,A.return=f,A}}}var So=Wx(!0),Xx=Wx(!1),pr=!1;function Mm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bg(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 Cr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ar(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=td(t),Ux(t,null,n),e}return Rd(t,i,e,n),td(t)}function xl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hx(t,n)}}function Kh(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Fg=!1;function wl(){if(Fg){var t=Ha;if(t!==null)throw t}}function El(t,e,n,i){Fg=!1;var r=t.updateQueue;pr=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;a=0,u=c=l=null,s=o;do{var h=s.lane&-536870913,m=h!==s.lane;if(m?(fe&h)===h:(i&h)===h){h!==0&&h===ja&&(Fg=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,_=s;h=e;var b=n;switch(_.tag){case 1:if(S=_.payload,typeof S=="function"){d=S.call(b,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=_.payload,h=typeof S=="function"?S.call(b,d,h):S,h==null)break e;d=He({},d,h);break e;case 2:pr=!0}}h=s.callback,h!==null&&(t.flags|=64,m&&(t.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=m,l=d):u=u.next=m,a|=h;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;m=s,s=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,o===null&&(r.shared.lanes=0),Ir|=a,t.lanes=a,t.memoizedState=d}}function Kx(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function Qx(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)Kx(n[t],e)}var Pa=ii(null),od=ii(0);function sS(t,e){t=Ii,Oe(od,t),Oe(Pa,e),Ii=t|e.baseLanes}function $g(){Oe(od,Ii),Oe(Pa,Pa.current)}function Nm(){Ii=od.current,ft(Pa),ft(od)}var cn=ii(null),En=null;function gr(t){var e=t.alternate;Oe(Ye,Ye.current&1),Oe(cn,t),En===null&&(e===null||Pa.current!==null||e.memoizedState!==null)&&(En=t)}function Ug(t){Oe(Ye,Ye.current),Oe(cn,t),En===null&&(En=t)}function Jx(t){t.tag===22?(Oe(Ye,Ye.current),Oe(cn,t),En===null&&(En=t)):mr(t)}function mr(){Oe(Ye,Ye.current),Oe(cn,cn.current)}function en(t){ft(cn),En===t&&(En=null),ft(Ye)}var Ye=ii(0);function ad(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||am(n)||sm(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ni=0,re=null,Ee=null,Je=null,sd=!1,Ba=!1,xo=!1,ld=0,Bl=0,Fa=null,yO=0;function Ze(){throw Error(M(321))}function Dm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ln(t[n],e[n]))return!1;return!0}function Lm(t,e,n,i,r,o){return Ni=o,re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q.H=t===null||t.memoizedState===null?Ow:qm,xo=!1,o=n(i,r),xo=!1,Ba&&(o=tw(e,n,i,r)),ew(t),o}function ew(t){Q.H=Fl;var e=Ee!==null&&Ee.next!==null;if(Ni=0,Je=Ee=re=null,sd=!1,Bl=0,Fa=null,e)throw Error(M(300));t===null||nt||(t=t.dependencies,t!==null&&id(t)&&(nt=!0))}function tw(t,e,n,i){re=t;var r=0;do{if(Ba&&(Fa=null),Bl=0,Ba=!1,25<=r)throw Error(M(301));if(r+=1,Je=Ee=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Q.H=Mw,o=e(n,i)}while(Ba);return o}function bO(){var t=Q.H,e=t.useState()[0];return e=typeof e.then=="function"?Ql(e):e,t=t.useState()[0],(Ee!==null?Ee.memoizedState:null)!==t&&(re.flags|=1024),e}function Im(){var t=ld!==0;return ld=0,t}function Hm(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function zm(t){if(sd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}sd=!1}Ni=0,Je=Ee=re=null,Ba=!1,Bl=ld=0,Fa=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?re.memoizedState=Je=t:Je=Je.next=t,Je}function We(){if(Ee===null){var t=re.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Je===null?re.memoizedState:Je.next;if(e!==null)Je=e,Ee=t;else{if(t===null)throw re.alternate===null?Error(M(467)):Error(M(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Je===null?re.memoizedState=Je=t:Je=Je.next=t}return Je}function Md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ql(t){var e=Bl;return Bl+=1,Fa===null&&(Fa=[]),t=Yx(Fa,t,e),e=re,(Je===null?e.memoizedState:Je.next)===null&&(e=e.alternate,Q.H=e===null||e.memoizedState===null?Ow:qm),t}function Nd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ql(t);if(t.$$typeof===Ci)return yt(t)}throw Error(M(438,String(t)))}function Bm(t){var e=null,n=re.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Md(),re.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=r2;return e.index++,n}function Di(t,e){return typeof e=="function"?e(t):e}function $u(t){var e=We();return Fm(e,Ee,t)}function Fm(t,e,n){var i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=n;var r=t.baseQueue,o=i.pending;if(o!==null){if(r!==null){var a=r.next;r.next=o.next,o.next=a}e.baseQueue=r=o,i.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(fe&d)===d:(Ni&d)===d){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===ja&&(u=!0);else if((Ni&h)===h){c=c.next,h===ja&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=o):l=l.next=d,re.lanes|=h,Ir|=h;d=c.action,xo&&n(o,d),o=c.hasEagerState?c.eagerState:n(o,d)}else h={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=h,a=o):l=l.next=h,re.lanes|=d,Ir|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=o:l.next=s,!ln(o,t.memoizedState)&&(nt=!0,u&&(n=Ha,n!==null)))throw n;t.memoizedState=o,t.baseState=a,t.baseQueue=l,i.lastRenderedState=o}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Qh(t){var e=We(),n=e.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,o=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do o=t(o,a.action),a=a.next;while(a!==r);ln(o,e.memoizedState)||(nt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,i]}function nw(t,e,n){var i=re,r=We(),o=he;if(o){if(n===void 0)throw Error(M(407));n=n()}else n=e();var a=!ln((Ee||r).memoizedState,n);if(a&&(r.memoizedState=n,nt=!0),r=r.queue,$m(ow.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Je!==null&&Je.memoizedState.tag&1){if(i.flags|=2048,qa(9,{destroy:void 0},rw.bind(null,i,r,n,e),null),Ae===null)throw Error(M(349));o||(Ni&127)!==0||iw(i,e,n)}return n}function iw(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=re.updateQueue,e===null?(e=Md(),re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function rw(t,e,n,i){e.value=n,e.getSnapshot=i,aw(e)&&sw(t)}function ow(t,e,n){return n(function(){aw(e)&&sw(t)})}function aw(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ln(t,n)}catch{return!0}}function sw(t){var e=To(t,2);e!==null&&Vt(e,t,2)}function Vg(t){var e=Lt();if(typeof t=="function"){var n=t;if(t=n(),xo){yr(!0);try{n()}finally{yr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:t},e}function lw(t,e,n,i){return t.baseState=n,Fm(t,Ee,typeof i=="function"?i:Di)}function _O(t,e,n,i,r){if(Ld(t))throw Error(M(485));if(t=e.action,t!==null){var o={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){o.listeners.push(a)}};Q.T!==null?n(!0):o.isTransition=!1,i(o),n=e.pending,n===null?(o.next=e.pending=o,cw(e,o)):(o.next=n.next,e.pending=n.next=o)}}function cw(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var o=Q.T,a={};Q.T=a;try{var s=n(r,i),l=Q.S;l!==null&&l(a,s),lS(t,e,s)}catch(c){jg(t,e,c)}finally{o!==null&&a.types!==null&&(o.types=a.types),Q.T=o}}else try{o=n(r,i),lS(t,e,o)}catch(c){jg(t,e,c)}}function lS(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){cS(t,e,i)},function(i){return jg(t,e,i)}):cS(t,e,n)}function cS(t,e,n){e.status="fulfilled",e.value=n,uw(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,cw(t,n)))}function jg(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,uw(e),e=e.next;while(e!==i)}t.action=null}function uw(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function dw(t,e){return e}function uS(t,e){if(he){var n=Ae.formState;if(n!==null){e:{var i=re;if(he){if(Ie){t:{for(var r=Ie,o=wn;r.nodeType!==8;){if(!o){r=null;break t}if(r=Cn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ie=Cn(r.nextSibling),i=r.data==="F!";break e}}Dr(i)}i=!1}i&&(e=n[0])}}return n=Lt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dw,lastRenderedState:e},n.queue=i,n=Tw.bind(null,re,i),i.dispatch=n,i=Vg(!1),o=Pm.bind(null,re,!1,i.queue),i=Lt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=_O.bind(null,re,r,o,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function dS(t){var e=We();return fw(e,Ee,t)}function fw(t,e,n){if(e=Fm(t,e,dw)[0],t=$u(Di)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Ql(e)}catch(a){throw a===es?Od:a}else i=e;e=We();var r=e.queue,o=r.dispatch;return n!==e.memoizedState&&(re.flags|=2048,qa(9,{destroy:void 0},SO.bind(null,r,n),null)),[i,o,t]}function SO(t,e){t.action=e}function fS(t){var e=We(),n=Ee;if(n!==null)return fw(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function qa(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=re.updateQueue,e===null&&(e=Md(),re.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function pw(){return We().memoizedState}function Uu(t,e,n,i){var r=Lt();re.flags|=t,r.memoizedState=qa(1|e,{destroy:void 0},n,i===void 0?null:i)}function Dd(t,e,n,i){var r=We();i=i===void 0?null:i;var o=r.memoizedState.inst;Ee!==null&&i!==null&&Dm(i,Ee.memoizedState.deps)?r.memoizedState=qa(e,o,n,i):(re.flags|=t,r.memoizedState=qa(1|e,o,n,i))}function pS(t,e){Uu(8390656,8,t,e)}function $m(t,e){Dd(2048,8,t,e)}function xO(t){re.flags|=4;var e=re.updateQueue;if(e===null)e=Md(),re.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function hw(t){var e=We().memoizedState;return xO({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function gw(t,e){return Dd(4,2,t,e)}function mw(t,e){return Dd(4,4,t,e)}function vw(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function yw(t,e,n){n=n!=null?n.concat([t]):null,Dd(4,4,vw.bind(null,e,t),n)}function Um(){}function bw(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Dm(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function _w(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Dm(e,i[1]))return i[0];if(i=t(),xo){yr(!0);try{t()}finally{yr(!1)}}return n.memoizedState=[i,e],i}function Vm(t,e,n){return n===void 0||(Ni&1073741824)!==0&&(fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=l1(),re.lanes|=t,Ir|=t,n)}function Sw(t,e,n,i){return ln(n,e)?n:Pa.current!==null?(t=Vm(t,n,i),ln(t,e)||(nt=!0),t):(Ni&42)===0||(Ni&1073741824)!==0&&(fe&261930)===0?(nt=!0,t.memoizedState=n):(t=l1(),re.lanes|=t,Ir|=t,e)}function xw(t,e,n,i,r){var o=ye.p;ye.p=o!==0&&8>o?o:8;var a=Q.T,s={};Q.T=s,Pm(t,!1,e,n);try{var l=r(),c=Q.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=vO(l,i);Cl(t,e,u,sn(t))}else Cl(t,e,i,sn(t))}catch(d){Cl(t,e,{then:function(){},status:"rejected",reason:d},sn())}finally{ye.p=o,a!==null&&s.types!==null&&(a.types=s.types),Q.T=a}}function wO(){}function Pg(t,e,n,i){if(t.tag!==5)throw Error(M(476));var r=ww(t).queue;xw(t,r,e,ho,n===null?wO:function(){return Ew(t),n(i)})}function ww(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ho,baseState:ho,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:ho},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ew(t){var e=ww(t);e.next===null&&(e=t.alternate.memoizedState),Cl(t,e.next.queue,{},sn())}function jm(){return yt(Vl)}function Cw(){return We().memoizedState}function Aw(){return We().memoizedState}function EO(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=sn();t=Cr(n);var i=Ar(e,t,n);i!==null&&(Vt(i,e,n),xl(i,e,n)),e={cache:km()},t.payload=e;return}e=e.return}}function CO(t,e,n){var i=sn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ld(t)?kw(e,n):(n=Em(t,e,n,i),n!==null&&(Vt(n,t,i),Rw(n,e,i)))}function Tw(t,e,n){var i=sn();Cl(t,e,n,i)}function Cl(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ld(t))kw(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,ln(s,a))return Rd(t,e,r,0),Ae===null&&kd(),!1}catch{}if(n=Em(t,e,r,i),n!==null)return Vt(n,t,i),Rw(n,e,i),!0}return!1}function Pm(t,e,n,i){if(i={lane:2,revertLane:Jm(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ld(t)){if(e)throw Error(M(479))}else e=Em(t,n,i,2),e!==null&&Vt(e,t,2)}function Ld(t){var e=t.alternate;return t===re||e!==null&&e===re}function kw(t,e){Ba=sd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Rw(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hx(t,n)}}var Fl={readContext:yt,use:Nd,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};Fl.useEffectEvent=Ze;var Ow={readContext:yt,use:Nd,useCallback:function(t,e){return Lt().memoizedState=[t,e===void 0?null:e],t},useContext:yt,useEffect:pS,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Uu(4194308,4,vw.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Uu(4194308,4,t,e)},useInsertionEffect:function(t,e){Uu(4,2,t,e)},useMemo:function(t,e){var n=Lt();e=e===void 0?null:e;var i=t();if(xo){yr(!0);try{t()}finally{yr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Lt();if(n!==void 0){var r=n(e);if(xo){yr(!0);try{n(e)}finally{yr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=CO.bind(null,re,t),[i.memoizedState,t]},useRef:function(t){var e=Lt();return t={current:t},e.memoizedState=t},useState:function(t){t=Vg(t);var e=t.queue,n=Tw.bind(null,re,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Um,useDeferredValue:function(t,e){var n=Lt();return Vm(n,t,e)},useTransition:function(){var t=Vg(!1);return t=xw.bind(null,re,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=re,r=Lt();if(he){if(n===void 0)throw Error(M(407));n=n()}else{if(n=e(),Ae===null)throw Error(M(349));(fe&127)!==0||iw(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,pS(ow.bind(null,i,o,t),[t]),i.flags|=2048,qa(9,{destroy:void 0},rw.bind(null,i,o,n,e),null),n},useId:function(){var t=Lt(),e=Ae.identifierPrefix;if(he){var n=ei,i=Jn;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=ld++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=yO++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:jm,useFormState:uS,useActionState:uS,useOptimistic:function(t){var e=Lt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Pm.bind(null,re,!0,n),n.dispatch=e,[t,e]},useMemoCache:Bm,useCacheRefresh:function(){return Lt().memoizedState=EO.bind(null,re)},useEffectEvent:function(t){var e=Lt(),n={impl:t};return e.memoizedState=n,function(){if((ve&2)!==0)throw Error(M(440));return n.impl.apply(void 0,arguments)}}},qm={readContext:yt,use:Nd,useCallback:bw,useContext:yt,useEffect:$m,useImperativeHandle:yw,useInsertionEffect:gw,useLayoutEffect:mw,useMemo:_w,useReducer:$u,useRef:pw,useState:function(){return $u(Di)},useDebugValue:Um,useDeferredValue:function(t,e){var n=We();return Sw(n,Ee.memoizedState,t,e)},useTransition:function(){var t=$u(Di)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Ql(t),e]},useSyncExternalStore:nw,useId:Cw,useHostTransitionStatus:jm,useFormState:dS,useActionState:dS,useOptimistic:function(t,e){var n=We();return lw(n,Ee,t,e)},useMemoCache:Bm,useCacheRefresh:Aw};qm.useEffectEvent=hw;var Mw={readContext:yt,use:Nd,useCallback:bw,useContext:yt,useEffect:$m,useImperativeHandle:yw,useInsertionEffect:gw,useLayoutEffect:mw,useMemo:_w,useReducer:Qh,useRef:pw,useState:function(){return Qh(Di)},useDebugValue:Um,useDeferredValue:function(t,e){var n=We();return Ee===null?Vm(n,t,e):Sw(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Qh(Di)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Ql(t),e]},useSyncExternalStore:nw,useId:Cw,useHostTransitionStatus:jm,useFormState:fS,useActionState:fS,useOptimistic:function(t,e){var n=We();return Ee!==null?lw(n,Ee,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Bm,useCacheRefresh:Aw};Mw.useEffectEvent=hw;function Jh(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:He({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var qg={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Cr(i);r.payload=e,n!=null&&(r.callback=n),e=Ar(t,r,i),e!==null&&(Vt(e,t,i),xl(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Cr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Ar(t,r,i),e!==null&&(Vt(e,t,i),xl(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),i=Cr(n);i.tag=2,e!=null&&(i.callback=e),e=Ar(t,i,n),e!==null&&(Vt(e,t,n),xl(e,t,n))}};function hS(t,e,n,i,r,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,o,a):e.prototype&&e.prototype.isPureReactComponent?!Ll(n,i)||!Ll(r,o):!0}function gS(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&qg.enqueueReplaceState(e,e.state,null)}function wo(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=He({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function Nw(t){ed(t)}function Dw(t){console.error(t)}function Lw(t){ed(t)}function cd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function mS(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Zg(t,e,n){return n=Cr(n),n.tag=3,n.payload={element:null},n.callback=function(){cd(t,e)},n}function Iw(t){return t=Cr(t),t.tag=3,t}function Hw(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=i.value;t.payload=function(){return r(o)},t.callback=function(){mS(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){mS(e,n,i),typeof r!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function AO(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ja(e,n,r,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return En===null?hd():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===rd?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),ug(t,i,r)),!1;case 22:return n.flags|=65536,i===rd?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),ug(t,i,r)),!1}throw Error(M(435,n.tag))}return ug(t,i,r),hd(),!1}if(he)return e=cn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Dg&&(t=Error(M(422),{cause:i}),Hl(xn(t,n)))):(i!==Dg&&(e=Error(M(423),{cause:i}),Hl(xn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=xn(i,n),r=Zg(t.stateNode,i,r),Kh(t,r),Ge!==4&&(Ge=2)),!1;var o=Error(M(520),{cause:i});if(o=xn(o,n),kl===null?kl=[o]:kl.push(o),Ge!==4&&(Ge=2),e===null)return!0;i=xn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Zg(n.stateNode,i,t),Kh(n,t),!1;case 1:if(e=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Tr===null||!Tr.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Iw(r),Hw(r,t,n,i),Kh(n,r),!1}n=n.return}while(n!==null);return!1}var Zm=Error(M(461)),nt=!1;function gt(t,e,n,i){e.child=t===null?Xx(e,null,n,i):So(e,t.child,n,i)}function vS(t,e,n,i,r){n=n.render;var o=e.ref;if("ref"in i){var a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}else a=i;return _o(e),i=Lm(t,e,n,a,o,r),s=Im(),t!==null&&!nt?(Hm(t,e,r),Li(t,e,r)):(he&&s&&Am(e),e.flags|=1,gt(t,e,i,r),e.child)}function yS(t,e,n,i,r){if(t===null){var o=n.type;return typeof o=="function"&&!Cm(o)&&o.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=o,zw(t,e,o,i,r)):(t=Bu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!Gm(t,r)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ll,n(a,i)&&t.ref===e.ref)return Li(t,e,r)}return e.flags|=1,t=ki(o,i),t.ref=e.ref,t.return=e,e.child=t}function zw(t,e,n,i,r){if(t!==null){var o=t.memoizedProps;if(Ll(o,i)&&t.ref===e.ref)if(nt=!1,e.pendingProps=i=o,Gm(t,r))(t.flags&131072)!==0&&(nt=!0);else return e.lanes=t.lanes,Li(t,e,r)}return Gg(t,e,n,i,r)}function Bw(t,e,n,i){var r=i.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,e.child=null;return bS(t,e,o,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fu(e,o!==null?o.cachePool:null),o!==null?sS(e,o):$g(),Jx(e);else return i=e.lanes=536870912,bS(t,e,o!==null?o.baseLanes|n:n,n,i)}else o!==null?(Fu(e,o.cachePool),sS(e,o),mr(e),e.memoizedState=null):(t!==null&&Fu(e,null),$g(),mr(e));return gt(t,e,r,n),e.child}function ml(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function bS(t,e,n,i,r){var o=Rm();return o=o===null?null:{parent:tt._currentValue,pool:o},e.memoizedState={baseLanes:n,cachePool:o},t!==null&&Fu(e,null),$g(),Jx(e),t!==null&&Ja(t,e,i,!0),e.childLanes=r,null}function Vu(t,e){return e=ud({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function _S(t,e,n){return So(e,t.child,null,n),t=Vu(e,e.pendingProps),t.flags|=2,en(e),e.memoizedState=null,t}function TO(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=Vu(e,i),e.lanes=536870912,ml(null,t);if(Ug(e),(t=Ie)?(t=O1(t,wn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Nr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=jx(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Dr(e);return e.lanes=536870912,null}return Vu(e,i)}var o=t.memoizedState;if(o!==null){var a=o.dehydrated;if(Ug(e),r)if(e.flags&256)e.flags&=-257,e=_S(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(nt||Ja(t,e,n,!1),r=(n&t.childLanes)!==0,nt||r){if(i=Ae,i!==null&&(a=gx(i,n),a!==0&&a!==o.retryLane))throw o.retryLane=a,To(t,a),Vt(i,t,a),Zm;hd(),e=_S(t,e,n)}else t=o.treeContext,Ie=Cn(a.nextSibling),vt=e,he=!0,Er=null,wn=!1,t!==null&&qx(e,t),e=Vu(e,i),e.flags|=4096;return e}return t=ki(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ju(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(M(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Gg(t,e,n,i,r){return _o(e),n=Lm(t,e,n,i,void 0,r),i=Im(),t!==null&&!nt?(Hm(t,e,r),Li(t,e,r)):(he&&i&&Am(e),e.flags|=1,gt(t,e,n,r),e.child)}function SS(t,e,n,i,r,o){return _o(e),e.updateQueue=null,n=tw(e,i,n,r),ew(t),i=Im(),t!==null&&!nt?(Hm(t,e,o),Li(t,e,o)):(he&&i&&Am(e),e.flags|=1,gt(t,e,n,o),e.child)}function xS(t,e,n,i,r){if(_o(e),e.stateNode===null){var o=Ra,a=n.contextType;typeof a=="object"&&a!==null&&(o=yt(a)),o=new n(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=qg,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},Mm(e),a=n.contextType,o.context=typeof a=="object"&&a!==null?yt(a):Ra,o.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Jh(e,n,a,i),o.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(a=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),a!==o.state&&qg.enqueueReplaceState(o,o.state,null),El(e,i,o,r),wl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=wo(n,s);o.props=l;var c=o.context,u=n.contextType;a=Ra,typeof u=="object"&&u!==null&&(a=yt(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||c!==a)&&gS(e,o,i,a),pr=!1;var h=e.memoizedState;o.state=h,El(e,i,o,r),wl(),c=e.memoizedState,s||h!==c||pr?(typeof d=="function"&&(Jh(e,n,d,i),c=e.memoizedState),(l=pr||hS(e,n,l,i,h,c,a))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,Bg(t,e),a=e.memoizedProps,u=wo(n,a),o.props=u,d=e.pendingProps,h=o.context,c=n.contextType,l=Ra,typeof c=="object"&&c!==null&&(l=yt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&gS(e,o,i,l),pr=!1,h=e.memoizedState,o.state=h,El(e,i,o,r),wl();var m=e.memoizedState;a!==d||h!==m||pr||t!==null&&t.dependencies!==null&&id(t.dependencies)?(typeof s=="function"&&(Jh(e,n,s,i),m=e.memoizedState),(u=pr||hS(e,n,u,i,h,m,l)||t!==null&&t.dependencies!==null&&id(t.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=m),o.props=i,o.state=m,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return o=i,ju(t,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&i?(e.child=So(e,t.child,null,r),e.child=So(e,null,n,r)):gt(t,e,n,r),e.memoizedState=o.state,t=e.child):t=Li(t,e,r),t}function wS(t,e,n,i){return bo(),e.flags|=256,gt(t,e,n,i),e.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(t){return{baseLanes:t,cachePool:Gx()}}function ng(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=nn),t}function Fw(t,e,n){var i=e.pendingProps,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(Ye.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?gr(e):mr(e),(t=Ie)?(t=O1(t,wn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Nr!==null?{id:Jn,overflow:ei}:null,retryLane:536870912,hydrationErrors:null},n=jx(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Dr(e);return sm(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(mr(e),r=e.mode,s=ud({mode:"hidden",children:s},r),i=go(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=tg(n),i.childLanes=ng(t,a,n),e.memoizedState=eg,ml(null,i)):(gr(e),Yg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(gr(e),e.flags&=-257,e=ig(t,e,n)):e.memoizedState!==null?(mr(e),e.child=t.child,e.flags|=128,e=null):(mr(e),s=i.fallback,r=e.mode,i=ud({mode:"visible",children:i.children},r),s=go(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,So(e,t.child,null,n),i=e.child,i.memoizedState=tg(n),i.childLanes=ng(t,a,n),e.memoizedState=eg,e=ml(null,i));else if(gr(e),sm(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(M(419)),i.stack="",i.digest=a,Hl({value:i,source:null,stack:null}),e=ig(t,e,n)}else if(nt||Ja(t,e,n,!1),a=(n&t.childLanes)!==0,nt||a){if(a=Ae,a!==null&&(i=gx(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,To(t,i),Vt(a,t,i),Zm;am(s)||hd(),e=ig(t,e,n)}else am(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ie=Cn(s.nextSibling),vt=e,he=!0,Er=null,wn=!1,t!==null&&qx(e,t),e=Yg(e,i.children),e.flags|=4096);return e}return r?(mr(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=ki(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=ki(c,s):(s=go(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,ml(null,i),i=e.child,s=t.child.memoizedState,s===null?s=tg(n):(r=s.cachePool,r!==null?(l=tt._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=Gx(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=ng(t,a,n),e.memoizedState=eg,ml(t.child,i)):(gr(e),n=t.child,t=n.sibling,n=ki(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Yg(t,e){return e=ud({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function ud(t,e){return t=tn(22,t,null,e),t.lanes=0,t}function ig(t,e,n){return So(e,t.child,null,n),t=Yg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ES(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Ig(t.return,e,n)}function rg(t,e,n,i,r,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function $w(t,e,n){var i=e.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=Ye.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,Oe(Ye,a),gt(t,e,i,n),i=he?Il:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ES(t,n,e);else if(t.tag===19)ES(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&ad(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),rg(e,!1,r,n,o,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&ad(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}rg(e,!0,n,null,o,i);break;case"together":rg(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Li(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ir|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ja(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,n=ki(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ki(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Gm(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&id(t)))}function kO(t,e,n){switch(e.tag){case 3:Xu(e,e.stateNode.containerInfo),hr(e,tt,t.memoizedState.cache),bo();break;case 27:case 5:xg(e);break;case 4:Xu(e,e.stateNode.containerInfo);break;case 10:hr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Ug(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(gr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Fw(t,e,n):(gr(e),t=Li(t,e,n),t!==null?t.sibling:null);gr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ja(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return $w(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Oe(Ye,Ye.current),i)break;return null;case 22:return e.lanes=0,Bw(t,e,n,e.pendingProps);case 24:hr(e,tt,t.memoizedState.cache)}return Li(t,e,n)}function Uw(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)nt=!0;else{if(!Gm(t,n)&&(e.flags&128)===0)return nt=!1,kO(t,e,n);nt=(t.flags&131072)!==0}else nt=!1,he&&(e.flags&1048576)!==0&&Px(e,Il,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=fo(e.elementType),e.type=t,typeof t=="function")Cm(t)?(i=wo(t,i),e.tag=1,e=xS(null,e,t,i,n)):(e.tag=0,e=Gg(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===dm){e.tag=11,e=vS(null,e,t,i,n);break e}else if(r===fm){e.tag=14,e=yS(null,e,t,i,n);break e}}throw e=_g(t)||t,Error(M(306,e,""))}}return e;case 0:return Gg(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=wo(i,e.pendingProps),xS(t,e,i,r,n);case 3:e:{if(Xu(e,e.stateNode.containerInfo),t===null)throw Error(M(387));i=e.pendingProps;var o=e.memoizedState;r=o.element,Bg(t,e),El(e,i,null,n);var a=e.memoizedState;if(i=a.cache,hr(e,tt,i),i!==o.cache&&Hg(e,[tt],n,!0),wl(),i=a.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=wS(t,e,i,n);break e}else if(i!==r){r=xn(Error(M(424)),e),Hl(r),e=wS(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ie=Cn(t.firstChild),vt=e,he=!0,Er=null,wn=!0,n=Xx(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bo(),i===r){e=Li(t,e,n);break e}gt(t,e,i,n)}e=e.child}return e;case 26:return ju(t,e),t===null?(n=ZS(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=yd(wr.current).createElement(n),i[mt]=e,i[jt]=t,bt(i,n,t),dt(i),e.stateNode=i):e.memoizedState=ZS(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return xg(e),t===null&&he&&(i=e.stateNode=M1(e.type,e.pendingProps,wr.current),vt=e,wn=!0,r=Ie,zr(e.type)?(lm=r,Ie=Cn(i.firstChild)):Ie=r),gt(t,e,e.pendingProps.children,n),ju(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Ie)&&(i=nM(i,e.type,e.pendingProps,wn),i!==null?(e.stateNode=i,vt=e,Ie=Cn(i.firstChild),wn=!1,r=!0):r=!1),r||Dr(e)),xg(e),r=e.type,o=e.pendingProps,a=t!==null?t.memoizedProps:null,i=o.children,rm(r,o)?i=null:a!==null&&rm(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Lm(t,e,bO,null,null,n),Vl._currentValue=r),ju(t,e),gt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Ie)&&(n=iM(n,e.pendingProps,wn),n!==null?(e.stateNode=n,vt=e,Ie=null,t=!0):t=!1),t||Dr(e)),null;case 13:return Fw(t,e,n);case 4:return Xu(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=So(e,null,i,n):gt(t,e,i,n),e.child;case 11:return vS(t,e,e.type,e.pendingProps,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,hr(e,e.type,i.value),gt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,_o(e),r=yt(r),i=i(r),e.flags|=1,gt(t,e,i,n),e.child;case 14:return yS(t,e,e.type,e.pendingProps,n);case 15:return zw(t,e,e.type,e.pendingProps,n);case 19:return $w(t,e,n);case 31:return TO(t,e,n);case 22:return Bw(t,e,n,e.pendingProps);case 24:return _o(e),i=yt(tt),t===null?(r=Rm(),r===null&&(r=Ae,o=km(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),e.memoizedState={parent:i,cache:r},Mm(e),hr(e,tt,r)):((t.lanes&n)!==0&&(Bg(t,e),El(e,null,null,n),wl()),r=t.memoizedState,o=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),hr(e,tt,i)):(i=o.cache,hr(e,tt,i),i!==r.cache&&Hg(e,[tt],n,!0))),gt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function bi(t){t.flags|=4}function og(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(d1())t.flags|=8192;else throw vo=rd,Om}else t.flags&=-16777217}function CS(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!L1(e))if(d1())t.flags|=8192;else throw vo=rd,Om}function Tu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?fx():536870912,t.lanes|=e,Za|=e)}function cl(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Le(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function RO(t,e,n){var i=e.pendingProps;switch(Tm(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(e),null;case 1:return Le(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Ri(tt),$a(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(va(e)?bi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Xh())),Le(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(bi(e),o!==null?(Le(e),CS(e,o)):(Le(e),og(e,r,null,i,n))):o?o!==t.memoizedState?(bi(e),Le(e),CS(e,o)):(Le(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&bi(e),Le(e),og(e,r,t,i,n)),null;case 27:if(Ku(e),n=wr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&bi(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}t=ni.current,va(e)?eS(e,t):(t=M1(r,i,n),e.stateNode=t,bi(e))}return Le(e),null;case 5:if(Ku(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&bi(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}if(o=ni.current,va(e))eS(e,o);else{var a=yd(wr.current);switch(o){case 1:o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=a.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}o[mt]=e,o[jt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)o.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=o;e:switch(bt(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&bi(e)}}return Le(e),og(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&bi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(M(166));if(t=wr.current,va(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=vt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[mt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||T1(t.nodeValue,n)),t||Dr(e,!0)}else t=yd(t).createTextNode(i),t[mt]=e,e.stateNode=t}return Le(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=va(e),n!==null){if(t===null){if(!i)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),t=!1}else n=Xh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(en(e),e):(en(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Le(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=va(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(M(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(M(317));r[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),r=!1}else r=Xh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(en(e),e):(en(e),null)}return en(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Tu(e,e.updateQueue),Le(e),null);case 4:return $a(),t===null&&ev(e.stateNode.containerInfo),Le(e),null;case 10:return Ri(e.type),Le(e),null;case 19:if(ft(Ye),i=e.memoizedState,i===null)return Le(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)cl(i,!1);else{if(Ge!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=ad(t),o!==null){for(e.flags|=128,cl(i,!1),t=o.updateQueue,e.updateQueue=t,Tu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Vx(n,t),n=n.sibling;return Oe(Ye,Ye.current&1|2),he&&wi(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&rn()>fd&&(e.flags|=128,r=!0,cl(i,!1),e.lanes=4194304)}else{if(!r)if(t=ad(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,Tu(e,t),cl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!he)return Le(e),null}else 2*rn()-i.renderingStartTime>fd&&n!==536870912&&(e.flags|=128,r=!0,cl(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(t=i.last,t!==null?t.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Ye.current,Oe(Ye,r?n&1|2:n&1),he&&wi(e,i.treeForkCount),t):(Le(e),null);case 22:case 23:return en(e),Nm(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Le(e),e.subtreeFlags&6&&(e.flags|=8192)):Le(e),n=e.updateQueue,n!==null&&Tu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ft(mo),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ri(tt),Le(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function OO(t,e){switch(Tm(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ri(tt),$a(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ku(e),null;case 31:if(e.memoizedState!==null){if(en(e),e.alternate===null)throw Error(M(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(en(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ft(Ye),null;case 4:return $a(),null;case 10:return Ri(e.type),null;case 22:case 23:return en(e),Nm(),t!==null&&ft(mo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ri(tt),null;case 25:return null;default:return null}}function Vw(t,e){switch(Tm(e),e.tag){case 3:Ri(tt),$a();break;case 26:case 27:case 5:Ku(e);break;case 4:$a();break;case 31:e.memoizedState!==null&&en(e);break;case 13:en(e);break;case 19:ft(Ye);break;case 10:Ri(e.type);break;case 22:case 23:en(e),Nm(),t!==null&&ft(mo);break;case 24:Ri(tt)}}function Jl(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(s){Se(e,e.return,s)}}function Lr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&t)===t){var a=i.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){Se(r,l,u)}}}i=i.next}while(i!==o)}}catch(u){Se(e,e.return,u)}}function jw(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Qx(e,n)}catch(i){Se(t,t.return,i)}}}function Pw(t,e,n){n.props=wo(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Se(t,e,i)}}function Al(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Se(t,e,r)}}function ti(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Se(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Se(t,e,r)}else n.current=null}function qw(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Se(t,t.return,r)}}function ag(t,e,n){try{var i=t.stateNode;XO(i,t.type,n,e),i[jt]=e}catch(r){Se(t,t.return,r)}}function Zw(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&zr(t.type)||t.tag===4}function sg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zw(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&&zr(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 Wg(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ai));else if(i!==4&&(i===27&&zr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Wg(t,e,n),t=t.sibling;t!==null;)Wg(t,e,n),t=t.sibling}function dd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&zr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(dd(t,e,n),t=t.sibling;t!==null;)dd(t,e,n),t=t.sibling}function Gw(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);bt(e,i,n),e[mt]=t,e[jt]=n}catch(o){Se(t,t.return,o)}}var Ei=!1,et=!1,lg=!1,AS=typeof WeakSet=="function"?WeakSet:Set,ut=null;function MO(t,e){if(t=t.containerInfo,nm=xd,t=Lx(t),xm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var m;d!==n||r!==0&&d.nodeType!==3||(s=a+r),d!==o||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===t)break t;if(h===n&&++c===r&&(s=a),h===o&&++u===i&&(l=a),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(im={focusedElem:t,selectionRange:n},xd=!1,ut=e;ut!==null;)if(e=ut,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ut=t;else for(;ut!==null;){switch(e=ut,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,n=e,r=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var S=wo(n.type,r);t=i.getSnapshotBeforeUpdate(S,o),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){Se(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)om(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":om(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(M(163))}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function Yw(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Si(t,n),i&4&&Jl(5,n);break;case 1:if(Si(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){Se(n,n.return,a)}else{var r=wo(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){Se(n,n.return,a)}}i&64&&jw(n),i&512&&Al(n,n.return);break;case 3:if(Si(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{Qx(t,e)}catch(a){Se(n,n.return,a)}}break;case 27:e===null&&i&4&&Gw(n);case 26:case 5:Si(t,n),e===null&&i&4&&qw(n),i&512&&Al(n,n.return);break;case 12:Si(t,n);break;case 31:Si(t,n),i&4&&Kw(t,n);break;case 13:Si(t,n),i&4&&Qw(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=$O.bind(null,n),rM(t,n))));break;case 22:if(i=n.memoizedState!==null||Ei,!i){e=e!==null&&e.memoizedState!==null||et,r=Ei;var o=et;Ei=i,(et=e)&&!o?xi(t,n,(n.subtreeFlags&8772)!==0):Si(t,n),Ei=r,et=o}break;case 30:break;default:Si(t,n)}}function Ww(t){var e=t.alternate;e!==null&&(t.alternate=null,Ww(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&mm(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Be=null,$t=!1;function _i(t,e,n){for(n=n.child;n!==null;)Xw(t,e,n),n=n.sibling}function Xw(t,e,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Zl,n)}catch{}switch(n.tag){case 26:et||ti(n,e),_i(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:et||ti(n,e);var i=Be,r=$t;zr(n.type)&&(Be=n.stateNode,$t=!1),_i(t,e,n),Ol(n.stateNode),Be=i,$t=r;break;case 5:et||ti(n,e);case 6:if(i=Be,r=$t,Be=null,_i(t,e,n),Be=i,$t=r,Be!==null)if($t)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(o){Se(n,e,o)}else try{Be.removeChild(n.stateNode)}catch(o){Se(n,e,o)}break;case 18:Be!==null&&($t?(t=Be,US(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Xa(t)):US(Be,n.stateNode));break;case 4:i=Be,r=$t,Be=n.stateNode.containerInfo,$t=!0,_i(t,e,n),Be=i,$t=r;break;case 0:case 11:case 14:case 15:Lr(2,n,e),et||Lr(4,n,e),_i(t,e,n);break;case 1:et||(ti(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Pw(n,e,i)),_i(t,e,n);break;case 21:_i(t,e,n);break;case 22:et=(i=et)||n.memoizedState!==null,_i(t,e,n),et=i;break;default:_i(t,e,n)}}function Kw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xa(t)}catch(n){Se(e,e.return,n)}}}function Qw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xa(t)}catch(n){Se(e,e.return,n)}}function NO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new AS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new AS),e;default:throw Error(M(435,t.tag))}}function ku(t,e){var n=NO(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=UO.bind(null,t,i);i.then(r,r)}})}function Bt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(zr(s.type)){Be=s.stateNode,$t=!1;break e}break;case 5:Be=s.stateNode,$t=!1;break e;case 3:case 4:Be=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(Be===null)throw Error(M(160));Xw(o,a,r),Be=null,$t=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Jw(e,t),e=e.sibling}var Bn=null;function Jw(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bt(e,t),Ft(t),i&4&&(Lr(3,t,t.return),Jl(3,t),Lr(5,t,t.return));break;case 1:Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),i&64&&Ei&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Bn;if(Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),i&4){var o=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Wl]||o[mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(i),r.head.insertBefore(o,r.querySelector("head > title"))),bt(o,i,n),o[mt]=t,dt(o),i=o;break e;case"link":var a=YS("link","href",r).get(i+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(o=a[s],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;case"meta":if(a=YS("meta","content",r).get(i+(n.content||""))){for(s=0;s<a.length;s++)if(o=a[s],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;default:throw Error(M(468,i))}o[mt]=t,dt(o),i=o}t.stateNode=i}else WS(r,t.type,t.stateNode);else t.stateNode=GS(r,i,t.memoizedProps);else o!==i?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,i===null?WS(r,t.type,t.stateNode):GS(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&ag(t,t.memoizedProps,n.memoizedProps)}break;case 27:Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),n!==null&&i&4&&ag(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Bt(e,t),Ft(t),i&512&&(et||n===null||ti(n,n.return)),t.flags&32){r=t.stateNode;try{Va(r,"")}catch(S){Se(t,t.return,S)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,ag(t,r,n!==null?n.memoizedProps:r)),i&1024&&(lg=!0);break;case 6:if(Bt(e,t),Ft(t),i&4){if(t.stateNode===null)throw Error(M(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(S){Se(t,t.return,S)}}break;case 3:if(Zu=null,r=Bn,Bn=bd(e.containerInfo),Bt(e,t),Bn=r,Ft(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Xa(e.containerInfo)}catch(S){Se(t,t.return,S)}lg&&(lg=!1,e1(t));break;case 4:i=Bn,Bn=bd(t.stateNode.containerInfo),Bt(e,t),Ft(t),Bn=i;break;case 12:Bt(e,t),Ft(t);break;case 31:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ku(t,i)));break;case 13:Bt(e,t),Ft(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Id=rn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ku(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Ei,u=et;if(Ei=c||r,et=u||l,Bt(e,t),et=u,Ei=c,Ft(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||Ei||et||po(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(o=l.stateNode,r)a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(S){Se(l,l.return,S)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(S){Se(l,l.return,S)}}}else if(e.tag===18){if(n===null){l=e;try{var m=l.stateNode;r?VS(m,!0):VS(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;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,ku(t,n))));break;case 19:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,ku(t,i)));break;case 30:break;case 21:break;default:Bt(e,t),Ft(t)}}function Ft(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(Zw(i)){n=i;break}i=i.return}if(n==null)throw Error(M(160));switch(n.tag){case 27:var r=n.stateNode,o=sg(t);dd(t,o,r);break;case 5:var a=n.stateNode;n.flags&32&&(Va(a,""),n.flags&=-33);var s=sg(t);dd(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=sg(t);Wg(t,c,l);break;default:throw Error(M(161))}}catch(u){Se(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function e1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;e1(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Si(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Yw(t,e.alternate,e),e=e.sibling}function po(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Lr(4,e,e.return),po(e);break;case 1:ti(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Pw(e,e.return,n),po(e);break;case 27:Ol(e.stateNode);case 26:case 5:ti(e,e.return),po(e);break;case 22:e.memoizedState===null&&po(e);break;case 30:po(e);break;default:po(e)}t=t.sibling}}function xi(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,o=e,a=o.flags;switch(o.tag){case 0:case 11:case 15:xi(r,o,n),Jl(4,o);break;case 1:if(xi(r,o,n),i=o,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Se(i,i.return,c)}if(i=o,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)Kx(l[r],s)}catch(c){Se(i,i.return,c)}}n&&a&64&&jw(o),Al(o,o.return);break;case 27:Gw(o);case 26:case 5:xi(r,o,n),n&&i===null&&a&4&&qw(o),Al(o,o.return);break;case 12:xi(r,o,n);break;case 31:xi(r,o,n),n&&a&4&&Kw(r,o);break;case 13:xi(r,o,n),n&&a&4&&Qw(r,o);break;case 22:o.memoizedState===null&&xi(r,o,n),Al(o,o.return);break;case 30:break;default:xi(r,o,n)}e=e.sibling}}function Ym(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Kl(n))}function Wm(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kl(t))}function zn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)t1(t,e,n,i),e=e.sibling}function t1(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:zn(t,e,n,i),r&2048&&Jl(9,e);break;case 1:zn(t,e,n,i);break;case 3:zn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kl(t)));break;case 12:if(r&2048){zn(t,e,n,i),t=e.stateNode;try{var o=e.memoizedProps,a=o.id,s=o.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Se(e,e.return,l)}}else zn(t,e,n,i);break;case 31:zn(t,e,n,i);break;case 13:zn(t,e,n,i);break;case 23:break;case 22:o=e.stateNode,a=e.alternate,e.memoizedState!==null?o._visibility&2?zn(t,e,n,i):Tl(t,e):o._visibility&2?zn(t,e,n,i):(o._visibility|=2,ba(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Ym(a,e);break;case 24:zn(t,e,n,i),r&2048&&Wm(e.alternate,e);break;default:zn(t,e,n,i)}}function ba(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,a=e,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:ba(o,a,s,l,r),Jl(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?ba(o,a,s,l,r):Tl(o,a):(u._visibility|=2,ba(o,a,s,l,r)),r&&c&2048&&Ym(a.alternate,a);break;case 24:ba(o,a,s,l,r),r&&c&2048&&Wm(a.alternate,a);break;default:ba(o,a,s,l,r)}e=e.sibling}}function Tl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Tl(n,i),r&2048&&Ym(i.alternate,i);break;case 24:Tl(n,i),r&2048&&Wm(i.alternate,i);break;default:Tl(n,i)}e=e.sibling}}var vl=8192;function ya(t,e,n){if(t.subtreeFlags&vl)for(t=t.child;t!==null;)n1(t,e,n),t=t.sibling}function n1(t,e,n){switch(t.tag){case 26:ya(t,e,n),t.flags&vl&&t.memoizedState!==null&&mM(n,Bn,t.memoizedState,t.memoizedProps);break;case 5:ya(t,e,n);break;case 3:case 4:var i=Bn;Bn=bd(t.stateNode.containerInfo),ya(t,e,n),Bn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=vl,vl=16777216,ya(t,e,n),vl=i):ya(t,e,n));break;default:ya(t,e,n)}}function i1(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 ul(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,o1(i,t)}i1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)r1(t),t=t.sibling}function r1(t){switch(t.tag){case 0:case 11:case 15:ul(t),t.flags&2048&&Lr(9,t,t.return);break;case 3:ul(t);break;case 12:ul(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Pu(t)):ul(t);break;default:ul(t)}}function Pu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,o1(i,t)}i1(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Lr(8,e,e.return),Pu(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Pu(e));break;default:Pu(e)}t=t.sibling}}function o1(t,e){for(;ut!==null;){var n=ut;switch(n.tag){case 0:case 11:case 15:Lr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Kl(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ut=i;else e:for(n=t;ut!==null;){i=ut;var r=i.sibling,o=i.return;if(Ww(i),i===n){ut=null;break e}if(r!==null){r.return=o,ut=r;break e}ut=o}}}var DO={getCacheForType:function(t){var e=yt(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return yt(tt).controller.signal}},LO=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ae=null,ce=null,fe=0,_e=0,Jt=null,_r=!1,ts=!1,Xm=!1,Ii=0,Ge=0,Ir=0,yo=0,Km=0,nn=0,Za=0,kl=null,Ut=null,Xg=!1,Id=0,a1=0,fd=1/0,pd=null,Tr=null,rt=0,kr=null,Ga=null,Oi=0,Kg=0,Qg=null,s1=null,Rl=0,Jg=null;function sn(){return(ve&2)!==0&&fe!==0?fe&-fe:Q.T!==null?Jm():mx()}function l1(){if(nn===0)if((fe&536870912)===0||he){var t=yu;yu<<=1,(yu&3932160)===0&&(yu=262144),nn=t}else nn=536870912;return t=cn.current,t!==null&&(t.flags|=32),nn}function Vt(t,e,n){(t===Ae&&(_e===2||_e===9)||t.cancelPendingCommit!==null)&&(Ya(t,0),Sr(t,fe,nn,!1)),Yl(t,n),((ve&2)===0||t!==Ae)&&(t===Ae&&((ve&2)===0&&(yo|=n),Ge===4&&Sr(t,fe,nn,!1)),ri(t))}function c1(t,e,n){if((ve&6)!==0)throw Error(M(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Gl(t,e),r=i?zO(t,e):cg(t,e,!0),o=i;do{if(r===0){ts&&!i&&Sr(t,e,0,!1);break}else{if(n=t.current.alternate,o&&!IO(n)){r=cg(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var s=t;r=kl;var l=s.current.memoizedState.isDehydrated;if(l&&(Ya(s,a).flags|=256),a=cg(s,a,!1),a!==2){if(Xm&&!l){s.errorRecoveryDisabledLanes|=o,yo|=o,r=4;break e}o=Ut,Ut=r,o!==null&&(Ut===null?Ut=o:Ut.push.apply(Ut,o))}r=a}if(o=!1,r!==2)continue}}if(r===1){Ya(t,0),Sr(t,e,0,!0);break}e:{switch(i=t,o=r,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:Sr(i,e,nn,!_r);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(r=Id+300-rn(),10<r)){if(Sr(i,e,nn,!_r),Ed(i,0,!0)!==0)break e;Oi=e,i.timeoutHandle=R1(TS.bind(null,i,n,Ut,pd,Xg,e,nn,yo,Za,_r,o,"Throttled",-0,0),r);break e}TS(i,n,Ut,pd,Xg,e,nn,yo,Za,_r,o,null,-0,0)}}break}while(!0);ri(t)}function TS(t,e,n,i,r,o,a,s,l,c,u,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:Ai},n1(e,o,d);var S=(o&62914560)===o?Id-rn():(o&4194048)===o?a1-rn():0;if(S=vM(d,S),S!==null){Oi=o,t.cancelPendingCommit=S(RS.bind(null,t,e,o,n,i,r,a,s,l,u,d,null,h,m)),Sr(t,o,a,!c);return}}RS(t,e,o,n,i,r,a,s,l)}function IO(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ln(o(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Sr(t,e,n,i){e&=~Km,e&=~yo,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var o=31-an(r),a=1<<o;i[o]=-1,r&=~a}n!==0&&px(t,n,e)}function Hd(){return(ve&6)===0?(ec(0,!1),!1):!0}function Qm(){if(ce!==null){if(_e===0)var t=ce.return;else t=ce,Ti=ko=null,zm(t),za=null,zl=0,t=ce;for(;t!==null;)Vw(t.alternate,t),t=t.return;ce=null}}function Ya(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,JO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Oi=0,Qm(),Ae=t,ce=n=ki(t.current,null),fe=e,_e=0,Jt=null,_r=!1,ts=Gl(t,e),Xm=!1,Za=nn=Km=yo=Ir=Ge=0,Ut=kl=null,Xg=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),o=1<<r;e|=t[r],i&=~o}return Ii=e,kd(),n}function u1(t,e){re=null,Q.H=Fl,e===es||e===Od?(e=oS(),_e=3):e===Om?(e=oS(),_e=4):_e=e===Zm?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Jt=e,ce===null&&(Ge=1,cd(t,xn(e,t.current)))}function d1(){var t=cn.current;return t===null?!0:(fe&4194048)===fe?En===null:(fe&62914560)===fe||(fe&536870912)!==0?t===En:!1}function f1(){var t=Q.H;return Q.H=Fl,t===null?Fl:t}function p1(){var t=Q.A;return Q.A=DO,t}function hd(){Ge=4,_r||(fe&4194048)!==fe&&cn.current!==null||(ts=!0),(Ir&134217727)===0&&(yo&134217727)===0||Ae===null||Sr(Ae,fe,nn,!1)}function cg(t,e,n){var i=ve;ve|=2;var r=f1(),o=p1();(Ae!==t||fe!==e)&&(pd=null,Ya(t,e)),e=!1;var a=Ge;e:do try{if(_e!==0&&ce!==null){var s=ce,l=Jt;switch(_e){case 8:Qm(),a=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(e=!0);var c=_e;if(_e=0,Jt=null,Na(t,s,l,c),n&&ts){a=0;break e}break;default:c=_e,_e=0,Jt=null,Na(t,s,l,c)}}HO(),a=Ge;break}catch(u){u1(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ti=ko=null,ve=i,Q.H=r,Q.A=o,ce===null&&(Ae=null,fe=0,kd()),a}function HO(){for(;ce!==null;)h1(ce)}function zO(t,e){var n=ve;ve|=2;var i=f1(),r=p1();Ae!==t||fe!==e?(pd=null,fd=rn()+500,Ya(t,e)):ts=Gl(t,e);e:do try{if(_e!==0&&ce!==null){e=ce;var o=Jt;t:switch(_e){case 1:_e=0,Jt=null,Na(t,e,o,1);break;case 2:case 9:if(rS(o)){_e=0,Jt=null,kS(e);break}e=function(){_e!==2&&_e!==9||Ae!==t||(_e=7),ri(t)},o.then(e,e);break e;case 3:_e=7;break e;case 4:_e=5;break e;case 7:rS(o)?(_e=0,Jt=null,kS(e)):(_e=0,Jt=null,Na(t,e,o,7));break;case 5:var a=null;switch(ce.tag){case 26:a=ce.memoizedState;case 5:case 27:var s=ce;if(a?L1(a):s.stateNode.complete){_e=0,Jt=null;var l=s.sibling;if(l!==null)ce=l;else{var c=s.return;c!==null?(ce=c,zd(c)):ce=null}break t}}_e=0,Jt=null,Na(t,e,o,5);break;case 6:_e=0,Jt=null,Na(t,e,o,6);break;case 8:Qm(),Ge=6;break e;default:throw Error(M(462))}}BO();break}catch(u){u1(t,u)}while(!0);return Ti=ko=null,Q.H=i,Q.A=r,ve=n,ce!==null?0:(Ae=null,fe=0,kd(),Ge)}function BO(){for(;ce!==null&&!s2();)h1(ce)}function h1(t){var e=Uw(t.alternate,t,Ii);t.memoizedProps=t.pendingProps,e===null?zd(t):ce=e}function kS(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=SS(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=SS(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:zm(e);default:Vw(n,e),e=ce=Vx(e,Ii),e=Uw(n,e,Ii)}t.memoizedProps=t.pendingProps,e===null?zd(t):ce=e}function Na(t,e,n,i){Ti=ko=null,zm(e),za=null,zl=0;var r=e.return;try{if(AO(t,r,e,n,fe)){Ge=1,cd(t,xn(n,t.current)),ce=null;return}}catch(o){if(r!==null)throw ce=r,o;Ge=1,cd(t,xn(n,t.current)),ce=null;return}e.flags&32768?(he||i===1?t=!0:ts||(fe&536870912)!==0?t=!1:(_r=t=!0,(i===2||i===9||i===3||i===6)&&(i=cn.current,i!==null&&i.tag===13&&(i.flags|=16384))),g1(e,t)):zd(e)}function zd(t){var e=t;do{if((e.flags&32768)!==0){g1(e,_r);return}t=e.return;var n=RO(e.alternate,e,Ii);if(n!==null){ce=n;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ge===0&&(Ge=5)}function g1(t,e){do{var n=OO(t.alternate,t);if(n!==null){n.flags&=32767,ce=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=n}while(t!==null);Ge=6,ce=null}function RS(t,e,n,i,r,o,a,s,l){t.cancelPendingCommit=null;do Bd();while(rt!==0);if((ve&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=wm,v2(t,n,o,a,s,l),t===Ae&&(ce=Ae=null,fe=0),Ga=e,kr=t,Oi=n,Kg=o,Qg=r,s1=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,VO(Qu,function(){return _1(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,r=ye.p,ye.p=2,a=ve,ve|=4;try{MO(t,e,n)}finally{ve=a,ye.p=r,Q.T=i}}rt=1,m1(),v1(),y1()}}function m1(){if(rt===1){rt=0;var t=kr,e=Ga,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Jw(e,t);var o=im,a=Lx(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&Dx(s.ownerDocument.documentElement,s)){if(l!==null&&xm(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),S=s.textContent.length,_=Math.min(l.start,S),b=l.end===void 0?_:Math.min(l.end,S);!m.extend&&_>b&&(a=b,b=_,_=a);var f=K_(s,_),p=K_(s,b);if(f&&p&&(m.rangeCount!==1||m.anchorNode!==f.node||m.anchorOffset!==f.offset||m.focusNode!==p.node||m.focusOffset!==p.offset)){var v=d.createRange();v.setStart(f.node,f.offset),m.removeAllRanges(),_>b?(m.addRange(v),m.extend(p.node,p.offset)):(v.setEnd(p.node,p.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=!!nm,im=nm=null}finally{ve=r,ye.p=i,Q.T=n}}t.current=e,rt=2}}function v1(){if(rt===2){rt=0;var t=kr,e=Ga,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Yw(t,e.alternate,e)}finally{ve=r,ye.p=i,Q.T=n}}rt=3}}function y1(){if(rt===4||rt===3){rt=0,l2();var t=kr,e=Ga,n=Oi,i=s1;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?rt=5:(rt=0,Ga=kr=null,b1(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Tr=null),gm(n),e=e.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Zl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Q.T,r=ye.p,ye.p=2,Q.T=null;try{for(var o=t.onRecoverableError,a=0;a<i.length;a++){var s=i[a];o(s.value,{componentStack:s.stack})}}finally{Q.T=e,ye.p=r}}(Oi&3)!==0&&Bd(),ri(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Jg?Rl++:(Rl=0,Jg=t):Rl=0,ec(0,!1)}}function b1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Kl(e)))}function Bd(){return m1(),v1(),y1(),_1()}function _1(){if(rt!==5)return!1;var t=kr,e=Kg;Kg=0;var n=gm(Oi),i=Q.T,r=ye.p;try{ye.p=32>n?32:n,Q.T=null,n=Qg,Qg=null;var o=kr,a=Oi;if(rt=0,Ga=kr=null,Oi=0,(ve&6)!==0)throw Error(M(331));var s=ve;if(ve|=4,r1(o.current),t1(o,o.current,a,n),ve=s,ec(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Zl,o)}catch{}return!0}finally{ye.p=r,Q.T=i,b1(t,e)}}function OS(t,e,n){e=xn(n,e),e=Zg(t.stateNode,e,2),t=Ar(t,e,2),t!==null&&(Yl(t,2),ri(t))}function Se(t,e,n){if(t.tag===3)OS(t,t,n);else for(;e!==null;){if(e.tag===3){OS(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Tr===null||!Tr.has(i))){t=xn(n,t),n=Iw(2),i=Ar(e,n,2),i!==null&&(Hw(n,i,e,t),Yl(i,2),ri(i));break}}e=e.return}}function ug(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new LO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Xm=!0,r.add(n),t=FO.bind(null,t,e,n),e.then(t,t))}function FO(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(fe&n)===n&&(Ge===4||Ge===3&&(fe&62914560)===fe&&300>rn()-Id?(ve&2)===0&&Ya(t,0):Km|=n,Za===fe&&(Za=0)),ri(t)}function S1(t,e){e===0&&(e=fx()),t=To(t,e),t!==null&&(Yl(t,e),ri(t))}function $O(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),S1(t,n)}function UO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(M(314))}i!==null&&i.delete(e),S1(t,n)}function VO(t,e){return pm(t,e)}var gd=null,_a=null,em=!1,md=!1,dg=!1,xr=0;function ri(t){t!==_a&&t.next===null&&(_a===null?gd=_a=t:_a=_a.next=t),md=!0,em||(em=!0,PO())}function ec(t,e){if(!dg&&md){dg=!0;do for(var n=!1,i=gd;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-an(42|t)+1)-1,o&=r&~(a&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,MS(i,o))}else o=fe,o=Ed(i,i===Ae?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Gl(i,o)||(n=!0,MS(i,o));i=i.next}while(n);dg=!1}}function jO(){x1()}function x1(){md=em=!1;var t=0;xr!==0&&QO()&&(t=xr);for(var e=rn(),n=null,i=gd;i!==null;){var r=i.next,o=w1(i,e);o===0?(i.next=null,n===null?gd=r:n.next=r,r===null&&(_a=n)):(n=i,(t!==0||(o&3)!==0)&&(md=!0)),i=r}rt!==0&&rt!==5||ec(t,!1),xr!==0&&(xr=0)}function w1(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var a=31-an(o),s=1<<a,l=r[a];l===-1?((s&n)===0||(s&i)!==0)&&(r[a]=m2(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,n=fe,n=Ed(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(_e===2||_e===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&$h(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Gl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&$h(i),gm(n)){case 2:case 8:n=ux;break;case 32:n=Qu;break;case 268435456:n=dx;break;default:n=Qu}return i=E1.bind(null,t),n=pm(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&$h(i),t.callbackPriority=2,t.callbackNode=null,2}function E1(t,e){if(rt!==0&&rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Bd()&&t.callbackNode!==n)return null;var i=fe;return i=Ed(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(c1(t,i,e),w1(t,rn()),t.callbackNode!=null&&t.callbackNode===n?E1.bind(null,t):null)}function MS(t,e){if(Bd())return null;c1(t,e,!0)}function PO(){eM(function(){(ve&6)!==0?pm(cx,jO):x1()})}function Jm(){if(xr===0){var t=ja;t===0&&(t=vu,vu<<=1,(vu&261888)===0&&(vu=256)),xr=t}return xr}function NS(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Iu(""+t)}function DS(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function qO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var o=NS((r[jt]||null).action),a=i.submitter;a&&(e=(e=a[jt]||null)?NS(e.formAction):a.getAttribute("formAction"),e!==null&&(o=e,a=null));var s=new Cd("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(xr!==0){var l=a?DS(r,a):new FormData(r);Pg(n,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=a?DS(r,a):new FormData(r),Pg(n,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(Ru=0;Ru<Ng.length;Ru++)Ou=Ng[Ru],LS=Ou.toLowerCase(),IS=Ou[0].toUpperCase()+Ou.slice(1),Fn(LS,"on"+IS);var Ou,LS,IS,Ru;Fn(Hx,"onAnimationEnd");Fn(zx,"onAnimationIteration");Fn(Bx,"onAnimationStart");Fn("dblclick","onDoubleClick");Fn("focusin","onFocus");Fn("focusout","onBlur");Fn(cO,"onTransitionRun");Fn(uO,"onTransitionStart");Fn(dO,"onTransitionCancel");Fn(Fx,"onTransitionEnd");Ua("onMouseEnter",["mouseout","mouseover"]);Ua("onMouseLeave",["mouseout","mouseover"]);Ua("onPointerEnter",["pointerout","pointerover"]);Ua("onPointerLeave",["pointerout","pointerover"]);Eo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Eo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Eo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Eo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $l="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(" "),ZO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($l));function C1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){ed(u)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(s=i[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){ed(u)}r.currentTarget=null,o=l}}}}function le(t,e){var n=e[Eg];n===void 0&&(n=e[Eg]=new Set);var i=t+"__bubble";n.has(i)||(A1(e,t,2,!1),n.add(i))}function fg(t,e,n){var i=0;e&&(i|=4),A1(n,t,i,e)}var Mu="_reactListening"+Math.random().toString(36).slice(2);function ev(t){if(!t[Mu]){t[Mu]=!0,vx.forEach(function(n){n!=="selectionchange"&&(ZO.has(n)||fg(n,!1,t),fg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mu]||(e[Mu]=!0,fg("selectionchange",!1,e))}}function A1(t,e,n,i){switch(F1(e)){case 2:var r=_M;break;case 8:r=SM;break;default:r=rv}n=r.bind(null,e,n,t),r=void 0,!Rg||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function pg(t,e,n,i,r){var o=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var s=i.stateNode.containerInfo;if(s===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;s!==null;){if(a=wa(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=o=a;continue e}s=s.parentNode}}i=i.return}Cx(function(){var c=o,u=ym(n),d=[];e:{var h=$x.get(t);if(h!==void 0){var m=Cd,S=t;switch(t){case"keypress":if(zu(n)===0)break e;case"keydown":case"keyup":m=U2;break;case"focusin":S="focus",m=qh;break;case"focusout":S="blur",m=qh;break;case"beforeblur":case"afterblur":m=qh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=V_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=R2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=P2;break;case Hx:case zx:case Bx:m=N2;break;case Fx:m=Z2;break;case"scroll":case"scrollend":m=T2;break;case"wheel":m=Y2;break;case"copy":case"cut":case"paste":m=L2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=P_;break;case"toggle":case"beforetoggle":m=X2}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),f=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,v;p!==null;){var y=p;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=Nl(p,f),y!=null&&_.push(Ul(p,y,v))),b)break;p=p.return}0<_.length&&(h=new m(h,S,null,n,u),d.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&n!==kg&&(S=n.relatedTarget||n.fromElement)&&(wa(S)||S[Ka]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(S=n.relatedTarget||n.toElement,m=c,S=S?wa(S):null,S!==null&&(b=ql(S),_=S.tag,S!==b||_!==5&&_!==27&&_!==6)&&(S=null)):(m=null,S=c),m!==S)){if(_=V_,y="onMouseLeave",f="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=P_,y="onPointerLeave",f="onPointerEnter",p="pointer"),b=m==null?h:gl(m),v=S==null?h:gl(S),h=new _(y,p+"leave",m,n,u),h.target=b,h.relatedTarget=v,y=null,wa(u)===c&&(_=new _(f,p+"enter",S,n,u),_.target=v,_.relatedTarget=b,y=_),b=y,m&&S)t:{for(_=GO,f=m,p=S,v=0,y=f;y;y=_(y))v++;y=0;for(var w=p;w;w=_(w))y++;for(;0<v-y;)f=_(f),v--;for(;0<y-v;)p=_(p),y--;for(;v--;){if(f===p||p!==null&&f===p.alternate){_=f;break t}f=_(f),p=_(p)}_=null}else _=null;m!==null&&HS(d,h,m,_,!1),S!==null&&b!==null&&HS(d,b,S,_,!0)}}e:{if(h=c?gl(c):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var A=Y_;else if(G_(h))if(Mx)A=aO;else{A=rO;var x=iO}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&vm(c.elementType)&&(A=Y_):A=oO;if(A&&(A=A(t,c))){Ox(d,A,n,u);break e}x&&x(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&Tg(h,"number",h.value)}switch(x=c?gl(c):window,t){case"focusin":(G_(x)||x.contentEditable==="true")&&(Aa=x,Og=c,_l=null);break;case"focusout":_l=Og=Aa=null;break;case"mousedown":Mg=!0;break;case"contextmenu":case"mouseup":case"dragend":Mg=!1,Q_(d,n,u);break;case"selectionchange":if(lO)break;case"keydown":case"keyup":Q_(d,n,u)}var T;if(Sm)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 Ca?kx(t,n)&&(k="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Tx&&n.locale!=="ko"&&(Ca||k!=="onCompositionStart"?k==="onCompositionEnd"&&Ca&&(T=Ax()):(br=u,bm="value"in br?br.value:br.textContent,Ca=!0)),x=vd(c,k),0<x.length&&(k=new j_(k,t,null,n,u),d.push({event:k,listeners:x}),T?k.data=T:(T=Rx(n),T!==null&&(k.data=T)))),(T=Q2?J2(t,n):eO(t,n))&&(k=vd(c,"onBeforeInput"),0<k.length&&(x=new j_("onBeforeInput","beforeinput",null,n,u),d.push({event:x,listeners:k}),x.data=T)),qO(d,t,c,n,u)}C1(d,e)})}function Ul(t,e,n){return{instance:t,listener:e,currentTarget:n}}function vd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Nl(t,n),r!=null&&i.unshift(Ul(t,r,o)),r=Nl(t,e),r!=null&&i.push(Ul(t,r,o))),t.tag===3)return i;t=t.return}return[]}function GO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function HS(t,e,n,i,r){for(var o=e._reactName,a=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=Nl(n,o),c!=null&&a.unshift(Ul(n,c,l))):r||(c=Nl(n,o),c!=null&&a.push(Ul(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var YO=/\r\n?/g,WO=/\u0000|\uFFFD/g;function zS(t){return(typeof t=="string"?t:""+t).replace(YO,`
|
|
9
|
-
`).replace(WO,"")}function T1(t,e){return e=zS(e),zS(t)===e}function we(t,e,n,i,r,o){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Va(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Va(t,""+i);break;case"className":_u(t,"class",i);break;case"tabIndex":_u(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":_u(t,n,i);break;case"style":Ex(t,i,o);break;case"data":if(e!=="object"){_u(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Iu(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Iu(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Ai);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Iu(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":le("beforetoggle",t),le("toggle",t),Lu(t,"popover",i);break;case"xlinkActuate":yi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":yi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":yi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":yi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":yi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":yi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":yi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":yi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":yi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Lu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=C2.get(n)||n,Lu(t,n,i))}}function tm(t,e,n,i,r,o){switch(n){case"style":Ex(t,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Va(t,i):(typeof i=="number"||typeof i=="bigint")&&Va(t,""+i);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yx.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),o=t[jt]||null,o=o!=null?o[n]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof i=="function")){typeof o!="function"&&o!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Lu(t,n,i)}}}function bt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",t),le("load",t);var i=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];if(a!=null)switch(o){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,o,a,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":le("invalid",t);var s=o=a=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(M(137,e));break;default:we(t,e,i,u,n,null)}}Sx(t,o,s,l,c,a,r,!1);return;case"select":le("invalid",t),i=a=o=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":a=s;break;case"multiple":i=s;default:we(t,e,r,s,n,null)}e=o,n=a,t.multiple=!!i,e!=null?La(t,!!i,e,!1):n!=null&&La(t,!!i,n,!0);return;case"textarea":le("invalid",t),o=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(M(91));break;default:we(t,e,a,s,n,null)}wx(t,i,r,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,l,i,n,null));return;case"dialog":le("beforetoggle",t),le("toggle",t),le("cancel",t),le("close",t);break;case"iframe":case"object":le("load",t);break;case"video":case"audio":for(i=0;i<$l.length;i++)le($l[i],t);break;case"image":le("error",t),le("load",t);break;case"details":le("toggle",t);break;case"embed":case"source":case"link":le("error",t),le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,c,i,n,null)}return;default:if(vm(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&tm(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&we(t,e,s,i,n,null))}function XO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,a=null,s=null,l=null,c=null,u=null;for(m in n){var d=n[m];if(n.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(m)||we(t,e,m,null,i,d)}}for(var h in i){var m=i[h];if(d=n[h],i.hasOwnProperty(h)&&(m!=null||d!=null))switch(h){case"type":o=m;break;case"name":r=m;break;case"checked":c=m;break;case"defaultChecked":u=m;break;case"value":a=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(M(137,e));break;default:m!==d&&we(t,e,h,m,i,d)}}Ag(t,a,s,l,c,u,o,r);return;case"select":m=a=s=h=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:i.hasOwnProperty(o)||we(t,e,o,null,i,l)}for(r in i)if(o=i[r],l=n[r],i.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":a=o;default:o!==l&&we(t,e,r,o,i,l)}e=s,n=a,i=m,h!=null?La(t,!!n,h,!1):!!i!=!!n&&(e!=null?La(t,!!n,e,!0):La(t,!!n,n?[]:"",!1));return;case"textarea":m=h=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,i,r)}for(a in i)if(r=i[a],o=n[a],i.hasOwnProperty(a)&&(r!=null||o!=null))switch(a){case"value":h=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(M(91));break;default:r!==o&&we(t,e,a,r,i,o)}xx(t,h,m);return;case"option":for(var S in n)h=n[S],n.hasOwnProperty(S)&&h!=null&&!i.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,i,h));for(l in i)h=i[l],m=n[l],i.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,i,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 _ in n)h=n[_],n.hasOwnProperty(_)&&h!=null&&!i.hasOwnProperty(_)&&we(t,e,_,null,i,h);for(c in i)if(h=i[c],m=n[c],i.hasOwnProperty(c)&&h!==m&&(h!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(M(137,e));break;default:we(t,e,c,h,i,m)}return;default:if(vm(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&tm(t,e,b,void 0,i,h);for(u in i)h=i[u],m=n[u],!i.hasOwnProperty(u)||h===m||h===void 0&&m===void 0||tm(t,e,u,h,i,m);return}}for(var f in n)h=n[f],n.hasOwnProperty(f)&&h!=null&&!i.hasOwnProperty(f)&&we(t,e,f,null,i,h);for(d in i)h=i[d],m=n[d],!i.hasOwnProperty(d)||h===m||h==null&&m==null||we(t,e,d,h,i,m)}function BS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&BS(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&BS(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(o+a)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var nm=null,im=null;function yd(t){return t.nodeType===9?t:t.ownerDocument}function FS(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 k1(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 rm(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 hg=null;function QO(){var t=window.event;return t&&t.type==="popstate"?t===hg?!1:(hg=t,!0):(hg=null,!1)}var R1=typeof setTimeout=="function"?setTimeout:void 0,JO=typeof clearTimeout=="function"?clearTimeout:void 0,$S=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof $S<"u"?function(t){return $S.resolve(null).then(t).catch(tM)}:R1;function tM(t){setTimeout(function(){throw t})}function zr(t){return t==="head"}function US(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Xa(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Ol(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Ol(n);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[Wl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=a}}else n==="body"&&Ol(t.ownerDocument.body);n=r}while(n);Xa(e)}function VS(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function om(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":om(n),mm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function nM(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Wl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=Cn(t.nextSibling),t===null)break}return null}function iM(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Cn(t.nextSibling),t===null))return null;return t}function O1(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Cn(t.nextSibling),t===null))return null;return t}function am(t){return t.data==="$?"||t.data==="$~"}function sm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rM(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Cn(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 lm=null;function jS(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return Cn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function PS(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function M1(t,e,n){switch(e=yd(n),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function Ol(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);mm(t)}var An=new Map,qS=new Set;function bd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Hi=ye.d;ye.d={f:oM,r:aM,D:sM,C:lM,L:cM,m:uM,X:fM,S:dM,M:pM};function oM(){var t=Hi.f(),e=Hd();return t||e}function aM(t){var e=Qa(t);e!==null&&e.tag===5&&e.type==="form"?Ew(e):Hi.r(t)}var ns=typeof document>"u"?null:document;function N1(t,e,n){var i=ns;if(i&&typeof e=="string"&&e){var r=Sn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),qS.has(r)||(qS.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function sM(t){Hi.D(t),N1("dns-prefetch",t,null)}function lM(t,e){Hi.C(t,e),N1("preconnect",t,e)}function cM(t,e,n){Hi.L(t,e,n);var i=ns;if(i&&t&&e){var r='link[rel="preload"][as="'+Sn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Sn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Sn(n.imageSizes)+'"]')):r+='[href="'+Sn(t)+'"]';var o=r;switch(e){case"style":o=Wa(t);break;case"script":o=is(t)}An.has(o)||(t=He({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),An.set(o,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(tc(o))||e==="script"&&i.querySelector(nc(o))||(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function uM(t,e){Hi.m(t,e);var n=ns;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Sn(i)+'"][href="'+Sn(t)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=is(t)}if(!An.has(o)&&(t=He({rel:"modulepreload",href:t},e),An.set(o,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(nc(o)))return}i=n.createElement("link"),bt(i,"link",t),dt(i),n.head.appendChild(i)}}}function dM(t,e,n){Hi.S(t,e,n);var i=ns;if(i&&t){var r=Da(i).hoistableStyles,o=Wa(t);e=e||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(tc(o)))s.loading=5;else{t=He({rel:"stylesheet",href:t,"data-precedence":e},n),(n=An.get(o))&&tv(t,n);var l=a=i.createElement("link");dt(l),bt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,qu(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}}function fM(t,e){Hi.X(t,e);var n=ns;if(n&&t){var i=Da(n).hoistableScripts,r=is(t),o=i.get(r);o||(o=n.querySelector(nc(r)),o||(t=He({src:t,async:!0},e),(e=An.get(r))&&nv(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function pM(t,e){Hi.M(t,e);var n=ns;if(n&&t){var i=Da(n).hoistableScripts,r=is(t),o=i.get(r);o||(o=n.querySelector(nc(r)),o||(t=He({src:t,async:!0,type:"module"},e),(e=An.get(r))&&nv(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function ZS(t,e,n,i){var r=(r=wr.current)?bd(r):null;if(!r)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Wa(n.href),n=Da(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Wa(n.href);var o=Da(r).hoistableStyles,a=o.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,a),(o=r.querySelector(tc(t)))&&!o._p&&(a.instance=o,a.state.loading=5),An.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},An.set(t,n),o||hM(r,t,n,a.state))),e&&i===null)throw Error(M(528,""));return a}if(e&&i!==null)throw Error(M(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=is(n),n=Da(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,t))}}function Wa(t){return'href="'+Sn(t)+'"'}function tc(t){return'link[rel="stylesheet"]['+t+"]"}function D1(t){return He({},t,{"data-precedence":t.precedence,precedence:null})}function hM(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),bt(e,"link",n),dt(e),t.head.appendChild(e))}function is(t){return'[src="'+Sn(t)+'"]'}function nc(t){return"script[async]"+t}function GS(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+Sn(n.href)+'"]');if(i)return e.instance=i,dt(i),i;var r=He({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),dt(i),bt(i,"style",r),qu(i,n.precedence,t),e.instance=i;case"stylesheet":r=Wa(n.href);var o=t.querySelector(tc(r));if(o)return e.state.loading|=4,e.instance=o,dt(o),o;i=D1(n),(r=An.get(r))&&tv(i,r),o=(t.ownerDocument||t).createElement("link"),dt(o);var a=o;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),e.state.loading|=4,qu(o,n.precedence,t),e.instance=o;case"script":return o=is(n.src),(r=t.querySelector(nc(o)))?(e.instance=r,dt(r),r):(i=n,(r=An.get(o))&&(i=He({},n),nv(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),dt(r),bt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,qu(i,n.precedence,t));return e.instance}function qu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function tv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function nv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Zu=null;function YS(t,e,n){if(Zu===null){var i=new Map,r=Zu=new Map;r.set(n,i)}else r=Zu,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var o=n[r];if(!(o[Wl]||o[mt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var a=o.getAttribute(e)||"";a=t+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function WS(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function gM(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function L1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mM(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Wa(i.href),o=e.querySelector(tc(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=_d.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=o,dt(o);return}o=e.ownerDocument||e,i=D1(i),(r=An.get(r))&&tv(i,r),o=o.createElement("link"),dt(o);var a=o;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),n.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=_d.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var gg=0;function vM(t,e){return t.stylesheets&&t.count===0&&Gu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Gu(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&gg===0&&(gg=62500*KO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Gu(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>gg?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function _d(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Sd=null;function Gu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Sd=new Map,e.forEach(yM,t),Sd=null,_d.call(t))}function yM(t,e){if(!(e.state.loading&4)){var n=Sd.get(t);if(n)var i=n.get(null);else{n=new Map,Sd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}r=e.instance,a=r.getAttribute("data-precedence"),o=n.get(a)||i,o===i&&n.set(null,r),n.set(a,r),this.count++,i=_d.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Vl={$$typeof:Ci,Provider:null,Consumer:null,_currentValue:ho,_currentValue2:ho,_threadCount:0};function bM(t,e,n,i,r,o,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Uh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uh(0),this.hiddenUpdates=Uh(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function I1(t,e,n,i,r,o,a,s,l,c,u,d){return t=new bM(t,e,n,a,l,c,u,d,s),e=1,o===!0&&(e|=24),o=tn(3,null,null,e),t.current=o,o.stateNode=t,e=km(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:e},Mm(o),t}function H1(t){return t?(t=Ra,t):Ra}function z1(t,e,n,i,r,o){r=H1(r),i.context===null?i.context=r:i.pendingContext=r,i=Cr(e),i.payload={element:n},o=o===void 0?null:o,o!==null&&(i.callback=o),n=Ar(t,i,e),n!==null&&(Vt(n,t,e),xl(n,t,e))}function XS(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function iv(t,e){XS(t,e),(t=t.alternate)&&XS(t,e)}function B1(t){if(t.tag===13||t.tag===31){var e=To(t,67108864);e!==null&&Vt(e,t,67108864),iv(t,67108864)}}function KS(t){if(t.tag===13||t.tag===31){var e=sn();e=hm(e);var n=To(t,e);n!==null&&Vt(n,t,e),iv(t,e)}}var xd=!0;function _M(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=2,rv(t,e,n,i)}finally{ye.p=o,Q.T=r}}function SM(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=8,rv(t,e,n,i)}finally{ye.p=o,Q.T=r}}function rv(t,e,n,i){if(xd){var r=cm(i);if(r===null)pg(t,e,i,wd,n),QS(t,i);else if(wM(r,t,e,n,i))i.stopPropagation();else if(QS(t,i),e&4&&-1<xM.indexOf(t)){for(;r!==null;){var o=Qa(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var a=uo(o.pendingLanes);if(a!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-an(a);s.entanglements[1]|=l,a&=~l}ri(o),(ve&6)===0&&(fd=rn()+500,ec(0,!1))}}break;case 31:case 13:s=To(o,2),s!==null&&Vt(s,o,2),Hd(),iv(o,2)}if(o=cm(i),o===null&&pg(t,e,i,wd,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else pg(t,e,i,null,n)}}function cm(t){return t=ym(t),ov(t)}var wd=null;function ov(t){if(wd=null,t=wa(t),t!==null){var e=ql(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=rx(e),t!==null)return t;t=null}else if(n===31){if(t=ox(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return wd=t,null}function F1(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(c2()){case cx:return 2;case ux:return 8;case Qu:case u2:return 32;case dx:return 268435456;default:return 32}default:return 32}}var um=!1,Rr=null,Or=null,Mr=null,jl=new Map,Pl=new Map,vr=[],xM="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 QS(t,e){switch(t){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":jl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(e.pointerId)}}function dl(t,e,n,i,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Qa(e),e!==null&&B1(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function wM(t,e,n,i,r){switch(e){case"focusin":return Rr=dl(Rr,t,e,n,i,r),!0;case"dragenter":return Or=dl(Or,t,e,n,i,r),!0;case"mouseover":return Mr=dl(Mr,t,e,n,i,r),!0;case"pointerover":var o=r.pointerId;return jl.set(o,dl(jl.get(o)||null,t,e,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Pl.set(o,dl(Pl.get(o)||null,t,e,n,i,r)),!0}return!1}function $1(t){var e=wa(t.target);if(e!==null){var n=ql(e);if(n!==null){if(e=n.tag,e===13){if(e=rx(n),e!==null){t.blockedOn=e,I_(t.priority,function(){KS(n)});return}}else if(e===31){if(e=ox(n),e!==null){t.blockedOn=e,I_(t.priority,function(){KS(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Yu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=cm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);kg=i,n.target.dispatchEvent(i),kg=null}else return e=Qa(n),e!==null&&B1(e),t.blockedOn=n,!1;e.shift()}return!0}function JS(t,e,n){Yu(t)&&n.delete(e)}function EM(){um=!1,Rr!==null&&Yu(Rr)&&(Rr=null),Or!==null&&Yu(Or)&&(Or=null),Mr!==null&&Yu(Mr)&&(Mr=null),jl.forEach(JS),Pl.forEach(JS)}function Nu(t,e){t.blockedOn===e&&(t.blockedOn=null,um||(um=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,EM)))}var Du=null;function ex(t){Du!==t&&(Du=t,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,function(){Du===t&&(Du=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(ov(i||n)===null)continue;break}var o=Qa(n);o!==null&&(t.splice(e,3),e-=3,Pg(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Xa(t){function e(l){return Nu(l,t)}Rr!==null&&Nu(Rr,t),Or!==null&&Nu(Or,t),Mr!==null&&Nu(Mr,t),jl.forEach(e),Pl.forEach(e);for(var n=0;n<vr.length;n++){var i=vr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<vr.length&&(n=vr[0],n.blockedOn===null);)$1(n),n.blockedOn===null&&vr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[jt]||null;if(typeof o=="function")a||ex(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[jt]||null)s=a.formAction;else if(ov(r)!==null)continue}else s=a.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),ex(n)}}}function U1(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function av(t){this._internalRoot=t}Fd.prototype.render=av.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var n=e.current,i=sn();z1(n,i,t,e,null,null)};Fd.prototype.unmount=av.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;z1(t.current,2,null,t,null,null),Hd(),e[Ka]=null}};function Fd(t){this._internalRoot=t}Fd.prototype.unstable_scheduleHydration=function(t){if(t){var e=mx();t={blockedOn:null,target:t,priority:e};for(var n=0;n<vr.length&&e!==0&&e<vr[n].priority;n++);vr.splice(n,0,t),n===0&&$1(t)}};var tx=nx.version;if(tx!=="19.2.4")throw Error(M(527,tx,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=n2(e),t=t!==null?ax(t):null,t=t===null?null:t.stateNode,t};var CM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(fl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!fl.isDisabled&&fl.supportsFiber))try{Zl=fl.inject(CM),on=fl}catch{}var fl;$d.createRoot=function(t,e){if(!ix(t))throw Error(M(299));var n=!1,i="",r=Nw,o=Dw,a=Lw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=I1(t,1,!1,null,null,n,i,null,r,o,a,U1),t[Ka]=e.current,ev(t),new av(e)};$d.hydrateRoot=function(t,e,n){if(!ix(t))throw Error(M(299));var i=!1,r="",o=Nw,a=Dw,s=Lw,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=I1(t,1,!0,e,n??null,i,r,l,o,a,s,U1),e.context=H1(null),n=e.current,i=sn(),i=hm(i),r=Cr(i),r.callback=null,Ar(n,r,i),n=i,e.current.lanes=n,Yl(e,n),ri(e),t[Ka]=e.current,ev(t),new Fd(e)};$d.version="19.2.4"});var Ro=Xn((ZI,P1)=>{"use strict";function j1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j1)}catch(t){console.error(t)}}j1(),P1.exports=V1()});var $E=Xn(af=>{"use strict";var yN=Symbol.for("react.transitional.element"),bN=Symbol.for("react.fragment");function FE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:yN,type:t,key:i,ref:e!==void 0?e:null,props:n}}af.Fragment=bN;af.jsx=FE;af.jsxs=FE});var $e=Xn((u6,UE)=>{"use strict";UE.exports=$E()});var zI={};e_(zI,{ANIMATION_KEYFRAMES:()=>Js,ActivationConfigZ:()=>ua,AddClassZ:()=>f0,AnchorIdZ:()=>gn,AnchorStateZ:()=>Jk,AnchorVisibleConditionZ:()=>qp,AppRegistry:()=>dc,AugmentationZ:()=>eR,BadgePositionZ:()=>t0,BadgeZ:()=>y0,BoundingBoxZ:()=>Qk,CanvasEvents:()=>fs,CanvasRecipeZ:()=>np,ConditionZ:()=>ca,ContextManager:()=>nu,CooldownActiveConditionZ:()=>Kp,CounterDefZ:()=>Ps,CtaButtonZ:()=>th,DEFAULT_COOLDOWN:()=>wf,DEFAULT_TTL:()=>xf,DecisionStrategyZ:()=>or,DismissedConditionZ:()=>Xp,EVENT_SCHEMA_VERSION:()=>Fo,EventBus:()=>ou,EventCountConditionZ:()=>Jp,EventFilterZ:()=>oR,EventOccurredConditionZ:()=>Zp,EventSourceZ:()=>H0,ExecutorRegistry:()=>tu,ExternalStrategyZ:()=>Ws,FrequencyEntryZ:()=>pR,FrequencyLimitConditionZ:()=>Qp,HighlightStepZ:()=>FA,HighlightStyleZ:()=>e0,HighlightZ:()=>m0,InsertHtmlZ:()=>g0,InsertPositionZ:()=>o0,MAX_VISIBLE_TOASTS:()=>Sf,MatchOpZ:()=>js,ModalContentZ:()=>r0,ModalZ:()=>_0,ModelStrategyZ:()=>Ys,MountWidgetZ:()=>w0,NavigateZ:()=>x0,NavigationMonitor:()=>Ks,NormalizedEventZ:()=>rR,NotificationToastStack:()=>_f,PageContextZ:()=>Yk,PageHistoryEntryZ:()=>Wk,PageUrlConditionZ:()=>jp,ParallelZ:()=>A0,PlacementZ:()=>n0,PulseZ:()=>v0,RUNTIME_SDK_BUILD:()=>Y0,RUNTIME_VERSION:()=>j0,RemoveClassZ:()=>p0,RouteConditionZ:()=>Pp,RouteFilterZ:()=>Qb,RuleStrategyZ:()=>Zs,RuleZ:()=>qs,RuntimeContextZ:()=>tR,RuntimeProvider:()=>kf,SDK_SCHEMA_VERSION:()=>Vi,SDK_VERSION:()=>mf,STATIC_SLOT_STYLES:()=>U0,ScoreStrategyZ:()=>Gs,ScrollBehaviorZ:()=>c0,ScrollLogicalPositionZ:()=>eh,ScrollToZ:()=>S0,SelectorZ:()=>dy,SequenceZ:()=>C0,SessionContextZ:()=>Xk,SessionMetricConditionZ:()=>Wp,SessionMetricTracker:()=>wc,SetAttrZ:()=>d0,SetStyleZ:()=>h0,SetTextZ:()=>u0,ShadowCanvasOverlay:()=>Fv,ShadowRootProvider:()=>Rv,SmartCanvasApp:()=>Uv,SmartCanvasController:()=>yf,SmartCanvasElement:()=>Of,SmartCanvasPortal:()=>t3,StandardEvents:()=>be,StateEqualsConditionZ:()=>Gp,StateStore:()=>su,StoredValueZ:()=>fR,Syntro:()=>G0,TileCard:()=>ps,TileWheel:()=>zD,TooltipContentZ:()=>i0,TooltipStepZ:()=>BA,TooltipTriggerZ:()=>a0,TooltipZ:()=>b0,TourStepForSchemaZ:()=>l0,TourZ:()=>T0,ViewportConditionZ:()=>Yp,ViewportContextZ:()=>Kk,WaitZ:()=>E0,WidgetConfigZ:()=>s0,WidgetRegistry:()=>cu,appRegistry:()=>ls,applyStaticSlotStyles:()=>lh,cleanupAppContext:()=>cf,contentRuntime:()=>Ud,coreActionStepSchemas:()=>Zk,createActionEngine:()=>Vp,createAnchorResolver:()=>nh,createAppContext:()=>lf,createAppLoader:()=>df,createCanvasConfigFetcher:()=>Ho,createContextManager:()=>ih,createDecisionEngine:()=>rh,createEventAccumulator:()=>oh,createEventBus:()=>Xs,createGrowthBookClient:()=>Wf,createNoopClient:()=>rp,createOverlayRecipeFetcher:()=>e3,createPostHogClient:()=>Fp,createPostHogNormalizer:()=>ah,createSessionMetricTracker:()=>Xf,createSmartCanvas:()=>Mf,createSmartCanvasController:()=>kv,createSmartCanvasRuntime:()=>vh,createStateStore:()=>sh,createSurfaceContainer:()=>ph,createSurfaces:()=>gh,decisionSchemas:()=>nI,decodeToken:()=>uu,encodeToken:()=>yh,evaluate:()=>M0,evaluateCondition:()=>R0,evaluateRule:()=>O0,evaluateRuleStrategy:()=>iu,evaluateScoreStrategy:()=>ru,evaluateSync:()=>N0,executorRegistry:()=>mi,getAntiFlickerSnippet:()=>hC,getAppIdFromActionKind:()=>Sv,getAppIdFromWidgetId:()=>uf,getExecutor:()=>jk,getSlotAnchorId:()=>lu,getSlotType:()=>Qs,getSlotZIndex:()=>hh,hasExecutor:()=>$p,interpolateTemplate:()=>gc,isCoreActionKind:()=>_v,matchEvent:()=>Ef,needsMigration:()=>UD,normalizePostHogEvent:()=>L0,overlaysRuntime:()=>sf,parseVersion:()=>gs,playEnterAnimation:()=>dh,playExitAnimation:()=>fh,registerConfigPredicates:()=>hc,registerSmartCanvasElement:()=>jv,resolveConfigUri:()=>vf,setupAdjacentPositioning:()=>ch,setupInlinePositioning:()=>uh,shouldNormalizeEvent:()=>I0,useDecision:()=>DC,useNotifications:()=>Cf,useNotifyWatcher:()=>Tf,usePageContext:()=>Rf,useRuntime:()=>ai,useRuntimeContext:()=>mc,useRuntimeEvents:()=>MC,useRuntimeState:()=>NC,useSessionContext:()=>RC,useShadowCanvasConfig:()=>$v,useShadowRoot:()=>Bo,useViewportContext:()=>OC,validateAction:()=>rr,validateActions:()=>Up,validateActivationConfig:()=>tI,validateCondition:()=>J5,validateConfig:()=>BD,validateEventFilter:()=>vI,validateFrequencyEntry:()=>xI,validateNormalizedEvent:()=>mI,validateRecipe:()=>JL,validateRuntimeContext:()=>pI,validateStoredValue:()=>SI,validateStrategy:()=>eI,widgetRegistry:()=>mh});var wR=X(Qe(),1),bh=X(nl(),1),HI=X(Ro(),1);function q1(t,e,n,i){let r=i?.maxRetries??3,o=i?.debounceMs??50,a=t.parentElement??e.parentElement;if(!a)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(d=>{if(!c){for(let h of d)for(let m of h.removedNodes)if(m===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},o);return}}});return u.observe(a,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var AM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function sv(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!AM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),m=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(d||m)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var Z1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=sv(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":o=n.innerHTML,n.replaceWith(r);break}let a=null;if(t.deepLink){let{tileId:c,itemId:u}=t.deepLink;a=()=>{let d=window.SynOS?.handle;d&&(d.open(),d.runtime?.events?.publish("notification.deep_link",{tileId:c,itemId:u}))},r.style.cursor="pointer",r.addEventListener("click",a)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let l=q1(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(a&&r.removeEventListener("click",a),l(),t.position==="replace"&&o!==null){let c=document.createElement(n.tagName);c.innerHTML=o,Array.from(n.attributes).forEach(u=>{c.setAttribute(u.name,u.value)}),r.replaceWith(c)}else r.remove()},updateFn:c=>{"html"in c&&typeof c.html=="string"&&(r.innerHTML=sv(c.html))}}},G1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},Y1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&o!==null?n.setAttribute(t.attr,o):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},W1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},X1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},K1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=new Map;for(let r of Object.keys(t.styles)){let o=n.style.getPropertyValue(r);i.set(r,o)}for(let[r,o]of Object.entries(t.styles))n.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,o]of i)o?n.style.setProperty(r,o):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,a]of Object.entries(r.styles))n.style.setProperty(o,a)}}},lv=[{kind:"content:insertHtml",executor:Z1},{kind:"content:setText",executor:G1},{kind:"content:setAttr",executor:Y1},{kind:"content:addClass",executor:W1},{kind:"content:removeClass",executor:X1},{kind:"content:setStyle",executor:K1}],Ud={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:lv};var TM={light:50,medium:100,heavy:200},kM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],Q1={init(t,e,n){let i=TM[n.intensity],r=n.colors.length>0?n.colors:kM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,n){let i=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation),n.shape==="circle"?(t.beginPath(),t.arc(0,0,n.size/2,0,Math.PI*2),t.fill()):t.fillRect(-n.size/2,-n.size/2,n.size,n.size*.6),t.restore())}};var RM={light:20,medium:40,heavy:80},OM="\u{1F389}",J1={init(t,e,n){let i=RM[n.intensity],r=typeof n.props?.emoji=="string"?n.props.emoji:OM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:r,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let a of o)a.data&&(a.data.originX=a.x);return o},update(t,e,n){let i=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,a=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(n*.003+o)*a*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e)n.opacity<.01||!n.emoji||(t.save(),t.globalAlpha=n.opacity,t.font=`${n.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(n.emoji,n.x,n.y),t.restore())}};var MM={light:20,medium:40,heavy:80},NM={light:3,medium:4,heavy:5},eE={init(t,e,n){let i=MM[n.intensity],r=NM[n.intensity],o=n.colors.length>0?n.colors:["#ff4444","#44ff44","#4444ff"],a=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,c=Math.random()*e*.6,u=o[Math.floor(Math.random()*o.length)];for(let d=0;d<i;d++){let h=Math.PI*2*d/i+(Math.random()-.5)*.3,m=Math.random()*3+2;a.push({x:l,y:c,vx:Math.cos(h)*m,vy:Math.sin(h)*m,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:u,opacity:1,shape:"circle",data:{centerX:l,centerY:c}})}}return a},update(t,e,n){let i=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.shadowBlur=12,t.shadowColor=n.color,t.beginPath(),t.arc(n.x,n.y,n.size,0,Math.PI*2),t.fill(),t.restore())}};var DM={light:30,medium:60,heavy:120},tE={init(t,e,n){let i=DM[n.intensity],r=n.colors.length>0?n.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:r[Math.floor(Math.random()*r.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,n){let i=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,a=r.data?.baseOpacity??1;if(a<=.01)r.opacity=0;else{let s=Math.sin(n*.005+o)*.4+.6;r.opacity=a*s}r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e){if(n.opacity<.01)continue;t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation);let i=n.size;t.beginPath(),t.moveTo(0,-i),t.lineTo(i*.3,-i*.3),t.lineTo(i,0),t.lineTo(i*.3,i*.3),t.lineTo(0,i),t.lineTo(-i*.3,i*.3),t.lineTo(-i,0),t.lineTo(-i*.3,-i*.3),t.closePath(),t.fill(),t.restore()}}};var Vd=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,n,i){this.container=e,this.effect=n,this.duration=i.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,a=window.innerWidth,s=window.innerHeight;r.width=a*o,r.height=s*o,r.style.width=`${a}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=n.init(a,s,i),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let n=e-this.startTime,i=e-this.lastFrame;if(this.lastFrame=e,n>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,i,n)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var LM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],nE=new Map([["confetti",Q1],["fireworks",eE],["sparkles",tE],["emoji-rain",J1]]),iE=async(t,e)=>{let n=nE.get(t.effect);if(!n)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...nE.keys()].join(", ")}`),{cleanup:()=>{}};let i={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:t.colors??LM,props:t.props},r=new Vd;return r.start(e.overlayRoot,n,i),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{r.stop()}}};var uv="syntro_active_tour",jd=new Map;function IM(t){try{let e=localStorage.getItem(uv);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function cv(t){try{localStorage.setItem(uv,JSON.stringify(t))}catch{}}function HM(){try{localStorage.removeItem(uv)}catch{}}function ic(){return window.location.pathname}function zM(t){if(!t.route)return!0;let e=ic();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var dv=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:o=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(jd.has(n))return{cleanup:async()=>{let v=jd.get(n);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=IM(n),s=!!a;if(!s&&!o)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},cv(a));let l=i.findIndex(v=>v.id===a.currentStepId);if(l===-1){let v=r||i[0].id;l=i.findIndex(y=>y.id===v),l===-1&&(l=0),a.currentStepId=i[l].id,cv(a)}let c=i[l];if(!zM(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:ic()}),{cleanup:()=>{}};let u=!1,d=null,h=null,m=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},_=async v=>{if(u)return;if(await S(),v==="end"){HM(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let y=i.find(w=>w.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(a.currentStepId=v,cv(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:v}),y.route&&y.route!==ic()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:v,targetRoute:y.route});return}await b(y)},b=async v=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:v.id,stepIndex:i.findIndex(y=>y.id===v.id),totalSteps:i.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",A=>{let x=A?.actionId;if(x&&v.onAction){let T=v.onAction[x];T&&_(T)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",A=>{let x=A?.actionId;if(x&&v.onAction){let T=v.onAction[x];T&&_(T)}}),w=h;h=()=>{w(),y()}}}};m=(()=>{let v=ic(),y=()=>{let x=ic();x!==v&&(v=x,e.publishEvent("tour.route_changed",{tourId:n,newRoute:x}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let w=history.pushState.bind(history),A=history.replaceState.bind(history);return history.pushState=(...x)=>{w(...x),queueMicrotask(y)},history.replaceState=(...x)=>{A(...x),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=A}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:a.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:a.currentStepId}),await b(c);let p=async()=>{u=!0,jd.delete(n),await S(),m&&m(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return jd.set(n,{cleanup:p}),{cleanup:p}};var _t={white:"#ffffff",black:"#000000"},ne={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},C={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},Te={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},St={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Fe={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},un={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},rc={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},at={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},oc={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var zi={primary:C[10],secondary:C[9],tertiary:C[8]},uH={primary:C[2],secondary:C[0]},fv={primary:C[4],secondary:C[3]},Pd={primary:{text:_t.white,icon:_t.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:C[10],textHover:_t.white,icon:C[10],iconHover:_t.white,border:C[4],background:C[2]},link:{text:_t.white,icon:_t.white,hover:ne[5]},error:{text:Fe[5],hover:Fe[6]},success:{text:Te[5],hover:Te[6]}},dH={slateGrey:{content:C[10],pillOutline:C[10],borderPrimary:C[5],borderSecondary:C[5],background:C[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Fe[8],pillOutline:Fe[4],borderPrimary:Fe[2],borderSecondary:Fe[2],background:Fe[0]},yellow:{content:St[8],pillOutline:St[4],borderPrimary:St[2],borderSecondary:St[2],background:St[0]},green:{content:Te[8],pillOutline:Te[4],borderPrimary:Te[2],borderSecondary:Te[2],background:Te[0]},purple:{content:at[8],pillOutline:at[4],borderPrimary:at[2],borderSecondary:at[2],background:at[0]},blue:{content:un[8],pillOutline:un[4],borderPrimary:un[2],borderSecondary:un[2],background:un[0]},orange:{content:rc[8],pillOutline:rc[4],borderPrimary:rc[2],borderSecondary:rc[2],background:rc[0]},pink:{content:oc[8],pillOutline:oc[4],borderPrimary:oc[2],borderSecondary:oc[2],background:oc[0]}},fH={green:{content:Te[8],border:Te[2],background:Te[0]},yellow:{content:St[8],border:St[2],background:St[0]},red:{content:Fe[8],border:Fe[2],background:Fe[0]}},pH={green:{content:Te[1],background:Te[9]},yellow:{content:St[1],background:St[9]},red:{content:Fe[1],background:Fe[9]}},hH={content:C[10],border:C[4],background:"#1c2124"},gH={backgroundDefault:C[2],backgroundHover:C[1],selected:C[3]},mH={background:C[2],icon:C[10],borderDefault:C[4],borderSelected:ne[3],textLabel:C[9],textPlaceholder:C[8],textHint:C[8]},vH={backgroundDefault:C[2],backgroundDisabled:C[0],textLabel:C[9],textPlaceholder:C[8],textHint:C[8],textError:Fe[5],iconDefault:C[9],iconPlaceholder:C[10],iconError:Fe[5],borderDefault:C[4],borderSelected:ne[3],borderError:Fe[5]},yH={handleDefault:_t.white,handleDisabled:C[10],off:{backgroundDefault:C[4],backgroundHover:C[5],backgroundDisabled:C[4]},on:{backgroundDefault:Te[3],backgroundHover:Te[2],backgroundDisabled:C[4]}},bH={off:{backgroundDefault:"#00000000",backgroundHover:C[5],backgroundDisabled:C[2],border:C[6]},on:{backgroundDefault:Te[0],backgroundHover:Te[1],backgroundDisabled:C[2],border:Te[3]}},_H={content:C[10],background:C[4]},SH={background:C[4],active:Te[3]},xH={background:C[1],content:C[9],border:C[4]},wH={backgroundDefault:C[1],backgroundHover:C[3],backgroundActive:C[4],border:C[4],contentPrimary:C[10],contentSecondary:C[9],contentTertiary:C[8]},EH={background:C[1],content:C[9],border:C[4]},CH={activeBackground:C[3],activeContent:ne[5],inactiveContent:C[9],border:C[4]},AH={header:{textDefault:C[9],textHover:C[8],backgroundDefault:C[1]},border:C[4],cell:{textPrimary:C[10],textSecondary:C[9],backgroundDefault:C[2],backgroundHover:C[1]}},TH={textPrimaryDefault:C[10],textPrimaryHover:C[10],textSecondaryDefault:C[8],textSecondaryHover:C[9],iconPrimary:C[10],iconSecondary:C[8]},kH={background:Te[1],active:Te[5]},RH={textDefault:C[10],textSelected:_t.white,textDisabled:C[7],backgroundDefault:C[2],backgroundMiddle:C[3],backgroundSelected:ne[3],border:C[4]},OH=C[9];var rE=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function oE(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??`var(--syntro-ring, ${un[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),d=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),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 _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${a||h||un[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(_);let b=[];if(!rE)for(let k=0;k<4;k++){let E=document.createElement("div");E.style.position="fixed",E.style.background="inherit",b.push(E),m.appendChild(E)}let f=k=>{m.style.clipPath=k,m.style.webkitClipPath=k},p=()=>{if(!t.isConnected){T.destroy();return}let k=t.getBoundingClientRect(),E=Math.max(0,k.left-i),R=Math.max(0,k.top-i),D=Math.min(window.innerWidth,k.width+i*2),N=Math.min(window.innerHeight,k.height+i*2);if(Object.assign(_.style,{left:`${E}px`,top:`${R}px`,width:`${D}px`,height:`${N}px`}),rE){let H=window.innerWidth,B=window.innerHeight,z=Math.min(r,D/2,N/2),te=`M 0 0 L ${H} 0 L ${H} ${B} L 0 ${B} Z`,I=`M ${E+z} ${R} A ${z} ${z} 0 0 0 ${E} ${R+z} L ${E} ${R+N-z} A ${z} ${z} 0 0 0 ${E+z} ${R+N} L ${E+D-z} ${R+N} A ${z} ${z} 0 0 0 ${E+D} ${R+N-z} L ${E+D} ${R+z} A ${z} ${z} 0 0 0 ${E+D-z} ${R} L ${E+z} ${R} Z`;f(`path('${te} ${I}')`)}else{let[H,B,z,te]=b;Object.assign(H.style,{left:"0px",top:"0px",width:"100vw",height:`${R}px`}),Object.assign(z.style,{left:"0px",top:`${R+N}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(R+N))}px`}),Object.assign(te.style,{left:"0px",top:`${R}px`,width:`${E}px`,height:`${N}px`}),Object.assign(B.style,{left:`${E+D}px`,top:`${R}px`,width:`${Math.max(0,window.innerWidth-(E+D))}px`,height:`${N}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(p));v.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let A=k=>{k.key==="Escape"&&c&&T.destroy()};c&&window.addEventListener("keydown",A);let x=k=>{s?(k.preventDefault(),k.stopPropagation()):l&&T.destroy()};m.addEventListener("click",x);let T={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",A),m.removeEventListener("click",x),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),_.remove()},220)}};return p(),T}var BM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function dn(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!BM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(d||h)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var pv=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:o,dismiss:a,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
8
|
+
`+i.stack}}var wg=Object.prototype.hasOwnProperty,pm=ot.unstable_scheduleCallback,Fh=ot.unstable_cancelCallback,s2=ot.unstable_shouldYield,l2=ot.unstable_requestPaint,rn=ot.unstable_now,c2=ot.unstable_getCurrentPriorityLevel,cS=ot.unstable_ImmediatePriority,uS=ot.unstable_UserBlockingPriority,Qu=ot.unstable_NormalPriority,u2=ot.unstable_LowPriority,dS=ot.unstable_IdlePriority,d2=ot.log,f2=ot.unstable_setDisableYieldValue,ql=null,on=null;function br(t){if(typeof d2=="function"&&f2(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(ql,t)}catch{}}var an=Math.clz32?Math.clz32:g2,p2=Math.log,h2=Math.LN2;function g2(t){return t>>>=0,t===0?32:31-(p2(t)/h2|0)|0}var vu=256,yu=262144,bu=4194304;function fo(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ed(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,o=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~o,i!==0?r=fo(i):(a&=s,a!==0?r=fo(a):n||(n=s&~t,n!==0&&(r=fo(n))))):(s=i&~o,s!==0?r=fo(s):a!==0?r=fo(a):n||(n=i&~t,n!==0&&(r=fo(n)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,n=e&-e,o>=n||o===32&&(n&4194048)!==0)?e:r}function Zl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function m2(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 fS(){var t=bu;return bu<<=1,(bu&62914560)===0&&(bu=4194304),t}function Uh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Gl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function v2(t,e,n,i,r,o){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-an(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var m=h[u];m!==null&&(m.lane&=-536870913)}n&=~d}i!==0&&pS(t,i,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(a&~e))}function pS(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function hS(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function gS(t,e){var n=e&-e;return n=(n&42)!==0?1:hm(n),(n&(t.suspendedLanes|e))!==0?0:n}function hm(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 gm(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function mS(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:$1(t.type))}function I_(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var zr=Math.random().toString(36).slice(2),vt="__reactFiber$"+zr,Pt="__reactProps$"+zr,Xa="__reactContainer$"+zr,Eg="__reactEvents$"+zr,y2="__reactListeners$"+zr,b2="__reactHandles$"+zr,H_="__reactResources$"+zr,Yl="__reactMarker$"+zr;function mm(t){delete t[vt],delete t[Pt],delete t[Eg],delete t[y2],delete t[b2]}function Sa(t){var e=t[vt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Xa]||n[vt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Px(t);t!==null;){if(n=t[vt])return n;t=Px(t)}return e}t=n,n=t.parentNode}return null}function Ka(t){if(t=t[vt]||t[Xa]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function hl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Na(t){var e=t[H_];return e||(e=t[H_]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ft(t){t[Yl]=!0}var vS=new Set,yS={};function Co(t,e){Fa(t,e),Fa(t+"Capture",e)}function Fa(t,e){for(yS[t]=e,t=0;t<e.length;t++)vS.add(e[t])}var _2=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]*$"),z_={},B_={};function x2(t){return wg.call(B_,t)?!0:wg.call(z_,t)?!1:_2.test(t)?B_[t]=!0:(z_[t]=!0,!1)}function Lu(t,e,n){if(x2(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function _u(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function xi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function _n(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function bS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function S2(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,o=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Cg(t){if(!t._valueTracker){var e=bS(t)?"checked":"value";t._valueTracker=S2(t,e,""+t[e])}}function _S(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=bS(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Ju(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 w2=/[\n"\\]/g;function wn(t){return t.replace(w2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Ag(t,e,n,i,r,o,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+_n(e)):t.value!==""+_n(e)&&(t.value=""+_n(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?kg(t,a,_n(e)):n!=null?kg(t,a,_n(n)):i!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+_n(s):t.removeAttribute("name")}function xS(t,e,n,i,r,o,a,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Cg(t);return}n=n!=null?""+_n(n):"",e=e!=null?""+_n(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),Cg(t)}function kg(t,e,n){e==="number"&&Ju(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Da(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+_n(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function SS(t,e,n){if(e!=null&&(e=""+_n(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+_n(n):""}function wS(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(M(92));if(pl(i)){if(1<i.length)throw Error(M(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=_n(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),Cg(t)}function Ua(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var E2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $_(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||E2.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function ES(t,e,n){if(e!=null&&typeof e!="object")throw Error(M(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&$_(t,r,i)}else for(var o in e)e.hasOwnProperty(o)&&$_(t,o,e[o])}function vm(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 C2=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"]]),A2=/^[\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 Iu(t){return A2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ri(){}var Tg=null;function ym(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wa=null,La=null;function F_(t){var e=Ka(t);if(e&&(t=e.stateNode)){var n=t[Pt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Ag(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+wn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Pt]||null;if(!r)throw Error(M(90));Ag(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&_S(i)}break e;case"textarea":SS(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Da(t,!!n.multiple,e,!1)}}}var Vh=!1;function CS(t,e,n){if(Vh)return t(e,n);Vh=!0;try{var i=t(e);return i}finally{if(Vh=!1,(wa!==null||La!==null)&&(Hd(),wa&&(e=wa,t=La,La=wa=null,F_(e),t)))for(e=0;e<t.length;e++)F_(t[e])}}function Ml(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Pt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(M(231,e,typeof n));return n}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rg=!1;if(Li)try{ga={},Object.defineProperty(ga,"passive",{get:function(){Rg=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{Rg=!1}var ga,_r=null,bm=null,Hu=null;function AS(){if(Hu)return Hu;var t,e=bm,n=e.length,i,r="value"in _r?_r.value:_r.textContent,o=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[o-i];i++);return Hu=r.slice(t,1<i?1-i:void 0)}function zu(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 xu(){return!0}function U_(){return!1}function qt(t){function e(n,i,r,o,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?xu:U_,this.isPropagationStopped=U_,this}return He(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=xu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xu)},persist:function(){},isPersistent:xu}),e}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=qt(Ao),Wl=He({},Ao,{view:0,detail:0}),k2=qt(Wl),jh,Ph,al,Ad=He({},Wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_m,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!==al&&(al&&t.type==="mousemove"?(jh=t.screenX-al.screenX,Ph=t.screenY-al.screenY):Ph=jh=0,al=t),jh)},movementY:function(t){return"movementY"in t?t.movementY:Ph}}),V_=qt(Ad),T2=He({},Ad,{dataTransfer:0}),R2=qt(T2),O2=He({},Wl,{relatedTarget:0}),qh=qt(O2),M2=He({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),N2=qt(M2),D2=He({},Ao,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),L2=qt(D2),I2=He({},Ao,{data:0}),j_=qt(I2),H2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},z2={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"},B2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=B2[t])?!!e[t]:!1}function _m(){return $2}var F2=He({},Wl,{key:function(t){if(t.key){var e=H2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?z2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_m,charCode:function(t){return t.type==="keypress"?zu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),U2=qt(F2),V2=He({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P_=qt(V2),j2=He({},Wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_m}),P2=qt(j2),q2=He({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z2=qt(q2),G2=He({},Ad,{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}),Y2=qt(G2),W2=He({},Ao,{newState:0,oldState:0}),X2=qt(W2),K2=[9,13,27,32],xm=Li&&"CompositionEvent"in window,vl=null;Li&&"documentMode"in document&&(vl=document.documentMode);var Q2=Li&&"TextEvent"in window&&!vl,kS=Li&&(!xm||vl&&8<vl&&11>=vl),q_=" ",Z_=!1;function TS(t,e){switch(t){case"keyup":return K2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RS(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ea=!1;function J2(t,e){switch(t){case"compositionend":return RS(e);case"keypress":return e.which!==32?null:(Z_=!0,q_);case"textInput":return t=e.data,t===q_&&Z_?null:t;default:return null}}function eO(t,e){if(Ea)return t==="compositionend"||!xm&&TS(t,e)?(t=AS(),Hu=bm=_r=null,Ea=!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 kS&&e.locale!=="ko"?null:e.data;default:return null}}var tO={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 G_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tO[t.type]:e==="textarea"}function OS(t,e,n,i){wa?La?La.push(i):La=[i]:wa=i,e=vd(e,"onChange"),0<e.length&&(n=new Cd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var yl=null,Nl=null;function nO(t){C1(t,0)}function kd(t){var e=hl(t);if(_S(e))return t}function Y_(t,e){if(t==="change")return e}var MS=!1;Li&&(Li?(wu="oninput"in document,wu||(Zh=document.createElement("div"),Zh.setAttribute("oninput","return;"),wu=typeof Zh.oninput=="function"),Su=wu):Su=!1,MS=Su&&(!document.documentMode||9<document.documentMode));var Su,wu,Zh;function W_(){yl&&(yl.detachEvent("onpropertychange",NS),Nl=yl=null)}function NS(t){if(t.propertyName==="value"&&kd(Nl)){var e=[];OS(e,Nl,t,ym(t)),CS(nO,e)}}function iO(t,e,n){t==="focusin"?(W_(),yl=e,Nl=n,yl.attachEvent("onpropertychange",NS)):t==="focusout"&&W_()}function rO(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return kd(Nl)}function oO(t,e){if(t==="click")return kd(e)}function aO(t,e){if(t==="input"||t==="change")return kd(e)}function sO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ln=typeof Object.is=="function"?Object.is:sO;function Dl(t,e){if(ln(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!wg.call(e,r)||!ln(t[r],e[r]))return!1}return!0}function X_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function K_(t,e){var n=X_(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=X_(n)}}function DS(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?DS(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function LS(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ju(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ju(t.document)}return e}function Sm(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 lO=Li&&"documentMode"in document&&11>=document.documentMode,Ca=null,Og=null,bl=null,Mg=!1;function Q_(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mg||Ca==null||Ca!==Ju(i)||(i=Ca,"selectionStart"in i&&Sm(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),bl&&Dl(bl,i)||(bl=i,i=vd(Og,"onSelect"),0<i.length&&(e=new Cd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Ca)))}function co(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Aa={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},Gh={},IS={};Li&&(IS=document.createElement("div").style,"AnimationEvent"in window||(delete Aa.animationend.animation,delete Aa.animationiteration.animation,delete Aa.animationstart.animation),"TransitionEvent"in window||delete Aa.transitionend.transition);function ko(t){if(Gh[t])return Gh[t];if(!Aa[t])return t;var e=Aa[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in IS)return Gh[t]=e[n];return t}var HS=ko("animationend"),zS=ko("animationiteration"),BS=ko("animationstart"),cO=ko("transitionrun"),uO=ko("transitionstart"),dO=ko("transitioncancel"),$S=ko("transitionend"),FS=new Map,Ng="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(" ");Ng.push("scrollEnd");function Un(t,e){FS.set(t,e),Co(e,[t])}var ed=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)},bn=[],ka=0,wm=0;function Td(){for(var t=ka,e=wm=ka=0;e<t;){var n=bn[e];bn[e++]=null;var i=bn[e];bn[e++]=null;var r=bn[e];bn[e++]=null;var o=bn[e];if(bn[e++]=null,i!==null&&r!==null){var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}o!==0&&US(n,r,o)}}function Rd(t,e,n,i){bn[ka++]=t,bn[ka++]=e,bn[ka++]=n,bn[ka++]=i,wm|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Em(t,e,n,i){return Rd(t,e,n,i),td(t)}function To(t,e){return Rd(t,null,null,e),td(t)}function US(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,o=t.return;o!==null;)o.childLanes|=n,i=o.alternate,i!==null&&(i.childLanes|=n),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-an(n),t=o.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),o):null}function td(t){if(50<Tl)throw Tl=0,Jg=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ta={};function fO(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,i){return new fO(t,e,n,i)}function Cm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Mi(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function VS(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Bu(t,e,n,i,r,o){var a=0;if(i=t,typeof t=="function")Cm(t)&&(a=1);else if(typeof t=="string")a=gM(t,n,ai.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case bg:return t=tn(31,n,e,r),t.elementType=bg,t.lanes=o,t;case _a:return mo(n.children,r,o,e);case sS:a=8,r|=24;break;case mg:return t=tn(12,n,e,r|2),t.elementType=mg,t.lanes=o,t;case vg:return t=tn(13,n,e,r),t.elementType=vg,t.lanes=o,t;case yg:return t=tn(19,n,e,r),t.elementType=yg,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ti:a=10;break e;case lS:a=9;break e;case dm:a=11;break e;case fm:a=14;break e;case pr:a=16,i=null;break e}a=29,n=Error(M(130,t===null?"null":typeof t,"")),i=null}return e=tn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function mo(t,e,n,i){return t=tn(7,t,i,e),t.lanes=n,t}function Yh(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function jS(t){var e=tn(18,null,null,0);return e.stateNode=t,e}function Wh(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var J_=new WeakMap;function En(t,e){if(typeof t=="object"&&t!==null){var n=J_.get(t);return n!==void 0?n:(e={value:t,source:e,stack:L_(e)},J_.set(t,e),e)}return{value:t,source:e,stack:L_(e)}}var Ra=[],Oa=0,nd=null,Ll=0,xn=[],Sn=0,Dr=null,ii=1,ri="";function Ai(t,e){Ra[Oa++]=Ll,Ra[Oa++]=nd,nd=t,Ll=e}function PS(t,e,n){xn[Sn++]=ii,xn[Sn++]=ri,xn[Sn++]=Dr,Dr=t;var i=ii;t=ri;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(e)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,ii=1<<32-an(e)+r|n<<r|i,ri=o+t}else ii=1<<o|n<<r|i,ri=t}function Am(t){t.return!==null&&(Ai(t,1),PS(t,1,0))}function km(t){for(;t===nd;)nd=Ra[--Oa],Ra[Oa]=null,Ll=Ra[--Oa],Ra[Oa]=null;for(;t===Dr;)Dr=xn[--Sn],xn[Sn]=null,ri=xn[--Sn],xn[Sn]=null,ii=xn[--Sn],xn[Sn]=null}function qS(t,e){xn[Sn++]=ii,xn[Sn++]=ri,xn[Sn++]=Dr,ii=e.id,ri=e.overflow,Dr=t}var yt=null,Ie=null,he=!1,Cr=null,Cn=!1,Dg=Error(M(519));function Lr(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Il(En(e,t)),Dg}function ex(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[vt]=t,e[Pt]=i,n){case"dialog":ce("cancel",e),ce("close",e);break;case"iframe":case"object":case"embed":ce("load",e);break;case"video":case"audio":for(n=0;n<$l.length;n++)ce($l[n],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),xS(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ce("invalid",e);break;case"textarea":ce("invalid",e),wS(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||k1(e.textContent,n)?(i.popover!=null&&(ce("beforetoggle",e),ce("toggle",e)),i.onScroll!=null&&ce("scroll",e),i.onScrollEnd!=null&&ce("scrollend",e),i.onClick!=null&&(e.onclick=Ri),e=!0):e=!1,e||Lr(t,!0)}function tx(t){for(yt=t.return;yt;)switch(yt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:yt=yt.return}}function ma(t){if(t!==yt)return!1;if(!he)return tx(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||rm(t.type,t.memoizedProps)),n=!n),n&&Ie&&Lr(t),tx(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=jx(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=jx(t)}else e===27?(e=Ie,Br(t.type)?(t=lm,lm=null,Ie=t):Ie=e):Ie=yt?kn(t.stateNode.nextSibling):null;return!0}function _o(){Ie=yt=null,he=!1}function Xh(){var t=Cr;return t!==null&&(Vt===null?Vt=t:Vt.push.apply(Vt,t),Cr=null),t}function Il(t){Cr===null?Cr=[t]:Cr.push(t)}var Lg=si(null),Ro=null,Oi=null;function gr(t,e,n){Oe(Lg,e._currentValue),e._currentValue=n}function Ni(t){t._currentValue=Lg.current,pt(Lg)}function Ig(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Hg(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var a=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Ig(o.return,n,t),i||(a=null);break e}o=s.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(M(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ig(a,n,t),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===t){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Qa(t,e,n,i){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(M(387));if(a=a.memoizedProps,a!==null){var s=r.type;ln(r.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(r===Wu.current){if(a=r.alternate,a===null)throw Error(M(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Ul):t=[Ul])}r=r.return}t!==null&&Hg(e,t,n,i),e.flags|=262144}function id(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function xo(t){Ro=t,Oi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return ZS(Ro,t)}function Eu(t,e){return Ro===null&&xo(t),ZS(t,e)}function ZS(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Oi===null){if(t===null)throw Error(M(308));Oi=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Oi=Oi.next=e;return n}var pO=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},hO=ot.unstable_scheduleCallback,gO=ot.unstable_NormalPriority,et={$$typeof:Ti,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tm(){return{controller:new pO,data:new Map,refCount:0}}function Xl(t){t.refCount--,t.refCount===0&&hO(gO,function(){t.controller.abort()})}var _l=null,zg=0,Va=0,Ia=null;function mO(t,e){if(_l===null){var n=_l=[];zg=0,Va=Jm(),Ia={status:"pending",value:void 0,then:function(i){n.push(i)}}}return zg++,e.then(nx,nx),e}function nx(){if(--zg===0&&_l!==null){Ia!==null&&(Ia.status="fulfilled");var t=_l;_l=null,Va=0,Ia=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function vO(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var ix=ee.S;ee.S=function(t,e){a1=rn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&mO(t,e),ix!==null&&ix(t,e)};var vo=si(null);function Rm(){var t=vo.current;return t!==null?t:Ae.pooledCache}function $u(t,e){e===null?Oe(vo,vo.current):Oe(vo,e.pool)}function GS(){var t=Rm();return t===null?null:{parent:et._currentValue,pool:t}}var Ja=Error(M(460)),Om=Error(M(474)),Od=Error(M(542)),rd={then:function(){}};function rx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function YS(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Ri,Ri),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,ax(t),t;default:if(typeof e.status=="string")e.then(Ri,Ri);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(M(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,ax(t),t}throw yo=e,Ja}}function po(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(yo=n,Ja):n}}var yo=null;function ox(){if(yo===null)throw Error(M(459));var t=yo;return yo=null,t}function ax(t){if(t===Ja||t===Od)throw Error(M(483))}var Ha=null,Hl=0;function Cu(t){var e=Hl;return Hl+=1,Ha===null&&(Ha=[]),YS(Ha,t,e)}function sl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Au(t,e){throw e.$$typeof===i2?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function WS(t){function e(f,g){if(t){var v=f.deletions;v===null?(f.deletions=[g],f.flags|=16):v.push(g)}}function n(f,g){if(!t)return null;for(;g!==null;)e(f,g),g=g.sibling;return null}function i(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 r(f,g){return f=Mi(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 a(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,g,v,y){return g===null||g.tag!==6?(g=Yh(v,f.mode,y),g.return=f,g):(g=r(g,v),g.return=f,g)}function l(f,g,v,y){var w=v.type;return w===_a?u(f,g,v.props.children,y,v.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===pr&&po(w)===g.type)?(g=r(g,v.props),sl(g,v),g.return=f,g):(g=Bu(v.type,v.key,v.props,null,f.mode,y),sl(g,v),g.return=f,g)}function c(f,g,v,y){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=Wh(v,f.mode,y),g.return=f,g):(g=r(g,v.children||[]),g.return=f,g)}function u(f,g,v,y,w){return g===null||g.tag!==7?(g=mo(v,f.mode,y,w),g.return=f,g):(g=r(g,v),g.return=f,g)}function d(f,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Yh(""+g,f.mode,v),g.return=f,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case mu:return v=Bu(g.type,g.key,g.props,null,f.mode,v),sl(v,g),v.return=f,v;case fl:return g=Wh(g,f.mode,v),g.return=f,g;case pr:return g=po(g),d(f,g,v)}if(pl(g)||ol(g))return g=mo(g,f.mode,v,null),g.return=f,g;if(typeof g.then=="function")return d(f,Cu(g),v);if(g.$$typeof===Ti)return d(f,Eu(f,g),v);Au(f,g)}return null}function h(f,g,v,y){var w=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:s(f,g,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case mu:return v.key===w?l(f,g,v,y):null;case fl:return v.key===w?c(f,g,v,y):null;case pr:return v=po(v),h(f,g,v,y)}if(pl(v)||ol(v))return w!==null?null:u(f,g,v,y,null);if(typeof v.then=="function")return h(f,g,Cu(v),y);if(v.$$typeof===Ti)return h(f,g,Eu(f,v),y);Au(f,v)}return null}function m(f,g,v,y,w){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(g,f,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case mu:return f=f.get(y.key===null?v:y.key)||null,l(g,f,y,w);case fl:return f=f.get(y.key===null?v:y.key)||null,c(g,f,y,w);case pr:return y=po(y),m(f,g,v,y,w)}if(pl(y)||ol(y))return f=f.get(v)||null,u(g,f,y,w,null);if(typeof y.then=="function")return m(f,g,v,Cu(y),w);if(y.$$typeof===Ti)return m(f,g,v,Eu(g,y),w);Au(g,y)}return null}function x(f,g,v,y){for(var w=null,E=null,S=g,k=g=0,T=null;S!==null&&k<v.length;k++){S.index>k?(T=S,S=null):T=S.sibling;var C=h(f,S,v[k],y);if(C===null){S===null&&(S=T);break}t&&S&&C.alternate===null&&e(f,S),g=o(C,g,k),E===null?w=C:E.sibling=C,E=C,S=T}if(k===v.length)return n(f,S),he&&Ai(f,k),w;if(S===null){for(;k<v.length;k++)S=d(f,v[k],y),S!==null&&(g=o(S,g,k),E===null?w=S:E.sibling=S,E=S);return he&&Ai(f,k),w}for(S=i(S);k<v.length;k++)T=m(S,f,k,v[k],y),T!==null&&(t&&T.alternate!==null&&S.delete(T.key===null?k:T.key),g=o(T,g,k),E===null?w=T:E.sibling=T,E=T);return t&&S.forEach(function(R){return e(f,R)}),he&&Ai(f,k),w}function _(f,g,v,y){if(v==null)throw Error(M(151));for(var w=null,E=null,S=g,k=g=0,T=null,C=v.next();S!==null&&!C.done;k++,C=v.next()){S.index>k?(T=S,S=null):T=S.sibling;var R=h(f,S,C.value,y);if(R===null){S===null&&(S=T);break}t&&S&&R.alternate===null&&e(f,S),g=o(R,g,k),E===null?w=R:E.sibling=R,E=R,S=T}if(C.done)return n(f,S),he&&Ai(f,k),w;if(S===null){for(;!C.done;k++,C=v.next())C=d(f,C.value,y),C!==null&&(g=o(C,g,k),E===null?w=C:E.sibling=C,E=C);return he&&Ai(f,k),w}for(S=i(S);!C.done;k++,C=v.next())C=m(S,f,k,C.value,y),C!==null&&(t&&C.alternate!==null&&S.delete(C.key===null?k:C.key),g=o(C,g,k),E===null?w=C:E.sibling=C,E=C);return t&&S.forEach(function(L){return e(f,L)}),he&&Ai(f,k),w}function b(f,g,v,y){if(typeof v=="object"&&v!==null&&v.type===_a&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case mu:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===_a){if(g.tag===7){n(f,g.sibling),y=r(g,v.props.children),y.return=f,f=y;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===pr&&po(w)===g.type){n(f,g.sibling),y=r(g,v.props),sl(y,v),y.return=f,f=y;break e}n(f,g);break}else e(f,g);g=g.sibling}v.type===_a?(y=mo(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Bu(v.type,v.key,v.props,null,f.mode,y),sl(y,v),y.return=f,f=y)}return a(f);case fl:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(f,g.sibling),y=r(g,v.children||[]),y.return=f,f=y;break e}else{n(f,g);break}else e(f,g);g=g.sibling}y=Wh(v,f.mode,y),y.return=f,f=y}return a(f);case pr:return v=po(v),b(f,g,v,y)}if(pl(v))return x(f,g,v,y);if(ol(v)){if(w=ol(v),typeof w!="function")throw Error(M(150));return v=w.call(v),_(f,g,v,y)}if(typeof v.then=="function")return b(f,g,Cu(v),y);if(v.$$typeof===Ti)return b(f,g,Eu(f,v),y);Au(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(n(f,g.sibling),y=r(g,v),y.return=f,f=y):(n(f,g),y=Yh(v,f.mode,y),y.return=f,f=y),a(f)):n(f,g)}return function(f,g,v,y){try{Hl=0;var w=b(f,g,v,y);return Ha=null,w}catch(S){if(S===Ja||S===Od)throw S;var E=tn(29,S,null,f.mode);return E.lanes=y,E.return=f,E}}}var So=WS(!0),XS=WS(!1),hr=!1;function Mm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bg(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 Ar(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function kr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=td(t),US(t,null,n),e}return Rd(t,i,e,n),td(t)}function xl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hS(t,n)}}function Kh(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var $g=!1;function Sl(){if($g){var t=Ia;if(t!==null)throw t}}function wl(t,e,n,i){$g=!1;var r=t.updateQueue;hr=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;a=0,u=c=l=null,s=o;do{var h=s.lane&-536870913,m=h!==s.lane;if(m?(pe&h)===h:(i&h)===h){h!==0&&h===Va&&($g=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var x=t,_=s;h=e;var b=n;switch(_.tag){case 1:if(x=_.payload,typeof x=="function"){d=x.call(b,d,h);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=_.payload,h=typeof x=="function"?x.call(b,d,h):x,h==null)break e;d=He({},d,h);break e;case 2:hr=!0}}h=s.callback,h!==null&&(t.flags|=64,m&&(t.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=m,l=d):u=u.next=m,a|=h;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;m=s,s=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,o===null&&(r.shared.lanes=0),Hr|=a,t.lanes=a,t.memoizedState=d}}function KS(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function QS(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)KS(n[t],e)}var ja=si(null),od=si(0);function sx(t,e){t=Bi,Oe(od,t),Oe(ja,e),Bi=t|e.baseLanes}function Fg(){Oe(od,Bi),Oe(ja,ja.current)}function Nm(){Bi=od.current,pt(ja),pt(od)}var cn=si(null),An=null;function mr(t){var e=t.alternate;Oe(Ye,Ye.current&1),Oe(cn,t),An===null&&(e===null||ja.current!==null||e.memoizedState!==null)&&(An=t)}function Ug(t){Oe(Ye,Ye.current),Oe(cn,t),An===null&&(An=t)}function JS(t){t.tag===22?(Oe(Ye,Ye.current),Oe(cn,t),An===null&&(An=t)):vr(t)}function vr(){Oe(Ye,Ye.current),Oe(cn,cn.current)}function en(t){pt(cn),An===t&&(An=null),pt(Ye)}var Ye=si(0);function ad(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||am(n)||sm(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ii=0,ae=null,Ee=null,Qe=null,sd=!1,za=!1,wo=!1,ld=0,zl=0,Ba=null,yO=0;function Ze(){throw Error(M(321))}function Dm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ln(t[n],e[n]))return!1;return!0}function Lm(t,e,n,i,r,o){return Ii=o,ae=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?Ow:qm,wo=!1,o=n(i,r),wo=!1,za&&(o=tw(e,n,i,r)),ew(t),o}function ew(t){ee.H=Bl;var e=Ee!==null&&Ee.next!==null;if(Ii=0,Qe=Ee=ae=null,sd=!1,zl=0,Ba=null,e)throw Error(M(300));t===null||tt||(t=t.dependencies,t!==null&&id(t)&&(tt=!0))}function tw(t,e,n,i){ae=t;var r=0;do{if(za&&(Ba=null),zl=0,za=!1,25<=r)throw Error(M(301));if(r+=1,Qe=Ee=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ee.H=Mw,o=e(n,i)}while(za);return o}function bO(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?Kl(e):e,t=t.useState()[0],(Ee!==null?Ee.memoizedState:null)!==t&&(ae.flags|=1024),e}function Im(){var t=ld!==0;return ld=0,t}function Hm(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function zm(t){if(sd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}sd=!1}Ii=0,Qe=Ee=ae=null,za=!1,zl=ld=0,Ba=null}function Dt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ae.memoizedState=Qe=t:Qe=Qe.next=t,Qe}function We(){if(Ee===null){var t=ae.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Qe===null?ae.memoizedState:Qe.next;if(e!==null)Qe=e,Ee=t;else{if(t===null)throw ae.alternate===null?Error(M(467)):Error(M(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Qe===null?ae.memoizedState=Qe=t:Qe=Qe.next=t}return Qe}function Md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Kl(t){var e=zl;return zl+=1,Ba===null&&(Ba=[]),t=YS(Ba,t,e),e=ae,(Qe===null?e.memoizedState:Qe.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?Ow:qm),t}function Nd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Kl(t);if(t.$$typeof===Ti)return bt(t)}throw Error(M(438,String(t)))}function Bm(t){var e=null,n=ae.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=ae.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Md(),ae.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=r2;return e.index++,n}function Hi(t,e){return typeof e=="function"?e(t):e}function Fu(t){var e=We();return $m(e,Ee,t)}function $m(t,e,n){var i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=n;var r=t.baseQueue,o=i.pending;if(o!==null){if(r!==null){var a=r.next;r.next=o.next,o.next=a}e.baseQueue=r=o,i.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(pe&d)===d:(Ii&d)===d){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===Va&&(u=!0);else if((Ii&h)===h){c=c.next,h===Va&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=o):l=l.next=d,ae.lanes|=h,Hr|=h;d=c.action,wo&&n(o,d),o=c.hasEagerState?c.eagerState:n(o,d)}else h={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=h,a=o):l=l.next=h,ae.lanes|=d,Hr|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=o:l.next=s,!ln(o,t.memoizedState)&&(tt=!0,u&&(n=Ia,n!==null)))throw n;t.memoizedState=o,t.baseState=a,t.baseQueue=l,i.lastRenderedState=o}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Qh(t){var e=We(),n=e.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,o=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do o=t(o,a.action),a=a.next;while(a!==r);ln(o,e.memoizedState)||(tt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,i]}function nw(t,e,n){var i=ae,r=We(),o=he;if(o){if(n===void 0)throw Error(M(407));n=n()}else n=e();var a=!ln((Ee||r).memoizedState,n);if(a&&(r.memoizedState=n,tt=!0),r=r.queue,Fm(ow.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Qe!==null&&Qe.memoizedState.tag&1){if(i.flags|=2048,Pa(9,{destroy:void 0},rw.bind(null,i,r,n,e),null),Ae===null)throw Error(M(349));o||(Ii&127)!==0||iw(i,e,n)}return n}function iw(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ae.updateQueue,e===null?(e=Md(),ae.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function rw(t,e,n,i){e.value=n,e.getSnapshot=i,aw(e)&&sw(t)}function ow(t,e,n){return n(function(){aw(e)&&sw(t)})}function aw(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ln(t,n)}catch{return!0}}function sw(t){var e=To(t,2);e!==null&&jt(e,t,2)}function Vg(t){var e=Dt();if(typeof t=="function"){var n=t;if(t=n(),wo){br(!0);try{n()}finally{br(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:t},e}function lw(t,e,n,i){return t.baseState=n,$m(t,Ee,typeof i=="function"?i:Hi)}function _O(t,e,n,i,r){if(Ld(t))throw Error(M(485));if(t=e.action,t!==null){var o={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){o.listeners.push(a)}};ee.T!==null?n(!0):o.isTransition=!1,i(o),n=e.pending,n===null?(o.next=e.pending=o,cw(e,o)):(o.next=n.next,e.pending=n.next=o)}}function cw(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var o=ee.T,a={};ee.T=a;try{var s=n(r,i),l=ee.S;l!==null&&l(a,s),lx(t,e,s)}catch(c){jg(t,e,c)}finally{o!==null&&a.types!==null&&(o.types=a.types),ee.T=o}}else try{o=n(r,i),lx(t,e,o)}catch(c){jg(t,e,c)}}function lx(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){cx(t,e,i)},function(i){return jg(t,e,i)}):cx(t,e,n)}function cx(t,e,n){e.status="fulfilled",e.value=n,uw(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,cw(t,n)))}function jg(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,uw(e),e=e.next;while(e!==i)}t.action=null}function uw(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function dw(t,e){return e}function ux(t,e){if(he){var n=Ae.formState;if(n!==null){e:{var i=ae;if(he){if(Ie){t:{for(var r=Ie,o=Cn;r.nodeType!==8;){if(!o){r=null;break t}if(r=kn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ie=kn(r.nextSibling),i=r.data==="F!";break e}}Lr(i)}i=!1}i&&(e=n[0])}}return n=Dt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dw,lastRenderedState:e},n.queue=i,n=kw.bind(null,ae,i),i.dispatch=n,i=Vg(!1),o=Pm.bind(null,ae,!1,i.queue),i=Dt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=_O.bind(null,ae,r,o,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function dx(t){var e=We();return fw(e,Ee,t)}function fw(t,e,n){if(e=$m(t,e,dw)[0],t=Fu(Hi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Kl(e)}catch(a){throw a===Ja?Od:a}else i=e;e=We();var r=e.queue,o=r.dispatch;return n!==e.memoizedState&&(ae.flags|=2048,Pa(9,{destroy:void 0},xO.bind(null,r,n),null)),[i,o,t]}function xO(t,e){t.action=e}function fx(t){var e=We(),n=Ee;if(n!==null)return fw(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function Pa(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=ae.updateQueue,e===null&&(e=Md(),ae.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function pw(){return We().memoizedState}function Uu(t,e,n,i){var r=Dt();ae.flags|=t,r.memoizedState=Pa(1|e,{destroy:void 0},n,i===void 0?null:i)}function Dd(t,e,n,i){var r=We();i=i===void 0?null:i;var o=r.memoizedState.inst;Ee!==null&&i!==null&&Dm(i,Ee.memoizedState.deps)?r.memoizedState=Pa(e,o,n,i):(ae.flags|=t,r.memoizedState=Pa(1|e,o,n,i))}function px(t,e){Uu(8390656,8,t,e)}function Fm(t,e){Dd(2048,8,t,e)}function SO(t){ae.flags|=4;var e=ae.updateQueue;if(e===null)e=Md(),ae.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function hw(t){var e=We().memoizedState;return SO({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function gw(t,e){return Dd(4,2,t,e)}function mw(t,e){return Dd(4,4,t,e)}function vw(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function yw(t,e,n){n=n!=null?n.concat([t]):null,Dd(4,4,vw.bind(null,e,t),n)}function Um(){}function bw(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Dm(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function _w(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Dm(e,i[1]))return i[0];if(i=t(),wo){br(!0);try{t()}finally{br(!1)}}return n.memoizedState=[i,e],i}function Vm(t,e,n){return n===void 0||(Ii&1073741824)!==0&&(pe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=l1(),ae.lanes|=t,Hr|=t,n)}function xw(t,e,n,i){return ln(n,e)?n:ja.current!==null?(t=Vm(t,n,i),ln(t,e)||(tt=!0),t):(Ii&42)===0||(Ii&1073741824)!==0&&(pe&261930)===0?(tt=!0,t.memoizedState=n):(t=l1(),ae.lanes|=t,Hr|=t,e)}function Sw(t,e,n,i,r){var o=ye.p;ye.p=o!==0&&8>o?o:8;var a=ee.T,s={};ee.T=s,Pm(t,!1,e,n);try{var l=r(),c=ee.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=vO(l,i);El(t,e,u,sn(t))}else El(t,e,i,sn(t))}catch(d){El(t,e,{then:function(){},status:"rejected",reason:d},sn())}finally{ye.p=o,a!==null&&s.types!==null&&(a.types=s.types),ee.T=a}}function wO(){}function Pg(t,e,n,i){if(t.tag!==5)throw Error(M(476));var r=ww(t).queue;Sw(t,r,e,go,n===null?wO:function(){return Ew(t),n(i)})}function ww(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:go,baseState:go,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:go},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ew(t){var e=ww(t);e.next===null&&(e=t.alternate.memoizedState),El(t,e.next.queue,{},sn())}function jm(){return bt(Ul)}function Cw(){return We().memoizedState}function Aw(){return We().memoizedState}function EO(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=sn();t=Ar(n);var i=kr(e,t,n);i!==null&&(jt(i,e,n),xl(i,e,n)),e={cache:Tm()},t.payload=e;return}e=e.return}}function CO(t,e,n){var i=sn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ld(t)?Tw(e,n):(n=Em(t,e,n,i),n!==null&&(jt(n,t,i),Rw(n,e,i)))}function kw(t,e,n){var i=sn();El(t,e,n,i)}function El(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ld(t))Tw(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,ln(s,a))return Rd(t,e,r,0),Ae===null&&Td(),!1}catch{}if(n=Em(t,e,r,i),n!==null)return jt(n,t,i),Rw(n,e,i),!0}return!1}function Pm(t,e,n,i){if(i={lane:2,revertLane:Jm(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ld(t)){if(e)throw Error(M(479))}else e=Em(t,n,i,2),e!==null&&jt(e,t,2)}function Ld(t){var e=t.alternate;return t===ae||e!==null&&e===ae}function Tw(t,e){za=sd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Rw(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hS(t,n)}}var Bl={readContext:bt,use:Nd,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};Bl.useEffectEvent=Ze;var Ow={readContext:bt,use:Nd,useCallback:function(t,e){return Dt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:px,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Uu(4194308,4,vw.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Uu(4194308,4,t,e)},useInsertionEffect:function(t,e){Uu(4,2,t,e)},useMemo:function(t,e){var n=Dt();e=e===void 0?null:e;var i=t();if(wo){br(!0);try{t()}finally{br(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Dt();if(n!==void 0){var r=n(e);if(wo){br(!0);try{n(e)}finally{br(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=CO.bind(null,ae,t),[i.memoizedState,t]},useRef:function(t){var e=Dt();return t={current:t},e.memoizedState=t},useState:function(t){t=Vg(t);var e=t.queue,n=kw.bind(null,ae,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Um,useDeferredValue:function(t,e){var n=Dt();return Vm(n,t,e)},useTransition:function(){var t=Vg(!1);return t=Sw.bind(null,ae,t.queue,!0,!1),Dt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=ae,r=Dt();if(he){if(n===void 0)throw Error(M(407));n=n()}else{if(n=e(),Ae===null)throw Error(M(349));(pe&127)!==0||iw(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,px(ow.bind(null,i,o,t),[t]),i.flags|=2048,Pa(9,{destroy:void 0},rw.bind(null,i,o,n,e),null),n},useId:function(){var t=Dt(),e=Ae.identifierPrefix;if(he){var n=ri,i=ii;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=ld++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=yO++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:jm,useFormState:ux,useActionState:ux,useOptimistic:function(t){var e=Dt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Pm.bind(null,ae,!0,n),n.dispatch=e,[t,e]},useMemoCache:Bm,useCacheRefresh:function(){return Dt().memoizedState=EO.bind(null,ae)},useEffectEvent:function(t){var e=Dt(),n={impl:t};return e.memoizedState=n,function(){if((ve&2)!==0)throw Error(M(440));return n.impl.apply(void 0,arguments)}}},qm={readContext:bt,use:Nd,useCallback:bw,useContext:bt,useEffect:Fm,useImperativeHandle:yw,useInsertionEffect:gw,useLayoutEffect:mw,useMemo:_w,useReducer:Fu,useRef:pw,useState:function(){return Fu(Hi)},useDebugValue:Um,useDeferredValue:function(t,e){var n=We();return xw(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Fu(Hi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Kl(t),e]},useSyncExternalStore:nw,useId:Cw,useHostTransitionStatus:jm,useFormState:dx,useActionState:dx,useOptimistic:function(t,e){var n=We();return lw(n,Ee,t,e)},useMemoCache:Bm,useCacheRefresh:Aw};qm.useEffectEvent=hw;var Mw={readContext:bt,use:Nd,useCallback:bw,useContext:bt,useEffect:Fm,useImperativeHandle:yw,useInsertionEffect:gw,useLayoutEffect:mw,useMemo:_w,useReducer:Qh,useRef:pw,useState:function(){return Qh(Hi)},useDebugValue:Um,useDeferredValue:function(t,e){var n=We();return Ee===null?Vm(n,t,e):xw(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Qh(Hi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Kl(t),e]},useSyncExternalStore:nw,useId:Cw,useHostTransitionStatus:jm,useFormState:fx,useActionState:fx,useOptimistic:function(t,e){var n=We();return Ee!==null?lw(n,Ee,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Bm,useCacheRefresh:Aw};Mw.useEffectEvent=hw;function Jh(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:He({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var qg={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Ar(i);r.payload=e,n!=null&&(r.callback=n),e=kr(t,r,i),e!==null&&(jt(e,t,i),xl(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=sn(),r=Ar(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=kr(t,r,i),e!==null&&(jt(e,t,i),xl(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),i=Ar(n);i.tag=2,e!=null&&(i.callback=e),e=kr(t,i,n),e!==null&&(jt(e,t,n),xl(e,t,n))}};function hx(t,e,n,i,r,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,o,a):e.prototype&&e.prototype.isPureReactComponent?!Dl(n,i)||!Dl(r,o):!0}function gx(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&qg.enqueueReplaceState(e,e.state,null)}function Eo(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=He({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function Nw(t){ed(t)}function Dw(t){console.error(t)}function Lw(t){ed(t)}function cd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function mx(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Zg(t,e,n){return n=Ar(n),n.tag=3,n.payload={element:null},n.callback=function(){cd(t,e)},n}function Iw(t){return t=Ar(t),t.tag=3,t}function Hw(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=i.value;t.payload=function(){return r(o)},t.callback=function(){mx(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){mx(e,n,i),typeof r!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function AO(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Qa(e,n,r,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return An===null?hd():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===rd?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),ug(t,i,r)),!1;case 22:return n.flags|=65536,i===rd?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),ug(t,i,r)),!1}throw Error(M(435,n.tag))}return ug(t,i,r),hd(),!1}if(he)return e=cn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Dg&&(t=Error(M(422),{cause:i}),Il(En(t,n)))):(i!==Dg&&(e=Error(M(423),{cause:i}),Il(En(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=En(i,n),r=Zg(t.stateNode,i,r),Kh(t,r),Ge!==4&&(Ge=2)),!1;var o=Error(M(520),{cause:i});if(o=En(o,n),kl===null?kl=[o]:kl.push(o),Ge!==4&&(Ge=2),e===null)return!0;i=En(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Zg(n.stateNode,i,t),Kh(n,t),!1;case 1:if(e=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Tr===null||!Tr.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Iw(r),Hw(r,t,n,i),Kh(n,r),!1}n=n.return}while(n!==null);return!1}var Zm=Error(M(461)),tt=!1;function mt(t,e,n,i){e.child=t===null?XS(e,null,n,i):So(e,t.child,n,i)}function vx(t,e,n,i,r){n=n.render;var o=e.ref;if("ref"in i){var a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}else a=i;return xo(e),i=Lm(t,e,n,a,o,r),s=Im(),t!==null&&!tt?(Hm(t,e,r),zi(t,e,r)):(he&&s&&Am(e),e.flags|=1,mt(t,e,i,r),e.child)}function yx(t,e,n,i,r){if(t===null){var o=n.type;return typeof o=="function"&&!Cm(o)&&o.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=o,zw(t,e,o,i,r)):(t=Bu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!Gm(t,r)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Dl,n(a,i)&&t.ref===e.ref)return zi(t,e,r)}return e.flags|=1,t=Mi(o,i),t.ref=e.ref,t.return=e,e.child=t}function zw(t,e,n,i,r){if(t!==null){var o=t.memoizedProps;if(Dl(o,i)&&t.ref===e.ref)if(tt=!1,e.pendingProps=i=o,Gm(t,r))(t.flags&131072)!==0&&(tt=!0);else return e.lanes=t.lanes,zi(t,e,r)}return Gg(t,e,n,i,r)}function Bw(t,e,n,i){var r=i.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,e.child=null;return bx(t,e,o,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&$u(e,o!==null?o.cachePool:null),o!==null?sx(e,o):Fg(),JS(e);else return i=e.lanes=536870912,bx(t,e,o!==null?o.baseLanes|n:n,n,i)}else o!==null?($u(e,o.cachePool),sx(e,o),vr(e),e.memoizedState=null):(t!==null&&$u(e,null),Fg(),vr(e));return mt(t,e,r,n),e.child}function gl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function bx(t,e,n,i,r){var o=Rm();return o=o===null?null:{parent:et._currentValue,pool:o},e.memoizedState={baseLanes:n,cachePool:o},t!==null&&$u(e,null),Fg(),JS(e),t!==null&&Qa(t,e,i,!0),e.childLanes=r,null}function Vu(t,e){return e=ud({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function _x(t,e,n){return So(e,t.child,null,n),t=Vu(e,e.pendingProps),t.flags|=2,en(e),e.memoizedState=null,t}function kO(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=Vu(e,i),e.lanes=536870912,gl(null,t);if(Ug(e),(t=Ie)?(t=O1(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dr!==null?{id:ii,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},n=jS(t),n.return=e,e.child=n,yt=e,Ie=null)):t=null,t===null)throw Lr(e);return e.lanes=536870912,null}return Vu(e,i)}var o=t.memoizedState;if(o!==null){var a=o.dehydrated;if(Ug(e),r)if(e.flags&256)e.flags&=-257,e=_x(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(tt||Qa(t,e,n,!1),r=(n&t.childLanes)!==0,tt||r){if(i=Ae,i!==null&&(a=gS(i,n),a!==0&&a!==o.retryLane))throw o.retryLane=a,To(t,a),jt(i,t,a),Zm;hd(),e=_x(t,e,n)}else t=o.treeContext,Ie=kn(a.nextSibling),yt=e,he=!0,Cr=null,Cn=!1,t!==null&&qS(e,t),e=Vu(e,i),e.flags|=4096;return e}return t=Mi(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ju(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(M(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Gg(t,e,n,i,r){return xo(e),n=Lm(t,e,n,i,void 0,r),i=Im(),t!==null&&!tt?(Hm(t,e,r),zi(t,e,r)):(he&&i&&Am(e),e.flags|=1,mt(t,e,n,r),e.child)}function xx(t,e,n,i,r,o){return xo(e),e.updateQueue=null,n=tw(e,i,n,r),ew(t),i=Im(),t!==null&&!tt?(Hm(t,e,o),zi(t,e,o)):(he&&i&&Am(e),e.flags|=1,mt(t,e,n,o),e.child)}function Sx(t,e,n,i,r){if(xo(e),e.stateNode===null){var o=Ta,a=n.contextType;typeof a=="object"&&a!==null&&(o=bt(a)),o=new n(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=qg,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},Mm(e),a=n.contextType,o.context=typeof a=="object"&&a!==null?bt(a):Ta,o.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Jh(e,n,a,i),o.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(a=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),a!==o.state&&qg.enqueueReplaceState(o,o.state,null),wl(e,i,o,r),Sl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Eo(n,s);o.props=l;var c=o.context,u=n.contextType;a=Ta,typeof u=="object"&&u!==null&&(a=bt(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||c!==a)&&gx(e,o,i,a),hr=!1;var h=e.memoizedState;o.state=h,wl(e,i,o,r),Sl(),c=e.memoizedState,s||h!==c||hr?(typeof d=="function"&&(Jh(e,n,d,i),c=e.memoizedState),(l=hr||hx(e,n,l,i,h,c,a))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,Bg(t,e),a=e.memoizedProps,u=Eo(n,a),o.props=u,d=e.pendingProps,h=o.context,c=n.contextType,l=Ta,typeof c=="object"&&c!==null&&(l=bt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&gx(e,o,i,l),hr=!1,h=e.memoizedState,o.state=h,wl(e,i,o,r),Sl();var m=e.memoizedState;a!==d||h!==m||hr||t!==null&&t.dependencies!==null&&id(t.dependencies)?(typeof s=="function"&&(Jh(e,n,s,i),m=e.memoizedState),(u=hr||hx(e,n,u,i,h,m,l)||t!==null&&t.dependencies!==null&&id(t.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=m),o.props=i,o.state=m,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return o=i,ju(t,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&i?(e.child=So(e,t.child,null,r),e.child=So(e,null,n,r)):mt(t,e,n,r),e.memoizedState=o.state,t=e.child):t=zi(t,e,r),t}function wx(t,e,n,i){return _o(),e.flags|=256,mt(t,e,n,i),e.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(t){return{baseLanes:t,cachePool:GS()}}function ng(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=nn),t}function $w(t,e,n){var i=e.pendingProps,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(Ye.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?mr(e):vr(e),(t=Ie)?(t=O1(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Dr!==null?{id:ii,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},n=jS(t),n.return=e,e.child=n,yt=e,Ie=null)):t=null,t===null)throw Lr(e);return sm(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(vr(e),r=e.mode,s=ud({mode:"hidden",children:s},r),i=mo(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=tg(n),i.childLanes=ng(t,a,n),e.memoizedState=eg,gl(null,i)):(mr(e),Yg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(mr(e),e.flags&=-257,e=ig(t,e,n)):e.memoizedState!==null?(vr(e),e.child=t.child,e.flags|=128,e=null):(vr(e),s=i.fallback,r=e.mode,i=ud({mode:"visible",children:i.children},r),s=mo(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,So(e,t.child,null,n),i=e.child,i.memoizedState=tg(n),i.childLanes=ng(t,a,n),e.memoizedState=eg,e=gl(null,i));else if(mr(e),sm(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(M(419)),i.stack="",i.digest=a,Il({value:i,source:null,stack:null}),e=ig(t,e,n)}else if(tt||Qa(t,e,n,!1),a=(n&t.childLanes)!==0,tt||a){if(a=Ae,a!==null&&(i=gS(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,To(t,i),jt(a,t,i),Zm;am(s)||hd(),e=ig(t,e,n)}else am(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ie=kn(s.nextSibling),yt=e,he=!0,Cr=null,Cn=!1,t!==null&&qS(e,t),e=Yg(e,i.children),e.flags|=4096);return e}return r?(vr(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Mi(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=Mi(c,s):(s=mo(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,gl(null,i),i=e.child,s=t.child.memoizedState,s===null?s=tg(n):(r=s.cachePool,r!==null?(l=et._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=GS(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=ng(t,a,n),e.memoizedState=eg,gl(t.child,i)):(mr(e),n=t.child,t=n.sibling,n=Mi(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Yg(t,e){return e=ud({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function ud(t,e){return t=tn(22,t,null,e),t.lanes=0,t}function ig(t,e,n){return So(e,t.child,null,n),t=Yg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ex(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Ig(t.return,e,n)}function rg(t,e,n,i,r,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function Fw(t,e,n){var i=e.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=Ye.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,Oe(Ye,a),mt(t,e,i,n),i=he?Ll:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ex(t,n,e);else if(t.tag===19)Ex(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&ad(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),rg(e,!1,r,n,o,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&ad(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}rg(e,!0,n,null,o,i);break;case"together":rg(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function zi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Hr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Qa(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,n=Mi(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Mi(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Gm(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&id(t)))}function TO(t,e,n){switch(e.tag){case 3:Xu(e,e.stateNode.containerInfo),gr(e,et,t.memoizedState.cache),_o();break;case 27:case 5:Sg(e);break;case 4:Xu(e,e.stateNode.containerInfo);break;case 10:gr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Ug(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(mr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?$w(t,e,n):(mr(e),t=zi(t,e,n),t!==null?t.sibling:null);mr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Qa(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return Fw(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Oe(Ye,Ye.current),i)break;return null;case 22:return e.lanes=0,Bw(t,e,n,e.pendingProps);case 24:gr(e,et,t.memoizedState.cache)}return zi(t,e,n)}function Uw(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)tt=!0;else{if(!Gm(t,n)&&(e.flags&128)===0)return tt=!1,TO(t,e,n);tt=(t.flags&131072)!==0}else tt=!1,he&&(e.flags&1048576)!==0&&PS(e,Ll,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=po(e.elementType),e.type=t,typeof t=="function")Cm(t)?(i=Eo(t,i),e.tag=1,e=Sx(null,e,t,i,n)):(e.tag=0,e=Gg(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===dm){e.tag=11,e=vx(null,e,t,i,n);break e}else if(r===fm){e.tag=14,e=yx(null,e,t,i,n);break e}}throw e=_g(t)||t,Error(M(306,e,""))}}return e;case 0:return Gg(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Eo(i,e.pendingProps),Sx(t,e,i,r,n);case 3:e:{if(Xu(e,e.stateNode.containerInfo),t===null)throw Error(M(387));i=e.pendingProps;var o=e.memoizedState;r=o.element,Bg(t,e),wl(e,i,null,n);var a=e.memoizedState;if(i=a.cache,gr(e,et,i),i!==o.cache&&Hg(e,[et],n,!0),Sl(),i=a.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=wx(t,e,i,n);break e}else if(i!==r){r=En(Error(M(424)),e),Il(r),e=wx(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ie=kn(t.firstChild),yt=e,he=!0,Cr=null,Cn=!0,n=XS(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_o(),i===r){e=zi(t,e,n);break e}mt(t,e,i,n)}e=e.child}return e;case 26:return ju(t,e),t===null?(n=Zx(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=yd(Er.current).createElement(n),i[vt]=e,i[Pt]=t,_t(i,n,t),ft(i),e.stateNode=i):e.memoizedState=Zx(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Sg(e),t===null&&he&&(i=e.stateNode=M1(e.type,e.pendingProps,Er.current),yt=e,Cn=!0,r=Ie,Br(e.type)?(lm=r,Ie=kn(i.firstChild)):Ie=r),mt(t,e,e.pendingProps.children,n),ju(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Ie)&&(i=nM(i,e.type,e.pendingProps,Cn),i!==null?(e.stateNode=i,yt=e,Ie=kn(i.firstChild),Cn=!1,r=!0):r=!1),r||Lr(e)),Sg(e),r=e.type,o=e.pendingProps,a=t!==null?t.memoizedProps:null,i=o.children,rm(r,o)?i=null:a!==null&&rm(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Lm(t,e,bO,null,null,n),Ul._currentValue=r),ju(t,e),mt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Ie)&&(n=iM(n,e.pendingProps,Cn),n!==null?(e.stateNode=n,yt=e,Ie=null,t=!0):t=!1),t||Lr(e)),null;case 13:return $w(t,e,n);case 4:return Xu(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=So(e,null,i,n):mt(t,e,i,n),e.child;case 11:return vx(t,e,e.type,e.pendingProps,n);case 7:return mt(t,e,e.pendingProps,n),e.child;case 8:return mt(t,e,e.pendingProps.children,n),e.child;case 12:return mt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,gr(e,e.type,i.value),mt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,xo(e),r=bt(r),i=i(r),e.flags|=1,mt(t,e,i,n),e.child;case 14:return yx(t,e,e.type,e.pendingProps,n);case 15:return zw(t,e,e.type,e.pendingProps,n);case 19:return Fw(t,e,n);case 31:return kO(t,e,n);case 22:return Bw(t,e,n,e.pendingProps);case 24:return xo(e),i=bt(et),t===null?(r=Rm(),r===null&&(r=Ae,o=Tm(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),e.memoizedState={parent:i,cache:r},Mm(e),gr(e,et,r)):((t.lanes&n)!==0&&(Bg(t,e),wl(e,null,null,n),Sl()),r=t.memoizedState,o=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),gr(e,et,i)):(i=o.cache,gr(e,et,i),i!==r.cache&&Hg(e,[et],n,!0))),mt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function Si(t){t.flags|=4}function og(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(d1())t.flags|=8192;else throw yo=rd,Om}else t.flags&=-16777217}function Cx(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!L1(e))if(d1())t.flags|=8192;else throw yo=rd,Om}function ku(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?fS():536870912,t.lanes|=e,qa|=e)}function ll(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Le(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function RO(t,e,n){var i=e.pendingProps;switch(km(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(e),null;case 1:return Le(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Ni(et),$a(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ma(e)?Si(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Xh())),Le(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(Si(e),o!==null?(Le(e),Cx(e,o)):(Le(e),og(e,r,null,i,n))):o?o!==t.memoizedState?(Si(e),Le(e),Cx(e,o)):(Le(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&Si(e),Le(e),og(e,r,t,i,n)),null;case 27:if(Ku(e),n=Er.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Si(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}t=ai.current,ma(e)?ex(e,t):(t=M1(r,i,n),e.stateNode=t,Si(e))}return Le(e),null;case 5:if(Ku(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Si(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}if(o=ai.current,ma(e))ex(e,o);else{var a=yd(Er.current);switch(o){case 1:o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=a.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}o[vt]=e,o[Pt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)o.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=o;e:switch(_t(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Si(e)}}return Le(e),og(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Si(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(M(166));if(t=Er.current,ma(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=yt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[vt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||k1(t.nodeValue,n)),t||Lr(e,!0)}else t=yd(t).createTextNode(i),t[vt]=e,e.stateNode=t}return Le(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=ma(e),n!==null){if(t===null){if(!i)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[vt]=e}else _o(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),t=!1}else n=Xh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(en(e),e):(en(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Le(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=ma(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(M(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(M(317));r[vt]=e}else _o(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),r=!1}else r=Xh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(en(e),e):(en(e),null)}return en(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),ku(e,e.updateQueue),Le(e),null);case 4:return $a(),t===null&&ev(e.stateNode.containerInfo),Le(e),null;case 10:return Ni(e.type),Le(e),null;case 19:if(pt(Ye),i=e.memoizedState,i===null)return Le(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)ll(i,!1);else{if(Ge!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=ad(t),o!==null){for(e.flags|=128,ll(i,!1),t=o.updateQueue,e.updateQueue=t,ku(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)VS(n,t),n=n.sibling;return Oe(Ye,Ye.current&1|2),he&&Ai(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&rn()>fd&&(e.flags|=128,r=!0,ll(i,!1),e.lanes=4194304)}else{if(!r)if(t=ad(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,ku(e,t),ll(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!he)return Le(e),null}else 2*rn()-i.renderingStartTime>fd&&n!==536870912&&(e.flags|=128,r=!0,ll(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(t=i.last,t!==null?t.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Ye.current,Oe(Ye,r?n&1|2:n&1),he&&Ai(e,i.treeForkCount),t):(Le(e),null);case 22:case 23:return en(e),Nm(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Le(e),e.subtreeFlags&6&&(e.flags|=8192)):Le(e),n=e.updateQueue,n!==null&&ku(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&pt(vo),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ni(et),Le(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function OO(t,e){switch(km(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ni(et),$a(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ku(e),null;case 31:if(e.memoizedState!==null){if(en(e),e.alternate===null)throw Error(M(340));_o()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(en(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));_o()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return pt(Ye),null;case 4:return $a(),null;case 10:return Ni(e.type),null;case 22:case 23:return en(e),Nm(),t!==null&&pt(vo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ni(et),null;case 25:return null;default:return null}}function Vw(t,e){switch(km(e),e.tag){case 3:Ni(et),$a();break;case 26:case 27:case 5:Ku(e);break;case 4:$a();break;case 31:e.memoizedState!==null&&en(e);break;case 13:en(e);break;case 19:pt(Ye);break;case 10:Ni(e.type);break;case 22:case 23:en(e),Nm(),t!==null&&pt(vo);break;case 24:Ni(et)}}function Ql(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(s){xe(e,e.return,s)}}function Ir(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&t)===t){var a=i.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){xe(r,l,u)}}}i=i.next}while(i!==o)}}catch(u){xe(e,e.return,u)}}function jw(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{QS(e,n)}catch(i){xe(t,t.return,i)}}}function Pw(t,e,n){n.props=Eo(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){xe(t,e,i)}}function Cl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){xe(t,e,r)}}function oi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){xe(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){xe(t,e,r)}else n.current=null}function qw(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){xe(t,t.return,r)}}function ag(t,e,n){try{var i=t.stateNode;XO(i,t.type,n,e),i[Pt]=e}catch(r){xe(t,t.return,r)}}function Zw(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Br(t.type)||t.tag===4}function sg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zw(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&&Br(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 Wg(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ri));else if(i!==4&&(i===27&&Br(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Wg(t,e,n),t=t.sibling;t!==null;)Wg(t,e,n),t=t.sibling}function dd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Br(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(dd(t,e,n),t=t.sibling;t!==null;)dd(t,e,n),t=t.sibling}function Gw(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);_t(e,i,n),e[vt]=t,e[Pt]=n}catch(o){xe(t,t.return,o)}}var ki=!1,Je=!1,lg=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,dt=null;function MO(t,e){if(t=t.containerInfo,nm=Sd,t=LS(t),Sm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var m;d!==n||r!==0&&d.nodeType!==3||(s=a+r),d!==o||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===t)break t;if(h===n&&++c===r&&(s=a),h===o&&++u===i&&(l=a),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(im={focusedElem:t,selectionRange:n},Sd=!1,dt=e;dt!==null;)if(e=dt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,dt=t;else for(;dt!==null;){switch(e=dt,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,n=e,r=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var x=Eo(n.type,r);t=i.getSnapshotBeforeUpdate(x,o),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){xe(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)om(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":om(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(M(163))}if(t=e.sibling,t!==null){t.return=e.return,dt=t;break}dt=e.return}}function Yw(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Ei(t,n),i&4&&Ql(5,n);break;case 1:if(Ei(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){xe(n,n.return,a)}else{var r=Eo(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){xe(n,n.return,a)}}i&64&&jw(n),i&512&&Cl(n,n.return);break;case 3:if(Ei(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{QS(t,e)}catch(a){xe(n,n.return,a)}}break;case 27:e===null&&i&4&&Gw(n);case 26:case 5:Ei(t,n),e===null&&i&4&&qw(n),i&512&&Cl(n,n.return);break;case 12:Ei(t,n);break;case 31:Ei(t,n),i&4&&Kw(t,n);break;case 13:Ei(t,n),i&4&&Qw(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=FO.bind(null,n),rM(t,n))));break;case 22:if(i=n.memoizedState!==null||ki,!i){e=e!==null&&e.memoizedState!==null||Je,r=ki;var o=Je;ki=i,(Je=e)&&!o?Ci(t,n,(n.subtreeFlags&8772)!==0):Ei(t,n),ki=r,Je=o}break;case 30:break;default:Ei(t,n)}}function Ww(t){var e=t.alternate;e!==null&&(t.alternate=null,Ww(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&mm(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Be=null,Ut=!1;function wi(t,e,n){for(n=n.child;n!==null;)Xw(t,e,n),n=n.sibling}function Xw(t,e,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(ql,n)}catch{}switch(n.tag){case 26:Je||oi(n,e),wi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Je||oi(n,e);var i=Be,r=Ut;Br(n.type)&&(Be=n.stateNode,Ut=!1),wi(t,e,n),Rl(n.stateNode),Be=i,Ut=r;break;case 5:Je||oi(n,e);case 6:if(i=Be,r=Ut,Be=null,wi(t,e,n),Be=i,Ut=r,Be!==null)if(Ut)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(o){xe(n,e,o)}else try{Be.removeChild(n.stateNode)}catch(o){xe(n,e,o)}break;case 18:Be!==null&&(Ut?(t=Be,Ux(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Wa(t)):Ux(Be,n.stateNode));break;case 4:i=Be,r=Ut,Be=n.stateNode.containerInfo,Ut=!0,wi(t,e,n),Be=i,Ut=r;break;case 0:case 11:case 14:case 15:Ir(2,n,e),Je||Ir(4,n,e),wi(t,e,n);break;case 1:Je||(oi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Pw(n,e,i)),wi(t,e,n);break;case 21:wi(t,e,n);break;case 22:Je=(i=Je)||n.memoizedState!==null,wi(t,e,n),Je=i;break;default:wi(t,e,n)}}function Kw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Wa(t)}catch(n){xe(e,e.return,n)}}}function Qw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Wa(t)}catch(n){xe(e,e.return,n)}}function NO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Ax),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Ax),e;default:throw Error(M(435,t.tag))}}function Tu(t,e){var n=NO(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=UO.bind(null,t,i);i.then(r,r)}})}function $t(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(Br(s.type)){Be=s.stateNode,Ut=!1;break e}break;case 5:Be=s.stateNode,Ut=!1;break e;case 3:case 4:Be=s.stateNode.containerInfo,Ut=!0;break e}s=s.return}if(Be===null)throw Error(M(160));Xw(o,a,r),Be=null,Ut=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Jw(e,t),e=e.sibling}var Fn=null;function Jw(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:$t(e,t),Ft(t),i&4&&(Ir(3,t,t.return),Ql(3,t),Ir(5,t,t.return));break;case 1:$t(e,t),Ft(t),i&512&&(Je||n===null||oi(n,n.return)),i&64&&ki&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Fn;if($t(e,t),Ft(t),i&512&&(Je||n===null||oi(n,n.return)),i&4){var o=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Yl]||o[vt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(i),r.head.insertBefore(o,r.querySelector("head > title"))),_t(o,i,n),o[vt]=t,ft(o),i=o;break e;case"link":var a=Yx("link","href",r).get(i+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(o=a[s],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}o=r.createElement(i),_t(o,i,n),r.head.appendChild(o);break;case"meta":if(a=Yx("meta","content",r).get(i+(n.content||""))){for(s=0;s<a.length;s++)if(o=a[s],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}o=r.createElement(i),_t(o,i,n),r.head.appendChild(o);break;default:throw Error(M(468,i))}o[vt]=t,ft(o),i=o}t.stateNode=i}else Wx(r,t.type,t.stateNode);else t.stateNode=Gx(r,i,t.memoizedProps);else o!==i?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,i===null?Wx(r,t.type,t.stateNode):Gx(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&ag(t,t.memoizedProps,n.memoizedProps)}break;case 27:$t(e,t),Ft(t),i&512&&(Je||n===null||oi(n,n.return)),n!==null&&i&4&&ag(t,t.memoizedProps,n.memoizedProps);break;case 5:if($t(e,t),Ft(t),i&512&&(Je||n===null||oi(n,n.return)),t.flags&32){r=t.stateNode;try{Ua(r,"")}catch(x){xe(t,t.return,x)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,ag(t,r,n!==null?n.memoizedProps:r)),i&1024&&(lg=!0);break;case 6:if($t(e,t),Ft(t),i&4){if(t.stateNode===null)throw Error(M(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(x){xe(t,t.return,x)}}break;case 3:if(Zu=null,r=Fn,Fn=bd(e.containerInfo),$t(e,t),Fn=r,Ft(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Wa(e.containerInfo)}catch(x){xe(t,t.return,x)}lg&&(lg=!1,e1(t));break;case 4:i=Fn,Fn=bd(t.stateNode.containerInfo),$t(e,t),Ft(t),Fn=i;break;case 12:$t(e,t),Ft(t);break;case 31:$t(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Tu(t,i)));break;case 13:$t(e,t),Ft(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Id=rn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Tu(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=ki,u=Je;if(ki=c||r,Je=u||l,$t(e,t),Je=u,ki=c,Ft(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||ki||Je||ho(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(o=l.stateNode,r)a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(x){xe(l,l.return,x)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(x){xe(l,l.return,x)}}}else if(e.tag===18){if(n===null){l=e;try{var m=l.stateNode;r?Vx(m,!0):Vx(l.stateNode,!1)}catch(x){xe(l,l.return,x)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Tu(t,n))));break;case 19:$t(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Tu(t,i)));break;case 30:break;case 21:break;default:$t(e,t),Ft(t)}}function Ft(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(Zw(i)){n=i;break}i=i.return}if(n==null)throw Error(M(160));switch(n.tag){case 27:var r=n.stateNode,o=sg(t);dd(t,o,r);break;case 5:var a=n.stateNode;n.flags&32&&(Ua(a,""),n.flags&=-33);var s=sg(t);dd(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=sg(t);Wg(t,c,l);break;default:throw Error(M(161))}}catch(u){xe(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function e1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;e1(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Ei(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Yw(t,e.alternate,e),e=e.sibling}function ho(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Ir(4,e,e.return),ho(e);break;case 1:oi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Pw(e,e.return,n),ho(e);break;case 27:Rl(e.stateNode);case 26:case 5:oi(e,e.return),ho(e);break;case 22:e.memoizedState===null&&ho(e);break;case 30:ho(e);break;default:ho(e)}t=t.sibling}}function Ci(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,o=e,a=o.flags;switch(o.tag){case 0:case 11:case 15:Ci(r,o,n),Ql(4,o);break;case 1:if(Ci(r,o,n),i=o,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){xe(i,i.return,c)}if(i=o,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)KS(l[r],s)}catch(c){xe(i,i.return,c)}}n&&a&64&&jw(o),Cl(o,o.return);break;case 27:Gw(o);case 26:case 5:Ci(r,o,n),n&&i===null&&a&4&&qw(o),Cl(o,o.return);break;case 12:Ci(r,o,n);break;case 31:Ci(r,o,n),n&&a&4&&Kw(r,o);break;case 13:Ci(r,o,n),n&&a&4&&Qw(r,o);break;case 22:o.memoizedState===null&&Ci(r,o,n),Cl(o,o.return);break;case 30:break;default:Ci(r,o,n)}e=e.sibling}}function Ym(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Xl(n))}function Wm(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Xl(t))}function $n(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)t1(t,e,n,i),e=e.sibling}function t1(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:$n(t,e,n,i),r&2048&&Ql(9,e);break;case 1:$n(t,e,n,i);break;case 3:$n(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Xl(t)));break;case 12:if(r&2048){$n(t,e,n,i),t=e.stateNode;try{var o=e.memoizedProps,a=o.id,s=o.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){xe(e,e.return,l)}}else $n(t,e,n,i);break;case 31:$n(t,e,n,i);break;case 13:$n(t,e,n,i);break;case 23:break;case 22:o=e.stateNode,a=e.alternate,e.memoizedState!==null?o._visibility&2?$n(t,e,n,i):Al(t,e):o._visibility&2?$n(t,e,n,i):(o._visibility|=2,ya(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Ym(a,e);break;case 24:$n(t,e,n,i),r&2048&&Wm(e.alternate,e);break;default:$n(t,e,n,i)}}function ya(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,a=e,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:ya(o,a,s,l,r),Ql(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?ya(o,a,s,l,r):Al(o,a):(u._visibility|=2,ya(o,a,s,l,r)),r&&c&2048&&Ym(a.alternate,a);break;case 24:ya(o,a,s,l,r),r&&c&2048&&Wm(a.alternate,a);break;default:ya(o,a,s,l,r)}e=e.sibling}}function Al(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Al(n,i),r&2048&&Ym(i.alternate,i);break;case 24:Al(n,i),r&2048&&Wm(i.alternate,i);break;default:Al(n,i)}e=e.sibling}}var ml=8192;function va(t,e,n){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)n1(t,e,n),t=t.sibling}function n1(t,e,n){switch(t.tag){case 26:va(t,e,n),t.flags&ml&&t.memoizedState!==null&&mM(n,Fn,t.memoizedState,t.memoizedProps);break;case 5:va(t,e,n);break;case 3:case 4:var i=Fn;Fn=bd(t.stateNode.containerInfo),va(t,e,n),Fn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=ml,ml=16777216,va(t,e,n),ml=i):va(t,e,n));break;default:va(t,e,n)}}function i1(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 cl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];dt=i,o1(i,t)}i1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)r1(t),t=t.sibling}function r1(t){switch(t.tag){case 0:case 11:case 15:cl(t),t.flags&2048&&Ir(9,t,t.return);break;case 3:cl(t);break;case 12:cl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Pu(t)):cl(t);break;default:cl(t)}}function Pu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];dt=i,o1(i,t)}i1(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Ir(8,e,e.return),Pu(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Pu(e));break;default:Pu(e)}t=t.sibling}}function o1(t,e){for(;dt!==null;){var n=dt;switch(n.tag){case 0:case 11:case 15:Ir(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Xl(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,dt=i;else e:for(n=t;dt!==null;){i=dt;var r=i.sibling,o=i.return;if(Ww(i),i===n){dt=null;break e}if(r!==null){r.return=o,dt=r;break e}dt=o}}}var DO={getCacheForType:function(t){var e=bt(et),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return bt(et).controller.signal}},LO=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ae=null,ue=null,pe=0,_e=0,Jt=null,xr=!1,es=!1,Xm=!1,Bi=0,Ge=0,Hr=0,bo=0,Km=0,nn=0,qa=0,kl=null,Vt=null,Xg=!1,Id=0,a1=0,fd=1/0,pd=null,Tr=null,rt=0,Rr=null,Za=null,Di=0,Kg=0,Qg=null,s1=null,Tl=0,Jg=null;function sn(){return(ve&2)!==0&&pe!==0?pe&-pe:ee.T!==null?Jm():mS()}function l1(){if(nn===0)if((pe&536870912)===0||he){var t=yu;yu<<=1,(yu&3932160)===0&&(yu=262144),nn=t}else nn=536870912;return t=cn.current,t!==null&&(t.flags|=32),nn}function jt(t,e,n){(t===Ae&&(_e===2||_e===9)||t.cancelPendingCommit!==null)&&(Ga(t,0),Sr(t,pe,nn,!1)),Gl(t,n),((ve&2)===0||t!==Ae)&&(t===Ae&&((ve&2)===0&&(bo|=n),Ge===4&&Sr(t,pe,nn,!1)),li(t))}function c1(t,e,n){if((ve&6)!==0)throw Error(M(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Zl(t,e),r=i?zO(t,e):cg(t,e,!0),o=i;do{if(r===0){es&&!i&&Sr(t,e,0,!1);break}else{if(n=t.current.alternate,o&&!IO(n)){r=cg(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var s=t;r=kl;var l=s.current.memoizedState.isDehydrated;if(l&&(Ga(s,a).flags|=256),a=cg(s,a,!1),a!==2){if(Xm&&!l){s.errorRecoveryDisabledLanes|=o,bo|=o,r=4;break e}o=Vt,Vt=r,o!==null&&(Vt===null?Vt=o:Vt.push.apply(Vt,o))}r=a}if(o=!1,r!==2)continue}}if(r===1){Ga(t,0),Sr(t,e,0,!0);break}e:{switch(i=t,o=r,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:Sr(i,e,nn,!xr);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(r=Id+300-rn(),10<r)){if(Sr(i,e,nn,!xr),Ed(i,0,!0)!==0)break e;Di=e,i.timeoutHandle=R1(kx.bind(null,i,n,Vt,pd,Xg,e,nn,bo,qa,xr,o,"Throttled",-0,0),r);break e}kx(i,n,Vt,pd,Xg,e,nn,bo,qa,xr,o,null,-0,0)}}break}while(!0);li(t)}function kx(t,e,n,i,r,o,a,s,l,c,u,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:Ri},n1(e,o,d);var x=(o&62914560)===o?Id-rn():(o&4194048)===o?a1-rn():0;if(x=vM(d,x),x!==null){Di=o,t.cancelPendingCommit=x(Rx.bind(null,t,e,o,n,i,r,a,s,l,u,d,null,h,m)),Sr(t,o,a,!c);return}}Rx(t,e,o,n,i,r,a,s,l)}function IO(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ln(o(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Sr(t,e,n,i){e&=~Km,e&=~bo,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var o=31-an(r),a=1<<o;i[o]=-1,r&=~a}n!==0&&pS(t,n,e)}function Hd(){return(ve&6)===0?(Jl(0,!1),!1):!0}function Qm(){if(ue!==null){if(_e===0)var t=ue.return;else t=ue,Oi=Ro=null,zm(t),Ha=null,Hl=0,t=ue;for(;t!==null;)Vw(t.alternate,t),t=t.return;ue=null}}function Ga(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,JO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Di=0,Qm(),Ae=t,ue=n=Mi(t.current,null),pe=e,_e=0,Jt=null,xr=!1,es=Zl(t,e),Xm=!1,qa=nn=Km=bo=Hr=Ge=0,Vt=kl=null,Xg=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),o=1<<r;e|=t[r],i&=~o}return Bi=e,Td(),n}function u1(t,e){ae=null,ee.H=Bl,e===Ja||e===Od?(e=ox(),_e=3):e===Om?(e=ox(),_e=4):_e=e===Zm?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Jt=e,ue===null&&(Ge=1,cd(t,En(e,t.current)))}function d1(){var t=cn.current;return t===null?!0:(pe&4194048)===pe?An===null:(pe&62914560)===pe||(pe&536870912)!==0?t===An:!1}function f1(){var t=ee.H;return ee.H=Bl,t===null?Bl:t}function p1(){var t=ee.A;return ee.A=DO,t}function hd(){Ge=4,xr||(pe&4194048)!==pe&&cn.current!==null||(es=!0),(Hr&134217727)===0&&(bo&134217727)===0||Ae===null||Sr(Ae,pe,nn,!1)}function cg(t,e,n){var i=ve;ve|=2;var r=f1(),o=p1();(Ae!==t||pe!==e)&&(pd=null,Ga(t,e)),e=!1;var a=Ge;e:do try{if(_e!==0&&ue!==null){var s=ue,l=Jt;switch(_e){case 8:Qm(),a=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(e=!0);var c=_e;if(_e=0,Jt=null,Ma(t,s,l,c),n&&es){a=0;break e}break;default:c=_e,_e=0,Jt=null,Ma(t,s,l,c)}}HO(),a=Ge;break}catch(u){u1(t,u)}while(!0);return e&&t.shellSuspendCounter++,Oi=Ro=null,ve=i,ee.H=r,ee.A=o,ue===null&&(Ae=null,pe=0,Td()),a}function HO(){for(;ue!==null;)h1(ue)}function zO(t,e){var n=ve;ve|=2;var i=f1(),r=p1();Ae!==t||pe!==e?(pd=null,fd=rn()+500,Ga(t,e)):es=Zl(t,e);e:do try{if(_e!==0&&ue!==null){e=ue;var o=Jt;t:switch(_e){case 1:_e=0,Jt=null,Ma(t,e,o,1);break;case 2:case 9:if(rx(o)){_e=0,Jt=null,Tx(e);break}e=function(){_e!==2&&_e!==9||Ae!==t||(_e=7),li(t)},o.then(e,e);break e;case 3:_e=7;break e;case 4:_e=5;break e;case 7:rx(o)?(_e=0,Jt=null,Tx(e)):(_e=0,Jt=null,Ma(t,e,o,7));break;case 5:var a=null;switch(ue.tag){case 26:a=ue.memoizedState;case 5:case 27:var s=ue;if(a?L1(a):s.stateNode.complete){_e=0,Jt=null;var l=s.sibling;if(l!==null)ue=l;else{var c=s.return;c!==null?(ue=c,zd(c)):ue=null}break t}}_e=0,Jt=null,Ma(t,e,o,5);break;case 6:_e=0,Jt=null,Ma(t,e,o,6);break;case 8:Qm(),Ge=6;break e;default:throw Error(M(462))}}BO();break}catch(u){u1(t,u)}while(!0);return Oi=Ro=null,ee.H=i,ee.A=r,ve=n,ue!==null?0:(Ae=null,pe=0,Td(),Ge)}function BO(){for(;ue!==null&&!s2();)h1(ue)}function h1(t){var e=Uw(t.alternate,t,Bi);t.memoizedProps=t.pendingProps,e===null?zd(t):ue=e}function Tx(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=xx(n,e,e.pendingProps,e.type,void 0,pe);break;case 11:e=xx(n,e,e.pendingProps,e.type.render,e.ref,pe);break;case 5:zm(e);default:Vw(n,e),e=ue=VS(e,Bi),e=Uw(n,e,Bi)}t.memoizedProps=t.pendingProps,e===null?zd(t):ue=e}function Ma(t,e,n,i){Oi=Ro=null,zm(e),Ha=null,Hl=0;var r=e.return;try{if(AO(t,r,e,n,pe)){Ge=1,cd(t,En(n,t.current)),ue=null;return}}catch(o){if(r!==null)throw ue=r,o;Ge=1,cd(t,En(n,t.current)),ue=null;return}e.flags&32768?(he||i===1?t=!0:es||(pe&536870912)!==0?t=!1:(xr=t=!0,(i===2||i===9||i===3||i===6)&&(i=cn.current,i!==null&&i.tag===13&&(i.flags|=16384))),g1(e,t)):zd(e)}function zd(t){var e=t;do{if((e.flags&32768)!==0){g1(e,xr);return}t=e.return;var n=RO(e.alternate,e,Bi);if(n!==null){ue=n;return}if(e=e.sibling,e!==null){ue=e;return}ue=e=t}while(e!==null);Ge===0&&(Ge=5)}function g1(t,e){do{var n=OO(t.alternate,t);if(n!==null){n.flags&=32767,ue=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ue=t;return}ue=t=n}while(t!==null);Ge=6,ue=null}function Rx(t,e,n,i,r,o,a,s,l){t.cancelPendingCommit=null;do Bd();while(rt!==0);if((ve&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=wm,v2(t,n,o,a,s,l),t===Ae&&(ue=Ae=null,pe=0),Za=e,Rr=t,Di=n,Kg=o,Qg=r,s1=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,VO(Qu,function(){return _1(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=ee.T,ee.T=null,r=ye.p,ye.p=2,a=ve,ve|=4;try{MO(t,e,n)}finally{ve=a,ye.p=r,ee.T=i}}rt=1,m1(),v1(),y1()}}function m1(){if(rt===1){rt=0;var t=Rr,e=Za,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=ee.T,ee.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Jw(e,t);var o=im,a=LS(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&DS(s.ownerDocument.documentElement,s)){if(l!==null&&Sm(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),x=s.textContent.length,_=Math.min(l.start,x),b=l.end===void 0?_:Math.min(l.end,x);!m.extend&&_>b&&(a=b,b=_,_=a);var f=K_(s,_),g=K_(s,b);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?(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}}Sd=!!nm,im=nm=null}finally{ve=r,ye.p=i,ee.T=n}}t.current=e,rt=2}}function v1(){if(rt===2){rt=0;var t=Rr,e=Za,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=ee.T,ee.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Yw(t,e.alternate,e)}finally{ve=r,ye.p=i,ee.T=n}}rt=3}}function y1(){if(rt===4||rt===3){rt=0,l2();var t=Rr,e=Za,n=Di,i=s1;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?rt=5:(rt=0,Za=Rr=null,b1(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Tr=null),gm(n),e=e.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(ql,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=ee.T,r=ye.p,ye.p=2,ee.T=null;try{for(var o=t.onRecoverableError,a=0;a<i.length;a++){var s=i[a];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,ye.p=r}}(Di&3)!==0&&Bd(),li(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Jg?Tl++:(Tl=0,Jg=t):Tl=0,Jl(0,!1)}}function b1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Xl(e)))}function Bd(){return m1(),v1(),y1(),_1()}function _1(){if(rt!==5)return!1;var t=Rr,e=Kg;Kg=0;var n=gm(Di),i=ee.T,r=ye.p;try{ye.p=32>n?32:n,ee.T=null,n=Qg,Qg=null;var o=Rr,a=Di;if(rt=0,Za=Rr=null,Di=0,(ve&6)!==0)throw Error(M(331));var s=ve;if(ve|=4,r1(o.current),t1(o,o.current,a,n),ve=s,Jl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(ql,o)}catch{}return!0}finally{ye.p=r,ee.T=i,b1(t,e)}}function Ox(t,e,n){e=En(n,e),e=Zg(t.stateNode,e,2),t=kr(t,e,2),t!==null&&(Gl(t,2),li(t))}function xe(t,e,n){if(t.tag===3)Ox(t,t,n);else for(;e!==null;){if(e.tag===3){Ox(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Tr===null||!Tr.has(i))){t=En(n,t),n=Iw(2),i=kr(e,n,2),i!==null&&(Hw(n,i,e,t),Gl(i,2),li(i));break}}e=e.return}}function ug(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new LO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Xm=!0,r.add(n),t=$O.bind(null,t,e,n),e.then(t,t))}function $O(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(pe&n)===n&&(Ge===4||Ge===3&&(pe&62914560)===pe&&300>rn()-Id?(ve&2)===0&&Ga(t,0):Km|=n,qa===pe&&(qa=0)),li(t)}function x1(t,e){e===0&&(e=fS()),t=To(t,e),t!==null&&(Gl(t,e),li(t))}function FO(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),x1(t,n)}function UO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(M(314))}i!==null&&i.delete(e),x1(t,n)}function VO(t,e){return pm(t,e)}var gd=null,ba=null,em=!1,md=!1,dg=!1,wr=0;function li(t){t!==ba&&t.next===null&&(ba===null?gd=ba=t:ba=ba.next=t),md=!0,em||(em=!0,PO())}function Jl(t,e){if(!dg&&md){dg=!0;do for(var n=!1,i=gd;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-an(42|t)+1)-1,o&=r&~(a&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Mx(i,o))}else o=pe,o=Ed(i,i===Ae?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Zl(i,o)||(n=!0,Mx(i,o));i=i.next}while(n);dg=!1}}function jO(){S1()}function S1(){md=em=!1;var t=0;wr!==0&&QO()&&(t=wr);for(var e=rn(),n=null,i=gd;i!==null;){var r=i.next,o=w1(i,e);o===0?(i.next=null,n===null?gd=r:n.next=r,r===null&&(ba=n)):(n=i,(t!==0||(o&3)!==0)&&(md=!0)),i=r}rt!==0&&rt!==5||Jl(t,!1),wr!==0&&(wr=0)}function w1(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var a=31-an(o),s=1<<a,l=r[a];l===-1?((s&n)===0||(s&i)!==0)&&(r[a]=m2(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,n=pe,n=Ed(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(_e===2||_e===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Fh(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Zl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Fh(i),gm(n)){case 2:case 8:n=uS;break;case 32:n=Qu;break;case 268435456:n=dS;break;default:n=Qu}return i=E1.bind(null,t),n=pm(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Fh(i),t.callbackPriority=2,t.callbackNode=null,2}function E1(t,e){if(rt!==0&&rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Bd()&&t.callbackNode!==n)return null;var i=pe;return i=Ed(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(c1(t,i,e),w1(t,rn()),t.callbackNode!=null&&t.callbackNode===n?E1.bind(null,t):null)}function Mx(t,e){if(Bd())return null;c1(t,e,!0)}function PO(){eM(function(){(ve&6)!==0?pm(cS,jO):S1()})}function Jm(){if(wr===0){var t=Va;t===0&&(t=vu,vu<<=1,(vu&261888)===0&&(vu=256)),wr=t}return wr}function Nx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Iu(""+t)}function Dx(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function qO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var o=Nx((r[Pt]||null).action),a=i.submitter;a&&(e=(e=a[Pt]||null)?Nx(e.formAction):a.getAttribute("formAction"),e!==null&&(o=e,a=null));var s=new Cd("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(wr!==0){var l=a?Dx(r,a):new FormData(r);Pg(n,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=a?Dx(r,a):new FormData(r),Pg(n,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(Ru=0;Ru<Ng.length;Ru++)Ou=Ng[Ru],Lx=Ou.toLowerCase(),Ix=Ou[0].toUpperCase()+Ou.slice(1),Un(Lx,"on"+Ix);var Ou,Lx,Ix,Ru;Un(HS,"onAnimationEnd");Un(zS,"onAnimationIteration");Un(BS,"onAnimationStart");Un("dblclick","onDoubleClick");Un("focusin","onFocus");Un("focusout","onBlur");Un(cO,"onTransitionRun");Un(uO,"onTransitionStart");Un(dO,"onTransitionCancel");Un($S,"onTransitionEnd");Fa("onMouseEnter",["mouseout","mouseover"]);Fa("onMouseLeave",["mouseout","mouseover"]);Fa("onPointerEnter",["pointerout","pointerover"]);Fa("onPointerLeave",["pointerout","pointerover"]);Co("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Co("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Co("onBeforeInput",["compositionend","keypress","textInput","paste"]);Co("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Co("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Co("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $l="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(" "),ZO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($l));function C1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){ed(u)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(s=i[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){ed(u)}r.currentTarget=null,o=l}}}}function ce(t,e){var n=e[Eg];n===void 0&&(n=e[Eg]=new Set);var i=t+"__bubble";n.has(i)||(A1(e,t,2,!1),n.add(i))}function fg(t,e,n){var i=0;e&&(i|=4),A1(n,t,i,e)}var Mu="_reactListening"+Math.random().toString(36).slice(2);function ev(t){if(!t[Mu]){t[Mu]=!0,vS.forEach(function(n){n!=="selectionchange"&&(ZO.has(n)||fg(n,!1,t),fg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mu]||(e[Mu]=!0,fg("selectionchange",!1,e))}}function A1(t,e,n,i){switch($1(e)){case 2:var r=_M;break;case 8:r=xM;break;default:r=rv}n=r.bind(null,e,n,t),r=void 0,!Rg||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function pg(t,e,n,i,r){var o=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var s=i.stateNode.containerInfo;if(s===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;s!==null;){if(a=Sa(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=o=a;continue e}s=s.parentNode}}i=i.return}CS(function(){var c=o,u=ym(n),d=[];e:{var h=FS.get(t);if(h!==void 0){var m=Cd,x=t;switch(t){case"keypress":if(zu(n)===0)break e;case"keydown":case"keyup":m=U2;break;case"focusin":x="focus",m=qh;break;case"focusout":x="blur",m=qh;break;case"beforeblur":case"afterblur":m=qh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=V_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=R2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=P2;break;case HS:case zS:case BS:m=N2;break;case $S:m=Z2;break;case"scroll":case"scrollend":m=k2;break;case"wheel":m=Y2;break;case"copy":case"cut":case"paste":m=L2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=P_;break;case"toggle":case"beforetoggle":m=X2}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),f=_?h!==null?h+"Capture":null:h;_=[];for(var g=c,v;g!==null;){var y=g;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=Ml(g,f),y!=null&&_.push(Fl(g,y,v))),b)break;g=g.return}0<_.length&&(h=new m(h,x,null,n,u),d.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&n!==Tg&&(x=n.relatedTarget||n.fromElement)&&(Sa(x)||x[Xa]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(x=n.relatedTarget||n.toElement,m=c,x=x?Sa(x):null,x!==null&&(b=Pl(x),_=x.tag,x!==b||_!==5&&_!==27&&_!==6)&&(x=null)):(m=null,x=c),m!==x)){if(_=V_,y="onMouseLeave",f="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(_=P_,y="onPointerLeave",f="onPointerEnter",g="pointer"),b=m==null?h:hl(m),v=x==null?h:hl(x),h=new _(y,g+"leave",m,n,u),h.target=b,h.relatedTarget=v,y=null,Sa(u)===c&&(_=new _(f,g+"enter",x,n,u),_.target=v,_.relatedTarget=b,y=_),b=y,m&&x)t:{for(_=GO,f=m,g=x,v=0,y=f;y;y=_(y))v++;y=0;for(var w=g;w;w=_(w))y++;for(;0<v-y;)f=_(f),v--;for(;0<y-v;)g=_(g),y--;for(;v--;){if(f===g||g!==null&&f===g.alternate){_=f;break t}f=_(f),g=_(g)}_=null}else _=null;m!==null&&Hx(d,h,m,_,!1),x!==null&&b!==null&&Hx(d,b,x,_,!0)}}e:{if(h=c?hl(c):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var E=Y_;else if(G_(h))if(MS)E=aO;else{E=rO;var S=iO}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&vm(c.elementType)&&(E=Y_):E=oO;if(E&&(E=E(t,c))){OS(d,E,n,u);break e}S&&S(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&kg(h,"number",h.value)}switch(S=c?hl(c):window,t){case"focusin":(G_(S)||S.contentEditable==="true")&&(Ca=S,Og=c,bl=null);break;case"focusout":bl=Og=Ca=null;break;case"mousedown":Mg=!0;break;case"contextmenu":case"mouseup":case"dragend":Mg=!1,Q_(d,n,u);break;case"selectionchange":if(lO)break;case"keydown":case"keyup":Q_(d,n,u)}var k;if(xm)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Ea?TS(t,n)&&(T="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(kS&&n.locale!=="ko"&&(Ea||T!=="onCompositionStart"?T==="onCompositionEnd"&&Ea&&(k=AS()):(_r=u,bm="value"in _r?_r.value:_r.textContent,Ea=!0)),S=vd(c,T),0<S.length&&(T=new j_(T,t,null,n,u),d.push({event:T,listeners:S}),k?T.data=k:(k=RS(n),k!==null&&(T.data=k)))),(k=Q2?J2(t,n):eO(t,n))&&(T=vd(c,"onBeforeInput"),0<T.length&&(S=new j_("onBeforeInput","beforeinput",null,n,u),d.push({event:S,listeners:T}),S.data=k)),qO(d,t,c,n,u)}C1(d,e)})}function Fl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function vd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Ml(t,n),r!=null&&i.unshift(Fl(t,r,o)),r=Ml(t,e),r!=null&&i.push(Fl(t,r,o))),t.tag===3)return i;t=t.return}return[]}function GO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hx(t,e,n,i,r){for(var o=e._reactName,a=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=Ml(n,o),c!=null&&a.unshift(Fl(n,c,l))):r||(c=Ml(n,o),c!=null&&a.push(Fl(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var YO=/\r\n?/g,WO=/\u0000|\uFFFD/g;function zx(t){return(typeof t=="string"?t:""+t).replace(YO,`
|
|
9
|
+
`).replace(WO,"")}function k1(t,e){return e=zx(e),zx(t)===e}function we(t,e,n,i,r,o){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Ua(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Ua(t,""+i);break;case"className":_u(t,"class",i);break;case"tabIndex":_u(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":_u(t,n,i);break;case"style":ES(t,i,o);break;case"data":if(e!=="object"){_u(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Iu(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Iu(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Ri);break;case"onScroll":i!=null&&ce("scroll",t);break;case"onScrollEnd":i!=null&&ce("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Iu(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":ce("beforetoggle",t),ce("toggle",t),Lu(t,"popover",i);break;case"xlinkActuate":xi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":xi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":xi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":xi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":xi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":xi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":xi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":xi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":xi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Lu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=C2.get(n)||n,Lu(t,n,i))}}function tm(t,e,n,i,r,o){switch(n){case"style":ES(t,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Ua(t,i):(typeof i=="number"||typeof i=="bigint")&&Ua(t,""+i);break;case"onScroll":i!=null&&ce("scroll",t);break;case"onScrollEnd":i!=null&&ce("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Ri);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yS.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),o=t[Pt]||null,o=o!=null?o[n]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof i=="function")){typeof o!="function"&&o!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Lu(t,n,i)}}}function _t(t,e,n){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 i=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];if(a!=null)switch(o){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,o,a,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":ce("invalid",t);var s=o=a=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(M(137,e));break;default:we(t,e,i,u,n,null)}}xS(t,o,s,l,c,a,r,!1);return;case"select":ce("invalid",t),i=a=o=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":a=s;break;case"multiple":i=s;default:we(t,e,r,s,n,null)}e=o,n=a,t.multiple=!!i,e!=null?Da(t,!!i,e,!1):n!=null&&Da(t,!!i,n,!0);return;case"textarea":ce("invalid",t),o=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(M(91));break;default:we(t,e,a,s,n,null)}wS(t,i,r,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,l,i,n,null));return;case"dialog":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(i=0;i<$l.length;i++)ce($l[i],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(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,c,i,n,null)}return;default:if(vm(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&tm(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&we(t,e,s,i,n,null))}function XO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,a=null,s=null,l=null,c=null,u=null;for(m in n){var d=n[m];if(n.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(m)||we(t,e,m,null,i,d)}}for(var h in i){var m=i[h];if(d=n[h],i.hasOwnProperty(h)&&(m!=null||d!=null))switch(h){case"type":o=m;break;case"name":r=m;break;case"checked":c=m;break;case"defaultChecked":u=m;break;case"value":a=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(M(137,e));break;default:m!==d&&we(t,e,h,m,i,d)}}Ag(t,a,s,l,c,u,o,r);return;case"select":m=a=s=h=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:i.hasOwnProperty(o)||we(t,e,o,null,i,l)}for(r in i)if(o=i[r],l=n[r],i.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":a=o;default:o!==l&&we(t,e,r,o,i,l)}e=s,n=a,i=m,h!=null?Da(t,!!n,h,!1):!!i!=!!n&&(e!=null?Da(t,!!n,e,!0):Da(t,!!n,n?[]:"",!1));return;case"textarea":m=h=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,i,r)}for(a in i)if(r=i[a],o=n[a],i.hasOwnProperty(a)&&(r!=null||o!=null))switch(a){case"value":h=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(M(91));break;default:r!==o&&we(t,e,a,r,i,o)}SS(t,h,m);return;case"option":for(var x in n)h=n[x],n.hasOwnProperty(x)&&h!=null&&!i.hasOwnProperty(x)&&(x==="selected"?t.selected=!1:we(t,e,x,null,i,h));for(l in i)h=i[l],m=n[l],i.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,i,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 _ in n)h=n[_],n.hasOwnProperty(_)&&h!=null&&!i.hasOwnProperty(_)&&we(t,e,_,null,i,h);for(c in i)if(h=i[c],m=n[c],i.hasOwnProperty(c)&&h!==m&&(h!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(M(137,e));break;default:we(t,e,c,h,i,m)}return;default:if(vm(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&tm(t,e,b,void 0,i,h);for(u in i)h=i[u],m=n[u],!i.hasOwnProperty(u)||h===m||h===void 0&&m===void 0||tm(t,e,u,h,i,m);return}}for(var f in n)h=n[f],n.hasOwnProperty(f)&&h!=null&&!i.hasOwnProperty(f)&&we(t,e,f,null,i,h);for(d in i)h=i[d],m=n[d],!i.hasOwnProperty(d)||h===m||h==null&&m==null||we(t,e,d,h,i,m)}function Bx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&Bx(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&Bx(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(o+a)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var nm=null,im=null;function yd(t){return t.nodeType===9?t:t.ownerDocument}function $x(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 T1(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 rm(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 hg=null;function QO(){var t=window.event;return t&&t.type==="popstate"?t===hg?!1:(hg=t,!0):(hg=null,!1)}var R1=typeof setTimeout=="function"?setTimeout:void 0,JO=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(t){return Fx.resolve(null).then(t).catch(tM)}:R1;function tM(t){setTimeout(function(){throw t})}function Br(t){return t==="head"}function Ux(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Wa(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Rl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Rl(n);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[Yl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=a}}else n==="body"&&Rl(t.ownerDocument.body);n=r}while(n);Wa(e)}function Vx(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function om(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":om(n),mm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function nM(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Yl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=kn(t.nextSibling),t===null)break}return null}function iM(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=kn(t.nextSibling),t===null))return null;return t}function O1(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=kn(t.nextSibling),t===null))return null;return t}function am(t){return t.data==="$?"||t.data==="$~"}function sm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rM(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function kn(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 lm=null;function jx(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return kn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function Px(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function M1(t,e,n){switch(e=yd(n),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function Rl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);mm(t)}var Tn=new Map,qx=new Set;function bd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var $i=ye.d;ye.d={f:oM,r:aM,D:sM,C:lM,L:cM,m:uM,X:fM,S:dM,M:pM};function oM(){var t=$i.f(),e=Hd();return t||e}function aM(t){var e=Ka(t);e!==null&&e.tag===5&&e.type==="form"?Ew(e):$i.r(t)}var ts=typeof document>"u"?null:document;function N1(t,e,n){var i=ts;if(i&&typeof e=="string"&&e){var r=wn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),qx.has(r)||(qx.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),_t(e,"link",t),ft(e),i.head.appendChild(e)))}}function sM(t){$i.D(t),N1("dns-prefetch",t,null)}function lM(t,e){$i.C(t,e),N1("preconnect",t,e)}function cM(t,e,n){$i.L(t,e,n);var i=ts;if(i&&t&&e){var r='link[rel="preload"][as="'+wn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+wn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+wn(n.imageSizes)+'"]')):r+='[href="'+wn(t)+'"]';var o=r;switch(e){case"style":o=Ya(t);break;case"script":o=ns(t)}Tn.has(o)||(t=He({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Tn.set(o,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(ec(o))||e==="script"&&i.querySelector(tc(o))||(e=i.createElement("link"),_t(e,"link",t),ft(e),i.head.appendChild(e)))}}function uM(t,e){$i.m(t,e);var n=ts;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+wn(i)+'"][href="'+wn(t)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ns(t)}if(!Tn.has(o)&&(t=He({rel:"modulepreload",href:t},e),Tn.set(o,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tc(o)))return}i=n.createElement("link"),_t(i,"link",t),ft(i),n.head.appendChild(i)}}}function dM(t,e,n){$i.S(t,e,n);var i=ts;if(i&&t){var r=Na(i).hoistableStyles,o=Ya(t);e=e||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(ec(o)))s.loading=5;else{t=He({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Tn.get(o))&&tv(t,n);var l=a=i.createElement("link");ft(l),_t(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,qu(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}}function fM(t,e){$i.X(t,e);var n=ts;if(n&&t){var i=Na(n).hoistableScripts,r=ns(t),o=i.get(r);o||(o=n.querySelector(tc(r)),o||(t=He({src:t,async:!0},e),(e=Tn.get(r))&&nv(t,e),o=n.createElement("script"),ft(o),_t(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function pM(t,e){$i.M(t,e);var n=ts;if(n&&t){var i=Na(n).hoistableScripts,r=ns(t),o=i.get(r);o||(o=n.querySelector(tc(r)),o||(t=He({src:t,async:!0,type:"module"},e),(e=Tn.get(r))&&nv(t,e),o=n.createElement("script"),ft(o),_t(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function Zx(t,e,n,i){var r=(r=Er.current)?bd(r):null;if(!r)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Ya(n.href),n=Na(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Ya(n.href);var o=Na(r).hoistableStyles,a=o.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,a),(o=r.querySelector(ec(t)))&&!o._p&&(a.instance=o,a.state.loading=5),Tn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tn.set(t,n),o||hM(r,t,n,a.state))),e&&i===null)throw Error(M(528,""));return a}if(e&&i!==null)throw Error(M(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ns(n),n=Na(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,t))}}function Ya(t){return'href="'+wn(t)+'"'}function ec(t){return'link[rel="stylesheet"]['+t+"]"}function D1(t){return He({},t,{"data-precedence":t.precedence,precedence:null})}function hM(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),_t(e,"link",n),ft(e),t.head.appendChild(e))}function ns(t){return'[src="'+wn(t)+'"]'}function tc(t){return"script[async]"+t}function Gx(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+wn(n.href)+'"]');if(i)return e.instance=i,ft(i),i;var r=He({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ft(i),_t(i,"style",r),qu(i,n.precedence,t),e.instance=i;case"stylesheet":r=Ya(n.href);var o=t.querySelector(ec(r));if(o)return e.state.loading|=4,e.instance=o,ft(o),o;i=D1(n),(r=Tn.get(r))&&tv(i,r),o=(t.ownerDocument||t).createElement("link"),ft(o);var a=o;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),_t(o,"link",i),e.state.loading|=4,qu(o,n.precedence,t),e.instance=o;case"script":return o=ns(n.src),(r=t.querySelector(tc(o)))?(e.instance=r,ft(r),r):(i=n,(r=Tn.get(o))&&(i=He({},n),nv(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ft(r),_t(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,qu(i,n.precedence,t));return e.instance}function qu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function tv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function nv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Zu=null;function Yx(t,e,n){if(Zu===null){var i=new Map,r=Zu=new Map;r.set(n,i)}else r=Zu,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var o=n[r];if(!(o[Yl]||o[vt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var a=o.getAttribute(e)||"";a=t+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function Wx(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function gM(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function L1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mM(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Ya(i.href),o=e.querySelector(ec(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=_d.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=o,ft(o);return}o=e.ownerDocument||e,i=D1(i),(r=Tn.get(r))&&tv(i,r),o=o.createElement("link"),ft(o);var a=o;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),_t(o,"link",i),n.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=_d.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var gg=0;function vM(t,e){return t.stylesheets&&t.count===0&&Gu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Gu(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&gg===0&&(gg=62500*KO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Gu(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>gg?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function _d(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var xd=null;function Gu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,xd=new Map,e.forEach(yM,t),xd=null,_d.call(t))}function yM(t,e){if(!(e.state.loading&4)){var n=xd.get(t);if(n)var i=n.get(null);else{n=new Map,xd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}r=e.instance,a=r.getAttribute("data-precedence"),o=n.get(a)||i,o===i&&n.set(null,r),n.set(a,r),this.count++,i=_d.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Ul={$$typeof:Ti,Provider:null,Consumer:null,_currentValue:go,_currentValue2:go,_threadCount:0};function bM(t,e,n,i,r,o,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Uh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uh(0),this.hiddenUpdates=Uh(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function I1(t,e,n,i,r,o,a,s,l,c,u,d){return t=new bM(t,e,n,a,l,c,u,d,s),e=1,o===!0&&(e|=24),o=tn(3,null,null,e),t.current=o,o.stateNode=t,e=Tm(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:e},Mm(o),t}function H1(t){return t?(t=Ta,t):Ta}function z1(t,e,n,i,r,o){r=H1(r),i.context===null?i.context=r:i.pendingContext=r,i=Ar(e),i.payload={element:n},o=o===void 0?null:o,o!==null&&(i.callback=o),n=kr(t,i,e),n!==null&&(jt(n,t,e),xl(n,t,e))}function Xx(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function iv(t,e){Xx(t,e),(t=t.alternate)&&Xx(t,e)}function B1(t){if(t.tag===13||t.tag===31){var e=To(t,67108864);e!==null&&jt(e,t,67108864),iv(t,67108864)}}function Kx(t){if(t.tag===13||t.tag===31){var e=sn();e=hm(e);var n=To(t,e);n!==null&&jt(n,t,e),iv(t,e)}}var Sd=!0;function _M(t,e,n,i){var r=ee.T;ee.T=null;var o=ye.p;try{ye.p=2,rv(t,e,n,i)}finally{ye.p=o,ee.T=r}}function xM(t,e,n,i){var r=ee.T;ee.T=null;var o=ye.p;try{ye.p=8,rv(t,e,n,i)}finally{ye.p=o,ee.T=r}}function rv(t,e,n,i){if(Sd){var r=cm(i);if(r===null)pg(t,e,i,wd,n),Qx(t,i);else if(wM(r,t,e,n,i))i.stopPropagation();else if(Qx(t,i),e&4&&-1<SM.indexOf(t)){for(;r!==null;){var o=Ka(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var a=fo(o.pendingLanes);if(a!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-an(a);s.entanglements[1]|=l,a&=~l}li(o),(ve&6)===0&&(fd=rn()+500,Jl(0,!1))}}break;case 31:case 13:s=To(o,2),s!==null&&jt(s,o,2),Hd(),iv(o,2)}if(o=cm(i),o===null&&pg(t,e,i,wd,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else pg(t,e,i,null,n)}}function cm(t){return t=ym(t),ov(t)}var wd=null;function ov(t){if(wd=null,t=Sa(t),t!==null){var e=Pl(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=rS(e),t!==null)return t;t=null}else if(n===31){if(t=oS(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return wd=t,null}function $1(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(c2()){case cS:return 2;case uS:return 8;case Qu:case u2:return 32;case dS:return 268435456;default:return 32}default:return 32}}var um=!1,Or=null,Mr=null,Nr=null,Vl=new Map,jl=new Map,yr=[],SM="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 Qx(t,e){switch(t){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":Vl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(e.pointerId)}}function ul(t,e,n,i,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Ka(e),e!==null&&B1(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function wM(t,e,n,i,r){switch(e){case"focusin":return Or=ul(Or,t,e,n,i,r),!0;case"dragenter":return Mr=ul(Mr,t,e,n,i,r),!0;case"mouseover":return Nr=ul(Nr,t,e,n,i,r),!0;case"pointerover":var o=r.pointerId;return Vl.set(o,ul(Vl.get(o)||null,t,e,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,jl.set(o,ul(jl.get(o)||null,t,e,n,i,r)),!0}return!1}function F1(t){var e=Sa(t.target);if(e!==null){var n=Pl(e);if(n!==null){if(e=n.tag,e===13){if(e=rS(n),e!==null){t.blockedOn=e,I_(t.priority,function(){Kx(n)});return}}else if(e===31){if(e=oS(n),e!==null){t.blockedOn=e,I_(t.priority,function(){Kx(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Yu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=cm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Tg=i,n.target.dispatchEvent(i),Tg=null}else return e=Ka(n),e!==null&&B1(e),t.blockedOn=n,!1;e.shift()}return!0}function Jx(t,e,n){Yu(t)&&n.delete(e)}function EM(){um=!1,Or!==null&&Yu(Or)&&(Or=null),Mr!==null&&Yu(Mr)&&(Mr=null),Nr!==null&&Yu(Nr)&&(Nr=null),Vl.forEach(Jx),jl.forEach(Jx)}function Nu(t,e){t.blockedOn===e&&(t.blockedOn=null,um||(um=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,EM)))}var Du=null;function eS(t){Du!==t&&(Du=t,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,function(){Du===t&&(Du=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(ov(i||n)===null)continue;break}var o=Ka(n);o!==null&&(t.splice(e,3),e-=3,Pg(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Wa(t){function e(l){return Nu(l,t)}Or!==null&&Nu(Or,t),Mr!==null&&Nu(Mr,t),Nr!==null&&Nu(Nr,t),Vl.forEach(e),jl.forEach(e);for(var n=0;n<yr.length;n++){var i=yr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<yr.length&&(n=yr[0],n.blockedOn===null);)F1(n),n.blockedOn===null&&yr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[Pt]||null;if(typeof o=="function")a||eS(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[Pt]||null)s=a.formAction;else if(ov(r)!==null)continue}else s=a.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),eS(n)}}}function U1(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function av(t){this._internalRoot=t}$d.prototype.render=av.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var n=e.current,i=sn();z1(n,i,t,e,null,null)};$d.prototype.unmount=av.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;z1(t.current,2,null,t,null,null),Hd(),e[Xa]=null}};function $d(t){this._internalRoot=t}$d.prototype.unstable_scheduleHydration=function(t){if(t){var e=mS();t={blockedOn:null,target:t,priority:e};for(var n=0;n<yr.length&&e!==0&&e<yr[n].priority;n++);yr.splice(n,0,t),n===0&&F1(t)}};var tS=nS.version;if(tS!=="19.2.4")throw Error(M(527,tS,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=n2(e),t=t!==null?aS(t):null,t=t===null?null:t.stateNode,t};var CM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(dl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!dl.isDisabled&&dl.supportsFiber))try{ql=dl.inject(CM),on=dl}catch{}var dl;Fd.createRoot=function(t,e){if(!iS(t))throw Error(M(299));var n=!1,i="",r=Nw,o=Dw,a=Lw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=I1(t,1,!1,null,null,n,i,null,r,o,a,U1),t[Xa]=e.current,ev(t),new av(e)};Fd.hydrateRoot=function(t,e,n){if(!iS(t))throw Error(M(299));var i=!1,r="",o=Nw,a=Dw,s=Lw,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=I1(t,1,!0,e,n??null,i,r,l,o,a,s,U1),e.context=H1(null),n=e.current,i=sn(),i=hm(i),r=Ar(i),r.callback=null,kr(n,r,i),n=i,e.current.lanes=n,Gl(e,n),li(e),t[Xa]=e.current,ev(t),new $d(e)};Fd.version="19.2.4"});var Oo=ei((GI,P1)=>{"use strict";function j1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j1)}catch(t){console.error(t)}}j1(),P1.exports=V1()});var FE=ei(af=>{"use strict";var yN=Symbol.for("react.transitional.element"),bN=Symbol.for("react.fragment");function $E(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:yN,type:t,key:i,ref:e!==void 0?e:null,props:n}}af.Fragment=bN;af.jsx=$E;af.jsxs=$E});var Fe=ei((dz,UE)=>{"use strict";UE.exports=FE()});var BI={};e_(BI,{ANIMATION_KEYFRAMES:()=>Qs,ActivationConfigZ:()=>tu,AddClassZ:()=>f0,AnchorIdZ:()=>vn,AnchorStateZ:()=>JT,AnchorVisibleConditionZ:()=>qp,AppRegistry:()=>uc,AugmentationZ:()=>eR,BadgePositionZ:()=>t0,BadgeZ:()=>y0,BoundingBoxZ:()=>QT,CanvasEvents:()=>ds,CanvasRecipeZ:()=>np,ConditionZ:()=>ua,ContextManager:()=>nu,CooldownActiveConditionZ:()=>Kp,CounterDefZ:()=>js,CtaButtonZ:()=>th,DEFAULT_COOLDOWN:()=>wf,DEFAULT_TTL:()=>Sf,DecisionStrategyZ:()=>sr,DismissedConditionZ:()=>Xp,EVENT_SCHEMA_VERSION:()=>Fo,EventBus:()=>ou,EventCountConditionZ:()=>Jp,EventFilterZ:()=>oR,EventOccurredConditionZ:()=>Zp,EventSourceZ:()=>H0,ExecutorRegistry:()=>eu,ExternalStrategyZ:()=>Ys,FrequencyEntryZ:()=>pR,FrequencyLimitConditionZ:()=>Qp,HighlightStepZ:()=>$A,HighlightStyleZ:()=>e0,HighlightZ:()=>m0,InsertHtmlZ:()=>g0,InsertPositionZ:()=>o0,MAX_VISIBLE_TOASTS:()=>xf,MatchOpZ:()=>Vs,ModalContentZ:()=>r0,ModalZ:()=>_0,ModelStrategyZ:()=>Gs,MountWidgetZ:()=>w0,NavigateZ:()=>S0,NavigationMonitor:()=>Xs,NormalizedEventZ:()=>rR,NotificationToastStack:()=>_f,PageContextZ:()=>YT,PageHistoryEntryZ:()=>WT,PageUrlConditionZ:()=>jp,ParallelZ:()=>A0,PlacementZ:()=>n0,PulseZ:()=>v0,RUNTIME_SDK_BUILD:()=>Y0,RUNTIME_VERSION:()=>j0,RemoveClassZ:()=>p0,RouteConditionZ:()=>Pp,RouteFilterZ:()=>Qb,RuleStrategyZ:()=>qs,RuleZ:()=>Ps,RuntimeContextZ:()=>tR,RuntimeProvider:()=>Tf,SDK_SCHEMA_VERSION:()=>Pi,SDK_VERSION:()=>mf,STATIC_SLOT_STYLES:()=>U0,ScoreStrategyZ:()=>Zs,ScrollBehaviorZ:()=>c0,ScrollLogicalPositionZ:()=>eh,ScrollToZ:()=>x0,SelectorZ:()=>dy,SequenceZ:()=>C0,SessionContextZ:()=>XT,SessionMetricConditionZ:()=>Wp,SessionMetricTracker:()=>Sc,SetAttrZ:()=>d0,SetStyleZ:()=>h0,SetTextZ:()=>u0,ShadowCanvasOverlay:()=>$v,ShadowRootProvider:()=>Rv,SmartCanvasApp:()=>Uv,SmartCanvasController:()=>yf,SmartCanvasElement:()=>Of,SmartCanvasPortal:()=>t3,StandardEvents:()=>be,StateEqualsConditionZ:()=>Gp,StateStore:()=>su,StoredValueZ:()=>fR,Syntro:()=>G0,TileCard:()=>fs,TileWheel:()=>zD,TooltipContentZ:()=>i0,TooltipStepZ:()=>BA,TooltipTriggerZ:()=>a0,TooltipZ:()=>b0,TourStepForSchemaZ:()=>l0,TourZ:()=>k0,ViewportConditionZ:()=>Yp,ViewportContextZ:()=>KT,WaitZ:()=>E0,WidgetConfigZ:()=>s0,WidgetRegistry:()=>cu,appRegistry:()=>ss,applyStaticSlotStyles:()=>lh,cleanupAppContext:()=>cf,contentRuntime:()=>Ud,coreActionStepSchemas:()=>ZT,createActionEngine:()=>Vp,createAnchorResolver:()=>nh,createAppContext:()=>lf,createAppLoader:()=>df,createCanvasConfigFetcher:()=>zo,createContextManager:()=>ih,createDecisionEngine:()=>rh,createEventAccumulator:()=>oh,createEventBus:()=>Ws,createGrowthBookClient:()=>Wf,createNoopClient:()=>rp,createOverlayRecipeFetcher:()=>e3,createPostHogClient:()=>$p,createPostHogNormalizer:()=>ah,createSessionMetricTracker:()=>Xf,createSmartCanvas:()=>Mf,createSmartCanvasController:()=>Tv,createSmartCanvasRuntime:()=>vh,createStateStore:()=>sh,createSurfaceContainer:()=>ph,createSurfaces:()=>gh,decisionSchemas:()=>nI,decodeToken:()=>uu,encodeToken:()=>yh,evaluate:()=>M0,evaluateCondition:()=>R0,evaluateRule:()=>O0,evaluateRuleStrategy:()=>iu,evaluateScoreStrategy:()=>ru,evaluateSync:()=>N0,executorRegistry:()=>bi,getAntiFlickerSnippet:()=>hC,getAppIdFromActionKind:()=>xv,getAppIdFromWidgetId:()=>uf,getExecutor:()=>jT,getSlotAnchorId:()=>lu,getSlotType:()=>Ks,getSlotZIndex:()=>hh,hasExecutor:()=>Fp,interpolateTemplate:()=>hc,isCoreActionKind:()=>_v,matchEvent:()=>Ef,needsMigration:()=>UD,normalizePostHogEvent:()=>L0,overlaysRuntime:()=>sf,parseVersion:()=>hs,playEnterAnimation:()=>dh,playExitAnimation:()=>fh,registerConfigPredicates:()=>pc,registerSmartCanvasElement:()=>jv,resolveConfigUri:()=>vf,setupAdjacentPositioning:()=>ch,setupInlinePositioning:()=>uh,shouldNormalizeEvent:()=>I0,useDecision:()=>DC,useNotifications:()=>Cf,useNotifyWatcher:()=>kf,usePageContext:()=>Rf,useRuntime:()=>ui,useRuntimeContext:()=>gc,useRuntimeEvents:()=>MC,useRuntimeState:()=>NC,useSessionContext:()=>RC,useShadowCanvasConfig:()=>Fv,useShadowRoot:()=>$o,useViewportContext:()=>OC,validateAction:()=>ar,validateActions:()=>Up,validateActivationConfig:()=>tI,validateCondition:()=>J5,validateConfig:()=>BD,validateEventFilter:()=>yI,validateFrequencyEntry:()=>wI,validateNormalizedEvent:()=>vI,validateRecipe:()=>JL,validateRuntimeContext:()=>hI,validateStoredValue:()=>SI,validateStrategy:()=>eI,widgetRegistry:()=>mh});var wR=Q(Ke(),1),bh=Q(tl(),1),zI=Q(Oo(),1);function q1(t,e,n,i){let r=i?.maxRetries??3,o=i?.debounceMs??50,a=t.parentElement??e.parentElement;if(!a)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(d=>{if(!c){for(let h of d)for(let m of h.removedNodes)if(m===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},o);return}}});return u.observe(a,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var AM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function sv(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!AM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),m=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(d||m)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var Z1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=sv(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":o=n.innerHTML,n.replaceWith(r);break}let a=null;if(t.deepLink){let{tileId:c,itemId:u}=t.deepLink;a=()=>{let d=window.SynOS?.handle;d&&(d.open(),d.runtime?.events?.publish("notification.deep_link",{tileId:c,itemId:u}))},r.style.cursor="pointer",r.addEventListener("click",a)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let l=q1(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(a&&r.removeEventListener("click",a),l(),t.position==="replace"&&o!==null){let c=document.createElement(n.tagName);c.innerHTML=o,Array.from(n.attributes).forEach(u=>{c.setAttribute(u.name,u.value)}),r.replaceWith(c)}else r.remove()},updateFn:c=>{"html"in c&&typeof c.html=="string"&&(r.innerHTML=sv(c.html))}}},G1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},Y1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&o!==null?n.setAttribute(t.attr,o):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},W1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},X1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},K1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=new Map;for(let r of Object.keys(t.styles)){let o=n.style.getPropertyValue(r);i.set(r,o)}for(let[r,o]of Object.entries(t.styles))n.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,o]of i)o?n.style.setProperty(r,o):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,a]of Object.entries(r.styles))n.style.setProperty(o,a)}}},lv=[{kind:"content:insertHtml",executor:Z1},{kind:"content:setText",executor:G1},{kind:"content:setAttr",executor:Y1},{kind:"content:addClass",executor:W1},{kind:"content:removeClass",executor:X1},{kind:"content:setStyle",executor:K1}],Ud={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:lv};var kM={light:50,medium:100,heavy:200},TM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],Q1={init(t,e,n){let i=kM[n.intensity],r=n.colors.length>0?n.colors:TM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,n){let i=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation),n.shape==="circle"?(t.beginPath(),t.arc(0,0,n.size/2,0,Math.PI*2),t.fill()):t.fillRect(-n.size/2,-n.size/2,n.size,n.size*.6),t.restore())}};var RM={light:20,medium:40,heavy:80},OM="\u{1F389}",J1={init(t,e,n){let i=RM[n.intensity],r=typeof n.props?.emoji=="string"?n.props.emoji:OM,o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:r,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let a of o)a.data&&(a.data.originX=a.x);return o},update(t,e,n){let i=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,a=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(n*.003+o)*a*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e)n.opacity<.01||!n.emoji||(t.save(),t.globalAlpha=n.opacity,t.font=`${n.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(n.emoji,n.x,n.y),t.restore())}};var MM={light:20,medium:40,heavy:80},NM={light:3,medium:4,heavy:5},eE={init(t,e,n){let i=MM[n.intensity],r=NM[n.intensity],o=n.colors.length>0?n.colors:["#ff4444","#44ff44","#4444ff"],a=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,c=Math.random()*e*.6,u=o[Math.floor(Math.random()*o.length)];for(let d=0;d<i;d++){let h=Math.PI*2*d/i+(Math.random()-.5)*.3,m=Math.random()*3+2;a.push({x:l,y:c,vx:Math.cos(h)*m,vy:Math.sin(h)*m,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:u,opacity:1,shape:"circle",data:{centerX:l,centerY:c}})}}return a},update(t,e,n){let i=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.shadowBlur=12,t.shadowColor=n.color,t.beginPath(),t.arc(n.x,n.y,n.size,0,Math.PI*2),t.fill(),t.restore())}};var DM={light:30,medium:60,heavy:120},tE={init(t,e,n){let i=DM[n.intensity],r=n.colors.length>0?n.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let a=0;a<i;a++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:r[Math.floor(Math.random()*r.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,n){let i=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,a=r.data?.baseOpacity??1;if(a<=.01)r.opacity=0;else{let s=Math.sin(n*.005+o)*.4+.6;r.opacity=a*s}r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e){if(n.opacity<.01)continue;t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation);let i=n.size;t.beginPath(),t.moveTo(0,-i),t.lineTo(i*.3,-i*.3),t.lineTo(i,0),t.lineTo(i*.3,i*.3),t.lineTo(0,i),t.lineTo(-i*.3,i*.3),t.lineTo(-i,0),t.lineTo(-i*.3,-i*.3),t.closePath(),t.fill(),t.restore()}}};var Vd=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,n,i){this.container=e,this.effect=n,this.duration=i.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,a=window.innerWidth,s=window.innerHeight;r.width=a*o,r.height=s*o,r.style.width=`${a}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=n.init(a,s,i),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let n=e-this.startTime,i=e-this.lastFrame;if(this.lastFrame=e,n>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,i,n)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var LM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],nE=new Map([["confetti",Q1],["fireworks",eE],["sparkles",tE],["emoji-rain",J1]]),iE=async(t,e)=>{let n=nE.get(t.effect);if(!n)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...nE.keys()].join(", ")}`),{cleanup:()=>{}};let i={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:t.colors??LM,props:t.props},r=new Vd;return r.start(e.overlayRoot,n,i),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{r.stop()}}};var uv="syntro_active_tour",jd=new Map;function IM(t){try{let e=localStorage.getItem(uv);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function cv(t){try{localStorage.setItem(uv,JSON.stringify(t))}catch{}}function HM(){try{localStorage.removeItem(uv)}catch{}}function nc(){return window.location.pathname}function zM(t){if(!t.route)return!0;let e=nc();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var dv=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:o=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(jd.has(n))return{cleanup:async()=>{let v=jd.get(n);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=IM(n),s=!!a;if(!s&&!o)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},cv(a));let l=i.findIndex(v=>v.id===a.currentStepId);if(l===-1){let v=r||i[0].id;l=i.findIndex(y=>y.id===v),l===-1&&(l=0),a.currentStepId=i[l].id,cv(a)}let c=i[l];if(!zM(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:nc()}),{cleanup:()=>{}};let u=!1,d=null,h=null,m=null,x=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},_=async v=>{if(u)return;if(await x(),v==="end"){HM(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let y=i.find(w=>w.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(a.currentStepId=v,cv(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:v}),y.route&&y.route!==nc()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:v,targetRoute:y.route});return}await b(y)},b=async v=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:v.id,stepIndex:i.findIndex(y=>y.id===v.id),totalSteps:i.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",E=>{let S=E?.actionId;if(S&&v.onAction){let k=v.onAction[S];k&&_(k)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",E=>{let S=E?.actionId;if(S&&v.onAction){let k=v.onAction[S];k&&_(k)}}),w=h;h=()=>{w(),y()}}}};m=(()=>{let v=nc(),y=()=>{let S=nc();S!==v&&(v=S,e.publishEvent("tour.route_changed",{tourId:n,newRoute:S}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let w=history.pushState.bind(history),E=history.replaceState.bind(history);return history.pushState=(...S)=>{w(...S),queueMicrotask(y)},history.replaceState=(...S)=>{E(...S),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=E}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:a.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:a.currentStepId}),await b(c);let g=async()=>{u=!0,jd.delete(n),await x(),m&&m(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return jd.set(n,{cleanup:g}),{cleanup:g}};var un={white:"#ffffff",black:"#000000"},ie={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},A={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},ke={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},xt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},$e={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},dn={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},ic={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Lt={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},rc={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var fn={primary:A[10],secondary:A[9],tertiary:A[8]},dH={primary:A[2],secondary:A[0]},fv={primary:A[4],secondary:A[3]},Pd={primary:{text:un.white,icon:un.white,border:ie[3],backgroundDefault:ie[3],backgroundHover:ie[2]},neutral:{text:A[10],textHover:un.white,icon:A[10],iconHover:un.white,border:A[4],background:A[2]},link:{text:un.white,icon:un.white,hover:ie[5]},error:{text:$e[5],hover:$e[6]},success:{text:ke[5],hover:ke[6]}},fH={slateGrey:{content:A[10],pillOutline:A[10],borderPrimary:A[5],borderSecondary:A[5],background:A[3]},brand:{content:ie[9],pillOutline:ie[9],borderPrimary:ie[6],borderSecondary:ie[6],background:ie[0]},red:{content:$e[8],pillOutline:$e[4],borderPrimary:$e[2],borderSecondary:$e[2],background:$e[0]},yellow:{content:xt[8],pillOutline:xt[4],borderPrimary:xt[2],borderSecondary:xt[2],background:xt[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:Lt[8],pillOutline:Lt[4],borderPrimary:Lt[2],borderSecondary:Lt[2],background:Lt[0]},blue:{content:dn[8],pillOutline:dn[4],borderPrimary:dn[2],borderSecondary:dn[2],background:dn[0]},orange:{content:ic[8],pillOutline:ic[4],borderPrimary:ic[2],borderSecondary:ic[2],background:ic[0]},pink:{content:rc[8],pillOutline:rc[4],borderPrimary:rc[2],borderSecondary:rc[2],background:rc[0]}},pH={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:xt[8],border:xt[2],background:xt[0]},red:{content:$e[8],border:$e[2],background:$e[0]}},hH={green:{content:ke[1],background:ke[9]},yellow:{content:xt[1],background:xt[9]},red:{content:$e[1],background:$e[9]}},gH={content:A[10],border:A[4],background:"#1c2124"},mH={backgroundDefault:A[2],backgroundHover:A[1],selected:A[3]},vH={background:A[2],icon:A[10],borderDefault:A[4],borderSelected:ie[3],textLabel:A[9],textPlaceholder:A[8],textHint:A[8]},yH={backgroundDefault:A[2],backgroundDisabled:A[0],textLabel:A[9],textPlaceholder:A[8],textHint:A[8],textError:$e[5],iconDefault:A[9],iconPlaceholder:A[10],iconError:$e[5],borderDefault:A[4],borderSelected:ie[3],borderError:$e[5]},bH={handleDefault:un.white,handleDisabled:A[10],off:{backgroundDefault:A[4],backgroundHover:A[5],backgroundDisabled:A[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:A[4]}},_H={off:{backgroundDefault:"#00000000",backgroundHover:A[5],backgroundDisabled:A[2],border:A[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:A[2],border:ke[3]}},xH={content:A[10],background:A[4]},SH={background:A[4],active:ke[3]},wH={background:A[1],content:A[9],border:A[4]},EH={backgroundDefault:A[1],backgroundHover:A[3],backgroundActive:A[4],border:A[4],contentPrimary:A[10],contentSecondary:A[9],contentTertiary:A[8]},CH={background:A[1],content:A[9],border:A[4]},AH={activeBackground:A[3],activeContent:ie[5],inactiveContent:A[9],border:A[4]},kH={header:{textDefault:A[9],textHover:A[8],backgroundDefault:A[1]},border:A[4],cell:{textPrimary:A[10],textSecondary:A[9],backgroundDefault:A[2],backgroundHover:A[1]}},TH={textPrimaryDefault:A[10],textPrimaryHover:A[10],textSecondaryDefault:A[8],textSecondaryHover:A[9],iconPrimary:A[10],iconSecondary:A[8]},RH={background:ke[1],active:ke[5]},OH={textDefault:A[10],textSelected:un.white,textDisabled:A[7],backgroundDefault:A[2],backgroundMiddle:A[3],backgroundSelected:ie[3],border:A[4]},MH=A[9];var rE=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function oE(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??`var(--syntro-ring, ${dn[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),d=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),m=document.createElement("div");m.className="syntro-spotlight-scrim";let x=s||l;Object.assign(m.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:x?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(m),requestAnimationFrame(()=>m.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${a||h||dn[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(_);let b=[];if(!rE)for(let T=0;T<4;T++){let C=document.createElement("div");C.style.position="fixed",C.style.background="inherit",b.push(C),m.appendChild(C)}let f=T=>{m.style.clipPath=T,m.style.webkitClipPath=T},g=()=>{if(!t.isConnected){k.destroy();return}let T=t.getBoundingClientRect(),C=Math.max(0,T.left-i),R=Math.max(0,T.top-i),L=Math.min(window.innerWidth,T.width+i*2),N=Math.min(window.innerHeight,T.height+i*2);if(Object.assign(_.style,{left:`${C}px`,top:`${R}px`,width:`${L}px`,height:`${N}px`}),rE){let z=window.innerWidth,B=window.innerHeight,H=Math.min(r,L/2,N/2),K=`M 0 0 L ${z} 0 L ${z} ${B} L 0 ${B} Z`,D=`M ${C+H} ${R} A ${H} ${H} 0 0 0 ${C} ${R+H} L ${C} ${R+N-H} A ${H} ${H} 0 0 0 ${C+H} ${R+N} L ${C+L-H} ${R+N} A ${H} ${H} 0 0 0 ${C+L} ${R+N-H} L ${C+L} ${R+H} A ${H} ${H} 0 0 0 ${C+L-H} ${R} L ${C+H} ${R} Z`;f(`path('${K} ${D}')`)}else{let[z,B,H,K]=b;Object.assign(z.style,{left:"0px",top:"0px",width:"100vw",height:`${R}px`}),Object.assign(H.style,{left:"0px",top:`${R+N}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(R+N))}px`}),Object.assign(K.style,{left:"0px",top:`${R}px`,width:`${C}px`,height:`${N}px`}),Object.assign(B.style,{left:`${C+L}px`,top:`${R}px`,width:`${Math.max(0,window.innerWidth-(C+L))}px`,height:`${N}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(g));v.observe(t);let y=()=>requestAnimationFrame(g),w=()=>requestAnimationFrame(g);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let E=T=>{T.key==="Escape"&&c&&k.destroy()};c&&window.addEventListener("keydown",E);let S=T=>{s?(T.preventDefault(),T.stopPropagation()):l&&k.destroy()};m.addEventListener("click",S);let k={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",E),m.removeEventListener("click",S),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),_.remove()},220)}};return g(),k}var BM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function pn(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!BM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(d||h)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var pv=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:o,dismiss:a,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
10
10
|
position: fixed;
|
|
11
11
|
inset: 0;
|
|
12
12
|
background: rgba(0, 0, 0, ${o?.opacity??.6});
|
|
@@ -20,14 +20,14 @@ Error generating stack: `+i.message+`
|
|
|
20
20
|
transform: translate(-50%, -50%) scale(0.95);
|
|
21
21
|
max-width: ${u[i]};
|
|
22
22
|
width: 90%;
|
|
23
|
-
background: ${
|
|
23
|
+
background: ${un.white};
|
|
24
24
|
border-radius: 12px;
|
|
25
25
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
26
26
|
z-index: 2147483646;
|
|
27
27
|
opacity: 0;
|
|
28
28
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
|
29
29
|
padding: 24px;
|
|
30
|
-
`;let d="";if(n.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${
|
|
30
|
+
`;let d="";if(n.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${pn(n.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: #4b5563; line-height: 1.5;">${pn(n.body)}</div>`,a?.closeButton!==!1&&(d+=`
|
|
31
31
|
<button class="syntro-modal-close" data-syntro-action="dismiss" style="
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 16px;
|
|
@@ -42,10 +42,10 @@ Error generating stack: `+i.message+`
|
|
|
42
42
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
43
43
|
</svg>
|
|
44
44
|
</button>
|
|
45
|
-
`),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of s){let
|
|
45
|
+
`),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of s){let E=w.primary??!1;d+=`
|
|
46
46
|
<button
|
|
47
|
-
class="syntro-modal-btn ${
|
|
48
|
-
data-syntro-action="${
|
|
47
|
+
class="syntro-modal-btn ${E?"syntro-modal-btn-primary":""}"
|
|
48
|
+
data-syntro-action="${pn(w.actionId)}"
|
|
49
49
|
style="
|
|
50
50
|
padding: 10px 20px;
|
|
51
51
|
border-radius: 8px;
|
|
@@ -53,54 +53,69 @@ Error generating stack: `+i.message+`
|
|
|
53
53
|
font-weight: 500;
|
|
54
54
|
cursor: pointer;
|
|
55
55
|
transition: background 150ms ease;
|
|
56
|
-
${
|
|
56
|
+
${E?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
|
|
57
57
|
"
|
|
58
58
|
>
|
|
59
|
-
${
|
|
59
|
+
${pn(w.label)}
|
|
60
60
|
</button>
|
|
61
|
-
`}d+="</div>"}c.innerHTML=d,e.overlayRoot.appendChild(c);let h=null,m=c.querySelectorAll("[data-syntro-action]"),S=w=>{let x=w.currentTarget.getAttribute("data-syntro-action");x&&(h=x,e.publishEvent("action.modal_cta_clicked",{actionId:x}),y.destroy())};m.forEach(w=>w.addEventListener("click",S));let _=w=>{w.key==="Escape"&&a?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let b=()=>{r||y.destroy()};l.addEventListener("click",b);let f=[];r&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&!w.querySelector("[data-syntro-editor-panel]")&&!w.hasAttribute("data-syntro-editor-panel")&&(w.setAttribute("inert",""),f.push(w))});let p;a?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},a.timeoutMs));let v=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",b),m.forEach(w=>w.removeEventListener("click",S)),f.forEach(w=>w.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var lE=["top","right","bottom","left"];var Br=Math.min,Bi=Math.max,sc=Math.round,lc=Math.floor,$n=t=>({x:t,y:t}),FM={left:"right",right:"left",bottom:"top",top:"bottom"},$M={start:"end",end:"start"};function Zd(t,e,n){return Bi(t,Br(e,n))}function Oo(t,e){return typeof t=="function"?t(e):t}function Fr(t){return t.split("-")[0]}function rs(t){return t.split("-")[1]}function hv(t){return t==="x"?"y":"x"}function Gd(t){return t==="y"?"height":"width"}var UM=new Set(["top","bottom"]);function Fi(t){return UM.has(Fr(t))?"y":"x"}function Yd(t){return hv(Fi(t))}function cE(t,e,n){n===void 0&&(n=!1);let i=rs(t),r=Yd(t),o=Gd(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=ac(a)),[a,ac(a)]}function uE(t){let e=ac(t);return[qd(t),e,qd(e)]}function qd(t){return t.replace(/start|end/g,e=>$M[e])}var aE=["left","right"],sE=["right","left"],VM=["top","bottom"],jM=["bottom","top"];function PM(t,e,n){switch(t){case"top":case"bottom":return n?e?sE:aE:e?aE:sE;case"left":case"right":return e?VM:jM;default:return[]}}function dE(t,e,n,i){let r=rs(t),o=PM(Fr(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(qd)))),o}function ac(t){return t.replace(/left|right|bottom|top/g,e=>FM[e])}function qM(t){return{top:0,right:0,bottom:0,left:0,...t}}function gv(t){return typeof t!="number"?qM(t):{top:t,right:t,bottom:t,left:t}}function Mo(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function fE(t,e,n){let{reference:i,floating:r}=t,o=Fi(e),a=Yd(e),s=Gd(a),l=Fr(e),c=o==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2,m;switch(l){case"top":m={x:u,y:i.y-r.height};break;case"bottom":m={x:u,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:d};break;case"left":m={x:i.x-r.width,y:d};break;default:m={x:i.x,y:i.y}}switch(rs(e)){case"start":m[a]-=h*(n&&c?-1:1);break;case"end":m[a]+=h*(n&&c?-1:1);break}return m}async function gE(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:o,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=Oo(e,t),S=gv(m),b=s[h?d==="floating"?"reference":"floating":d],f=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),p=d==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},w=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:v,strategy:l}):p);return{top:(f.top-w.top+S.top)/y.y,bottom:(w.bottom-f.bottom+S.bottom)/y.y,left:(f.left-w.left+S.left)/y.x,right:(w.right-f.right+S.right)/y.x}}var mE=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=fE(c,i,l),h=i,m={},S=0;for(let b=0;b<s.length;b++){var _;let{name:f,fn:p}=s[b],{x:v,y,data:w,reset:A}=await p({x:u,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:m,rects:c,platform:{...a,detectOverflow:(_=a.detectOverflow)!=null?_:gE},elements:{reference:t,floating:e}});u=v??u,d=y??d,m={...m,[f]:{...m[f],...w}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):A.rects),{x:u,y:d}=fE(c,h,l)),b=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:m}},vE=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Oo(t,e)||{};if(c==null)return{};let d=gv(u),h={x:n,y:i},m=Yd(r),S=Gd(m),_=await a.getDimensions(c),b=m==="y",f=b?"top":"left",p=b?"bottom":"right",v=b?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[m]-h[m]-o.floating[S],w=h[m]-o.reference[m],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),x=A?A[v]:0;(!x||!await(a.isElement==null?void 0:a.isElement(A)))&&(x=s.floating[v]||o.floating[S]);let T=y/2-w/2,k=x/2-_[S]/2-1,E=Br(d[f],k),R=Br(d[p],k),D=E,N=x-_[S]-R,H=x/2-_[S]/2+T,B=Zd(D,H,N),z=!l.arrow&&rs(r)!=null&&H!==B&&o.reference[S]/2-(H<D?E:R)-_[S]/2<0,te=z?H<D?H-D:H-N:0;return{[m]:h[m]+te,data:{[m]:B,centerOffset:H-B-te,...z&&{alignmentOffset:te}},reset:z}}});var yE=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...b}=Oo(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=Fr(r),p=Fi(s),v=Fr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(v||!_?[ac(s)]:uE(s)),A=S!=="none";!h&&A&&w.push(...dE(s,_,S,y));let x=[s,...w],T=await l.detectOverflow(e,b),k=[],E=((i=o.flip)==null?void 0:i.overflows)||[];if(u&&k.push(T[f]),d){let H=cE(r,a,y);k.push(T[H[0]],T[H[1]])}if(E=[...E,{placement:r,overflows:k}],!k.every(H=>H<=0)){var R,D;let H=(((R=o.flip)==null?void 0:R.index)||0)+1,B=x[H];if(B&&(!(d==="alignment"?p!==Fi(B):!1)||E.every(I=>Fi(I.placement)===p?I.overflows[0]>0:!0)))return{data:{index:H,overflows:E},reset:{placement:B}};let z=(D=E.filter(te=>te.overflows[0]<=0).sort((te,I)=>te.overflows[1]-I.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(m){case"bestFit":{var N;let te=(N=E.filter(I=>{if(A){let G=Fi(I.placement);return G===p||G==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(G=>G>0).reduce((G,J)=>G+J,0)]).sort((I,G)=>I[1]-G[1])[0])==null?void 0:N[0];te&&(z=te);break}case"initialPlacement":z=s;break}if(r!==z)return{reset:{placement:z}}}return{}}}};function pE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hE(t){return lE.some(e=>t[e]>=0)}var bE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=Oo(t,e);switch(r){case"referenceHidden":{let a=await i.detectOverflow(e,{...o,elementContext:"reference"}),s=pE(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hE(s)}}}case"escaped":{let a=await i.detectOverflow(e,{...o,altBoundary:!0}),s=pE(a,n.floating);return{data:{escapedOffsets:s,escaped:hE(s)}}}default:return{}}}}};var ZM=new Set(["left","top"]);async function GM(t,e){let{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Fr(n),s=rs(n),l=Fi(n)==="y",c=ZM.has(a)?-1:1,u=o&&l?-1:1,d=Oo(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*u,y:h*c}:{x:h*c,y:m*u}}var _E=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:o,placement:a,middlewareData:s}=e,l=await GM(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},SE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:p,y:v}=f;return{x:p,y:v}}},...c}=Oo(t,e),u={x:n,y:i},d=await o.detectOverflow(e,c),h=Fi(Fr(r)),m=hv(h),S=u[m],_=u[h];if(a){let f=m==="y"?"top":"left",p=m==="y"?"bottom":"right",v=S+d[f],y=S-d[p];S=Zd(v,S,y)}if(s){let f=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=_+d[f],y=_-d[p];_=Zd(v,_,y)}let b=l.fn({...e,[m]:S,[h]:_});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[m]:a,[h]:s}}}}}};function Wd(){return typeof window<"u"}function No(t){return wE(t)?(t.nodeName||"").toLowerCase():"#document"}function qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Un(t){var e;return(e=(wE(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wE(t){return Wd()?t instanceof Node||t instanceof qt(t).Node:!1}function Tn(t){return Wd()?t instanceof Element||t instanceof qt(t).Element:!1}function Vn(t){return Wd()?t instanceof HTMLElement||t instanceof qt(t).HTMLElement:!1}function xE(t){return!Wd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qt(t).ShadowRoot}var YM=new Set(["inline","contents"]);function as(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=kn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!YM.has(r)}var WM=new Set(["table","td","th"]);function EE(t){return WM.has(No(t))}var XM=[":popover-open",":modal"];function cc(t){return XM.some(e=>{try{return t.matches(e)}catch{return!1}})}var KM=["transform","translate","scale","rotate","perspective"],QM=["transform","translate","scale","rotate","perspective","filter"],JM=["paint","layout","strict","content"];function Xd(t){let e=Kd(),n=Tn(t)?kn(t):t;return KM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||QM.some(i=>(n.willChange||"").includes(i))||JM.some(i=>(n.contain||"").includes(i))}function CE(t){let e=$i(t);for(;Vn(e)&&!Do(e);){if(Xd(e))return e;if(cc(e))return null;e=$i(e)}return null}function Kd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var eN=new Set(["html","body","#document"]);function Do(t){return eN.has(No(t))}function kn(t){return qt(t).getComputedStyle(t)}function uc(t){return Tn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $i(t){if(No(t)==="html")return t;let e=t.assignedSlot||t.parentNode||xE(t)&&t.host||Un(t);return xE(e)?e.host:e}function AE(t){let e=$i(t);return Do(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vn(e)&&as(e)?e:AE(e)}function os(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=AE(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=qt(r);if(o){let s=Qd(a);return e.concat(a,a.visualViewport||[],as(r)?r:[],s&&n?os(s):[])}return e.concat(r,os(r,[],n))}function Qd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function OE(t){let e=kn(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Vn(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=sc(n)!==o||sc(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function vv(t){return Tn(t)?t:t.contextElement}function ss(t){let e=vv(t);if(!Vn(e))return $n(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=OE(e),a=(o?sc(n.width):n.width)/i,s=(o?sc(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var tN=$n(0);function ME(t){let e=qt(t);return!Kd()||!e.visualViewport?tN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nN(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==qt(t)?!1:e}function Lo(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),o=vv(t),a=$n(1);e&&(i?Tn(i)&&(a=ss(i)):a=ss(t));let s=nN(o,n,i)?ME(o):$n(0),l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){let h=qt(o),m=i&&Tn(i)?qt(i):i,S=h,_=Qd(S);for(;_&&i&&m!==S;){let b=ss(_),f=_.getBoundingClientRect(),p=kn(_),v=f.left+(_.clientLeft+parseFloat(p.paddingLeft))*b.x,y=f.top+(_.clientTop+parseFloat(p.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=v,c+=y,S=qt(_),_=Qd(S)}}return Mo({width:u,height:d,x:l,y:c})}function Jd(t,e){let n=uc(t).scrollLeft;return e?e.left+n:Lo(Un(t)).left+n}function NE(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Jd(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function iN(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o=r==="fixed",a=Un(i),s=e?cc(e.floating):!1;if(i===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=$n(1),u=$n(0),d=Vn(i);if((d||!d&&!o)&&((No(i)!=="body"||as(a))&&(l=uc(i)),Vn(i))){let m=Lo(i);c=ss(i),u.x=m.x+i.clientLeft,u.y=m.y+i.clientTop}let h=a&&!d&&!o?NE(a,l):$n(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function rN(t){return Array.from(t.getClientRects())}function oN(t){let e=Un(t),n=uc(t),i=t.ownerDocument.body,r=Bi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Bi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+Jd(t),s=-n.scrollTop;return kn(i).direction==="rtl"&&(a+=Bi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}var TE=25;function aN(t,e){let n=qt(t),i=Un(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;let u=Kd();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=Jd(i);if(c<=0){let u=i.ownerDocument,d=u.body,h=getComputedStyle(d),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(i.clientWidth-d.clientWidth-m);S<=TE&&(o-=S)}else c<=TE&&(o+=c);return{width:o,height:a,x:s,y:l}}var sN=new Set(["absolute","fixed"]);function lN(t,e){let n=Lo(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Vn(t)?ss(t):$n(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:a,height:s,x:l,y:c}}function kE(t,e,n){let i;if(e==="viewport")i=aN(t,n);else if(e==="document")i=oN(Un(t));else if(Tn(e))i=lN(e,n);else{let r=ME(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Mo(i)}function DE(t,e){let n=$i(t);return n===e||!Tn(n)||Do(n)?!1:kn(n).position==="fixed"||DE(n,e)}function cN(t,e){let n=e.get(t);if(n)return n;let i=os(t,[],!1).filter(s=>Tn(s)&&No(s)!=="body"),r=null,o=kn(t).position==="fixed",a=o?$i(t):t;for(;Tn(a)&&!Do(a);){let s=kn(a),l=Xd(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&sN.has(r.position)||as(a)&&!l&&DE(t,a))?i=i.filter(u=>u!==a):r=s,a=$i(a)}return e.set(t,i),i}function uN(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?cc(e)?[]:cN(e,this._c):[].concat(n),i],s=a[0],l=a.reduce((c,u)=>{let d=kE(e,u,r);return c.top=Bi(d.top,c.top),c.right=Br(d.right,c.right),c.bottom=Br(d.bottom,c.bottom),c.left=Bi(d.left,c.left),c},kE(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dN(t){let{width:e,height:n}=OE(t);return{width:e,height:n}}function fN(t,e,n){let i=Vn(e),r=Un(e),o=n==="fixed",a=Lo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$n(0);function c(){l.x=Jd(r)}if(i||!i&&!o)if((No(e)!=="body"||as(r))&&(s=uc(e)),i){let m=Lo(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else r&&c();o&&!i&&r&&c();let u=r&&!i&&!o?NE(r,s):$n(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function mv(t){return kn(t).position==="static"}function RE(t,e){if(!Vn(t)||kn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Un(t)===n&&(n=n.ownerDocument.body),n}function LE(t,e){let n=qt(t);if(cc(t))return n;if(!Vn(t)){let r=$i(t);for(;r&&!Do(r);){if(Tn(r)&&!mv(r))return r;r=$i(r)}return n}let i=RE(t,e);for(;i&&EE(i)&&mv(i);)i=RE(i,e);return i&&Do(i)&&mv(i)&&!Xd(i)?n:i||CE(t)||n}var pN=async function(t){let e=this.getOffsetParent||LE,n=this.getDimensions,i=await n(t.floating);return{reference:fN(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function hN(t){return kn(t).direction==="rtl"}var gN={convertOffsetParentRelativeRectToViewportRelativeRect:iN,getDocumentElement:Un,getClippingRect:uN,getOffsetParent:LE,getElementRects:pN,getClientRects:rN,getDimensions:dN,getScale:ss,isElement:Tn,isRTL:hN};function IE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mN(t,e){let n=null,i,r=Un(t);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:d,width:h,height:m}=c;if(s||e(),!h||!m)return;let S=lc(d),_=lc(r.clientWidth-(u+h)),b=lc(r.clientHeight-(d+m)),f=lc(u),v={rootMargin:-S+"px "+-_+"px "+-b+"px "+-f+"px",threshold:Bi(0,Br(1,l))||1},y=!0;function w(A){let x=A[0].intersectionRatio;if(x!==l){if(!y)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}x===1&&!IE(c,t.getBoundingClientRect())&&a(),y=!1}try{n=new IntersectionObserver(w,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return a(!0),o}function ef(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=vv(t),u=r||o?[...c?os(c):[],...os(e)]:[];u.forEach(f=>{r&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&s?mN(c,n):null,h=-1,m=null;a&&(m=new ResizeObserver(f=>{let[p]=f;p&&p.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let S,_=l?Lo(t):null;l&&b();function b(){let f=Lo(t);_&&!IE(_,f)&&n(),_=f,S=requestAnimationFrame(b)}return n(),()=>{var f;u.forEach(p=>{r&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),d?.(),(f=m)==null||f.disconnect(),m=null,l&&cancelAnimationFrame(S)}}var tf=_E;var nf=SE,rf=yE;var HE=bE,zE=vE;var of=(t,e,n)=>{let i=new Map,r={platform:gN,...n},o={...r.platform,_c:i};return mE(t,e,{...r,platform:o})};function vN(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let o=Math.max(e.left,0),a=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(o+s)/2,u=(a+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function BE(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=dn(n.html),!n.trigger||n.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>b.destroy()),o.style.position="relative",o.appendChild(f)}let a=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&n.onAction&&n.onAction(v)};a.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[tf(n.offsetPx??8),rf(),nf({padding:8}),HE(),zE({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",d=ef(t,o,async()=>{if(!t.isConnected){b.destroy();return}let f=vN(t),p=await of(f,o,{placement:u,strategy:"fixed",middleware:c}),{x:v,y,strategy:w,middlewareData:A,placement:x}=p;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:w}),A.arrow){let{x:T,y:k}=A.arrow,E=x.split("-")[0],R={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:T!=null?`${T}px`:"",top:k!=null?`${k}px`:"",right:"",bottom:"",[R[E]]:"-4px"});let D={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${D[E]||"0deg"})`}}),h=f=>{f.key==="Escape"&&b.destroy()};window.addEventListener("keydown",h);let m=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),m.push(p.id||p.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let p=f[0],v=f[f.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(v.focus(),w.preventDefault()):document.activeElement===v&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",p),t.addEventListener("focus",f),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",f),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let f=()=>{o.style.visibility==="visible"?b.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),b={el:o,destroy(){d(),_(),window.removeEventListener("keydown",h),a.forEach(f=>f.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return b}var yv=X($e(),1),Pe=X(Qe(),1),PE=X(Ro(),1);var Ue=X($e(),1);function _N({completed:t,total:e}){let n=e>0?Math.round(t/e*100):0;return(0,Ue.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ue.jsx)("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${n}%`}})})}function SN({step:t,isCompleted:e,isCurrent:n,tourId:i,onStepClick:r}){return(0,Ue.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":n?"true":void 0,"data-completed":e?"true":void 0,"aria-current":n?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${n?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(i,t.id),children:[(0,Ue.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ue.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):n?(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ue.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function xN({workflow:t,expanded:e,onStepClick:n,onDismiss:i}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ue.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ue.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ue.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ue.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ue.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>i(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ue.jsxs)("div",{className:"se-mb-2",children:[(0,Ue.jsx)(_N,{completed:r,total:o}),(0,Ue.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ue.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(a=>(0,Ue.jsx)(SN,{step:a,isCompleted:t.completedSteps.includes(a.id),isCurrent:t.currentStepId===a.id,tourId:t.tourId,onStepClick:n},a.id))}),e&&t.meta.description&&(0,Ue.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function VE({workflows:t,expanded:e,onStepClick:n,onDismiss:i}){return t.length===0?(0,Ue.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ue.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ue.jsx)(xN,{workflow:r,expanded:e,onStepClick:n,onDismiss:i},r.tourId))})}function jE(t,e){let n=document.createElement("div");n.setAttribute("data-testid","workflow-toast"),n.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(n.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let i=document.createElement("div");if(i.className="se-font-semibold",i.style.fontWeight="600",i.textContent=e.title,n.appendChild(i),e.body){let a=document.createElement("div");a.className="se-mt-1 se-text-sm",a.style.marginTop="4px",a.style.fontSize="13px",a.style.color="var(--se-color-text-secondary, #666)",a.textContent=e.body,n.appendChild(a)}t.appendChild(n);let r,o=setTimeout(()=>{n.style.opacity="0",r=setTimeout(()=>{n.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),n.remove()}}function wN(t){let e=new Map;for(let n of t){let i=n.action;if(i.kind==="core:tour"&&i.workflow&&i.tourId){let r=i.workflow,a=(i.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(i.tourId,{meta:r,steps:a})}}return e}function EN({runtime:t}){let[e,n]=(0,Pe.useState)(0),i=(0,Pe.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return wN(b)},[t,e]),r=(0,Pe.useRef)(i);r.current=i,(0,Pe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>n(b=>b+1))},[t]);let o=(0,Pe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),a=(0,Pe.useRef)(new Set),s=(0,Pe.useRef)([]),l=(0,Pe.useRef)(null),c=(0,Pe.useRef)({}),[u,d]=(0,Pe.useState)([]),h=(0,Pe.useRef)(!1);if(!h.current&&o){let b=o.get?.("notified")||[];for(let p of b)a.current.add(p);let f=o.get?.("completed")||{};c.current={...f},h.current=!0}(0,Pe.useEffect)(()=>{if(i.size===0)return;let b=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(p=>{let v=new Set(p.map(w=>w.tourId)),y=[];for(let[w,{meta:A,steps:x}]of i){if(v.has(w))continue;let T="active";b.includes(w)?T="dismissed":f[w]&&(T="completed"),y.push({tourId:w,meta:A,steps:x,currentStepId:null,completedSteps:[],status:T,completedAt:f[w]||void 0})}return y.length>0?[...p,...y]:p});for(let[p,{meta:v}]of i)if(!a.current.has(p)&&v.notification&&l.current&&!b.includes(p)&&!f[p]){a.current.add(p),o?.set?.("notified",[...a.current]);let y=jE(l.current,v.notification);s.current.push(y)}},[i,o]),(0,Pe.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},f=>{let p=f.props?.tourId;if(!p)return;let v=r.current;if(!v.has(p)&&f.name==="tour.started"){n(y=>y+1);return}v.has(p)&&d(y=>y.map(A=>{if(A.tourId!==p)return A;switch(f.name){case"tour.started":{let x=f.props?.startStepId||A.steps[0]?.id||null;if(!a.current.has(p)){a.current.add(p),o?.set?.("notified",[...a.current]);let k=v.get(p);if(k?.meta.notification&&l.current){let E=jE(l.current,k.meta.notification);s.current.push(E)}}let T=y.filter(k=>k.status==="active"||k.tourId===p).map(k=>k.tourId);return T.includes(p)||T.push(p),o?.set?.("active",[...new Set(T)]),{...A,status:"active",currentStepId:x,completedSteps:A.status==="active"?A.completedSteps:[]}}case"tour.step_started":{let x=f.props?.stepId;return{...A,currentStepId:x||A.currentStepId}}case"tour.step_changed":{let x=f.props?.previousStepId,T=f.props?.nextStepId,k=x&&!A.completedSteps.includes(x)?[...A.completedSteps,x]:A.completedSteps;return{...A,currentStepId:T||A.currentStepId,completedSteps:k}}case"tour.completed":{let x=Date.now();return c.current[p]=x,o?.set?.("completed",{...c.current}),{...A,status:"completed",currentStepId:null,completedSteps:A.steps.map(T=>T.id),completedAt:x}}case"tour.paused":return A;default:return A}}))});return()=>{b();for(let f of s.current)f();s.current=[]}},[t,o]);let m=(0,Pe.useCallback)((b,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:f})},[t]),S=(0,Pe.useCallback)(b=>{d(f=>{let p=f.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),v=p.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),p})},[o]),_=(0,Pe.useMemo)(()=>u.filter(b=>b.status==="active"),[u]);return(0,yv.jsx)("div",{ref:l,children:(0,yv.jsx)(VE,{workflows:_,onStepClick:m,onDismiss:S})})}var qE={mount(t,e){let n=e?.runtime||null,i=(0,PE.createRoot)(t);return i.render(Pe.default.createElement(EN,{runtime:n})),()=>{i.unmount()}}};var ZE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=oE(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},GE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.duration??2e3;if(!document.querySelector("[data-syntro-pulse-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-pulse-styles",""),a.textContent=`
|
|
61
|
+
`}d+="</div>"}c.innerHTML=d,e.overlayRoot.appendChild(c);let h=null,m=c.querySelectorAll("[data-syntro-action]"),x=w=>{let S=w.currentTarget.getAttribute("data-syntro-action");S&&(h=S,e.publishEvent("action.modal_cta_clicked",{actionId:S}),y.destroy())};m.forEach(w=>w.addEventListener("click",x));let _=w=>{w.key==="Escape"&&a?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let b=()=>{r||y.destroy()};l.addEventListener("click",b);let f=[];r&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&!w.querySelector("[data-syntro-editor-panel]")&&!w.hasAttribute("data-syntro-editor-panel")&&(w.setAttribute("inert",""),f.push(w))});let g;a?.timeoutMs&&(g=setTimeout(()=>{y.destroy()},a.timeoutMs));let v=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let y={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",_),l.removeEventListener("click",b),m.forEach(w=>w.removeEventListener("click",x)),f.forEach(w=>w.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var lE=["top","right","bottom","left"];var $r=Math.min,Fi=Math.max,ac=Math.round,sc=Math.floor,Vn=t=>({x:t,y:t}),$M={left:"right",right:"left",bottom:"top",top:"bottom"},FM={start:"end",end:"start"};function Zd(t,e,n){return Fi(t,$r(e,n))}function Mo(t,e){return typeof t=="function"?t(e):t}function Fr(t){return t.split("-")[0]}function is(t){return t.split("-")[1]}function hv(t){return t==="x"?"y":"x"}function Gd(t){return t==="y"?"height":"width"}var UM=new Set(["top","bottom"]);function Ui(t){return UM.has(Fr(t))?"y":"x"}function Yd(t){return hv(Ui(t))}function cE(t,e,n){n===void 0&&(n=!1);let i=is(t),r=Yd(t),o=Gd(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=oc(a)),[a,oc(a)]}function uE(t){let e=oc(t);return[qd(t),e,qd(e)]}function qd(t){return t.replace(/start|end/g,e=>FM[e])}var aE=["left","right"],sE=["right","left"],VM=["top","bottom"],jM=["bottom","top"];function PM(t,e,n){switch(t){case"top":case"bottom":return n?e?sE:aE:e?aE:sE;case"left":case"right":return e?VM:jM;default:return[]}}function dE(t,e,n,i){let r=is(t),o=PM(Fr(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(qd)))),o}function oc(t){return t.replace(/left|right|bottom|top/g,e=>$M[e])}function qM(t){return{top:0,right:0,bottom:0,left:0,...t}}function gv(t){return typeof t!="number"?qM(t):{top:t,right:t,bottom:t,left:t}}function No(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function fE(t,e,n){let{reference:i,floating:r}=t,o=Ui(e),a=Yd(e),s=Gd(a),l=Fr(e),c=o==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2,m;switch(l){case"top":m={x:u,y:i.y-r.height};break;case"bottom":m={x:u,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:d};break;case"left":m={x:i.x-r.width,y:d};break;default:m={x:i.x,y:i.y}}switch(is(e)){case"start":m[a]-=h*(n&&c?-1:1);break;case"end":m[a]+=h*(n&&c?-1:1);break}return m}async function gE(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:o,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=Mo(e,t),x=gv(m),b=s[h?d==="floating"?"reference":"floating":d],f=No(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g=d==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},w=No(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(f.top-w.top+x.top)/y.y,bottom:(w.bottom-f.bottom+x.bottom)/y.y,left:(f.left-w.left+x.left)/y.x,right:(w.right-f.right+x.right)/y.x}}var mE=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=fE(c,i,l),h=i,m={},x=0;for(let b=0;b<s.length;b++){var _;let{name:f,fn:g}=s[b],{x:v,y,data:w,reset:E}=await g({x:u,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:m,rects:c,platform:{...a,detectOverflow:(_=a.detectOverflow)!=null?_:gE},elements:{reference:t,floating:e}});u=v??u,d=y??d,m={...m,[f]:{...m[f],...w}},E&&x<=50&&(x++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):E.rects),{x:u,y:d}=fE(c,h,l)),b=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:m}},vE=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Mo(t,e)||{};if(c==null)return{};let d=gv(u),h={x:n,y:i},m=Yd(r),x=Gd(m),_=await a.getDimensions(c),b=m==="y",f=b?"top":"left",g=b?"bottom":"right",v=b?"clientHeight":"clientWidth",y=o.reference[x]+o.reference[m]-h[m]-o.floating[x],w=h[m]-o.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),S=E?E[v]:0;(!S||!await(a.isElement==null?void 0:a.isElement(E)))&&(S=s.floating[v]||o.floating[x]);let k=y/2-w/2,T=S/2-_[x]/2-1,C=$r(d[f],T),R=$r(d[g],T),L=C,N=S-_[x]-R,z=S/2-_[x]/2+k,B=Zd(L,z,N),H=!l.arrow&&is(r)!=null&&z!==B&&o.reference[x]/2-(z<L?C:R)-_[x]/2<0,K=H?z<L?z-L:z-N:0;return{[m]:h[m]+K,data:{[m]:B,centerOffset:z-B-K,...H&&{alignmentOffset:K}},reset:H}}});var yE=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...b}=Mo(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=Fr(r),g=Ui(s),v=Fr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(v||!_?[oc(s)]:uE(s)),E=x!=="none";!h&&E&&w.push(...dE(s,_,x,y));let S=[s,...w],k=await l.detectOverflow(e,b),T=[],C=((i=o.flip)==null?void 0:i.overflows)||[];if(u&&T.push(k[f]),d){let z=cE(r,a,y);T.push(k[z[0]],k[z[1]])}if(C=[...C,{placement:r,overflows:T}],!T.every(z=>z<=0)){var R,L;let z=(((R=o.flip)==null?void 0:R.index)||0)+1,B=S[z];if(B&&(!(d==="alignment"?g!==Ui(B):!1)||C.every(D=>Ui(D.placement)===g?D.overflows[0]>0:!0)))return{data:{index:z,overflows:C},reset:{placement:B}};let H=(L=C.filter(K=>K.overflows[0]<=0).sort((K,D)=>K.overflows[1]-D.overflows[1])[0])==null?void 0:L.placement;if(!H)switch(m){case"bestFit":{var N;let K=(N=C.filter(D=>{if(E){let G=Ui(D.placement);return G===g||G==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(G=>G>0).reduce((G,ut)=>G+ut,0)]).sort((D,G)=>D[1]-G[1])[0])==null?void 0:N[0];K&&(H=K);break}case"initialPlacement":H=s;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function pE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hE(t){return lE.some(e=>t[e]>=0)}var bE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=Mo(t,e);switch(r){case"referenceHidden":{let a=await i.detectOverflow(e,{...o,elementContext:"reference"}),s=pE(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hE(s)}}}case"escaped":{let a=await i.detectOverflow(e,{...o,altBoundary:!0}),s=pE(a,n.floating);return{data:{escapedOffsets:s,escaped:hE(s)}}}default:return{}}}}};var ZM=new Set(["left","top"]);async function GM(t,e){let{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Fr(n),s=is(n),l=Ui(n)==="y",c=ZM.has(a)?-1:1,u=o&&l?-1:1,d=Mo(e,t),{mainAxis:h,crossAxis:m,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof x=="number"&&(m=s==="end"?x*-1:x),l?{x:m*u,y:h*c}:{x:h*c,y:m*u}}var _E=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:o,placement:a,middlewareData:s}=e,l=await GM(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},xE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:g,y:v}=f;return{x:g,y:v}}},...c}=Mo(t,e),u={x:n,y:i},d=await o.detectOverflow(e,c),h=Ui(Fr(r)),m=hv(h),x=u[m],_=u[h];if(a){let f=m==="y"?"top":"left",g=m==="y"?"bottom":"right",v=x+d[f],y=x-d[g];x=Zd(v,x,y)}if(s){let f=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=_+d[f],y=_-d[g];_=Zd(v,_,y)}let b=l.fn({...e,[m]:x,[h]:_});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[m]:a,[h]:s}}}}}};function Wd(){return typeof window<"u"}function Do(t){return wE(t)?(t.nodeName||"").toLowerCase():"#document"}function Zt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function jn(t){var e;return(e=(wE(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wE(t){return Wd()?t instanceof Node||t instanceof Zt(t).Node:!1}function Rn(t){return Wd()?t instanceof Element||t instanceof Zt(t).Element:!1}function Pn(t){return Wd()?t instanceof HTMLElement||t instanceof Zt(t).HTMLElement:!1}function SE(t){return!Wd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zt(t).ShadowRoot}var YM=new Set(["inline","contents"]);function os(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=On(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!YM.has(r)}var WM=new Set(["table","td","th"]);function EE(t){return WM.has(Do(t))}var XM=[":popover-open",":modal"];function lc(t){return XM.some(e=>{try{return t.matches(e)}catch{return!1}})}var KM=["transform","translate","scale","rotate","perspective"],QM=["transform","translate","scale","rotate","perspective","filter"],JM=["paint","layout","strict","content"];function Xd(t){let e=Kd(),n=Rn(t)?On(t):t;return KM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||QM.some(i=>(n.willChange||"").includes(i))||JM.some(i=>(n.contain||"").includes(i))}function CE(t){let e=Vi(t);for(;Pn(e)&&!Lo(e);){if(Xd(e))return e;if(lc(e))return null;e=Vi(e)}return null}function Kd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var eN=new Set(["html","body","#document"]);function Lo(t){return eN.has(Do(t))}function On(t){return Zt(t).getComputedStyle(t)}function cc(t){return Rn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Vi(t){if(Do(t)==="html")return t;let e=t.assignedSlot||t.parentNode||SE(t)&&t.host||jn(t);return SE(e)?e.host:e}function AE(t){let e=Vi(t);return Lo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Pn(e)&&os(e)?e:AE(e)}function rs(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=AE(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=Zt(r);if(o){let s=Qd(a);return e.concat(a,a.visualViewport||[],os(r)?r:[],s&&n?rs(s):[])}return e.concat(r,rs(r,[],n))}function Qd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function OE(t){let e=On(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Pn(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=ac(n)!==o||ac(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function vv(t){return Rn(t)?t:t.contextElement}function as(t){let e=vv(t);if(!Pn(e))return Vn(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=OE(e),a=(o?ac(n.width):n.width)/i,s=(o?ac(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var tN=Vn(0);function ME(t){let e=Zt(t);return!Kd()||!e.visualViewport?tN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nN(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Zt(t)?!1:e}function Io(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),o=vv(t),a=Vn(1);e&&(i?Rn(i)&&(a=as(i)):a=as(t));let s=nN(o,n,i)?ME(o):Vn(0),l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){let h=Zt(o),m=i&&Rn(i)?Zt(i):i,x=h,_=Qd(x);for(;_&&i&&m!==x;){let b=as(_),f=_.getBoundingClientRect(),g=On(_),v=f.left+(_.clientLeft+parseFloat(g.paddingLeft))*b.x,y=f.top+(_.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=v,c+=y,x=Zt(_),_=Qd(x)}}return No({width:u,height:d,x:l,y:c})}function Jd(t,e){let n=cc(t).scrollLeft;return e?e.left+n:Io(jn(t)).left+n}function NE(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Jd(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function iN(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o=r==="fixed",a=jn(i),s=e?lc(e.floating):!1;if(i===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Vn(1),u=Vn(0),d=Pn(i);if((d||!d&&!o)&&((Do(i)!=="body"||os(a))&&(l=cc(i)),Pn(i))){let m=Io(i);c=as(i),u.x=m.x+i.clientLeft,u.y=m.y+i.clientTop}let h=a&&!d&&!o?NE(a,l):Vn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function rN(t){return Array.from(t.getClientRects())}function oN(t){let e=jn(t),n=cc(t),i=t.ownerDocument.body,r=Fi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Fi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+Jd(t),s=-n.scrollTop;return On(i).direction==="rtl"&&(a+=Fi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}var kE=25;function aN(t,e){let n=Zt(t),i=jn(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;let u=Kd();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=Jd(i);if(c<=0){let u=i.ownerDocument,d=u.body,h=getComputedStyle(d),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(i.clientWidth-d.clientWidth-m);x<=kE&&(o-=x)}else c<=kE&&(o+=c);return{width:o,height:a,x:s,y:l}}var sN=new Set(["absolute","fixed"]);function lN(t,e){let n=Io(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Pn(t)?as(t):Vn(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:a,height:s,x:l,y:c}}function TE(t,e,n){let i;if(e==="viewport")i=aN(t,n);else if(e==="document")i=oN(jn(t));else if(Rn(e))i=lN(e,n);else{let r=ME(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return No(i)}function DE(t,e){let n=Vi(t);return n===e||!Rn(n)||Lo(n)?!1:On(n).position==="fixed"||DE(n,e)}function cN(t,e){let n=e.get(t);if(n)return n;let i=rs(t,[],!1).filter(s=>Rn(s)&&Do(s)!=="body"),r=null,o=On(t).position==="fixed",a=o?Vi(t):t;for(;Rn(a)&&!Lo(a);){let s=On(a),l=Xd(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&sN.has(r.position)||os(a)&&!l&&DE(t,a))?i=i.filter(u=>u!==a):r=s,a=Vi(a)}return e.set(t,i),i}function uN(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?lc(e)?[]:cN(e,this._c):[].concat(n),i],s=a[0],l=a.reduce((c,u)=>{let d=TE(e,u,r);return c.top=Fi(d.top,c.top),c.right=$r(d.right,c.right),c.bottom=$r(d.bottom,c.bottom),c.left=Fi(d.left,c.left),c},TE(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dN(t){let{width:e,height:n}=OE(t);return{width:e,height:n}}function fN(t,e,n){let i=Pn(e),r=jn(e),o=n==="fixed",a=Io(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Vn(0);function c(){l.x=Jd(r)}if(i||!i&&!o)if((Do(e)!=="body"||os(r))&&(s=cc(e)),i){let m=Io(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else r&&c();o&&!i&&r&&c();let u=r&&!i&&!o?NE(r,s):Vn(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function mv(t){return On(t).position==="static"}function RE(t,e){if(!Pn(t)||On(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return jn(t)===n&&(n=n.ownerDocument.body),n}function LE(t,e){let n=Zt(t);if(lc(t))return n;if(!Pn(t)){let r=Vi(t);for(;r&&!Lo(r);){if(Rn(r)&&!mv(r))return r;r=Vi(r)}return n}let i=RE(t,e);for(;i&&EE(i)&&mv(i);)i=RE(i,e);return i&&Lo(i)&&mv(i)&&!Xd(i)?n:i||CE(t)||n}var pN=async function(t){let e=this.getOffsetParent||LE,n=this.getDimensions,i=await n(t.floating);return{reference:fN(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function hN(t){return On(t).direction==="rtl"}var gN={convertOffsetParentRelativeRectToViewportRelativeRect:iN,getDocumentElement:jn,getClippingRect:uN,getOffsetParent:LE,getElementRects:pN,getClientRects:rN,getDimensions:dN,getScale:as,isElement:Rn,isRTL:hN};function IE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mN(t,e){let n=null,i,r=jn(t);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:d,width:h,height:m}=c;if(s||e(),!h||!m)return;let x=sc(d),_=sc(r.clientWidth-(u+h)),b=sc(r.clientHeight-(d+m)),f=sc(u),v={rootMargin:-x+"px "+-_+"px "+-b+"px "+-f+"px",threshold:Fi(0,$r(1,l))||1},y=!0;function w(E){let S=E[0].intersectionRatio;if(S!==l){if(!y)return a();S?a(!1,S):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!IE(c,t.getBoundingClientRect())&&a(),y=!1}try{n=new IntersectionObserver(w,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return a(!0),o}function ef(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=vv(t),u=r||o?[...c?rs(c):[],...rs(e)]:[];u.forEach(f=>{r&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&s?mN(c,n):null,h=-1,m=null;a&&(m=new ResizeObserver(f=>{let[g]=f;g&&g.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let x,_=l?Io(t):null;l&&b();function b(){let f=Io(t);_&&!IE(_,f)&&n(),_=f,x=requestAnimationFrame(b)}return n(),()=>{var f;u.forEach(g=>{r&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),d?.(),(f=m)==null||f.disconnect(),m=null,l&&cancelAnimationFrame(x)}}var tf=_E;var nf=xE,rf=yE;var HE=bE,zE=vE;var of=(t,e,n)=>{let i=new Map,r={platform:gN,...n},o={...r.platform,_c:i};return mE(t,e,{...r,platform:o})};function vN(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let o=Math.max(e.left,0),a=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(o+s)/2,u=(a+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function BE(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=pn(n.html),!n.trigger||n.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>b.destroy()),o.style.position="relative",o.appendChild(f)}let a=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&n.onAction&&n.onAction(v)};a.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[tf(n.offsetPx??8),rf(),nf({padding:8}),HE(),zE({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",d=ef(t,o,async()=>{if(!t.isConnected){b.destroy();return}let f=vN(t),g=await of(f,o,{placement:u,strategy:"fixed",middleware:c}),{x:v,y,strategy:w,middlewareData:E,placement:S}=g;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:w}),E.arrow){let{x:k,y:T}=E.arrow,C=S.split("-")[0],R={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:k!=null?`${k}px`:"",top:T!=null?`${T}px`:"",right:"",bottom:"",[R[C]]:"-4px"});let L={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${L[C]||"0deg"})`}}),h=f=>{f.key==="Escape"&&b.destroy()};window.addEventListener("keydown",h);let m=[];if(n.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=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===g&&(v.focus(),w.preventDefault()):document.activeElement===v&&(g.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>g.focus())}}let _=(()=>{if(n.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},g=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",g),t.addEventListener("focus",f),t.addEventListener("blur",g),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",g),t.removeEventListener("focus",f),t.removeEventListener("blur",g)}}if(n.trigger==="click"){let f=()=>{o.style.visibility==="visible"?b.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),b={el:o,destroy(){d(),_(),window.removeEventListener("keydown",h),a.forEach(f=>f.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return b}var yv=Q(Fe(),1),Pe=Q(Ke(),1),PE=Q(Oo(),1);var Ue=Q(Fe(),1);function _N({completed:t,total:e}){let n=e>0?Math.round(t/e*100):0;return(0,Ue.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ue.jsx)("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${n}%`}})})}function xN({step:t,isCompleted:e,isCurrent:n,tourId:i,onStepClick:r}){return(0,Ue.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":n?"true":void 0,"data-completed":e?"true":void 0,"aria-current":n?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${n?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(i,t.id),children:[(0,Ue.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ue.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):n?(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ue.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function SN({workflow:t,expanded:e,onStepClick:n,onDismiss:i}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ue.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ue.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ue.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ue.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ue.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>i(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ue.jsxs)("div",{className:"se-mb-2",children:[(0,Ue.jsx)(_N,{completed:r,total:o}),(0,Ue.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ue.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(a=>(0,Ue.jsx)(xN,{step:a,isCompleted:t.completedSteps.includes(a.id),isCurrent:t.currentStepId===a.id,tourId:t.tourId,onStepClick:n},a.id))}),e&&t.meta.description&&(0,Ue.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function VE({workflows:t,expanded:e,onStepClick:n,onDismiss:i}){return t.length===0?(0,Ue.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ue.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ue.jsx)(SN,{workflow:r,expanded:e,onStepClick:n,onDismiss:i},r.tourId))})}function jE(t,e){let n=document.createElement("div");n.setAttribute("data-testid","workflow-toast"),n.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(n.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let i=document.createElement("div");if(i.className="se-font-semibold",i.style.fontWeight="600",i.textContent=e.title,n.appendChild(i),e.body){let a=document.createElement("div");a.className="se-mt-1 se-text-sm",a.style.marginTop="4px",a.style.fontSize="13px",a.style.color="var(--se-color-text-secondary, #666)",a.textContent=e.body,n.appendChild(a)}t.appendChild(n);let r,o=setTimeout(()=>{n.style.opacity="0",r=setTimeout(()=>{n.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),n.remove()}}function wN(t){let e=new Map;for(let n of t){let i=n.action;if(i.kind==="core:tour"&&i.workflow&&i.tourId){let r=i.workflow,a=(i.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(i.tourId,{meta:r,steps:a})}}return e}function EN({runtime:t}){let[e,n]=(0,Pe.useState)(0),i=(0,Pe.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return wN(b)},[t,e]),r=(0,Pe.useRef)(i);r.current=i,(0,Pe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>n(b=>b+1))},[t]);let o=(0,Pe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),a=(0,Pe.useRef)(new Set),s=(0,Pe.useRef)([]),l=(0,Pe.useRef)(null),c=(0,Pe.useRef)({}),[u,d]=(0,Pe.useState)([]),h=(0,Pe.useRef)(!1);if(!h.current&&o){let b=o.get?.("notified")||[];for(let g of b)a.current.add(g);let f=o.get?.("completed")||{};c.current={...f},h.current=!0}(0,Pe.useEffect)(()=>{if(i.size===0)return;let b=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(g=>{let v=new Set(g.map(w=>w.tourId)),y=[];for(let[w,{meta:E,steps:S}]of i){if(v.has(w))continue;let k="active";b.includes(w)?k="dismissed":f[w]&&(k="completed"),y.push({tourId:w,meta:E,steps:S,currentStepId:null,completedSteps:[],status:k,completedAt:f[w]||void 0})}return y.length>0?[...g,...y]:g});for(let[g,{meta:v}]of i)if(!a.current.has(g)&&v.notification&&l.current&&!b.includes(g)&&!f[g]){a.current.add(g),o?.set?.("notified",[...a.current]);let y=jE(l.current,v.notification);s.current.push(y)}},[i,o]),(0,Pe.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},f=>{let g=f.props?.tourId;if(!g)return;let v=r.current;if(!v.has(g)&&f.name==="tour.started"){n(y=>y+1);return}v.has(g)&&d(y=>y.map(E=>{if(E.tourId!==g)return E;switch(f.name){case"tour.started":{let S=f.props?.startStepId||E.steps[0]?.id||null;if(!a.current.has(g)){a.current.add(g),o?.set?.("notified",[...a.current]);let T=v.get(g);if(T?.meta.notification&&l.current){let C=jE(l.current,T.meta.notification);s.current.push(C)}}let k=y.filter(T=>T.status==="active"||T.tourId===g).map(T=>T.tourId);return k.includes(g)||k.push(g),o?.set?.("active",[...new Set(k)]),{...E,status:"active",currentStepId:S,completedSteps:E.status==="active"?E.completedSteps:[]}}case"tour.step_started":{let S=f.props?.stepId;return{...E,currentStepId:S||E.currentStepId}}case"tour.step_changed":{let S=f.props?.previousStepId,k=f.props?.nextStepId,T=S&&!E.completedSteps.includes(S)?[...E.completedSteps,S]:E.completedSteps;return{...E,currentStepId:k||E.currentStepId,completedSteps:T}}case"tour.completed":{let S=Date.now();return c.current[g]=S,o?.set?.("completed",{...c.current}),{...E,status:"completed",currentStepId:null,completedSteps:E.steps.map(k=>k.id),completedAt:S}}case"tour.paused":return E;default:return E}}))});return()=>{b();for(let f of s.current)f();s.current=[]}},[t,o]);let m=(0,Pe.useCallback)((b,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:f})},[t]),x=(0,Pe.useCallback)(b=>{d(f=>{let g=f.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),v=g.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),g})},[o]),_=(0,Pe.useMemo)(()=>u.filter(b=>b.status==="active"),[u]);return(0,yv.jsx)("div",{ref:l,children:(0,yv.jsx)(VE,{workflows:_,onStepClick:m,onDismiss:x})})}var qE={mount(t,e){let n=e?.runtime||null,i=(0,PE.createRoot)(t);return i.render(Pe.default.createElement(EN,{runtime:n})),()=>{i.unmount()}}};var ZE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=oE(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},GE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.duration??4e3;await new Promise(_=>requestAnimationFrame(_));let r=_=>({r:parseInt(_.slice(1,3),16),g:parseInt(_.slice(3,5),16),b:parseInt(_.slice(5,7),16)}),a={r:79,g:70,b:229},s=null;try{let _=getComputedStyle(e.overlayRoot),b=_.getPropertyValue("--sc-color-primary")?.trim(),f=_.getPropertyValue("--sc-color-primary-hover")?.trim();b?.startsWith("#")&&b.length>=7&&(a=r(b)),f?.startsWith("#")&&f.length>=7&&(s=r(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let c=document.createElement("style");c.setAttribute("data-syntro-pulse-styles","");let{r:u,g:d,b:h}=a;if(s){let{r:_,g:b,b:f}=s;c.textContent=`
|
|
62
62
|
@keyframes syntro-pulse-anim {
|
|
63
63
|
0%, 100% {
|
|
64
|
-
box-shadow: 0 0 0 0 rgba(
|
|
64
|
+
box-shadow: 0 0 0 0 rgba(${u}, ${d}, ${h}, 0.35);
|
|
65
|
+
}
|
|
66
|
+
25% {
|
|
67
|
+
box-shadow: 0 0 0 12px rgba(${u}, ${d}, ${h}, 0);
|
|
68
|
+
}
|
|
69
|
+
50% {
|
|
70
|
+
box-shadow: 0 0 0 0 rgba(${_}, ${b}, ${f}, 0.35);
|
|
71
|
+
}
|
|
72
|
+
75% {
|
|
73
|
+
box-shadow: 0 0 0 12px rgba(${_}, ${b}, ${f}, 0);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`}else c.textContent=`
|
|
77
|
+
@keyframes syntro-pulse-anim {
|
|
78
|
+
0%, 100% {
|
|
79
|
+
box-shadow: 0 0 0 0 rgba(${u}, ${d}, ${h}, 0.35);
|
|
65
80
|
}
|
|
66
81
|
50% {
|
|
67
|
-
box-shadow: 0 0 0
|
|
82
|
+
box-shadow: 0 0 0 12px rgba(${u}, ${d}, ${h}, 0);
|
|
68
83
|
}
|
|
69
84
|
}
|
|
70
|
-
|
|
85
|
+
`;document.head.appendChild(c);let m=n.style.animation;n.style.animation="syntro-pulse-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",n.setAttribute("data-syntro-pulse","true");let x=setTimeout(()=>{n.style.animation=m,n.removeAttribute("data-syntro-pulse")},i);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:i}),{cleanup:()=>{clearTimeout(x),n.style.animation=m,n.removeAttribute("data-syntro-pulse")}}},YE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i="#4f46e5";try{let s=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();s?.startsWith("#")&&s.length>=7&&(i=s)}catch{}let r=document.createElement("div");r.textContent=t.content,r.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(r.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:i,borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let o=t.position??"top-right",a=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(r),o){case"top-left":Object.assign(r.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(r.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(r.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(r.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:o}),{cleanup:()=>{r.remove(),a!==void 0&&(n.style.position=a)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(r.textContent=s.content)}}},WE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:i}=t,r="";if(i.title&&(r+=`<div class="syntro-tt-title">${pn(i.title)}</div>`),r+=`<div class="syntro-tt-body">${pn(i.body)}</div>`,i.ctaButtons&&i.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let a of i.ctaButtons){let s=a.primary??!1;r+=`
|
|
71
86
|
<button
|
|
72
87
|
class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
|
|
73
|
-
data-syntro-action="${
|
|
88
|
+
data-syntro-action="${pn(a.actionId)}"
|
|
74
89
|
>
|
|
75
|
-
${
|
|
90
|
+
${pn(a.label)}
|
|
76
91
|
</button>
|
|
77
92
|
`}r+="</div>"}else i.cta&&(r+=`<div class="syntro-tt-actions">
|
|
78
93
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
79
|
-
${
|
|
94
|
+
${pn(i.cta.label)}
|
|
80
95
|
</button>
|
|
81
|
-
</div>`);let o=BE(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:a=>{if(a==="dismiss"){o.destroy();return}if(a==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let s=i.ctaButtons.find(l=>l.actionId===a);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:a,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},bv=[{kind:"overlays:highlight",executor:ZE},{kind:"overlays:pulse",executor:GE},{kind:"overlays:badge",executor:YE},{kind:"overlays:tooltip",executor:WE},{kind:"overlays:modal",executor:pv},{kind:"core:tour",executor:dv},{kind:"overlays:celebrate",executor:iE}],sf={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:bv,widgets:[{id:"workflow:tracker",component:qE,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function lf(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,o=[],a=[],s=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>s.get(c),set:(c,u)=>s.set(c,u),remove:c=>s.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,d)=>{let h=n.surfaces.mount(c,u,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:m=>h.update(m)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),a.push(c.id)}}}function cf(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var CN=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"]),AN={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function XE(t){return AN[t]??t}function _v(t){return CN.has(t)}function
|
|
96
|
+
</div>`);let o=BE(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:a=>{if(a==="dismiss"){o.destroy();return}if(a==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let s=i.ctaButtons.find(l=>l.actionId===a);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:a,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},bv=[{kind:"overlays:highlight",executor:ZE},{kind:"overlays:pulse",executor:GE},{kind:"overlays:badge",executor:YE},{kind:"overlays:tooltip",executor:WE},{kind:"overlays:modal",executor:pv},{kind:"core:tour",executor:dv},{kind:"overlays:celebrate",executor:iE}],sf={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:bv,widgets:[{id:"workflow:tracker",component:qE,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function lf(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,o=[],a=[],s=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>s.get(c),set:(c,u)=>s.set(c,u),remove:c=>s.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,d)=>{let h=n.surfaces.mount(c,u,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:m=>h.update(m)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),a.push(c.id)}}}function cf(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var CN=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"]),AN={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function XE(t){return AN[t]??t}function _v(t){return CN.has(t)}function xv(t){if(_v(t))return null;let e=t.indexOf(":");return e===-1?null:XE(t.slice(0,e))}function uf(t){let e=t.indexOf(":");return e===-1?null:XE(t.slice(0,e))}function df(t){let{cdnBase:e,registry:n,timeout:i=1e4,onLoadStart:r,onLoadEnd:o}=t,a=new Map,s=new Set,l=new Map;function c(_){return`${e}/adaptives/${_}/index.js`}async function u(_){if(n.has(_))return{appId:_,success:!0,manifest:n.get(_)?.manifest};if(l.has(_))return l.get(_);if(a.has(_))return a.get(_);let b=(async()=>{r?.(_);try{let f=c(_);if(s.has(f)){let w=n.get(_);if(w)return o?.(_,!0),{appId:_,success:!0,manifest:w.manifest}}let g=new Promise((w,E)=>{setTimeout(()=>E(new Error(`Timeout loading app: ${_}`)),i)}),v=d(f,_);await Promise.race([v,g]),s.add(f);let y=n.get(_);if(!y)throw new Error(`App ${_} did not register after loading`);return o?.(_,!0),{appId:_,success:!0,manifest:y.manifest}}catch(f){let g=f instanceof Error?f.message:String(f);o?.(_,!1,g);let v={appId:_,success:!1,error:g};return l.set(_,v),v}finally{a.delete(_)}})();return a.set(_,b),b}async function d(_,b){if(typeof window<"u"){try{let f=await import(_);f.manifest?n.register(f.manifest):f.default?.manifest?n.register(f.default.manifest):f.default&&n.register(f.default);return}catch{}return new Promise((f,g)=>{let v=document.createElement("script");v.src=_,v.async=!0,v.onload=()=>{n.get(b)?f():g(new Error(`App ${b} did not self-register`))},v.onerror=()=>{g(new Error(`Failed to load app script: ${_}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(_){let b=new Set;if(_.apps)for(let f of _.apps)b.add(f);if(_.actions)for(let f of _.actions){let g=xv(f.kind);if(g&&b.add(g),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=uf(v);y&&b.add(y)}}}if(_.tiles){for(let f of _.tiles)if(f.widget){let g=uf(f.widget);g&&b.add(g)}}return Array.from(b)}async function m(_){let b=h(_);return b.length===0?[]:await Promise.all(b.map(g=>u(g)))}async function x(_){return Promise.all(_.map(b=>u(b)))}return{loadApp:u,loadAppsForConfig:m,preloadApps:x,getRequiredApps:h,getAppUrl:c}}var uc=class{constructor(){P(this,"apps",new Map);P(this,"eventListeners",new Set);P(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"||n.state==="activating"){console.warn(`[AppRegistry] App already ${n.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let i of n.manifest.dependencies){let r=this.apps.get(i);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${i}, which is not active`)}n.state="activating";try{let i=n.manifest.metadata?.isBuiltIn===!0,r=lf({appId:e,runtime:this.runtime,isBuiltIn:i}),{runtime:o}=n.manifest,a=[];if(o){if(o.actions)for(let s of o.actions)r.registerAction(s);if(o.widgets)for(let s of o.widgets)r.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(c=>{if(s.names.includes(c.name)){let u={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{s.handler(c,u)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});a.push(l)}}n.cleanup=async()=>{for(let s of a)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}cf(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[i,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${i} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async unregister(e){let n=this.apps.get(e);n&&(n.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let n of this.eventListeners)try{n(e)}catch(i){console.error("[AppRegistry] Event listener error:",i)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},ss=new uc;var Zn=Q(Fe(),1);var Ho=Q(Ke(),1),wv=Q(Oo(),1);var ji=Q(Ke(),1);var KE=/```json\s*\n([\s\S]*?)```/g;function QE(t){let e=[],n=t,i=[],r;for(KE.lastIndex=0;(r=KE.exec(t))!==null;)i.push({fullMatch:r[0],json:r[1],index:r.index});for(let o=i.length-1;o>=0;o--){let{fullMatch:a,json:s}=i[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),n=n.replace(a,""))}return n=n.replace(/\n{3,}/g,`
|
|
82
97
|
|
|
83
|
-
`).trim(),{displayText:n,actions:e}}var
|
|
84
|
-
<div style="padding: 16px; font-family: system-ui; color: ${
|
|
85
|
-
<p style="margin: 0 0 8px; color: ${
|
|
86
|
-
<p style="margin: 0; font-size: 12px; color: ${
|
|
98
|
+
`).trim(),{displayText:n,actions:e}}var dc=class extends Error{constructor(e){super(e),this.name="AuthError"}};function kN(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new dc("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new dc("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function JE(t,e){let n=kN(),i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(e)});if(!i.ok)throw i.status===401?new dc("Session expired or unauthorized"):new Error(`Chat request failed: ${i.status} ${i.statusText}`);return i.json()}var TN=0;function Sv(){return`msg-${Date.now()}-${++TN}`}function eC(t){let{backendUrl:e,tileId:n,runtime:i,greeting:r,maxHistory:o=20,mlflowRunId:a,config:s}=t,[l,c]=(0,ji.useState)(()=>r?[{id:Sv(),role:"assistant",text:r,timestamp:Date.now()}]:[]),[u,d]=(0,ji.useState)(!1),[h,m]=(0,ji.useState)(null),x=(0,ji.useRef)(null),_=(0,ji.useCallback)(async f=>{let g=f.trim();if(!g)return;m(null);let v={id:Sv(),role:"user",text:g,timestamp:Date.now()};c(y=>[...y,v]),d(!0);try{let w=[...l,v].slice(-o).map(C=>({role:C.role,content:C.text})),E=await JE(e,{message:g,history:w,mlflow_run_id:a,current_config:s}),{displayText:S,actions:k}=QE(E.response),T={id:Sv(),role:"assistant",text:S,timestamp:Date.now()};c(C=>[...C,T]),k.length>0&&(x.current?.isApplied()&&await x.current.revertAll(),x.current=await i.actions.applyBatch(k),i.events.publish("chatbot.actions_applied",{count:k.length,kinds:k.map(C=>C.kind),tileId:n}))}catch(y){let w=y instanceof Error?y.message:"An unexpected error occurred";m(w)}finally{d(!1)}},[e,l,o,a,s,i,n]),b=(0,ji.useCallback)(()=>{c([]),m(null),x.current?.isApplied()&&(x.current.revertAll(),x.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${n}`)},[n]);return{messages:l,isLoading:u,error:h,sendMessage:_,clearMessages:b}}var qn={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:Lt[4],color:un.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:A[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:A[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:$e[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:A[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Lt[4],color:un.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function RN({message:t}){let e=t.role==="user",n={...qn.messageBubble,...e?qn.userMessage:qn.assistantMessage};return(0,Zn.jsx)("div",{style:n,children:t.text})}function ON({config:t,runtime:e,tileId:n}){let{messages:i,isLoading:r,error:o,sendMessage:a,clearMessages:s}=eC({backendUrl:t.backendUrl,tileId:n,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Ho.useRef)(null),c=(0,Ho.useRef)(null);(0,Ho.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let u=d=>{d.preventDefault();let h=c.current;if(!h||!h.value.trim()||r)return;let m=h.value;h.value="",a(m)};return(0,Zn.jsxs)("div",{style:qn.container,"data-testid":"chat-assistant",children:[(0,Zn.jsxs)("div",{ref:l,style:qn.messageList,children:[i.map(d=>(0,Zn.jsx)(RN,{message:d},d.id)),r&&(0,Zn.jsx)("div",{style:qn.loadingDots,children:"Thinking..."})]}),o&&(0,Zn.jsx)("div",{style:qn.errorBanner,children:o}),(0,Zn.jsxs)("form",{onSubmit:u,style:qn.inputForm,children:[(0,Zn.jsx)("input",{ref:c,style:qn.input,placeholder:"Ask anything...",disabled:r,"data-testid":"chat-input"}),(0,Zn.jsx)("button",{type:"submit",disabled:r,style:{...qn.sendButton,...r?qn.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var tC={mount(t,e){let{config:n,runtime:i,tileId:r="chatbot-widget"}=e||{};if(n&&i&&typeof wv.createRoot=="function"){let o=(0,wv.createRoot)(t);return o.render(Ho.default.createElement(ON,{config:n,runtime:i,tileId:r})),()=>{o.unmount()}}return!n||!i?(t.innerHTML=`<div style="padding: 16px; color: ${A[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
|
|
99
|
+
<div style="padding: 16px; font-family: system-ui; color: ${A[10]};">
|
|
100
|
+
<p style="margin: 0 0 8px; color: ${A[8]};">${n.greeting||"Hi! How can I help?"}</p>
|
|
101
|
+
<p style="margin: 0; font-size: 12px; color: ${A[7]};">Chat widget mounted. Awaiting React renderer.</p>
|
|
87
102
|
</div>
|
|
88
|
-
`,()=>{t.innerHTML=""})}};var nC={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:tC,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function iC(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function MN(t,e,n){let i=iC(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function NN(t,e,n){let i=iC(n,t.itemId,t.itemQuestion),{id:r}=i.config,o=t.state??"toggle",a;switch(o){case"open":n.expand(r),a="open";break;case"closed":n.collapse(r),a="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),a=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:a}),{cleanup:()=>{}}}async function DN(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var rC=[{kind:"faq:scroll_to",executor:MN},{kind:"faq:toggle_item",executor:NN},{kind:"faq:update",executor:DN}];var Ve=X($e(),1);var ke=X(Qe(),1),Ev=X(Ro(),1);function oC(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function LN(t){return typeof t=="string"?(0,Ve.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Ve.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Ve.jsx)("p",{style:{margin:0},children:t.content})}function IN(t){return t?t===!0?{style:"thumbs"}:t:null}function HN(t){return t.prompt||"Was this helpful?"}var Tt={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"16px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease"},accordion:{display:"flex",flexDirection:"column",gap:"8px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"15px",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"18px",transition:"transform 0.2s ease"},answer:{padding:"0 20px 16px 20px",fontSize:"14px",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"13px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 6px 4px",marginTop:"8px"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},cs={light:{container:{backgroundColor:_t.white,color:C[1]},searchInput:{backgroundColor:C[12],border:`1px solid ${C[11]}`,color:C[1]},item:{backgroundColor:C[12],border:`1px solid ${C[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:C[1]},questionHover:{backgroundColor:C[12]},answer:{color:C[6]},category:{backgroundColor:at[8],color:at[2]},categoryHeader:{color:C[7]},emptyState:{color:C[8]},feedbackPrompt:{color:C[7]}},dark:{container:{backgroundColor:C[1],color:C[12]},searchInput:{backgroundColor:C[3],border:`1px solid ${C[5]}`,color:C[12]},item:{backgroundColor:C[3],border:`1px solid ${C[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},question:{backgroundColor:"transparent",color:C[12]},questionHover:{backgroundColor:C[5]},answer:{color:C[8]},category:{backgroundColor:at[0],color:at[6]},categoryHeader:{color:C[8]},emptyState:{color:C[7]},feedbackPrompt:{color:C[8]}}};function zN({item:t,isExpanded:e,isHighlighted:n,onToggle:i,theme:r,feedbackConfig:o,feedbackValue:a,onFeedback:s}){let[l,c]=(0,ke.useState)(!1),u=cs[r],{question:d,answer:h}=t.config,m={...Tt.item,...u.item,...e?u.itemExpanded:{},...n?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{}},S={...Tt.question,...u.question,...l?u.questionHover:{}},_={...Tt.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...Tt.answer,...u.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},f={...Tt.feedback,...u.feedbackPrompt};return(0,Ve.jsxs)("div",{style:m,"data-faq-item-id":t.config.id,children:[(0,Ve.jsxs)("button",{type:"button",style:S,onClick:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,Ve.jsx)("span",{children:d}),(0,Ve.jsx)("span",{style:_,children:"\u25BC"})]}),(0,Ve.jsxs)("div",{style:b,"aria-hidden":!e,children:[LN(h),e&&o&&(0,Ve.jsxs)("div",{style:f,children:[(0,Ve.jsx)("span",{children:HN(o)}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...a==="up"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>s(t.config.id,d,"up"),children:"\u{1F44D}"}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...a==="down"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>s(t.config.id,d,"down"),children:"\u{1F44E}"})]})]})]})}function BN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,ke.useReducer)(R=>R+1,0),[o,a]=(0,ke.useState)(new Set),[s,l]=(0,ke.useState)(null),[c,u]=(0,ke.useState)(""),[d,h]=(0,ke.useState)(new Map),m=(0,ke.useMemo)(()=>IN(t.feedback),[t.feedback]);(0,ke.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,ke.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let N=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(H=>{let B=H.props?.actionId;return typeof B=="string"&&B.startsWith("faq:open:")}).pop();if(N&&Date.now()-N.ts<1e4){let H=N.props.actionId.replace("faq:open:","");a(new Set([H])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${H}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let N=D.props?.actionId;if(typeof N!="string"||!N.startsWith("faq:open:"))return;let H=N.replace("faq:open:","");a(new Set([H])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${H}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;let R=N=>{let H=N.props?.tileId,B=N.props?.itemId;H===n&&B&&(a(new Set([B])),l(B),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let z=document.querySelector(`[data-faq-item-id="${B}"]`);z&&z.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let H=e.events.getRecent({names:["notification.deep_link"]},5).filter(B=>B.props?.tileId===n&&B.props?.itemId).pop();H&&Date.now()-H.ts<1e4&&R(H)}return e.events.subscribe({names:["notification.deep_link"]},R)},[e,n]);let S=(0,ke.useMemo)(()=>t.actions.filter(R=>R.triggerWhen?e.evaluateSync(R.triggerWhen).value:!0),[t.actions,e,i]),_=(0,ke.useMemo)(()=>t.ordering==="priority"?[...S].sort((R,D)=>(D.config.priority??0)-(R.config.priority??0)):S,[S,t.ordering]),b=(0,ke.useMemo)(()=>{if(!t.searchable||!c.trim())return _;let R=c.toLowerCase();return _.filter(D=>D.config.question.toLowerCase().includes(R)||oC(D.config.answer).toLowerCase().includes(R)||D.config.category?.toLowerCase().includes(R))},[_,c,t.searchable]),f=(0,ke.useMemo)(()=>{let R=new Map;for(let D of b){let N=D.config.category;R.has(N)||R.set(N,[]),R.get(N).push(D)}return R},[b]),p=(0,ke.useMemo)(()=>b.some(R=>R.config.category),[b]),v=(0,ke.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,ke.useCallback)(R=>{a(D=>{let N=new Set(D);return t.expandBehavior==="single"?D.has(R)?new Set:new Set([R]):(D.has(R)?N.delete(R):N.add(R),N)}),e.events.publish("faq:toggled",{instanceId:n,questionId:R,expanded:!o.has(R),timestamp:Date.now()})},[t.expandBehavior,e.events,n,o]),w=(0,ke.useCallback)((R,D,N)=>{h(H=>{let B=new Map(H);return B.set(R,N),B}),e.events.publish("faq:feedback",{itemId:R,question:D,value:N})},[e.events]),A={...Tt.container,...cs[v].container},x={...Tt.searchInput,...cs[v].searchInput},T={...Tt.emptyState,...cs[v].emptyState},k={...Tt.categoryHeader,...cs[v].categoryHeader},E=R=>R.map(D=>(0,Ve.jsx)(zN,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(D.config.id),onFeedback:w},D.config.id));return S.length===0?(0,Ve.jsx)("div",{style:A,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,Ve.jsx)("div",{style:T,children:"No FAQ questions available."})}):(0,Ve.jsxs)("div",{style:A,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Ve.jsx)("div",{style:Tt.searchWrapper,children:(0,Ve.jsx)("input",{type:"text",placeholder:"Search questions...",value:c,onChange:R=>u(R.target.value),style:x})}),(0,Ve.jsx)("div",{style:Tt.accordion,children:p?Array.from(f.entries()).map(([R,D])=>(0,Ve.jsxs)(ke.default.Fragment,{children:[R&&(0,Ve.jsx)("div",{style:k,"data-category-header":R,children:R}),E(D)]},R??"__ungrouped")):E(b)}),t.searchable&&b.length===0&&c&&(0,Ve.jsxs)("div",{style:{...Tt.noResults,...cs[v].emptyState},children:['No questions found matching "',c,'"']})]})}var aC={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof Ev.createRoot=="function"){let a=(0,Ev.createRoot)(t);return a.render(ke.default.createElement(BN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
103
|
+
`,()=>{t.innerHTML=""})}};var nC={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:tC,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function iC(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function MN(t,e,n){let i=iC(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function NN(t,e,n){let i=iC(n,t.itemId,t.itemQuestion),{id:r}=i.config,o=t.state??"toggle",a;switch(o){case"open":n.expand(r),a="open";break;case"closed":n.collapse(r),a="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),a=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:a}),{cleanup:()=>{}}}async function DN(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var rC=[{kind:"faq:scroll_to",executor:MN},{kind:"faq:toggle_item",executor:NN},{kind:"faq:update",executor:DN}];var Ve=Q(Fe(),1);var Te=Q(Ke(),1),Ev=Q(Oo(),1);function oC(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function LN(t){return typeof t=="string"?(0,Ve.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Ve.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Ve.jsx)("p",{style:{margin:0},children:t.content})}function IN(t){return t?t===!0?{style:"thumbs"}:t:null}function HN(t){return t.prompt||"Was this helpful?"}var kt={container:{fontFamily:"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"},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:"18px",transition:"transform 0.2s ease"},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"}},ls={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{backgroundColor:A[12],border:`1px solid ${A[11]}`,color:A[1]},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:Lt[8],color:Lt[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]},feedbackPrompt:{color:A[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{backgroundColor:A[3],border:`1px solid ${A[5]}`,color:A[12]},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:Lt[0],color:Lt[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]},feedbackPrompt:{color:A[8]}}};function zN({item:t,isExpanded:e,isHighlighted:n,onToggle:i,theme:r,feedbackConfig:o,feedbackValue:a,onFeedback:s}){let[l,c]=(0,Te.useState)(!1),u=ls[r],{question:d,answer:h}=t.config,m={...kt.item,...u.item,...e?u.itemExpanded:{},...n?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{}},x={...kt.question,...u.question,...l?u.questionHover:{}},_={...kt.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...kt.answer,...u.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},f={...kt.feedback,...u.feedbackPrompt};return(0,Ve.jsxs)("div",{style:m,"data-faq-item-id":t.config.id,children:[(0,Ve.jsxs)("button",{type:"button",style:x,onClick:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,Ve.jsx)("span",{children:d}),(0,Ve.jsx)("span",{style:_,children:"\u25BC"})]}),(0,Ve.jsxs)("div",{style:b,"aria-hidden":!e,children:[LN(h),e&&o&&(0,Ve.jsxs)("div",{style:f,children:[(0,Ve.jsx)("span",{children:HN(o)}),(0,Ve.jsx)("button",{type:"button",style:{...kt.feedbackButton,...a==="up"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>s(t.config.id,d,"up"),children:"\u{1F44D}"}),(0,Ve.jsx)("button",{type:"button",style:{...kt.feedbackButton,...a==="down"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>s(t.config.id,d,"down"),children:"\u{1F44E}"})]})]})]})}function BN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,Te.useReducer)(R=>R+1,0),[o,a]=(0,Te.useState)(new Set),[s,l]=(0,Te.useState)(null),[c,u]=(0,Te.useState)(""),[d,h]=(0,Te.useState)(new Map),m=(0,Te.useMemo)(()=>IN(t.feedback),[t.feedback]);(0,Te.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,Te.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,Te.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let N=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(z=>{let B=z.props?.actionId;return typeof B=="string"&&B.startsWith("faq:open:")}).pop();if(N&&Date.now()-N.ts<1e4){let z=N.props.actionId.replace("faq:open:","");a(new Set([z])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${z}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},L=>{let N=L.props?.actionId;if(typeof N!="string"||!N.startsWith("faq:open:"))return;let z=N.replace("faq:open:","");a(new Set([z])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${z}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Te.useEffect)(()=>{if(!e.events.subscribe)return;let R=N=>{let z=N.props?.tileId,B=N.props?.itemId;z===n&&B&&(a(new Set([B])),l(B),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let H=document.querySelector(`[data-faq-item-id="${B}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let z=e.events.getRecent({names:["notification.deep_link"]},5).filter(B=>B.props?.tileId===n&&B.props?.itemId).pop();z&&Date.now()-z.ts<1e4&&R(z)}return e.events.subscribe({names:["notification.deep_link"]},R)},[e,n]);let x=(0,Te.useMemo)(()=>t.actions.filter(R=>R.triggerWhen?e.evaluateSync(R.triggerWhen).value:!0),[t.actions,e,i]),_=(0,Te.useMemo)(()=>t.ordering==="priority"?[...x].sort((R,L)=>(L.config.priority??0)-(R.config.priority??0)):x,[x,t.ordering]),b=(0,Te.useMemo)(()=>{if(!t.searchable||!c.trim())return _;let R=c.toLowerCase();return _.filter(L=>L.config.question.toLowerCase().includes(R)||oC(L.config.answer).toLowerCase().includes(R)||L.config.category?.toLowerCase().includes(R))},[_,c,t.searchable]),f=(0,Te.useMemo)(()=>{let R=new Map;for(let L of b){let N=L.config.category;R.has(N)||R.set(N,[]),R.get(N).push(L)}return R},[b]),g=(0,Te.useMemo)(()=>b.some(R=>R.config.category),[b]),v=(0,Te.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Te.useCallback)(R=>{a(L=>{let N=new Set(L);return t.expandBehavior==="single"?L.has(R)?new Set:new Set([R]):(L.has(R)?N.delete(R):N.add(R),N)}),e.events.publish("faq:toggled",{instanceId:n,questionId:R,expanded:!o.has(R),timestamp:Date.now()})},[t.expandBehavior,e.events,n,o]),w=(0,Te.useCallback)((R,L,N)=>{h(z=>{let B=new Map(z);return B.set(R,N),B}),e.events.publish("faq:feedback",{itemId:R,question:L,value:N})},[e.events]),E={...kt.container,...ls[v].container},S={...kt.searchInput,...ls[v].searchInput},k={...kt.emptyState,...ls[v].emptyState},T={...kt.categoryHeader,...ls[v].categoryHeader},C=R=>R.map(L=>(0,Ve.jsx)(zN,{item:L,isExpanded:o.has(L.config.id),isHighlighted:s===L.config.id,onToggle:()=>y(L.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(L.config.id),onFeedback:w},L.config.id));return x.length===0?(0,Ve.jsx)("div",{style:E,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,Ve.jsx)("div",{style:k,children:"No FAQ questions available."})}):(0,Ve.jsxs)("div",{style:E,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Ve.jsx)("div",{style:kt.searchWrapper,children:(0,Ve.jsx)("input",{type:"text",placeholder:"Search questions...",value:c,onChange:R=>u(R.target.value),style:S})}),(0,Ve.jsx)("div",{style:kt.accordion,children:g?Array.from(f.entries()).map(([R,L])=>(0,Ve.jsxs)(Te.default.Fragment,{children:[R&&(0,Ve.jsx)("div",{style:T,"data-category-header":R,children:R}),C(L)]},R??"__ungrouped")):C(b)}),t.searchable&&b.length===0&&c&&(0,Ve.jsxs)("div",{style:{...kt.noResults,...ls[v].emptyState},children:['No questions found matching "',c,'"']})]})}var aC={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof Ev.createRoot=="function"){let a=(0,Ev.createRoot)(t);return a.render(Te.default.createElement(BN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
89
104
|
<div style="font-family: system-ui; max-width: 800px;">
|
|
90
105
|
${o.map(a=>`
|
|
91
|
-
<div style="margin-bottom: 8px; padding: 16px; background: ${
|
|
106
|
+
<div style="margin-bottom: 8px; padding: 16px; background: ${A[12]}; border-radius: 8px;">
|
|
92
107
|
<strong>${a.config.question}</strong>
|
|
93
|
-
<p style="margin-top: 8px; color: ${
|
|
108
|
+
<p style="margin-top: 8px; color: ${A[6]};">${oC(a.config.answer)}</p>
|
|
94
109
|
</div>
|
|
95
110
|
`).join("")}
|
|
96
111
|
</div>
|
|
97
|
-
`,()=>{t.innerHTML=""}}};var sC={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:rC,widgets:[{id:"adaptive-faq:accordion",component:aC,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`faq:${n.config.id}`,strategy:n.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:n.config.id,question:n.config.question,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var
|
|
112
|
+
`,()=>{t.innerHTML=""}}};var sC={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:rC,widgets:[{id:"adaptive-faq:accordion",component:aC,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753"}}],notifyWatchers(t){return(t.actions??[]).filter(n=>n.notify&&n.triggerWhen).map(n=>({id:`faq:${n.config.id}`,strategy:n.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:n.config.id,question:n.config.question,title:n.notify.title,body:n.notify.body,icon:n.notify.icon}}))}};var $N=async(t,e)=>{let{badgeId:n}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:n,awardedAt:Date.now()}),{cleanup:()=>{}}},FN=async(t,e)=>{let{points:n,reason:i}=t;return e.publishEvent("gamification.points_added",{points:n,reason:i,timestamp:Date.now()}),{cleanup:()=>{}}},UN={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},VN=[{kind:"gamification:awardBadge",executor:$N},{kind:"gamification:addPoints",executor:FN}],jN=[UN],lC={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:VN,eventHandlers:jN};var St=Q(Fe(),1);var at=Q(Ke(),1),Cv=Q(Oo(),1);function ff(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Gn={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"}},pf={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:A[7]},emptyState:{color:A[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:A[8]},emptyState:{color:A[7]}}};function PN({item:t,isExpanded:e,isLast:n,onToggle:i,onNavigate:r,theme:o}){let[a,s]=(0,at.useState)(!1),l=pf[o],{title:c,description:u,href:d,icon:h,external:m}=t.config,x={...Gn.item,...l.item,...e?l.itemExpanded:{},...n?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},_={...Gn.header,...l.header,...a?l.headerHover:{}},b={...Gn.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Gn.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g=v=>{v.preventDefault(),v.stopPropagation(),d&&r(d,m??!1)};return(0,St.jsxs)("div",{style:x,"data-nav-tip-id":t.config.id,children:[(0,St.jsxs)("button",{type:"button",style:_,onClick:i,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[h&&(0,St.jsx)("span",{style:Gn.icon,children:h}),(0,St.jsx)("span",{children:c}),(0,St.jsx)("span",{style:b,children:"\u203A"})]}),(0,St.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,St.jsx)("p",{style:Gn.description,children:u}),d&&(0,St.jsxs)("a",{href:d,onClick:g,style:{...Gn.linkButton,...l.linkButton},target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,children:["Go ",m?"\u2197":"\u2192"]})]})]})}function qN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,at.useReducer)(f=>f+1,0),[o,a]=(0,at.useState)(new Set);(0,at.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,at.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]);let s=(0,at.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,i]),l=(0,at.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]),c=(0,at.useMemo)(()=>s.some(f=>f.config.category),[s]),u=(0,at.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,at.useCallback)(f=>{a(g=>{let v=g.has(f),y;if(t.expandBehavior==="single"){for(let w of g)w!==f&&e.events.publish("nav:toggled",{instanceId:n,tipId:w,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(g),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:n,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,n]),h=(0,at.useCallback)((f,g)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:n,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,n]),m={...Gn.container,...pf[u].container},x={...Gn.categoryHeader,...pf[u].categoryHeader},_={...Gn.emptyState,...pf[u].emptyState},b=f=>f.map((g,v)=>(0,St.jsx)(PN,{item:g,isExpanded:o.has(g.config.id),isLast:v===f.length-1,onToggle:()=>d(g.config.id),onNavigate:h,theme:u},g.config.id));return s.length===0?(0,St.jsx)("div",{style:m,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,St.jsx)("div",{style:_,children:"No navigation tips available."})}):(0,St.jsx)("div",{style:m,"data-adaptive-id":n,"data-adaptive-type":"adaptive-nav",children:(0,St.jsx)("div",{style:Gn.accordion,children:c?Array.from(l.entries()).map(([f,g])=>(0,St.jsxs)(at.default.Fragment,{children:[f&&(0,St.jsx)("div",{style:x,"data-category-header":f,children:f}),b(g)]},f??"__ungrouped")):b(s)})})}var cC={mount(t,e){let{runtime:n,instanceId:i="nav-widget",...r}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(n&&typeof Cv.createRoot=="function"){let a=(0,Cv.createRoot)(t);return a.render(at.default.createElement(qN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
98
113
|
<div style="font-family: system-ui; max-width: 100%;">
|
|
99
114
|
${o.map(a=>`
|
|
100
|
-
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${
|
|
115
|
+
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${A[12]}; border-radius: 8px;">
|
|
101
116
|
${a.config.icon?`<span>${ff(a.config.icon)}</span> `:""}<strong>${ff(a.config.title)}</strong>
|
|
102
|
-
<p style="margin-top: 8px; color: ${
|
|
103
|
-
${a.config.href?`<a href="${ff(a.config.href)}" style="color: ${
|
|
117
|
+
<p style="margin-top: 8px; color: ${A[6]}; font-size: 13px;">${ff(a.config.description)}</p>
|
|
118
|
+
${a.config.href?`<a href="${ff(a.config.href)}" style="color: ${Lt[2]}; font-size: 13px;">Go →</a>`:""}
|
|
104
119
|
</div>
|
|
105
120
|
`).join("")}
|
|
106
121
|
</div>
|
|
@@ -110,7 +125,7 @@ Error generating stack: `+i.message+`
|
|
|
110
125
|
s.textContent = '.${e} { ${n} }';
|
|
111
126
|
document.head.appendChild(s);
|
|
112
127
|
document.documentElement.className += ' ${e}';
|
|
113
|
-
})();`}function hf(t,e,n="first-match"){for(let i of e){let r=t.getFeatureValue?.(i,null);if(!r||typeof r!="object")continue;let o=r,a=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(a||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Av=!1;function gC(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function
|
|
128
|
+
})();`}function hf(t,e,n="first-match"){for(let i of e){let r=t.getFeatureValue?.(i,null);if(!r||typeof r!="object")continue;let o=r,a=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(a||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Av=!1;function gC(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function kv(t){if(gC()){Av=!0;return}Av=t??!1}function QN(){return gC()?!0:Av}function Y(t,e,n){QN()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function hn(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function gf(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var mf="2.4.0-canary.23";var Pi="2.0";var JN=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function eD(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):JN.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function tD(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var mC="syntro_config_cache",nD=1440*60*1e3;function vC(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function iD(t,e){if(vC())try{let n={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(mC,JSON.stringify(n))}catch{}}function rD(t){if(!vC())return null;try{let e=localStorage.getItem(mC);if(!e)return null;let n=JSON.parse(e);return!n.config||typeof n.timestamp!="number"||!n.sdkVersion||n.sdkVersion!==t||Date.now()-n.timestamp>nD?null:n.config}catch{return null}}var vf=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let i=e?.getFeatureValue?.(n,null);if(i)return i};function oD(t,e,n){if(e){let i=t.getFeatureValue?.(e,null);if(i&&typeof i=="object"){let r=i.variant_flags;if(r&&r.length>0)return r}}if(n&&t.getAllFeatures){let i=t.getAllFeatures();return Object.keys(i).filter(r=>r.startsWith(n))}return[]}var zo=({configUri:t,experiments:e,featureKey:n,credentials:i,configFeatureKey:r="smart-canvas-config",manifestKey:o,variantFlagPrefix:a,sdkVersion:s})=>async()=>{if(e&&r){let u=e.getFeatureValue?.(r,null);if(u&&typeof u=="object")return Y("SmartCanvas Config","Resolved config directly from feature flag",u),u}if(e&&(o||a)){let u=oD(e,o,a);if(u.length>0){let d=hf(e,u);if(d)return Y("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=vf({configUri:t,experiments:e,featureKey:n});if(!l)return Y("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!eD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let c=i??(tD(l)?"include":"omit");try{let u=await fetch(l,{credentials:c,headers:{"X-SDK-Version":mf,"X-SDK-Schema-Version":Pi}});if(!u.ok)throw new Error(`SmartCanvas: failed to fetch config (${u.status})`);let d=await u.json();return Y("SmartCanvas Config","Fetched config from URI",d),s&&iD(d,s),d}catch(u){if(s){let d=rD(s);if(d)return Y("SmartCanvas Config","Serving config from offline cache"),d}throw u}};var aD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function yC(t){if(typeof window>"u")return null;let n=new URLSearchParams(window.location.search).get(t);if(!n)return null;try{let i=n.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(i))}catch(i){return hn("Syntro Runtime",`Failed to decode ${t}:`,i),null}}var cs,us;function Ur(){if(cs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)cs={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${cs.token.slice(0,15)}...)`);else{let e=yC("editor_source");e&&(cs=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 cs??null}function Bo(){if(us==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)us={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=${us.mode})`);else{let e=yC("editor_conf");e&&(us=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return us??null}function sD(t){Y("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return Y("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(hn("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):aD.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r)?(Y("Syntro Runtime","\u2713 Editor URL validated"),!0):(hn("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return hn("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var bC=()=>{let t=Bo();return!Ur()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function lD(){return Ur()?.token??null}function cD(){return Ur()?.api_base??null}var fc=null,_C=async t=>{if(Y("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){Y("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){Y("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(fc)return Y("Syntro Runtime","Editor SDK load already in progress, waiting..."),fc;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){Y("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),Y("Syntro Runtime","================================");return}let n=cD(),r=(n?`${n}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!r){hn("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),Y("Syntro Runtime","================================");return}let o=lD();if(!o){hn("Syntro Runtime","\u274C No token found in editor_source."),Y("Syntro Runtime","================================");return}let a=`${r}?token=${encodeURIComponent(o)}`;if(Y("Syntro Runtime","Editor URL:",a),Y("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!r,hasApiBase:!!n,tokenPrefix:`${o.slice(0,10)}...`}),!sD(r)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",r),Y("Syntro Runtime","================================");return}return Y("Syntro Runtime","\u2713 URL validated, injecting script tag..."),fc=new Promise((s,l)=>{let c=document.createElement("script");c.src=a,c.async=!0,e.integrity&&(c.integrity=e.integrity,c.crossOrigin="anonymous",Y("Syntro Runtime","SRI integrity check enabled")),c.onload=()=>{Y("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),Y("Syntro Runtime","================================"),s()},c.onerror=u=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",u),console.error("[Syntro Runtime] URL attempted:",a),Y("Syntro Runtime","================================"),fc=null,l(u)},document.head.appendChild(c),Y("Syntro Runtime","Script tag appended to <head>")}),fc};var uD=new Set(["tag_name","$el_text"]);function dD(t){return uD.has(t)||t.startsWith("attr__")}function xC(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function fD(t){let{events:e,match:n}=t;return i=>{if(!e.includes(i.name))return!1;if(n){for(let[r,o]of Object.entries(n))if(dD(r)){let a=i.props?.elements;if(!a||!a.some(l=>xC(o,l[r])))return!1}else if(!xC(o,i.props?.[r]))return!1}return!0}}function SC(t,e){for(let n of t.rules)for(let i of n.conditions)if(i.type==="event_count"&&i.key){let r=i.counter,o=r?fD(r):()=>!0;e.register(i.key,o)}}function pc(t,e,n){for(let i of t){let r=i.props;if(!r)continue;let o=r.actions;if(o)for(let a of o)a.triggerWhen?.type==="rules"&&SC(a.triggerWhen,e)}if(n)for(let i of n){let r=i;r.triggerWhen?.type==="rules"&&SC(r.triggerWhen,e)}}var ci=null;function EC(t){ci&&ci!==t?t.appendChild(ci):ci=t;let e=t.getRootNode();e instanceof ShadowRoot&&pD(e)}function CC(){return ci||(ci=document.createElement("div"),ci.id="syntro-overlays",Object.assign(ci.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(ci)),ci}var wC=!1;function pD(t){if(wC)return;let e=`
|
|
114
129
|
:host {
|
|
115
130
|
--syntro-surface: var(--sc-overlay-background, #0f1318);
|
|
116
131
|
--syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
|
|
@@ -369,7 +384,7 @@ Error generating stack: `+i.message+`
|
|
|
369
384
|
.syntro-modal-btn-primary:hover {
|
|
370
385
|
background: var(--syntro-accent-hover, #d44844);
|
|
371
386
|
}
|
|
372
|
-
`,n=document.createElement("style");n.setAttribute("data-syntro","base-overlay"),n.textContent=e,t.appendChild(n),wC=!0}var UC=
|
|
387
|
+
`,n=document.createElement("style");n.setAttribute("data-syntro","base-overlay"),n.textContent=e,t.appendChild(n),wC=!0}var UC=Q(Oo(),1);var yf=class{constructor(e){P(this,"state");P(this,"listeners",new Set);let n=e?.open??!1;if(e?.open===void 0)try{let i=sessionStorage?.getItem("syntro:editor:panel-open");i!==null&&(n=JSON.parse(i))}catch{}this.state={open:n}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},Tv=t=>new yf(t);var bf=Q(Ke(),1),kC=Q(Fe(),1),AC=(0,bf.createContext)(null);function Rv({shadowRoot:t,portalRoot:e,overlayContainer:n,children:i}){return(0,kC.jsx)(AC.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:n},children:i})}function $o(){let t=(0,bf.useContext)(AC);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Yt=Q(Ke(),1);var st=Q(Ke(),1),Bv=Q(tl(),1);var be={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"},Fo="1.0.0";function Yn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:Fo}}function hD(t){return Yn(be.CANVAS_OPENED,{surface:t})}function gD(t){return Yn(be.CANVAS_CLOSED,{surface:t})}function mD(t,e){return Yn(be.TILE_VIEWED,{tileId:t,surface:e})}function vD(t,e){return Yn(be.TILE_EXPANDED,{tileId:t,surface:e})}function yD(t,e){return Yn(be.TILE_COLLAPSED,{tileId:t,surface:e})}function bD(t,e,n){return Yn(be.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function _D(t,e){return Yn(be.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function xD(t,e){return Yn(be.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function SD(t,e,n){return Yn(be.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function wD(t,e,n){return Yn(be.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function ED(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return Yn(n,e)}var ds={canvasOpened:hD,canvasClosed:gD,tileViewed:mD,tileExpanded:vD,tileCollapsed:yD,tileAction:bD,overlayStarted:_D,overlayCompleted:xD,overlayDismissed:SD,overlayStepViewed:wD,custom:ED};var Mn=Q(Fe(),1),TC="syntro-toast-styles",CD=`
|
|
373
388
|
@keyframes syntro-toast-slide-in {
|
|
374
389
|
from { opacity: 0; transform: translateY(12px); }
|
|
375
390
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -387,21 +402,21 @@ Error generating stack: `+i.message+`
|
|
|
387
402
|
.syntro-toast-progress.paused {
|
|
388
403
|
animation-play-state: paused;
|
|
389
404
|
}
|
|
390
|
-
`;function AD(t){if(t.querySelector(`#${kC}`))return;let e=document.createElement("style");e.id=kC,e.textContent=CD,t.appendChild(e)}function _f({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=Bo();return AD(r),t.length===0?null:(0,Rn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Rn.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:a=>{a.currentTarget.style.transform="translateY(-1px)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:a=>{a.currentTarget.style.transform="translateY(0)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Rn.jsxs)("div",{onClick:()=>n(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Rn.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,Rn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Rn.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,Rn.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,Rn.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Rn.jsx)("div",{style:{height:"2px",background:"rgba(255, 255, 255, 0.06)"},children:(0,Rn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Gn=X(Qe(),1);var Sf=3,xf=8e3,wf=3e4;var TD=0;function gc(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function kD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Ef(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!kD(t.name,r.on))continue;let o=Date.now(),a=r.ttl??8e3;return{notification:{id:`notif-${++TD}-${o}`,title:gc(r.title,t.props),body:r.body?gc(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?gc(r.deepLink.itemId,t.props):void 0,expiresAt:o+a,createdAt:o,ttl:a},rule:r}}}return null}function Cf(t,e){let[n,i]=(0,Gn.useState)([]),r=(0,Gn.useRef)(new Map),o=(0,Gn.useRef)(new Map),a=(0,Gn.useCallback)(c=>{t?.publish(be.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Gn.useCallback)(c=>{let u=setTimeout(()=>{i(d=>d.filter(h=>h.id!==c.id)),o.current.delete(c.id),a(c)},c.ttl);o.current.set(c.id,u)},[a]),l=(0,Gn.useCallback)(c=>{i(d=>{let h=d.find(m=>m.id===c);return h&&a(h),d.filter(m=>m.id!==c)});let u=o.current.get(c);u&&(clearTimeout(u),o.current.delete(c))},[a]);return(0,Gn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let d=Ef(u,e);if(!d)return;let{notification:h,rule:m}=d,S=h.itemId?`${h.tileId}:${u.name}:${h.itemId}`:`${h.tileId}:${u.name}`,_=r.current.get(S),b=Date.now(),f=m.cooldown??3e4;_!==void 0&&b-_<f||(r.current.set(S,b),i(p=>{if(h.itemId&&p.some(w=>w.tileId===h.tileId&&w.itemId===h.itemId))return p;let v=[...p,h];if(v.length>3){let y=v.shift(),w=o.current.get(y.id);w&&(clearTimeout(w),o.current.delete(y.id))}return v}),t.publish(be.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{c();for(let u of o.current.values())clearTimeout(u);o.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var Af=X(Qe(),1);function RD(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],a=e.get(r)?.manifest.runtime?.notifyWatchers;a&&n.push(...a(i.props??{}))}return n}function Tf(t,e,n){let i=(0,Af.useRef)(new Map);(0,Af.useEffect)(()=>{if(!t?.events||!n)return;let r=RD(e,n);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&o.remove(s.id)}})},[t,e,n])}var Zt=X(Qe(),1),LC=X($e(),1),Ov=(0,Zt.createContext)({runtime:null,context:null});function kf({runtime:t,children:e}){let[n,i]=(0,Zt.useState)(t?t.context.get():null);(0,Zt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Zt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,LC.jsx)(Ov.Provider,{value:r,children:e})}function ai(){let{runtime:t}=(0,Zt.useContext)(Ov);return t}function mc(){let{context:t}=(0,Zt.useContext)(Ov);return t}function Rf(){return mc()?.page??null}function RC(){return mc()?.session??null}function OC(){return mc()?.viewport??null}function MC(t,e,n=[]){let i=ai();(0,Zt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function NC(){return ai()?.state??null}function DC(t,e){let n=ai(),[i,r]=(0,Zt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Zt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(a=>{o||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),i}function se(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var OD={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:se(C[1],.95),colorBackgroundElevated:se(C[3],.95),colorBackgroundSubtle:se(C[0],.2),colorSurface:se(C[4],.8),colorSurfaceHover:se(C[5],.8),colorText:zi.primary,colorTextSecondary:zi.secondary,colorTextMuted:zi.tertiary,colorTextInverse:C[1],colorBorder:fv.primary,colorBorderSubtle:fv.secondary,colorSuccess:Te[4],colorSuccessMuted:Te[0],colorWarning:St[4],colorWarningMuted:St[0],colorError:Fe[4],colorErrorMuted:Fe[0],colorInfo:un[4],colorInfoMuted:un[0],colorNotification:ne[4],colorNotificationMuted:se(ne[4],.4),glassBackground:se(C[1],.6),glassBackgroundHover:se(C[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"},MD={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:se(ne[5],.1),colorBackground:se(C[12],.95),colorBackgroundElevated:se(C[11],.95),colorBackgroundSubtle:se(C[0],.02),colorSurface:se(C[11],.6),colorSurfaceHover:se(C[10],.6),colorText:C[1],colorTextSecondary:C[6],colorTextMuted:C[8],colorTextInverse:C[12],colorBorder:se(C[0],.12),colorBorderSubtle:se(C[0],.06),colorSuccess:Te[4],colorSuccessMuted:se(Te[4],.12),colorWarning:St[4],colorWarningMuted:se(St[4],.12),colorError:Fe[4],colorErrorMuted:se(Fe[4],.12),colorInfo:un[4],colorInfoMuted:se(un[4],.12),colorNotification:ne[3],colorNotificationMuted:se(ne[3],.4),glassBackground:se(C[12],.7),glassBackgroundHover:se(C[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 ND(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Mv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[4],borderRadius:"12px",canvas:{position:"right",background:se(C[1],.6),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:Pd.primary.backgroundDefault,backgroundHover:Pd.primary.backgroundHover,color:Pd.primary.icon,size:"56px",shadow:`0 8px 32px ${se(C[0],.6)}`},tile:{background:se(C[1],.6),backgroundHover:se(C[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:zi.primary,textColor:zi.secondary,iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(C[1],.6),textColor:zi.primary,border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(C[0],.95),textColor:zi.primary,textSecondaryColor:zi.secondary,border:`1px solid ${C[5]}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`}},Nv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[2],borderRadius:"12px",canvas:{position:"right",background:se(C[12],.7),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:ne[3],backgroundHover:ne[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)"},tile:{background:se(C[12],.7),backgroundHover:se(C[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:C[1],textColor:C[6],iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(C[12],.7),textColor:C[1],border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(C[12],.95),textColor:C[1],textSecondaryColor:C[6],border:`1px solid ${se(C[0],.12)}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`}};function Dv(t){let e=t.mode==="light"?Nv:Mv;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification}}}function Lv(t,e){let n=e.mode??t.mode??"dark",i=n==="light"?Nv:Mv;return{mode:n,fontFamily:e.fontFamily??t.fontFamily??i.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??i.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??i.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??i.borderRadius,canvas:{...i.canvas,...t.canvas,...e.canvas},launcher:{...i.launcher,...t.launcher,...e.launcher},tile:{...i.tile,...t.tile,...e.tile},overlay:{...i.overlay,...t.overlay,...e.overlay},notification:{...i.notification,...t.notification,...e.notification}}}var DD=["canvas","launcher","tile","overlay","notification"];function Iv(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let n of DD){let i=t[n];if(i)for(let[r,o]of Object.entries(i))o!==void 0&&(e[`--sc-${n}-${ND(r)}`]=o)}return e}var ji=X(Qe(),1);var HC=X($e(),1),IC=(0,ji.createContext)(null);function Hv({children:t,themeConfig:e,workspaceTheme:n,shadowRoot:i}){let r=(0,ji.useMemo)(()=>n?Lv(n,e??{}):Dv(e??{}),[e,n]),o=(0,ji.useMemo)(()=>Iv(r),[r]);(0,ji.useEffect)(()=>{if(!i)return;let s=i.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",i.insertBefore(s,i.firstChild));let l=Object.entries(o).map(([c,u])=>` ${c}: ${u};`).join(`
|
|
405
|
+
`;function AD(t){if(t.querySelector(`#${TC}`))return;let e=document.createElement("style");e.id=TC,e.textContent=CD,t.appendChild(e)}function _f({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=$o();return AD(r),t.length===0?null:(0,Mn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Mn.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:a=>{a.currentTarget.style.transform="translateY(-1px)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:a=>{a.currentTarget.style.transform="translateY(0)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Mn.jsxs)("div",{onClick:()=>n(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Mn.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,Mn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Mn.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,Mn.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,Mn.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Mn.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Mn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Wn=Q(Ke(),1);var xf=3,Sf=8e3,wf=3e4;var kD=0;function hc(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function TD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Ef(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!TD(t.name,r.on))continue;let o=Date.now(),a=r.ttl??8e3;return{notification:{id:`notif-${++kD}-${o}`,title:hc(r.title,t.props),body:r.body?hc(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?hc(r.deepLink.itemId,t.props):void 0,expiresAt:o+a,createdAt:o,ttl:a},rule:r}}}return null}function Cf(t,e){let[n,i]=(0,Wn.useState)([]),r=(0,Wn.useRef)(new Map),o=(0,Wn.useRef)(new Map),a=(0,Wn.useCallback)(c=>{t?.publish(be.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Wn.useCallback)(c=>{let u=setTimeout(()=>{i(d=>d.filter(h=>h.id!==c.id)),o.current.delete(c.id),a(c)},c.ttl);o.current.set(c.id,u)},[a]),l=(0,Wn.useCallback)(c=>{i(d=>{let h=d.find(m=>m.id===c);return h&&a(h),d.filter(m=>m.id!==c)});let u=o.current.get(c);u&&(clearTimeout(u),o.current.delete(c))},[a]);return(0,Wn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let d=Ef(u,e);if(!d)return;let{notification:h,rule:m}=d,x=h.itemId?`${h.tileId}:${u.name}:${h.itemId}`:`${h.tileId}:${u.name}`,_=r.current.get(x),b=Date.now(),f=m.cooldown??3e4;_!==void 0&&b-_<f||(r.current.set(x,b),i(g=>{if(h.itemId&&g.some(w=>w.tileId===h.tileId&&w.itemId===h.itemId))return g;let v=[...g,h];if(v.length>3){let y=v.shift(),w=o.current.get(y.id);w&&(clearTimeout(w),o.current.delete(y.id))}return v}),t.publish(be.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{c();for(let u of o.current.values())clearTimeout(u);o.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var Af=Q(Ke(),1);function RD(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],a=e.get(r)?.manifest.runtime?.notifyWatchers;a&&n.push(...a(i.props??{}))}return n}function kf(t,e,n){let i=(0,Af.useRef)(new Map);(0,Af.useEffect)(()=>{if(!t?.events||!n)return;let r=RD(e,n);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&o.remove(s.id)}})},[t,e,n])}var Gt=Q(Ke(),1),LC=Q(Fe(),1),Ov=(0,Gt.createContext)({runtime:null,context:null});function Tf({runtime:t,children:e}){let[n,i]=(0,Gt.useState)(t?t.context.get():null);(0,Gt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Gt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,LC.jsx)(Ov.Provider,{value:r,children:e})}function ui(){let{runtime:t}=(0,Gt.useContext)(Ov);return t}function gc(){let{context:t}=(0,Gt.useContext)(Ov);return t}function Rf(){return gc()?.page??null}function RC(){return gc()?.session??null}function OC(){return gc()?.viewport??null}function MC(t,e,n=[]){let i=ui();(0,Gt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function NC(){return ui()?.state??null}function DC(t,e){let n=ui(),[i,r]=(0,Gt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Gt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(a=>{o||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),i}function ne(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var OD={colorPrimary:ie[3],colorPrimaryHover:ie[4],colorPrimaryMuted:ie[0],colorBackground:ne(A[1],.95),colorBackgroundElevated:ne(A[3],.95),colorBackgroundSubtle:ne(A[0],.2),colorSurface:ne(A[4],.8),colorSurfaceHover:ne(A[5],.8),colorText:fn.primary,colorTextSecondary:fn.secondary,colorTextMuted:fn.tertiary,colorTextInverse:A[1],colorBorder:fv.primary,colorBorderSubtle:fv.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:xt[4],colorWarningMuted:xt[0],colorError:$e[4],colorErrorMuted:$e[0],colorInfo:dn[4],colorInfoMuted:dn[0],colorNotification:ie[4],colorNotificationMuted:ne(ie[4],.4),glassBackground:ne(A[1],.6),glassBackgroundHover:ne(A[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},MD={colorPrimary:ie[3],colorPrimaryHover:ie[2],colorPrimaryMuted:ne(ie[5],.1),colorBackground:ne(A[12],.95),colorBackgroundElevated:ne(A[11],.95),colorBackgroundSubtle:ne(A[0],.02),colorSurface:ne(A[11],.6),colorSurfaceHover:ne(A[10],.6),colorText:A[1],colorTextSecondary:A[6],colorTextMuted:A[8],colorTextInverse:A[12],colorBorder:ne(A[0],.12),colorBorderSubtle:ne(A[0],.06),colorSuccess:ke[4],colorSuccessMuted:ne(ke[4],.12),colorWarning:xt[4],colorWarningMuted:ne(xt[4],.12),colorError:$e[4],colorErrorMuted:ne($e[4],.12),colorInfo:dn[4],colorInfoMuted:ne(dn[4],.12),colorNotification:ie[3],colorNotificationMuted:ne(ie[3],.4),glassBackground:ne(A[12],.7),glassBackgroundHover:ne(A[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function ND(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Mv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ie[3],colorPrimaryHover:ie[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ne(A[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)"},launcher:{background:Pd.primary.backgroundDefault,backgroundHover:Pd.primary.backgroundHover,color:Pd.primary.icon,size:"56px",shadow:`0 8px 32px ${ne(A[0],.6)}`,borderRadius:"9999px"},tile:{background:ne(A[1],.6),backgroundHover:ne(A[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:fn.primary,textColor:fn.secondary,iconBackground:`linear-gradient(135deg, ${ie[3]} 0%, ${ie[3]}cc 100%)`,iconShadow:`0 2px 8px ${ie[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ne(A[1],.6),textColor:fn.primary,titleColor:fn.primary,arrowColor:ne(A[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ie[3]}`},notification:{background:ne(A[0],.95),textColor:fn.primary,textSecondaryColor:fn.secondary,border:`1px solid ${A[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:xt[4],errorColor:$e[4],iconBackground:ne(ie[3],.15),progressGradient:`linear-gradient(90deg, ${ie[3]}, ${ie[4]})`},content:{background:ne(A[3],.8),backgroundHover:ne(A[5],.6),border:`1px solid ${ne(A[5],.5)}`,borderRadius:"8px",textColor:fn.primary,textSecondaryColor:fn.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:ne(A[3],.8),searchColor:fn.primary,chevronColor:"currentColor"}},Nv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ie[3],colorPrimaryHover:ie[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ne(A[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)"},launcher:{background:ie[3],backgroundHover:ie[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:ne(A[12],.7),backgroundHover:ne(A[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:A[1],textColor:A[6],iconBackground:`linear-gradient(135deg, ${ie[3]} 0%, ${ie[3]}cc 100%)`,iconShadow:`0 2px 8px ${ie[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ne(A[12],.7),textColor:A[1],titleColor:A[1],arrowColor:ne(A[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ie[3]}`},notification:{background:ne(A[12],.95),textColor:A[1],textSecondaryColor:A[6],border:`1px solid ${ne(A[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:xt[4],errorColor:$e[4],iconBackground:ne(ie[3],.1),progressGradient:`linear-gradient(90deg, ${ie[3]}, ${ie[2]})`},content:{background:ne(A[12],.8),backgroundHover:ne(A[11],.6),border:`1px solid ${A[11]}`,borderRadius:"8px",textColor:A[1],textSecondaryColor:A[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:A[12],searchColor:A[1],chevronColor:"currentColor"}};function Dv(t){let e=t.mode==="light"?Nv:Mv;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 n=e.mode??t.mode??"dark",i=n==="light"?Nv:Mv;return{mode:n,fontFamily:e.fontFamily??t.fontFamily??i.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??i.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??i.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??i.borderRadius,canvas:{...i.canvas,...t.canvas,...e.canvas},launcher:{...i.launcher,...t.launcher,...e.launcher},tile:{...i.tile,...t.tile,...e.tile},overlay:{...i.overlay,...t.overlay,...e.overlay},notification:{...i.notification,...t.notification,...e.notification},content:{...i.content,...t.content,...e.content}}}var DD=["canvas","launcher","tile","overlay","notification","content"];function Iv(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let n of DD){let i=t[n];if(i)for(let[r,o]of Object.entries(i))o!==void 0&&(e[`--sc-${n}-${ND(r)}`]=o)}return e}var qi=Q(Ke(),1);var HC=Q(Fe(),1),IC=(0,qi.createContext)(null);function Hv({children:t,themeConfig:e,workspaceTheme:n,shadowRoot:i}){let r=(0,qi.useMemo)(()=>n?Lv(n,e??{}):Dv(e??{}),[e,n]),o=(0,qi.useMemo)(()=>Iv(r),[r]);(0,qi.useEffect)(()=>{if(!i)return;let s=i.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",i.insertBefore(s,i.firstChild));let l=Object.entries(o).map(([c,u])=>` ${c}: ${u};`).join(`
|
|
391
406
|
`);s.textContent=`:host {
|
|
392
407
|
${l}
|
|
393
|
-
}`},[i,o]);let a={config:r,mode:r.mode,cssVariables:o};return(0,HC.jsx)(IC.Provider,{value:a,children:t})}function zv(){let t=(0,
|
|
408
|
+
}`},[i,o]);let a={config:r,mode:r.mode,cssVariables:o};return(0,HC.jsx)(IC.Provider,{value:a,children:t})}function zv(){let t=(0,qi.useContext)(IC);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var It=Q(Ke(),1);var Nn=Q(Fe(),1);function LD({widgetId:t,props:e}){let n=ui(),i=(0,It.useRef)(null),r=(0,It.useRef)(null),o=n?.widgets,a=o?.has(t)??!1,[,s]=(0,It.useReducer)(l=>l+1,0);return(0,It.useEffect)(()=>{if(!(!o||a))return o.subscribe(l=>{l.type==="registered"&&l.widgetId===t&&s()})},[o,t,a]),(0,It.useEffect)(()=>{if(!i.current||!o||!a)return;let l=o.mount(t,i.current,e);return r.current=l,()=>{l.unmount(),r.current=null}},[o,t,e,a]),!o||!o.has(t)?(0,Nn.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Nn.jsx)("div",{ref:i,style:{width:"100%",minHeight:"40px"}})}function fs({config:t,surface:e,telemetry:n,style:i}){let{title:r,widget:o,props:a}=t,[,s]=(0,It.useState)(0),l=ui();(0,It.useEffect)(()=>{l&&s(b=>b+1)},[l]);let[c,u]=(0,It.useState)(!1),d=(0,It.useCallback)(()=>u(!0),[]),h=(0,It.useCallback)(()=>u(!1),[]),m={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:c?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:c?"scale(1.01)":"scale(1)",...i},x={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:"72px"},_={width:"40px",height:"40px",borderRadius:"10px",background:"var(--sc-tile-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:"var(--sc-tile-icon-shadow)"};return(0,Nn.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:m,onMouseEnter:d,onMouseLeave:h,children:[(0,Nn.jsxs)("div",{style:x,children:[(0,Nn.jsx)("div",{style:_,children:"+"}),(0,Nn.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Nn.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r??o})})]}),(0,Nn.jsx)("div",{style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Nn.jsx)("div",{style:{paddingTop:"0.875rem"},children:(0,Nn.jsx)(LD,{widgetId:o,props:{...a,instanceId:t.id}})})})]})}var me=Q(Fe(),1),zC="syntro-launcher-styles";function ID(t,e){if(t.querySelector(`#${zC}`))return;let n=document.createElement("style");n.id=zC,n.textContent=e,t.appendChild(n)}function $v({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherIcon:r,launcherAnimate:o=!1,launcherAnimationStyle:a="pulse",notificationCount:s,footerSlot:l,tiles:c,isLoading:u,error:d,canvasTitle:h,displayMode:m="standard"}){let[x,_]=(0,st.useState)(!1),[b,f]=(0,st.useState)(null),g=(0,st.useRef)(null),v=ui(),{shadowRoot:y,portalRoot:w}=$o(),{config:E}=zv(),{notifications:S,dismiss:k}=Cf(v?.events??null,c);kf(v,c,v?.apps);let T=(0,st.useCallback)(W=>{v&&v.events.publish(be.NOTIFICATION_CLICKED,{notificationId:W.id,tileId:W.tileId,itemId:W.itemId}),t||e(),v&&W.tileId&&v.events.publish(be.NOTIFICATION_DEEP_LINK,{tileId:W.tileId,itemId:W.itemId}),k(W.id)},[v,t,e,k]),C=(0,st.useMemo)(()=>`
|
|
394
409
|
@keyframes syntro-launcher-pulse {
|
|
395
410
|
0%, 100% {
|
|
396
|
-
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${
|
|
411
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${E.colorPrimary}66;
|
|
397
412
|
}
|
|
398
413
|
50% {
|
|
399
|
-
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${
|
|
414
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${E.colorPrimary}00;
|
|
400
415
|
}
|
|
401
416
|
}
|
|
402
417
|
@keyframes syntro-launcher-glow {
|
|
403
418
|
0%, 100% { border-color: rgba(255,255,255,0.1); }
|
|
404
|
-
50% { border-color: ${
|
|
419
|
+
50% { border-color: ${E.colorPrimaryHover}99; }
|
|
405
420
|
}
|
|
406
421
|
.syntro-launcher-animate {
|
|
407
422
|
animation: syntro-launcher-pulse 2s ease-in-out infinite, syntro-launcher-glow 2s ease-in-out infinite;
|
|
@@ -412,8 +427,8 @@ ${l}
|
|
|
412
427
|
75%, 100% { transform: scale(2.2); opacity: 0; }
|
|
413
428
|
}
|
|
414
429
|
@keyframes syntro-badge-glow {
|
|
415
|
-
0%, 100% { box-shadow: 0 0 8px 2px ${
|
|
416
|
-
50% { box-shadow: 0 0 20px 6px ${
|
|
430
|
+
0%, 100% { box-shadow: 0 0 8px 2px ${E.colorPrimaryHover}4d; }
|
|
431
|
+
50% { box-shadow: 0 0 20px 6px ${E.colorPrimaryHover}80; }
|
|
417
432
|
}
|
|
418
433
|
@keyframes syntro-badge-bounce {
|
|
419
434
|
0%, 100% { transform: translateY(0); }
|
|
@@ -423,7 +438,7 @@ ${l}
|
|
|
423
438
|
.syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
|
|
424
439
|
.syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
|
|
425
440
|
.syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
|
|
426
|
-
`,[w.colorPrimary,w.colorPrimaryHover]);(0,kt.useEffect)(()=>{t&&l.forEach(J=>{if(n?.trackRectangleViewed(J.id,"overlay"),p){let me=fs.tileViewed(J.id,"overlay");p.events.publish(me.name,me.props,me.source)}})},[n,p,t,l]),(0,kt.useEffect)(()=>{S(!0),ID(v,k)},[v,k]);let E=(0,kt.useCallback)(()=>{let J=!t;if(J?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let me=J?fs.canvasOpened("overlay"):fs.canvasClosed("overlay");p.events.publish(me.name,me.props,me.source)}e()},[t,n,p,e]),R=(0,kt.useCallback)(J=>{let me=J.currentTarget.getBoundingClientRect();f.current={startX:J.clientX,startY:J.clientY,startElX:me.left,startElY:me.top,dragged:!1},J.currentTarget.setPointerCapture(J.pointerId)},[]),D=(0,kt.useCallback)(J=>{let me=f.current;if(!me)return;let Ke=J.clientX-me.startX,Mt=J.clientY-me.startY;(Math.abs(Ke)>5||Math.abs(Mt)>5)&&(me.dragged=!0),me.dragged&&b({x:me.startElX+Ke,y:me.startElY+Mt})},[]),N=(0,kt.useCallback)(J=>{let me=f.current;f.current=null,me&&!me.dragged&&E()},[E]),H=h==="focused",B=w.canvas.position==="right",z=2147483600,te={display:"flex",flexDirection:"column",width:H?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:H?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:H?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:H?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...H?{}:{maskImage:B?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:B?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":B?"translateX(120%)":"translateX(-120%)"},G=(0,pe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:z},children:(0,pe.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:B?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-container",style:te,children:[H&&d&&(0,pe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,pe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:d})}),(0,pe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:H?"0":"1rem"},children:c?(0,pe.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:H?"1rem":"0"},children:"Loading..."}):u?(0,pe.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:H?"1rem":"0"},children:["Failed to load: ",u]}):H?l.length>0?(0,pe.jsx)(ps,{config:l[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,pe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(J=>(0,pe.jsx)(ps,{config:J,surface:"overlay",telemetry:n,style:{width:"100%"}},J.id))})}),s]}),(0,pe.jsx)("div",{onClick:E,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return m?(0,pe.jsxs)(pe.Fragment,{children:[(0,Bv.createPortal)((0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:z+47},children:[(0,pe.jsx)(_f,{notifications:A,onDismiss:x,onClickNotification:T,position:w.canvas.position??"right"}),(0,pe.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",..._?{top:_.y,left:_.x}:{bottom:"2.5rem",right:B?"2.5rem":void 0,left:B?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"9999px",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:f.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:f.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:R,onPointerMove:D,onPointerUp:N,onMouseEnter:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[(0,pe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M18 6L6 18"}),(0,pe.jsx)("path",{d:"M6 6l12 12"})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,pe.jsx)("path",{d:"M5 3v4"}),(0,pe.jsx)("path",{d:"M3 5h4"}),(0,pe.jsx)("path",{d:"M19 17v4"}),(0,pe.jsx)("path",{d:"M17 19h4"})]})}),!t&&A.length>0&&(0,pe.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,pe.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,pe.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,pe.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:A.length>99?"99+":A.length})]})]})]}),y),t?(0,Bv.createPortal)(G,y):null]}):null}var si=X(Qe(),1);var HD=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function $v({fetcher:t,experiments:e,runtime:n,pageUrl:i}){let[r,o]=(0,si.useState)({tiles:[],actions:[],isLoading:!0}),a=(0,si.useRef)("[]"),s=(0,si.useCallback)(async()=>{try{o(m=>({...m,isLoading:!0,error:void 0}));let l=await t();Y("SmartCanvas Config","Raw config response",l);let c=l.tiles||[];n?(c=await n.filterTiles(c),e&&(c=c.filter(m=>e.shouldRenderRectangle(m)))):e&&(c=c.filter(m=>e.shouldRenderRectangle(m))),Y("SmartCanvas Config",`Tile count after filtering: ${c.length}`);let u=l.actions||[],d=JSON.stringify(u),h=d!==a.current;h&&(a.current=d),o(m=>({tiles:HD(c),actions:h?u:m.actions,isLoading:!1,fetchedAt:l.fetchedAt,canvasTitle:l.canvasTitle,configVersion:l.configVersion,theme:l.theme,launcher:l.launcher}))}catch(l){let c=l instanceof Error?l.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",c,l),o(u=>({...u,isLoading:!1,error:c}))}},[e,t,n]);return(0,si.useEffect)(()=>{if(s(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>s())},[s,e,i]),(0,si.useMemo)(()=>r,[r])}var hs=X($e(),1);function Uv({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){return c?(0,hs.jsx)(kf,{runtime:c,children:(0,hs.jsx)(BC,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}):(0,hs.jsx)(BC,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}function BC({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){let[v,y]=(0,Gt.useState)(t.getState().open),w=Rf(),[A,x]=(0,Gt.useState)(()=>typeof window<"u"?window.location.href:"/"),T=w?.url??A;(0,Gt.useEffect)(()=>{if(c||typeof window>"u")return;let z=()=>x(window.location.href);window.addEventListener("popstate",z),window.addEventListener("hashchange",z);let te=history.pushState,I=history.replaceState;return history.pushState=function(...G){te.apply(this,G),queueMicrotask(z)},history.replaceState=function(...G){I.apply(this,G),queueMicrotask(z)},()=>{window.removeEventListener("popstate",z),window.removeEventListener("hashchange",z),history.pushState=te,history.replaceState=I}},[c]);let k=(0,Gt.useMemo)(()=>e||Ho({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:o}),[e,n,s,i,r,o]),E=$v({fetcher:k,experiments:s,runtime:c,pageUrl:T}),R=E.tiles.length>0&&!E.error;(0,Gt.useEffect)(()=>t.subscribe(z=>y(z.open)),[t]),(0,Gt.useEffect)(()=>{!E.isLoading&&!R&&t.getState().open&&t.setOpen(!1)},[t,R,E.isLoading]);let D=(0,Gt.useRef)(f??null),N=(0,Gt.useRef)(!!f);(0,Gt.useEffect)(()=>{if(!c?.actions)return;if(N.current){E.actions.length>0&&(N.current=!1);return}let z=!1;return(async()=>{if(D.current){try{await D.current.revertAll()}catch(I){console.error("[SmartCanvasApp] Failed to revert actions:",I)}D.current=null}if(!z&&E.actions.length>0)try{let I=await c.actions.applyBatch(E.actions);z?await I.revertAll():D.current=I}catch(I){z||console.error("[SmartCanvasApp] Failed to apply actions:",I)}})(),()=>{z=!0,D.current&&(D.current.revertAll().catch(I=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",I)}),D.current=null)}},[c,E.actions,T]),(0,Gt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let{shadowRoot:H}=Bo(),B=E.theme;return!E.isLoading&&!R?null:(0,hs.jsx)(Hv,{themeConfig:B,workspaceTheme:p,shadowRoot:H,children:(0,hs.jsx)(Fv,{tiles:E.tiles,isLoading:E.isLoading,error:E.error,canvasTitle:E.canvasTitle,telemetry:l,launcherLabel:_??E.launcher?.label,launcherAnimate:E.launcher?.animate,launcherAnimationStyle:E.launcher?.animationStyle,notificationCount:E.launcher?.notificationCount??E.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:E.displayMode})})}var Vv=X($e(),1),FC="smart-canvas",$C=`
|
|
441
|
+
`,[E.colorPrimary,E.colorPrimaryHover]);(0,st.useEffect)(()=>{t&&c.forEach(W=>{if(n?.trackRectangleViewed(W.id,"overlay"),v){let oe=ds.tileViewed(W.id,"overlay");v.events.publish(oe.name,oe.props,oe.source)}})},[n,v,t,c]),(0,st.useEffect)(()=>{_(!0),ID(y,C)},[y,C]);let R=(0,st.useCallback)(()=>{let W=!t;if(W?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),v){let oe=W?ds.canvasOpened("overlay"):ds.canvasClosed("overlay");v.events.publish(oe.name,oe.props,oe.source)}e()},[t,n,v,e]),L=(0,st.useCallback)(W=>{let oe=W.currentTarget.getBoundingClientRect();g.current={startX:W.clientX,startY:W.clientY,startElX:oe.left,startElY:oe.top,dragged:!1},W.currentTarget.setPointerCapture(W.pointerId)},[]),N=(0,st.useCallback)(W=>{let oe=g.current;if(!oe)return;let Bt=W.clientX-oe.startX,Ot=W.clientY-oe.startY;(Math.abs(Bt)>5||Math.abs(Ot)>5)&&(oe.dragged=!0),oe.dragged&&f({x:oe.startElX+Bt,y:oe.startElY+Ot})},[]),z=(0,st.useCallback)(W=>{let oe=g.current;g.current=null,oe&&!oe.dragged&&R()},[R]),B=m==="focused",H=E.canvas.position==="right",K=E.canvas.layout==="push",D=(0,st.useRef)(null),G=2147483600;(0,st.useEffect)(()=>{if(!K)return;let W=document.documentElement,oe=H?"marginRight":"marginLeft",Bt=W.style.transition;if(W.style.transition=`${oe} 340ms cubic-bezier(0.16, 1, 0.3, 1)`,t){let Ot=D.current?.offsetWidth??380;W.style[oe]=`${Ot}px`}else W.style[oe]="0px";return()=>{W.style[oe]="",W.style.transition=Bt}},[K,t,H]),(0,st.useEffect)(()=>{if(!K||!t)return;let W=D.current;if(!W)return;let oe=H?"marginRight":"marginLeft",Bt=new ResizeObserver(([Ot])=>{document.documentElement.style[oe]=`${Ot.contentRect.width}px`});return Bt.observe(W),()=>Bt.disconnect()},[K,t,H]);let ut={display:"flex",flexDirection:"column",width:B?"40vw":E.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:B?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:B?`${E.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:B?`${E.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...B?{}:{maskImage:H?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:H?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":H?"translateX(120%)":"translateX(-120%)"},it=(0,me.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:G},children:(0,me.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:H?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,me.jsxs)("div",{ref:D,"data-shadow-canvas-id":"overlay-container",style:ut,children:[B&&h&&(0,me.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,me.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:h})}),(0,me.jsx)("div",{style:{flex:1,overflowY:"auto",padding:B?"0":"1rem"},children:u?(0,me.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:B?"1rem":"0"},children:"Loading..."}):d?(0,me.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:B?"1rem":"0"},children:["Failed to load: ",d]}):B?c.length>0?(0,me.jsx)(fs,{config:c[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,me.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:c.map(W=>(0,me.jsx)(fs,{config:W,surface:"overlay",telemetry:n,style:{width:"100%"}},W.id))})}),l]}),(0,me.jsx)("div",{onClick:R,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return x?(0,me.jsxs)(me.Fragment,{children:[(0,Bv.createPortal)((0,me.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:G+47},children:[(0,me.jsx)(_f,{notifications:S,onDismiss:k,onClickNotification:T,position:E.canvas.position??"right"}),(0,me.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...b?{top:b.y,left:b.x}:{bottom:"2.5rem",right:H?"2.5rem":void 0,left:H?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:L,onPointerMove:N,onPointerUp:z,onMouseEnter:W=>{g.current?.dragged||(W.currentTarget.style.backgroundColor=E.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:W=>{g.current?.dragged||(W.currentTarget.style.backgroundColor=E.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,me.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,me.jsx)("path",{d:"M18 6L6 18"}),(0,me.jsx)("path",{d:"M6 6l12 12"})]}):r?(0,me.jsx)("img",{src:r,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,me.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,me.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,me.jsx)("path",{d:"M5 3v4"}),(0,me.jsx)("path",{d:"M3 5h4"}),(0,me.jsx)("path",{d:"M19 17v4"}),(0,me.jsx)("path",{d:"M17 19h4"})]}),!t&&S.length>0&&(0,me.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,me.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${E.colorPrimaryHover}66`}}),(0,me.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,me.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:E.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:S.length>99?"99+":S.length})]})]})]}),w),t?(0,Bv.createPortal)(it,w):null]}):null}var Xn=Q(Ke(),1);var HD=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function Fv({fetcher:t,experiments:e,runtime:n,pageUrl:i,pollIntervalMs:r}){let[o,a]=(0,Xn.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Xn.useRef)("[]"),l=(0,Xn.useCallback)(async()=>{try{a(x=>({...x,isLoading:!0,error:void 0}));let c=await t();Y("SmartCanvas Config","Raw config response",c);let u=c.tiles||[];n?(u=await n.filterTiles(u),e&&(u=u.filter(x=>e.shouldRenderRectangle(x)))):e&&(u=u.filter(x=>e.shouldRenderRectangle(x))),Y("SmartCanvas Config",`Tile count after filtering: ${u.length}`);let d=c.actions||[],h=JSON.stringify(d),m=h!==s.current;m&&(s.current=h),a(x=>({tiles:HD(u),actions:m?d:x.actions,isLoading:!1,fetchedAt:c.fetchedAt,canvasTitle:c.canvasTitle,configVersion:c.configVersion,theme:c.theme,launcher:c.launcher}))}catch(c){let u=c instanceof Error?c.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",u,c),a(d=>({...d,isLoading:!1,error:u}))}},[e,t,n]);return(0,Xn.useEffect)(()=>{if(l(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>l())},[l,e,i]),(0,Xn.useEffect)(()=>{if(!r)return;let c=setInterval(()=>{l()},r);return()=>clearInterval(c)},[l,r]),(0,Xn.useMemo)(()=>o,[o])}var ps=Q(Fe(),1);function Uv({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:x,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:g}){return c?(0,ps.jsx)(Tf,{runtime:c,children:(0,ps.jsx)(BC,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:x,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:g})}):(0,ps.jsx)(BC,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:x,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:g})}function BC({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:x,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:g}){let[v,y]=(0,Yt.useState)(t.getState().open),w=Rf(),[E,S]=(0,Yt.useState)(()=>typeof window<"u"?window.location.href:"/"),k=w?.url??E;(0,Yt.useEffect)(()=>{if(c||typeof window>"u")return;let H=()=>S(window.location.href);window.addEventListener("popstate",H),window.addEventListener("hashchange",H);let K=history.pushState,D=history.replaceState;return history.pushState=function(...G){K.apply(this,G),queueMicrotask(H)},history.replaceState=function(...G){D.apply(this,G),queueMicrotask(H)},()=>{window.removeEventListener("popstate",H),window.removeEventListener("hashchange",H),history.pushState=K,history.replaceState=D}},[c]);let T=(0,Yt.useMemo)(()=>e||zo({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:o}),[e,n,s,i,r,o]),C=Fv({fetcher:T,experiments:s,runtime:c,pageUrl:k}),R=C.tiles.length>0&&!C.error;(0,Yt.useEffect)(()=>t.subscribe(H=>y(H.open)),[t]),(0,Yt.useEffect)(()=>{!C.isLoading&&!R&&t.getState().open&&t.setOpen(!1)},[t,R,C.isLoading]);let L=(0,Yt.useRef)(f??null),N=(0,Yt.useRef)(!!f);(0,Yt.useEffect)(()=>{if(!c?.actions)return;if(N.current){C.actions.length>0&&(N.current=!1);return}let H=!1;return(async()=>{if(L.current){try{await L.current.revertAll()}catch(D){console.error("[SmartCanvasApp] Failed to revert actions:",D)}L.current=null}if(!H&&C.actions.length>0)try{let D=await c.actions.applyBatch(C.actions);H?await D.revertAll():L.current=D}catch(D){H||console.error("[SmartCanvasApp] Failed to apply actions:",D)}})(),()=>{H=!0,L.current&&(L.current.revertAll().catch(D=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",D)}),L.current=null)}},[c,C.actions,k]),(0,Yt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let{shadowRoot:z}=$o(),B=C.theme;return!C.isLoading&&!R?null:(0,ps.jsx)(Hv,{themeConfig:B,workspaceTheme:g,shadowRoot:z,children:(0,ps.jsx)($v,{tiles:C.tiles,isLoading:C.isLoading,error:C.error,canvasTitle:C.canvasTitle,telemetry:l,launcherLabel:_??C.launcher?.label,launcherAnimate:C.launcher?.animate,launcherAnimationStyle:C.launcher?.animationStyle,notificationCount:C.launcher?.notificationCount??C.tiles.length,footerSlot:x,isOpen:v,onToggle:()=>t.toggle(),displayMode:C.displayMode})})}var Vv=Q(Fe(),1),$C="smart-canvas",FC=`
|
|
427
442
|
:host {
|
|
428
443
|
font: inherit;
|
|
429
444
|
color: inherit;
|
|
@@ -437,12 +452,12 @@ ${l}
|
|
|
437
452
|
*, *::before, *::after {
|
|
438
453
|
box-sizing: border-box;
|
|
439
454
|
}
|
|
440
|
-
`,Mn,Ur,Vr,Pi,qi,jr,Zi,Of=class extends HTMLElement{constructor(){super();cr(this,Mn);cr(this,Ur);cr(this,Vr);cr(this,Pi);cr(this,qi);cr(this,jr,null);cr(this,Zi,null);Kn(this,Mn,this.attachShadow({mode:"open",delegatesFocus:!0})),Kn(this,Ur,document.createElement("div")),ge(this,Ur).setAttribute("part","mount"),ge(this,Mn).appendChild(ge(this,Ur)),Kn(this,Vr,document.createElement("div")),ge(this,Vr).id="portalRoot",ge(this,Mn).appendChild(ge(this,Vr)),Kn(this,Pi,document.createElement("div")),ge(this,Pi).id="overlayContainer",Object.assign(ge(this,Pi).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,Mn).appendChild(ge(this,Pi)),Kn(this,qi,kv()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,jr)?.unmount(),Kn(this,jr,null)}getMountNode(){return ge(this,Ur)}getController(){return ge(this,qi)}getPortalRoot(){return ge(this,Vr)}getOverlayContainer(){return ge(this,Pi)}getShadowRoot(){return ge(this,Mn)}open(){ge(this,qi).setOpen(!0)}close(){ge(this,qi).setOpen(!1)}toggle(){ge(this,qi).toggle()}setOverrideFetcher(n){ge(this,Zi)&&(Kn(this,Zi,{...ge(this,Zi),fetcher:n}),this.render())}mountReactApp(n){Kn(this,Zi,n),this.render()}render(){!this.isConnected||!ge(this,Zi)||(ge(this,jr)||Kn(this,jr,(0,UC.createRoot)(ge(this,Ur))),ge(this,jr).render((0,Vv.jsx)(Rv,{shadowRoot:ge(this,Mn),portalRoot:ge(this,Vr),overlayContainer:ge(this,Pi),children:(0,Vv.jsx)(Uv,{...ge(this,Zi),controller:ge(this,qi),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Mn).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync($C),ge(this,Mn).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=$C,ge(this,Mn).appendChild(n)}}};Mn=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Pi=new WeakMap,qi=new WeakMap,jr=new WeakMap,Zi=new WeakMap;var jv=()=>{typeof window>"u"||customElements.get(FC)||customElements.define(FC,Of)};var Mf=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let b=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=pC(b)}let n=null,i=null,r=null,{runtime:o}=t;async function a(b){!o?.actions||b.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(b))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();n=b,console.log("[SmartCanvas] Config fetched:",`tiles=${b.tiles?.length??0},`,`actions=${b.actions?.length??0},`,`theme=${b.theme?.mode??"default"}`),b.actions?.length&&console.log("[SmartCanvas] Actions to apply:",b.actions.map((f,p)=>`[${p}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await a(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&hc(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=bC();jv();let c=document.createElement("smart-canvas");if(EC(c.getOverlayContainer()),t.tokens)for(let[b,f]of Object.entries(t.tokens))c.style.setProperty(b,f);let u=()=>{let b=t.target??document.body;b&&b.appendChild(c)};document.body?u():document.addEventListener("DOMContentLoaded",u,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),_C(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,m=t.fetcher??Ho({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=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:r,workspaceTheme:t.workspaceTheme};c.mountReactApp(S),t.defaultOpen&&c.open();let _={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{s(),c.remove()},setTokens:b=>{for(let[f,p]of Object.entries(b))c.style.setProperty(f,p)},getConfig:async()=>{if(i)try{let b=await i();return n=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return n??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?n&&await a(n.actions):await s()},setOverrideFetcher:b=>{i=b,c.setOverrideFetcher(b),o?.accumulator&&b().then(f=>{f?.tiles&&hc(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{h?.register?.(b)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(b,f)=>h?.track?(h.track(b,f),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=_)}return _};typeof window<"u"&&(window.SmartCanvas={async create(t){return Mf(t)}});var qr=X(Qe(),1);var Pr=X($e(),1);function zD({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,qr.useState)(0),o=(0,qr.useMemo)(()=>[...t].sort((a,s)=>(a.priority??0)-(s.priority??0)),[t]);return(0,qr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,qr.useEffect)(()=>{if(o.length<=1)return;let a=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(a)},[o,e]),(0,qr.useEffect)(()=>{let a=o[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,o,n]),o.length?(0,Pr.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,Pr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${o.length*100}%`},children:o.map(a=>(0,Pr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Pr.jsx)(ps,{config:a,surface:"wheel",telemetry:n})},a.id))}),(0,Pr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((a,s)=>(0,Pr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},a.id))})]}):null}function gs(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function BD(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",o=gs(r),a=gs(Vi);return o.major>a.major&&e.push(`Config schema v${r} is newer than SDK v${Vi}. Some features may not work. Update SDK to latest version.`),o.major<a.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${Vi}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:FD(i,r)}):{valid:!0,warnings:e,errors:n}}function FD(t,e){let n={...t};return gs(e).major===1&&(n=$D(n)),n.schemaVersion=Vi,n}function $D(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function UD(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=gs(n),r=gs(Vi);return i.major<r.major||!e.schemaVersion}var jC={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function PC(){return jC}function Pv(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function vc(t,e,n){return n===2?Pv(Pv(t+e)+"")%1e4/1e4:n===1?Pv(e+t)%1e3/1e3:null}function VD(t){return t<=0?[]:new Array(t).fill(1/t)}function Nf(t,e){return t>=e[0]&&t<e[1]}function qC(t,e){let n=vc("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function ZC(t,e){for(let n=0;n<e.length;n++)if(Nf(t,e[n]))return n;return-1}function Zv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Df(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let o=qD(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else n=!0,o&&(i=!0)}return i||!n}function jD(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function PD(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,o)=>{i.push([t.searchParams.get(o)||"",r,!1])}),!i.some(r=>!jD(r[0],r[1],r[2]))}catch{return!1}}function qD(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=Zv(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return PD(i,n);return!1}catch{return!1}}function GC(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=VD(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,s)=>s+a,0);(r<.99||r>1.01)&&(n=i);let o=0;return n.map(a=>{let s=o;return o+=a,[s,s+e*a]})}function YC(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function WC(t){try{return t()}catch(e){return console.error(e),!1}}var qv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function $o(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||jC.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",qv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:qv(r)},i,qv(o));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function yc(t){return typeof t=="string"?t:JSON.stringify(t)}function pn(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function XC(){let t;try{t="1.6.4"}catch{t=""}return t}function KC(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,o)=>{i.searchParams.has(o)||i.searchParams.set(o,r)}),i.toString()}function VC(t){return typeof t=="object"&&t!==null}function Lf(t){return t.urlPatterns&&t.variations.some(e=>VC(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>VC(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function If(t,e){return new Promise(n=>{let i=!1,r,o=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>o(),e)),t.then(a=>o(a)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},li=PC(),ms={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>li.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return li.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new li.EventSource(`${t}/sub/${e}`,{headers:n}):new li.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),YD()):document.visibilityState==="hidden"&&(t=window.setTimeout(GD,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(li.localStorage=globalThis.localStorage)}catch{}var vs=new Map,QC=!1,Gi=new Map,Hf=new Map,ys=new Map,bs=new Set;function eA(t){Object.assign(Rt,t),Rt.backgroundSync||Qv()}async function tA({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Rt.backgroundSync=!1),WD({instance:t,allowStale:i,timeout:e,skipCache:n})}function ZD(t){let e=bc(t),n=vs.get(e)||new Set;n.add(t),vs.set(e,n)}function nA(t){vs.forEach(e=>e.delete(t))}function GD(){ys.forEach(t=>{t&&(t.state="idle",Xv(t))})}function YD(){ys.forEach(t=>{t&&t.state==="idle"&&Kv(t)})}async function JC(){try{if(!li.localStorage)return;await li.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(Gi.entries())))}catch{}}async function WD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=bc(t),o=Yv(t),a=new Date,s=new Date(a.getTime()-Rt.maxAge+Rt.staleTTL);await XD();let l=!Rt.disableCache&&!i?Gi.get(o):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>s?(l.sse&&bs.add(r),l.staleAt<a?Gv(t):Wv(t),{data:l.data,success:!0,source:"cache"}):await If(Gv(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function bc(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function Yv(t){let e=bc(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let o=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:a})}`}async function XD(){if(!QC){QC=!0;try{if(li.localStorage){let t=await li.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{Gi.set(n,{...i,staleAt:new Date(i.staleAt)})}),iA()}}}catch{}if(!Rt.disableIdleStreams){let t=ms.startIdleListener();t&&(ms.stopIdleListener=t)}}}function iA(){let t=Array.from(Gi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,Gi.size-Rt.maxEntries),Gi.size);for(let n=0;n<e;n++)Gi.delete(t[n].key)}function rA(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:Gi.get(e);if(o&&i&&o.version===i){o.staleAt=r,JC();return}Rt.disableCache||(Gi.set(e,{data:n,version:i,staleAt:r,sse:bs.has(t)}),iA()),JC();let a=vs.get(t);a&&a.forEach(s=>KD(s,n))}async function KD(t,e){await t.setPayload(e||t.getPayload())}async function Gv(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=bc(t),a=Yv(t),s=Hf.get(a);return s||(s=(r?ms.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):ms.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&bs.add(o),c.json()}).then(c=>(rA(o,a,c),Wv(t),Hf.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(Hf.delete(a),{data:null,source:"error",success:!1,error:c})),Hf.set(a,s)),s}function Wv(t,e=!1){let n=bc(t),i=Yv(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),a=t.getClientKey();if(e&&bs.add(n),Rt.backgroundSync&&bs.has(n)&&li.EventSource){if(ys.has(n))return;let s={src:null,host:r,clientKey:a,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=vs.get(n);c&&c.forEach(u=>{Gv(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);rA(n,i,c)}s.errors=0}catch{oA(s)}},errors:0,state:"active"};ys.set(n,s),Kv(s)}}function oA(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);Xv(t),setTimeout(()=>{["idle","active"].includes(t.state)||Kv(t)},Math.min(e,3e5))}}function Xv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Kv(t){t.src=ms.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=()=>oA(t),t.src.onopen=()=>{t.errors=0}}function QD(t,e){Xv(t),ys.delete(e)}function Qv(){bs.clear(),ys.forEach(QD),vs.clear(),ms.stopIdleListener()}function zf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Wv(t,!0),ZD(t)}}var JD=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,ty={revert:function(){}},Uf=new Map,ny=new Set;function e4(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Vf(t){var e=Uf.get(t);return e||(e={element:t,attributes:{}},Uf.set(t,e)),e}function jf(t,e,n,i,r){var o=n(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&a._positionTimeout)){e==="position"&&(a._positionTimeout=setTimeout(function(){a._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===a.virtualValue.parentNode&&s.insertBeforeNode===a.virtualValue.insertBeforeNode||s!==a.virtualValue&&(a.originalValue=s,r(a))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,e4(e)),a}function Pf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,aA()):t!==n&&(e.isDirty=!0,aA())}function t4(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Pf(g4(e),t)}function n4(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),Pf(Array.from(e).filter(Boolean).join(" "),t)}function i4(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Pf(e,t)}function r4(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function o4(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=r4(i);e=r||e}),Pf(e,t)}var a4=function(e){return e.innerHTML},s4=function(e,n){return e.innerHTML=n};function lA(t){var e=Vf(t);return e.html||(e.html=jf(t,"html",a4,s4,t4)),e.html}var l4=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},c4=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function cA(t){var e=Vf(t);return e.position||(e.position=jf(t,"position",l4,c4,o4)),e.position}var u4=function(e,n){return n?e.className=n:e.removeAttribute("class")},d4=function(e){return e.className};function uA(t){var e=Vf(t);return e.classes||(e.classes=jf(t,"class",d4,u4,n4)),e.classes}var f4=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},p4=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function dA(t,e){var n=Vf(t);return n.attributes[e]||(n.attributes[e]=jf(t,e,f4(e),p4(e),i4)),n.attributes[e]}function h4(t,e){var n=Uf.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var o,a;(o=n.classes)==null||(a=o.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,d;(c=n.attributes)==null||(u=c[e])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[e]}}var Bf;function g4(t){return Bf||(Bf=document.createElement("div")),Bf.innerHTML=t,Bf.innerHTML}function Ff(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||h4(t,e),n.setValue(t,i)}}function m4(t,e){t.html&&Ff(e,"html",t.html),t.classes&&Ff(e,"class",t.classes),t.position&&Ff(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){Ff(e,n,t.attributes[n])})}function aA(){Uf.forEach(m4)}function v4(t,e){var n=null;t.kind==="html"?n=lA(e):t.kind==="class"?n=uA(e):t.kind==="attribute"?n=dA(e,t.attribute):t.kind==="position"&&(n=cA(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function y4(t,e){var n=null;if(t.kind==="html"?n=lA(e):t.kind==="class"?n=uA(e):t.kind==="attribute"?n=dA(e,t.attribute):t.kind==="position"&&(n=cA(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function fA(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),v4(t,i))})}}function b4(t){t.elements.forEach(function(e){return y4(t,e)}),t.elements.clear(),ny.delete(t)}function sA(){ny.forEach(fA)}var Jv;function _4(){typeof document>"u"||(Jv||(Jv=new MutationObserver(function(){sA()})),sA(),Jv.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}_4();function qf(t){return typeof document>"u"?ty:(ny.add(t),fA(t),{revert:function(){b4(t)}})}function ey(t,e){return qf({kind:"html",elements:new Set,mutate:e,selector:t})}function pA(t,e){return qf({kind:"position",elements:new Set,mutate:e,selector:t})}function _c(t,e){return qf({kind:"class",elements:new Set,mutate:e,selector:t})}function $f(t,e,n){return JD.test(e)?e==="class"||e==="className"?_c(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return i.add(o)})}):qf({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):ty}function S4(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return ey(e,function(s){return s+(i??"")});if(n==="set")return ey(e,function(){return i??""})}else if(r==="class"){if(n==="append")return _c(e,function(s){i&&s.add(i)});if(n==="remove")return _c(e,function(s){i&&s.delete(i)});if(n==="set")return _c(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&o)return pA(e,function(){return{insertBeforeSelector:a,parentSelector:o}})}else{if(n==="append")return $f(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return $f(e,r,function(){return i??""});if(n==="remove")return $f(e,r,function(){return null})}return ty}var x4={html:ey,classes:_c,attribute:$f,position:pA,declarative:S4},hA=x4;var iy={};function Zr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!vA(t,r,n))return!1;break;case"$nor":if(vA(t,r,n))return!1;break;case"$and":if(!T4(t,r,n))return!1;break;case"$not":if(Zr(t,r,n))return!1;break;default:if(!Sc(r,w4(t,i),n))return!1}return!0}function w4(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function gA(t,e=!1){let n=`${t}${e?"/i":""}`;return iy[n]||(iy[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),iy[n]}function Sc(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!yA(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!A4(r,e,t[r],n))return!1;return!0}function yA(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function E4(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 C4(t,e,n){if(!Array.isArray(t))return!1;let i=yA(e)?r=>Sc(e,r,n):r=>Zr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function _s(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>i(r)===i(o))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function mA(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let a=0;a<t.length;a++)if(Sc(e[r],t[a],n,i)){o=!0;break}if(!o)return!1}return!0}function A4(t,e,n,i){switch(t){case"$veq":return pn(e)===pn(n);case"$vne":return pn(e)!==pn(n);case"$vgt":return pn(e)>pn(n);case"$vgte":return pn(e)>=pn(n);case"$vlt":return pn(e)<pn(n);case"$vlte":return pn(e)<=pn(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?_s(e,n):!1;case"$ini":return Array.isArray(n)?_s(e,n,!0):!1;case"$inGroup":return _s(e,i[n]||[]);case"$notInGroup":return!_s(e,i[n]||[]);case"$nin":return Array.isArray(n)?!_s(e,n):!1;case"$nini":return Array.isArray(n)?!_s(e,n,!0):!1;case"$not":return!Sc(n,e,i);case"$size":return Array.isArray(e)?Sc(n,e.length,i):!1;case"$elemMatch":return C4(e,n,i);case"$all":return Array.isArray(n)?mA(e,n,i):!1;case"$alli":return Array.isArray(n)?mA(e,n,i,!0):!1;case"$regex":try{return gA(n).test(e)}catch{return!1}case"$regexi":try{return gA(n,!0).test(e)}catch{return!1}case"$type":return E4(e)===n;default:return console.error("Unknown operator: "+t),!1}}function vA(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Zr(t,e[i],n))return!0;return!1}function T4(t,e,n){for(let i=0;i<e.length;i++)if(!Zr(t,e[i],n))return!1;return!0}var k4="Feature Evaluated",R4="Experiment Viewed";function O4(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function M4(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 bA(t,e,n){if(t.user.trackedExperiments){let r=Yf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(Ss(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(Ss(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(Ss(()=>r(R4,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function N4(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;Ss(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;Ss(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;Ss(()=>i(k4,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function Zf(t,e){if(e.stack.evaluatedFeatures.has(t))return Gr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=O4(e);if(n.has(t))return Gr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Gr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of i.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=Zf(l.id,e);if(c.source==="cyclicPrerequisite")return Gr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Zr(u,l.condition||{})){if(l.gate)return Gr(e,t,null,"prerequisite");continue e}}if(o.filters&&xA(o.filters,e))continue;if("force"in o){if(o.condition&&!SA(o.condition,e)||!D4(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=>{!bA(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Gr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let a={variations:o.variations,key:o.key||t};"coverage"in o&&(a.coverage=o.coverage),o.weights&&(a.weights=o.weights),o.hashAttribute&&(a.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(a.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(a.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(a.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(a.minBucketVersion=o.minBucketVersion),o.namespace&&(a.namespace=o.namespace),o.meta&&(a.meta=o.meta),o.ranges&&(a.ranges=o.ranges),o.name&&(a.name=o.name),o.phase&&(a.phase=o.phase),o.seed&&(a.seed=o.seed),o.hashVersion&&(a.hashVersion=o.hashVersion),o.filters&&(a.filters=o.filters),o.condition&&(a.condition=o.condition);let{result:s}=Gf(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,s),s.inExperiment&&!s.passthrough)return Gr(e,t,s.value,"experiment",o.id,a,s)}}return Gr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function Gf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:je(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:je(n,t,-1,!1,e)};if(t=L4(t,n),t.urlPatterns&&!Df(n.user.url||"",t.urlPatterns))return{result:je(n,t,-1,!1,e)};let o=YC(i,n.user.url||"",r);if(o!==null)return{result:je(n,t,o,!1,e)};let a=M4(n);if(i in a){let b=a[i];return{result:je(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:je(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Uo(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:je(n,t,-1,!1,e)};let c=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:f}=z4({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=b>=0,c=b,d=!!f}if(!u){if(t.filters){if(xA(t.filters,n))return{result:je(n,t,-1,!1,e)}}else if(t.namespace&&!qC(l,t.namespace))return{result:je(n,t,-1,!1,e)};if(t.include&&!WC(t.include))return{result:je(n,t,-1,!1,e)};if(t.condition&&!SA(t.condition,n))return{result:je(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let f of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let p=Zf(f.id,n);if(p.source==="cyclicPrerequisite")return{result:je(n,t,-1,!1,e)};let v={value:p.value};if(!Zr(v,f.condition||{}))return{result:je(n,t,-1,!1,e)}}}if(t.groups&&!H4(t.groups,n))return{result:je(n,t,-1,!1,e)}}if(t.url&&!I4(t.url,n))return{result:je(n,t,-1,!1,e)};let h=vc(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:je(n,t,-1,!1,e)};if(!u){let b=t.ranges||GC(r,t.coverage===void 0?1:t.coverage,t.weights);c=ZC(h,b)}if(d)return{result:je(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:je(n,t,-1,!1,e)};if("force"in t)return{result:je(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:je(n,t,-1,!1,e)};if(t.status==="stopped")return{result:je(n,t,-1,!1,e)};let m=je(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:f,doc:p}=F4(n,s,yc(l),{[ry(t.key,t.bucketVersion)]:m.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[f]=p,n.user.saveStickyBucketAssignmentDoc(p))}let S=bA(n,t,m);S.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:m});let _=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:m,trackingCall:_}}function Gr(t,e,n,i,r,o,a){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return o&&(s.experiment=o),a&&(s.experimentResult=a),i!=="override"&&N4(t,e,s),s}function _A(t){return{...t.user.attributes,...t.user.attributeOverrides}}function SA(t,e){return Zr(_A(e),t,e.global.savedGroups||{})}function xA(t,e){return t.some(n=>{let{hashValue:i}=Uo(e,n.attribute);if(!i)return!0;let r=vc(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(o=>Nf(r,o))})}function D4(t,e,n,i,r,o,a){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=Uo(t,n,i);if(!s)return!1;let l=vc(e,s,a||1);return l===null?!1:r?Nf(l,r):o!==void 0?l<=o:!0}function je(t,e,n,i,r,o,a){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=Uo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},d={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(d.name=u.name),o!==void 0&&(d.bucket=o),u.passthrough&&(d.passthrough=u.passthrough),d}function L4(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=Zv(t.url))),t}function Uo(t,e,n){let i=e||"id",r="",o=_A(t);return o[i]&&(r=o[i]),!r&&n&&(o[n]&&(r=o[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function I4(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function H4(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function z4({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:a}){n=n||0,o=o||0,i=i||"id",a=a||[];let s=ry(e,n),l=B4(t,i,r);if(o>0)for(let d=0;d<o;d++){let h=ry(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=a.findIndex(d=>d.key===c);return u<0?{variation:-1}:{variation:u}}function ry(t,e){return e=e||0,`${t}__${e}`}function oy(t,e){return`${t}||${e}`}function B4(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Uo(t,e),o=oy(i,yc(r)),{hashAttribute:a,hashValue:s}=Uo(t,n),l=s?oy(a,yc(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function F4(t,e,n,i){let r=oy(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...o,...i},s=JSON.stringify(o)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:s}}function $4(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(o=>{let a=i[o];if(a.rules)for(let s of a.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function wA(t,e,n){let i=ay(t,n);return e.getAllAssignments(i)}function ay(t,e){let n={};return $4(t,e).forEach(r=>{let{hashValue:o}=Uo(t,r);n[r]=yc(o)}),n}async function EA(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await $o(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await $o(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await $o(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function CA(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 Yf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var xs=typeof window<"u"&&typeof document<"u",U4=XC(),xc=class{constructor(e){if(e=e||{},this.version=U4,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),xs&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await EA(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,zf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&eA(e.cacheSettings),e.payload)return await this.setPayload(e.payload),zf(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return zf(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return CA(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return tA({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await $o(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await $o(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,nA(this),e.destroyAllStreams&&Qv(),this.logs=[],xs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=Gf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),o,a;r?o=je(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:a}=Gf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!n&&o.inExperiment&&i&&i.valueHash===s)return o;if(i&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Lf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?KC(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Df(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:d}=this._getNavigateFunction();if(u)if(xs)Promise.all([...a?[If(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,o)=>{i.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of n){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&Lf(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return Zf(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[Yf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Yf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(xs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Lf(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==i.protocol||o.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:xs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!xs)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(hA.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await wA(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=ay(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var V4="https://experiment.syntrologie.com",sy=class{constructor(e={}){P(this,"gb");P(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new xc({...e,apiHost:e.apiHost??V4,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let n of this.featureListeners)n()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function Wf(t={}){return new sy(t)}var AA="syntro_session_metrics",wc=class{constructor(e={}){P(this,"metrics",new Map);P(this,"experiments");P(this,"attributePrefix");P(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(AA);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(AA,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Xf(t={}){return new wc(t)}var g={};e_(g,{BRAND:()=>hL,DIRTY:()=>Vo,EMPTY_PATH:()=>Z4,INVALID:()=>W,NEVER:()=>QL,OK:()=>Ot,ParseStatus:()=>wt,Schema:()=>ae,ZodAny:()=>Xr,ZodArray:()=>Ki,ZodBigInt:()=>Po,ZodBoolean:()=>qo,ZodBranded:()=>Cc,ZodCatch:()=>na,ZodDate:()=>Zo,ZodDefault:()=>ta,ZodDiscriminatedUnion:()=>Jf,ZodEffects:()=>Ln,ZodEnum:()=>Jo,ZodError:()=>Yt,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>tp,ZodIntersection:()=>Xo,ZodIssueCode:()=>L,ZodLazy:()=>Ko,ZodLiteral:()=>Qo,ZodMap:()=>ks,ZodNaN:()=>Os,ZodNativeEnum:()=>ea,ZodNever:()=>Yn,ZodNull:()=>Yo,ZodNullable:()=>di,ZodNumber:()=>jo,ZodObject:()=>Wt,ZodOptional:()=>Nn,ZodParsedType:()=>j,ZodPipeline:()=>Ac,ZodPromise:()=>Kr,ZodReadonly:()=>ia,ZodRecord:()=>ep,ZodSchema:()=>ae,ZodSet:()=>Rs,ZodString:()=>Wr,ZodSymbol:()=>As,ZodTransformer:()=>Ln,ZodTuple:()=>ui,ZodType:()=>ae,ZodUndefined:()=>Go,ZodUnion:()=>Wo,ZodUnknown:()=>Xi,ZodVoid:()=>Ts,addIssueToContext:()=>F,any:()=>wL,array:()=>TL,bigint:()=>yL,boolean:()=>zA,coerce:()=>KL,custom:()=>LA,date:()=>bL,datetimeRegex:()=>NA,defaultErrorMap:()=>Yi,discriminatedUnion:()=>ML,effect:()=>jL,enum:()=>$L,function:()=>zL,getErrorMap:()=>ws,getParsedType:()=>ci,instanceof:()=>mL,intersection:()=>NL,isAborted:()=>Kf,isAsync:()=>Es,isDirty:()=>Qf,isValid:()=>Yr,late:()=>gL,lazy:()=>BL,literal:()=>FL,makeIssue:()=>Ec,map:()=>IL,nan:()=>vL,nativeEnum:()=>UL,never:()=>CL,null:()=>xL,nullable:()=>qL,number:()=>HA,object:()=>kL,objectUtil:()=>ly,oboolean:()=>XL,onumber:()=>WL,optional:()=>PL,ostring:()=>YL,pipeline:()=>GL,preprocess:()=>ZL,promise:()=>VL,quotelessJson:()=>j4,record:()=>LL,set:()=>HL,setErrorMap:()=>q4,strictObject:()=>RL,string:()=>IA,symbol:()=>_L,transformer:()=>jL,tuple:()=>DL,undefined:()=>SL,union:()=>OL,unknown:()=>EL,util:()=>ue,void:()=>AL});var ue;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},t.find=(r,o)=>{for(let a of r)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ue||(ue={}));var ly;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ly||(ly={}));var j=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ci=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.unknown}};var L=ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),j4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Yt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Yt.create=t=>new Yt(t);var P4=(t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===j.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case L.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},Yi=P4;var TA=Yi;function q4(t){TA=t}function ws(){return TA}var Ec=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},Z4=[];function F(t,e){let n=ws(),i=Ec({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Yi?void 0:Yi].filter(r=>!!r)});t.common.issues.push(i)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return W;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return W;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),Vo=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),Kf=t=>t.status==="aborted",Qf=t=>t.status==="dirty",Yr=t=>t.status==="valid",Es=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 Dn=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},kA=(t,e)=>{if(Yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Yt(t.common.issues);return this._error=n,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var ae=class{get description(){return this._def.description}_getType(e){return ci(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ci(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:ci(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Es(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)},r=this._parseSync({data:e,path:i.path,parent:i});return kA(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Yr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Yr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(Es(r)?r:Promise.resolve(r));return kA(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=e(r),s=()=>o.addIssue({code:L.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Ln({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Nn.create(this,this._def)}nullable(){return di.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ki.create(this)}promise(){return Kr.create(this,this._def)}or(e){return Wo.create([this,e],this._def)}and(e){return Xo.create(this,e,this._def)}transform(e){return new Ln({...oe(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ta({...oe(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new Cc({typeName:K.ZodBranded,type:this,...oe(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new na({...oe(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ac.create(this,e)}readonly(){return ia.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},G4=/^c[^\s-]{8,}$/i,Y4=/^[0-9a-z]+$/,W4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,X4=/^[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,K4=/^[a-z0-9_-]{21}$/i,Q4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J4=/^[-+]?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)?)??$/,eL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cy,nL=/^(?:(?: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])$/,iL=/^(?:(?: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])$/,rL=/^(([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]))$/,oL=/^(([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])$/,aL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OA="((\\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])))",lL=new RegExp(`^${OA}$`);function MA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function cL(t){return new RegExp(`^${MA(t)}$`)}function NA(t){let e=`${OA}T${MA(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function uL(t,e){return!!((e==="v4"||!e)&&nL.test(t)||(e==="v6"||!e)&&rL.test(t))}function dL(t,e){if(!Q4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function fL(t,e){return!!((e==="v4"||!e)&&iL.test(t)||(e==="v6"||!e)&&oL.test(t))}var Wr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.string,received:o.parsedType}),W}let i=new wt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?F(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&F(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")eL.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"email",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")cy||(cy=new RegExp(tL,"u")),cy.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"emoji",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")X4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"uuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")K4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"nanoid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")G4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Y4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cuid2",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")W4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"ulid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),F(r,{validation:"url",code:L.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"regex",code:L.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?NA(o).test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?lL.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?cL(o).test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?J4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"duration",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?uL(e.data,o.version)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"ip",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?dL(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"jwt",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?fL(e.data,o.version)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cidr",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?aL.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"base64",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?sL.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"base64url",code:L.invalid_string,message:o.message}),i.dirty()):ue.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:L.invalid_string,...Z.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Z.errToObj(n)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Wr.create=t=>new Wr({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...oe(t)});function pL(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}var jo=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.number,received:o.parsedType}),W}let i,r=new wt;for(let o of this._def.checks)o.kind==="int"?ue.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?pL(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_finite,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};jo.create=t=>new jo({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Po=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==j.bigint)return this._getInvalidInput(e);let i,r=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return F(n,{code:L.invalid_type,expected:j.bigint,received:n.parsedType}),W}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Po.create=t=>new Po({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var qo=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.boolean,received:i.parsedType}),W}return Ot(e.data)}};qo.create=t=>new qo({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Zo=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_date}),W}let i=new wt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ue.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Zo.create=t=>new Zo({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...oe(t)});var As=class extends ae{_parse(e){if(this._getType(e)!==j.symbol){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.symbol,received:i.parsedType}),W}return Ot(e.data)}};As.create=t=>new As({typeName:K.ZodSymbol,...oe(t)});var Go=class extends ae{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.undefined,received:i.parsedType}),W}return Ot(e.data)}};Go.create=t=>new Go({typeName:K.ZodUndefined,...oe(t)});var Yo=class extends ae{_parse(e){if(this._getType(e)!==j.null){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.null,received:i.parsedType}),W}return Ot(e.data)}};Yo.create=t=>new Yo({typeName:K.ZodNull,...oe(t)});var Xr=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Xr.create=t=>new Xr({typeName:K.ZodAny,...oe(t)});var Xi=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};Xi.create=t=>new Xi({typeName:K.ZodUnknown,...oe(t)});var Yn=class extends ae{_parse(e){let n=this._getOrReturnCtx(e);return F(n,{code:L.invalid_type,expected:j.never,received:n.parsedType}),W}};Yn.create=t=>new Yn({typeName:K.ZodNever,...oe(t)});var Ts=class extends ae{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.void,received:i.parsedType}),W}return Ot(e.data)}};Ts.create=t=>new Ts({typeName:K.ZodVoid,...oe(t)});var Ki=class t extends ae{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==j.array)return F(n,{code:L.invalid_type,expected:j.array,received:n.parsedType}),W;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(F(n,{code:a?L.too_big:L.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(F(n,{code:L.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(F(n,{code:L.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new Dn(n,a,n.path,s)))).then(a=>wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Dn(n,a,n.path,s)));return wt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};Ki.create=(t,e)=>new Ki({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...oe(e)});function Cs(t){if(t instanceof Wt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Nn.create(Cs(i))}return new Wt({...t._def,shape:()=>e})}else return t instanceof Ki?new Ki({...t._def,type:Cs(t.element)}):t instanceof Nn?Nn.create(Cs(t.unwrap())):t instanceof di?di.create(Cs(t.unwrap())):t instanceof ui?ui.create(t.items.map(e=>Cs(e))):t}var Wt=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==j.object){let c=this._getOrReturnCtx(e);return F(c,{code:L.invalid_type,expected:j.object,received:c.parsedType}),W}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Yn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=o[c],d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Dn(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Yn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(F(r,{code:L.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Dn(r,d,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(i,c)):wt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:Z.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ue.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ue.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return Cs(this)}partial(e){let n={};for(let i of ue.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ue.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Nn;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return DA(ue.objectKeys(this.shape))}};Wt.create=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.strictCreate=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strict",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});Wt.lazycreate=(t,e)=>new Wt({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:K.ZodObject,...oe(e)});var Wo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Yt(s.ctx.common.issues));return F(n,{code:L.invalid_union,unionErrors:a}),W}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Yt(l));return F(n,{code:L.invalid_union,unionErrors:s}),W}}get options(){return this._def.options}};Wo.create=(t,e)=>new Wo({options:t,typeName:K.ZodUnion,...oe(e)});var Wi=t=>t instanceof Ko?Wi(t.schema):t instanceof Ln?Wi(t.innerType()):t instanceof Qo?[t.value]:t instanceof Jo?t.options:t instanceof ea?ue.objectValues(t.enum):t instanceof ta?Wi(t._def.innerType):t instanceof Go?[void 0]:t instanceof Yo?[null]:t instanceof Nn?[void 0,...Wi(t.unwrap())]:t instanceof di?[null,...Wi(t.unwrap())]:t instanceof Cc||t instanceof ia?Wi(t.unwrap()):t instanceof na?Wi(t._def.innerType):[],Jf=class t extends ae{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.object)return F(n,{code:L.invalid_type,expected:j.object,received:n.parsedType}),W;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(F(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let a=Wi(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...oe(i)})}};function uy(t,e){let n=ci(t),i=ci(e);if(t===e)return{valid:!0,data:t};if(n===j.object&&i===j.object){let r=ue.objectKeys(e),o=ue.objectKeys(t).filter(s=>r.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=uy(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===j.array&&i===j.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=uy(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===j.date&&i===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Xo=class extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,a)=>{if(Kf(o)||Kf(a))return W;let s=uy(o.value,a.value);return s.valid?((Qf(o)||Qf(a))&&n.dirty(),{status:n.value,value:s.data}):(F(i,{code:L.invalid_intersection_types}),W)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Xo.create=(t,e,n)=>new Xo({left:t,right:e,typeName:K.ZodIntersection,...oe(n)});var ui=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.array)return F(i,{code:L.invalid_type,expected:j.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return F(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(F(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Dn(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>wt.mergeArray(n,a)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ui.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:t,typeName:K.ZodTuple,rest:null,...oe(e)})};var ep=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.object)return F(i,{code:L.invalid_type,expected:j.object,received:i.parsedType}),W;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Dn(i,s,i.path,s)),value:a._parse(new Dn(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?wt.mergeObjectAsync(n,r):wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ae?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...oe(i)}):new t({keyType:Wr.create(),valueType:e,typeName:K.ZodRecord,...oe(n)})}},ks=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.map)return F(i,{code:L.invalid_type,expected:j.map,received:i.parsedType}),W;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new Dn(i,s,i.path,[c,"key"])),value:o._parse(new Dn(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};ks.create=(t,e,n)=>new ks({valueType:e,keyType:t,typeName:K.ZodMap,...oe(n)});var Rs=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.set)return F(i,{code:L.invalid_type,expected:j.set,received:i.parsedType}),W;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(F(i,{code:L.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(F(i,{code:L.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return W;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>o._parse(new Dn(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Rs.create=(t,e)=>new Rs({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...oe(e)});var tp=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.function)return F(n,{code:L.invalid_type,expected:j.function,received:n.parsedType}),W;function i(s,l){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ws(),Yi].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function r(s,l){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ws(),Yi].filter(c=>!!c),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Kr){let s=this;return Ot(async function(...l){let c=new Yt([]),u=await s._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(i(l,m)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(r(d,m)),c})})}else{let s=this;return Ot(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new Yt([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Yt([r(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ui.create(e).rest(Xi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||ui.create([]).rest(Xi.create()),returns:n||Xi.create(),typeName:K.ZodFunction,...oe(i)})}},Ko=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ko.create=(t,e)=>new Ko({getter:t,typeName:K.ZodLazy,...oe(e)});var Qo=class extends ae{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return F(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Qo.create=(t,e)=>new Qo({value:t,typeName:K.ZodLiteral,...oe(e)});function DA(t,e){return new Jo({values:t,typeName:K.ZodEnum,...oe(e)})}var Jo=class t extends ae{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return F(n,{expected:ue.joinValues(i),received:n.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return F(n,{received:n.data,code:L.invalid_enum_value,options:i}),W}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Jo.create=DA;var ea=class extends ae{_parse(e){let n=ue.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==j.string&&i.parsedType!==j.number){let r=ue.objectValues(n);return F(i,{expected:ue.joinValues(r),received:i.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ue.objectValues(n);return F(i,{received:i.data,code:L.invalid_enum_value,options:r}),W}return Ot(e.data)}get enum(){return this._def.values}};ea.create=(t,e)=>new ea({values:t,typeName:K.ZodNativeEnum,...oe(e)});var Kr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.promise&&n.common.async===!1)return F(n,{code:L.invalid_type,expected:j.promise,received:n.parsedType}),W;let i=n.parsedType===j.promise?n.data:Promise.resolve(n.data);return Ot(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Kr.create=(t,e)=>new Kr({type:t,typeName:K.ZodPromise,...oe(e)});var Ln=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{F(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return W;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"?Vo(l.value):n.value==="dirty"?Vo(l.value):l});{if(n.value==="aborted")return W;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?W:s.status==="dirty"?Vo(s.value):n.value==="dirty"?Vo(s.value):s}}if(r.type==="refinement"){let a=s=>{let l=r.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Yr(a))return W;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Yr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):W);ue.assertNever(r)}};Ln.create=(t,e,n)=>new Ln({schema:t,typeName:K.ZodEffects,effect:e,...oe(n)});Ln.createWithPreprocess=(t,e,n)=>new Ln({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...oe(n)});var Nn=class extends ae{_parse(e){return this._getType(e)===j.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Nn.create=(t,e)=>new Nn({innerType:t,typeName:K.ZodOptional,...oe(e)});var di=class extends ae{_parse(e){return this._getType(e)===j.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};di.create=(t,e)=>new di({innerType:t,typeName:K.ZodNullable,...oe(e)});var ta=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===j.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ta.create=(t,e)=>new ta({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var na=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Es(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};na.create=(t,e)=>new na({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var Os=class extends ae{_parse(e){if(this._getType(e)!==j.nan){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};Os.create=t=>new Os({typeName:K.ZodNaN,...oe(t)});var hL=Symbol("zod_brand"),Cc=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Ac=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?W:o.status==="dirty"?(n.dirty(),Vo(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?W:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},ia=class extends ae{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Yr(r)&&(r.value=Object.freeze(r.value)),r);return Es(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};ia.create=(t,e)=>new ia({innerType:t,typeName:K.ZodReadonly,...oe(e)});function RA(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function LA(t,e={},n){return t?Xr.create().superRefine((i,r)=>{let o=t(i);if(o instanceof Promise)return o.then(a=>{if(!a){let s=RA(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=RA(e,i),s=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:s})}}):Xr.create()}var gL={object:Wt.lazycreate},K;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(K||(K={}));var mL=(t,e={message:`Input not instance of ${t.name}`})=>LA(n=>n instanceof t,e),IA=Wr.create,HA=jo.create,vL=Os.create,yL=Po.create,zA=qo.create,bL=Zo.create,_L=As.create,SL=Go.create,xL=Yo.create,wL=Xr.create,EL=Xi.create,CL=Yn.create,AL=Ts.create,TL=Ki.create,kL=Wt.create,RL=Wt.strictCreate,OL=Wo.create,ML=Jf.create,NL=Xo.create,DL=ui.create,LL=ep.create,IL=ks.create,HL=Rs.create,zL=tp.create,BL=Ko.create,FL=Qo.create,$L=Jo.create,UL=ea.create,VL=Kr.create,jL=Ln.create,PL=Nn.create,qL=di.create,ZL=Ln.createWithPreprocess,GL=Ac.create,YL=()=>IA().optional(),WL=()=>HA().optional(),XL=()=>zA().optional(),KL={string:(t=>Wr.create({...t,coerce:!0})),number:(t=>jo.create({...t,coerce:!0})),boolean:(t=>qo.create({...t,coerce:!0})),bigint:(t=>Po.create({...t,coerce:!0})),date:(t=>Zo.create({...t,coerce:!0}))};var QL=W;var dy=g.union([g.object({type:g.literal("data"),key:g.string(),value:g.string().optional()}),g.object({type:g.literal("css"),value:g.string()}),g.object({type:g.literal("aria"),role:g.string().optional(),label:g.string().optional()}),g.object({type:g.literal("shadow-css"),value:g.string()}),g.object({type:g.literal("ref"),el:g.any()})]),BA=g.object({kind:g.literal("tooltip"),id:g.string(),anchor:dy,content:g.object({title:g.string().optional(),body:g.string()}),placement:g.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:g.number().optional(),blocking:g.boolean().optional(),trigger:g.enum(["immediate","hover","click"]).optional(),dismiss:g.object({onEsc:g.boolean().optional(),closeButton:g.boolean().optional(),timeoutMs:g.number().optional()}).optional()}),FA=g.object({kind:g.literal("highlight"),id:g.string(),anchor:dy,copy:g.string().optional(),ring:g.object({paddingPx:g.number().optional(),radiusPx:g.number().optional()}).optional(),scrim:g.object({opacity:g.number().optional()}).optional(),ringColor:g.string().optional(),blocking:g.boolean().optional(),dismiss:g.object({onClickOutside:g.boolean().optional(),onEsc:g.boolean().optional(),timeoutMs:g.number().optional()}).optional()}),np=g.object({id:g.string(),version:g.number(),routes:g.array(g.string()).optional(),steps:g.array(g.union([BA,FA]))});function JL(t){return np.parse(t)}var e3=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=vf({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:i});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let a=await o.json();return np.parse(a)};var ip=X(Qe(),1),$A=X(nl(),1);function t3({element:t,children:e}){let[n,i]=(0,ip.useState)(null);return(0,ip.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,$A.createPortal)(e,n):null}function n3(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var fy=class{constructor(){P(this,"sessionId");this.sessionId=n3(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function rp(){return new fy}var O=typeof window<"u"?window:void 0,Ct=typeof globalThis<"u"?globalThis:O;typeof self>"u"&&(Ct.self=Ct),typeof File>"u"&&(Ct.File=function(){});var HT=Array.prototype,UA=HT.forEach,VA=HT.indexOf,hn=Ct?.navigator,U=Ct?.document,Kt=Ct?.location,ky=Ct?.fetch,Ry=Ct!=null&&Ct.XMLHttpRequest&&"withCredentials"in new Ct.XMLHttpRequest?Ct.XMLHttpRequest:void 0,jA=Ct?.AbortController,Xt=hn?.userAgent,ee=O??{},Ji={DEBUG:!1,LIB_VERSION:"1.302.2"};function PA(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function qA(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(l){PA(o,i,r,a,s,"next",l)}function s(l){PA(o,i,r,a,s,"throw",l)}a(void 0)}))}}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},q.apply(null,arguments)}function zT(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var i3=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ZA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return i3.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},r3=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function de(t,e){return t.indexOf(e)!==-1}var Hp=function(t){return t.trim()},Oy=function(t){return t.replace(/^\$/,"")},o3=Array.isArray,BT=Object.prototype,FT=BT.hasOwnProperty,zp=BT.toString,Re=o3||function(t){return zp.call(t)==="[object Array]"},io=t=>typeof t=="function",pt=t=>t===Object(t)&&!Re(t),Ls=t=>{if(pt(t)){for(var e in t)if(FT.call(t,e))return!1;return!0}return!1},$=t=>t===void 0,lt=t=>zp.call(t)=="[object String]",My=t=>lt(t)&&t.trim().length===0,ir=t=>t===null,Ce=t=>$(t)||ir(t),gi=t=>zp.call(t)=="[object Number]",ro=t=>zp.call(t)==="[object Boolean]",a3=t=>t instanceof FormData,s3=t=>de(r3,t);function Ny(t){return t===null||typeof t!="object"}function gp(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function $T(t){return!$(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var l3=[!0,"true",1,"1","yes"],py=t=>de(l3,t),c3=[!1,"false",0,"0","no"];function fi(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),gi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),fi(r||n,e,n,i))}var Dy=class{constructor(e){this.t={},this.i=e.i,this.o=fi(e.bucketSize,0,100,e.h),this.m=fi(e.refillRate,0,this.o,e.h),this.S=fi(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,i):(o={tokens:this.o,lastAccess:i},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},op,GA,hy,u3=t=>t instanceof Error;function d3(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return hy&&n.length===GA||(GA=n.length,hy=n.reduce(((i,r)=>{op||(op={});var o=op[r];if(o)i[o[0]]=o[1];else for(var a=t(r),s=a.length-1;s>=0;s--){var l=a[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,op[r]=[c,u];break}}return i}),{})),hy}}var Ly=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(),a=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return qA((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Re(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),q({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return qA((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,o,a={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,q({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:d3(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(o,a)=>{if(a<=4){var s=this.buildCoercingContext(e,n,a);return this.applyCoercers(o,s)}};return q({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:o=>r(o,i),next:o=>r(o,i+1)})}},Bs="?";function Iy(t,e,n,i,r){var o={platform:t,filename:e,function:n==="<anonymous>"?Bs:n,in_app:!0};return $(i)||(o.lineno=i),$(r)||(o.colno=r),o}var UT=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Bs,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},f3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,p3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h3=/\((\S*)(?::(\d+))(?::(\d+))\)/,g3=(t,e)=>{var n=f3.exec(t);if(n){var[,i,r,o]=n;return Iy(e,i,Bs,+r,+o)}var a=p3.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var s=h3.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[l,c]=UT(a[1]||Bs,a[2]);return Iy(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},m3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,v3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y3=(t,e)=>{var n=m3.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=v3.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],o=n[1]||Bs;return[o,r]=UT(o,r),Iy(e,r,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},YA=/\(error: (.*)\)/,WA=50;function b3(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
|
|
441
|
-
`),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=YA.test(c)?c.replace(YA,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var h=d(u,t);if(h){a.push(h);break}}if(a.length>=WA)break}}}return(function(m){if(!m.length)return[];var S=Array.from(m);return S.reverse(),S.slice(0,WA).map((_=>{return q({},_,{filename:_.filename||(b=S,b[b.length-1]||{}).filename,function:_.function||Bs});var b}))})(a)}}var Hy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return gp(e,"DOMException")}isDOMError(e){return gp(e,"DOMError")}},zy=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},By=class{constructor(){}match(e){return gp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},_3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Fy=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(_3);return r&&(n=r[1],i=r[2]),[n,i]}},S3=["fatal","error","warning","log","info","debug"];function VT(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var $y=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return $T(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+VT(e)}isSeverityLevel(e){return lt(e)&&!My(e)&&S3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(u3(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Uy=class{match(e){return $T(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+VT(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Vy=class{match(e){return Ny(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},jy=class{match(e){return gp(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return Ny(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(Ny(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}},jT=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(O&&(Ji.DEBUG||ee.POSTHOG_DEBUG||n)&&!$(O.console)&&O.console){for(var o=("__rrweb_original__"in O.console[r])?O.console[r].__rrweb_original__:O.console[r],a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];console.error(t,...o)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>jT(t+" "+r,o)};return i},V=jT("[PostHog.js]"),ct=V.createLogger,x3=ct("[ExternalScriptsLoader]"),XA=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return x3.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=U?.querySelectorAll("script");if(i){for(var r,o=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},a=0;a<i.length;a++)if(r=o())return r.v}var s=()=>{if(!U)return n("document not found");var l=U.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=U.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):U.body.appendChild(l)};U!=null&&U.body?s():U?.addEventListener("DOMContentLoaded",s)};ee.__PosthogExtensions__=ee.__PosthogExtensions__||{},ee.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",i);XA(t,o,n)},ee.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);XA(t,i,n)};var mp={};function oo(t,e,n){if(Re(t)){if(UA&&t.forEach===UA)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===mp)return}}}function Me(t,e,n){if(!Ce(t)){if(Re(t))return oo(t,e,n);if(a3(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===mp)return}else for(var r in t)if(FT.call(t,r)&&e.call(n,t[r],r)===mp)return}}var Xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return oo(n,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Us=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return oo(n,(function(r){oo(r,(function(o){t.push(o)}))})),t};function fp(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var KA=function(t){try{return t()}catch{return}},w3=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){V.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),V.critical(r)}}},Bb=function(t){var e={};return Me(t,(function(n,i){(lt(n)&&n.length>0||gi(n))&&(e[i]=n)})),e};function E3(t,e){return n=t,i=o=>lt(o)&&!ir(e)?o.slice(0,e):o,r=new Set,(function o(a,s){return a!==Object(a)?i?i(a,s):a:r.has(a)?void 0:(r.add(a),Re(a)?(l=[],oo(a,(c=>{l.push(o(c))}))):(l={},Me(a,((c,u)=>{r.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,i,r}var C3=["herokuapp.com","vercel.app","netlify.app"];function A3(t){var e=t?.hostname;if(!lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of C3)if(n===i)return!1;return!0}function PT(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function it(t,e,n,i){var{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}var qT="$people_distinct_id",Hc="__alias",zc="__timers",QA="$autocapture_disabled_server_side",Py="$heatmaps_enabled_server_side",JA="$exception_capture_enabled_server_side",qy="$error_tracking_suppression_rules",eT="$error_tracking_capture_extension_exceptions",tT="$web_vitals_enabled_server_side",ZT="$dead_clicks_enabled_server_side",nT="$web_vitals_allowed_metrics",gy="$session_recording_remote_config",vp="$sesid",GT="$session_is_sampled",Is="$enabled_feature_flags",Bc="$early_access_features",Zy="$feature_flag_details",Fc="$stored_person_properties",aa="$stored_group_properties",Gy="$surveys",ap="$surveys_activated",yp="$flag_call_reported",er="$user_state",Yy="$client_session_props",Wy="$capture_rate_limit",Xy="$initial_campaign_params",Ky="$initial_referrer_info",bp="$initial_person_info",_p="$epp",YT="__POSTHOG_TOOLBAR__",Tc="$posthog_cookieless",T3=[qT,Hc,"__cmpns",zc,"$session_recording_enabled_server_side",Py,vp,Is,qy,er,Bc,Zy,aa,Fc,Gy,yp,Yy,Wy,Xy,Ky,_p,bp];function iT(t){return t instanceof Element&&(t.id===YT||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Bp(t){return!!t&&t.nodeType===1}function ao(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function WT(t){return!!t&&t.nodeType===3}function XT(t){return!!t&&t.nodeType===11}function Fb(t){return t?Hp(t).split(/\s+/):[]}function rT(t){var e=O?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Sp(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 Fb(e)}function KT(t){return Ce(t)?null:Hp(t).split(/(\s+)/).filter((e=>Zc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Qc(t){var e="";return Qy(t)&&!nk(t)&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;WT(n)&&n.textContent&&(e+=(i=KT(n.textContent))!==null&&i!==void 0?i:"")})),Hp(e)}function QT(t){return $(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var $b=["a","button","form","input","select","textarea","label"];function JT(t,e){if($(e))return!0;var n,i=function(o){if(e.some((a=>o.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function ek(t){var e=t.parentNode;return!(!e||!Bp(e))&&e}var k3=["next","previous","prev",">","<"],oT=10,aT=[".ph-no-rageclick",".ph-no-capture"];function R3(t,e){if(!O||Ub(t))return!1;var n,i,r;if(ro(e)?(n=!!e&&aT,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:aT,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=tk(t,!1);return!(function(a,s){if(a===!1||$(a))return!1;var l;if(a===!0)l=k3;else{if(!Re(a))return!1;if(a.length>oT)return V.error("[PostHog] content_ignorelist array cannot exceed "+oT+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((h=>u.includes(h)||d.includes(h)))}))})(i,o.map((a=>{var s;return{safeText:Qc(a).toLowerCase(),ariaLabel:((s=a.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!JT(o,n)}var Ub=t=>!t||ao(t,"html")||!Bp(t),tk=(t,e)=>{if(!O||Ub(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!ao(r,"body");)if(XT(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var o=ek(r);if(!o)break;if(e||$b.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var a=O.getComputedStyle(o);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function O3(t,e,n,i,r){var o,a,s,l;if(n===void 0&&(n=void 0),!O||Ub(t)||(o=n)!=null&&o.url_allowlist&&!rT(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&rT(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=tk(t,i);if(!(function(S,_){var b=_?.element_allowlist;if($(b))return!0;var f,p=function(y){if(b.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var v of S)if(f=p(v))return f.v;return!1})(d,n)||!JT(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=O.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(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&($b.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function Qy(t){for(var e=t;e.parentNode&&!ao(e,"body");e=e.parentNode){var n=Sp(e);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(Sp(t),"ph-include"))return!0;var i=t.type||"";if(lt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(lt(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function nk(t){return!!(ao(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ao(t,"select")||ao(t,"textarea")||t.getAttribute("contenteditable")==="true")}var ik="(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})",M3=new RegExp("^(?:"+ik+")$"),N3=new RegExp(ik),rk="\\d{3}-?\\d{2}-?\\d{4}",D3=new RegExp("^("+rk+")$"),L3=new RegExp("("+rk+")");function Zc(t,e){return e===void 0&&(e=!0),!(Ce(t)||lt(t)&&(t=Hp(t),(e?M3:N3).test((t||"").replace(/[- ]/g,""))||(e?D3:L3).test(t)))}function ok(t){var e=Qc(t);return Zc(e=(e+" "+ak(t)).trim())?e:""}function ak(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Qc(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+ak(n)).trim())}catch(o){V.error("[AutoCapture]",o)}})),e}function I3(t){return(function(e){var n=e.map((i=>{var r,o,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))a+="."+s.replace(/"/g,"");var l=q({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=i.nth_of_type)!==null&&o!==void 0?o:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return fp(l).sort(((u,d)=>{var[h]=u,[m]=d;return h.localeCompare(m)})).forEach((u=>{var[d,h]=u;return c[sT(d.toString())]=sT(h.toString())})),a+=":",a+=fp(c).map((u=>{var[d,h]=u;return d+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,o={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:H3(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return fp(n).filter((a=>{var[s]=a;return s.indexOf("attr__")===0})).forEach((a=>{var[s,l]=a;return o.attributes[s]=l})),o}))})(t))}function sT(t){return t.replace(/"|\\"/g,'\\"')}function H3(t){var e=t.attr__class;return e?Re(e)?e:Fb(e):void 0}var xp=class{constructor(e){this.disabled=e===!1;var n=pt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},my="$copy_autocapture",nr=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var wp=t=>{var e=U?.createElement("a");return $(e)?null:(e.href=t,e)},z3=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Me(t,(function(o,a){$(o)||$(a)||a==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},Ep=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===e){n=o;break}}if(!Re(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{V.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Jc=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",o=i[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");Re(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var m=l;return s!=null&&(m+="?"+u.join("&")),o!=null&&(m+="#"+o),m},Cp=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},lT=ct("[AutoCapture]");function vy(t,e){return e.length>t?e.slice(0,t)+"...":e}function B3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Bp(e));return e}function F3(t,e,n,i){var r=t.tagName.toLowerCase(),o={tag_name:r};$b.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=vy(1024,ok(t)):o.$el_text=vy(1024,Qc(t)));var a=Sp(t);a.length>0&&(o.classes=a.filter((function(u){return u!==""}))),Me(t.attributes,(function(u){var d;if((!nk(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&Zc(u.value)&&(d=u.name,!lt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=Fb(h).join(" ")),o["attr__"+u.name]=vy(1024,h)}}));for(var s=1,l=1,c=t;c=B3(c);)s++,c.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function $3(t,e){for(var n,i,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!ao(u,"body");)XT(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],m={},S=!1,_=!1;if(Me(c,(y=>{var w=Qy(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=w&&S&&Zc(S)&&S),de(Sp(y),"ph-no-capture")&&(_=!0),h.push(F3(y,o,a,s));var A=(function(x){if(!Qy(x))return{};var T={};return Me(x.attributes,(function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var E=k.name.replace("data-ph-capture-attribute-",""),R=k.value;E&&R&&Zc(R)&&(T[E]=R)}})),T})(y);Xe(m,A)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=ok(t):h[0].$el_text=Qc(t)),S){var b,f;h[0].attr__href=S;var p=(b=wp(S))==null?void 0:b.host,v=O==null||(f=O.location)==null?void 0:f.host;p&&v&&p!==v&&(d=S)}return{props:Xe({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:I3(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},m)}}var Jy=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new xp(e.config.rageclick),this.I=null}get F(){var e,n,i=pt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(O&&U){var e=i=>{i=i||O?.event;try{this.M(i)}catch(r){lT.error("Failed to capture event",r)}};if(it(U,"submit",e,{capture:!0}),it(U,"change",e,{capture:!0}),it(U,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||O?.event,this.M(i,my)};it(U,"copy",n,{capture:!0}),it(U,"cut",n,{capture:!0})}}}else lT.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({[QA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var o=U?.querySelectorAll(r);o?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[QA],r=this.T;if(ir(r)&&!ro(i)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=QT(e);WT(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&R3(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===my;if(r&&O3(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=$3(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===my){var c,u=KT(O==null||(c=O.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return io(U?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return gi(t)&&isFinite(t)&&Math.floor(t)===t});var cT="0123456789abcdef",eb=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+cT.charAt(this.bytes[n]>>>4)+cT.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},tb=class{constructor(){this.A=0,this.D=0,this.j=new nb}generate(){var e=this.generateOrAbort();if($(e)){this.A=0;var n=this.generateOrAbort();if($(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return eb.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())}},uT,sk=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};O&&!$(O.crypto)&&crypto.getRandomValues&&(sk=t=>crypto.getRandomValues(t));var nb=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(sk(this.N),this.U=0),this.N[this.U++]}},no=()=>U3().toString(),U3=()=>(uT||(uT=new tb)).generate(),kc="",V3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function j3(t,e){if(e){var n=(function(r,o){if(o===void 0&&(o=U),kc)return kc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+no();!kc&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",kc=c)}return kc})(t);if(!n){var i=(r=>{var o=r.match(V3);return o?o[0]:""})(t);i!==n&&V.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var hi={H:()=>!!U,B:function(t){V.error("cookieStore error: "+t)},q:function(t){if(U){try{for(var e=t+"=",n=U.cookie.split(";").filter((o=>o.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(hi.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(U)try{var o="",a="",s=j3(U.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&V.warn("cookieStore warning: large cookie, len="+c.length),U.cookie=c,c}catch{return}},V:function(t,e){if(U!=null&&U.cookie)try{hi.G(t,"",-1,e)}catch{return}}},yy=null,qe={H:function(){if(!ir(yy))return yy;var t=!0;if($(O))t=!1;else try{var e="__mplssupport__";qe.G(e,"xyz"),qe.q(e)!=='"xyz"'&&(t=!1),qe.V(e)}catch{t=!1}return t||V.error("localStorage unsupported; falling back to cookie store"),yy=t,t},B:function(t){V.error("localStorage error: "+t)},q:function(t){try{return O?.localStorage.getItem(t)}catch(e){qe.B(e)}return null},W:function(t){try{return JSON.parse(qe.q(t))||{}}catch{}return null},G:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(n){qe.B(n)}},V:function(t){try{O?.localStorage.removeItem(t)}catch(e){qe.B(e)}}},P3=["distinct_id",vp,GT,_p,bp],sp=q({},qe,{W:function(t){try{var e={};try{e=hi.W(t)||{}}catch{}var n=Xe(e,JSON.parse(qe.q(t)||"{}"));return qe.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,o){try{qe.G(t,e,void 0,void 0,o);var a={};P3.forEach((s=>{e[s]&&(a[s]=e[s])})),Object.keys(a).length&&hi.G(t,a,n,i,r,o)}catch(s){qe.B(s)}},V:function(t,e){try{O?.localStorage.removeItem(t),hi.V(t,e)}catch(n){qe.B(n)}}}),lp={},q3={H:function(){return!0},B:function(t){V.error("memoryStorage error: "+t)},q:function(t){return lp[t]||null},W:function(t){return lp[t]||null},G:function(t,e){lp[t]=e},V:function(t){delete lp[t]}},ra=null,Et={H:function(){if(!ir(ra))return ra;if(ra=!0,$(O))ra=!1;else try{var t="__support__";Et.G(t,"xyz"),Et.q(t)!=='"xyz"'&&(ra=!1),Et.V(t)}catch{ra=!1}return ra},B:function(t){V.error("sessionStorage error: ",t)},q:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){Et.B(e)}return null},W:function(t){try{return JSON.parse(Et.q(t))||null}catch{}return null},G:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Et.B(n)}},V:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){Et.B(e)}}},tr=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),ib=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?tr.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===tr.DENIED||this.consent===tr.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===tr.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return py(e)?tr.GRANTED:de(c3,e)?tr.DENIED:tr.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?qe:hi;var n=e==="localStorage"?hi:qe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(py(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!PT([hn?.doNotTrack,hn?.msDoNotTrack,ee.doNotTrack],(e=>py(e)))}},cp=ct("[Dead Clicks]"),Z3=()=>!0,G3=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(ZT)),i=t.instance.config.capture_dead_clicks;return ro(i)?i:!!pt(i)||n},Ap=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[ZT]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?cp.error("failed to load script",r):e()}))}et(){var e;if(U){if(!this.tt&&(e=ee.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=pt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=ee.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(U),cp.info("starting...")}}else cp.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,cp.info("stopping..."))}},Rc=ct("[ExceptionAutocapture]"),rb=class{constructor(e){var n,i,r;this.rt=()=>{var o;if(O&&this.isEnabled&&(o=ee.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=ee.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=ee.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ee.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){Rc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[JA]),this.F=this.ht(),this.vt=new Dy({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:Rc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return pt(e)?n=q({},n,e):($(e)?this.ut:e)&&(n=q({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Rc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Rc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[JA]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?Rc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function dT(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return io(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var ob=class{constructor(e){var n;this._instance=e,this.dt=(O==null||(n=O.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(O&&O.history){var i=this;(e=O.history.pushState)!=null&&e.__posthog_wrapped__||dT(O.history,"pushState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("pushState")})),(n=O.history.replaceState)!=null&&n.__posthog_wrapped__||dT(O.history,"replaceState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=O==null||(n=O.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){V.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};it(O,"popstate",e),this.ct=()=>{O&&O.removeEventListener("popstate",e)}}}},by=ct("[SegmentIntegration]");function Y3(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var o=i.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||no();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(er,"identified")),r()},s=o.user();"then"in s&&io(s.then)?s.then((l=>a(l))):a(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||by.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===i.get_distinct_id()||(by.info("No userId set, resetting PostHog"),i.reset()),o.event.userId&&o.event.userId!==i.get_distinct_id()&&(by.info("UserId set, identifying with PostHog"),i.identify(o.event.userId));var s=i.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var lk="posthog-js";function ck(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return s=>{var l,c,u,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var 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)||[],_=S.map((f=>q({},f,{stacktrace:f.stacktrace?q({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((p=>q({},p,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=S[0])==null?void 0:c.value)||s.message,$exception_type:(u=S[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:_,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(h=S[0])==null?void 0:h.type,$sentry_tags:s.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),a&&t.exceptions.sendExceptionEvent(b),s}}var ab=class{constructor(e,n,i,r,o,a){this.name=lk,this.setupOnce=function(s){s(ck(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:a==null||a}))}}},W3=O!=null&&O.location?Cp(O.location.hash,"__posthog")||Cp(location.hash,"state"):null,fT="_postHogToolbarParams",pT=ct("[Toolbar]"),to=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(to||{}),sb=class{constructor(e){this.instance=e}_t(e){ee.ph_toolbar_state=e}yt(){var e;return(e=ee.ph_toolbar_state)!==null&&e!==void 0?e:to.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!O||!U)return!1;e=e??O.location,i=i??O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var r,o=W3||Cp(e.hash,"__posthog")||Cp(e.hash,"state"),a=o?KA((()=>JSON.parse(atob(decodeURIComponent(o)))))||KA((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(fT)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=ee.ph_load_toolbar||ee.ph_load_editor;!Ce(n)&&io(n)?n(e,this.instance):pT.warn("No toolbar load function found")}loadToolbar(e){var n=!(U==null||!U.getElementById(YT));if(!O||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=q({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(O.localStorage.setItem(fT,JSON.stringify(q({},r,{source:void 0}))),this.yt()===to.LOADED)this.bt(r);else if(this.yt()===to.UNINITIALIZED){var o;this._t(to.LOADING),(o=ee.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return pT.error("[Toolbar] Failed to load",a),void this._t(to.UNINITIALIZED);this._t(to.LOADED),this.bt(r)})),it(O,"turbolinks:load",(()=>{this._t(to.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},X3=ct("[TracingHeaders]"),lb=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;$(this.xt)&&((n=ee.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$(this.St)&&((i=ee.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return X3.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},In="Mobile",Tp="iOS",pi="Android",Gc="Tablet",uk=pi+" "+Gc,dk="iPad",fk="Apple",pk=fk+" Watch",Yc="Safari",Fs="BlackBerry",hk="Samsung",gk=hk+"Browser",mk=hk+" Internet",sa="Chrome",K3=sa+" OS",vk=sa+" "+Tp,Vb="Internet Explorer",yk=Vb+" "+In,jb="Opera",Q3=jb+" Mini",Pb="Edge",bk="Microsoft "+Pb,Hs="Firefox",_k=Hs+" "+Tp,Wc="Nintendo",Xc="PlayStation",zs="Xbox",Sk=pi+" "+In,xk=In+" "+Yc,$c="Windows",cb=$c+" Phone",hT="Nokia",ub="Ouya",wk="Generic",J3=wk+" "+In.toLowerCase(),Ek=wk+" "+Gc.toLowerCase(),db="Konqueror",Ht="(\\d+(\\.\\d+)?)",_y=new RegExp("Version/"+Ht),e5=new RegExp(zs,"i"),t5=new RegExp(Xc+" \\w+","i"),n5=new RegExp(Wc+" \\w+","i"),qb=new RegExp(Fs+"|PlayBook|BB10","i"),i5={"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"},r5=(t,e)=>e&&de(e,fk)||(function(n){return de(n,Yc)&&!de(n,sa)&&!de(n,pi)})(t),Ck=function(t,e){return e=e||"",de(t," OPR/")&&de(t,"Mini")?Q3:de(t," OPR/")?jb:qb.test(t)?Fs:de(t,"IE"+In)||de(t,"WPDesktop")?yk:de(t,gk)?mk:de(t,Pb)||de(t,"Edg/")?bk:de(t,"FBIOS")?"Facebook "+In:de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?vk:de(t,"CrMo")||de(t,sa)?sa:de(t,pi)&&de(t,Yc)?Sk:de(t,"FxiOS")?_k:de(t.toLowerCase(),db.toLowerCase())?db:r5(t,e)?de(t,In)?xk:Yc:de(t,Hs)?Hs:de(t,"MSIE")||de(t,"Trident/")?Vb:de(t,"Gecko")?Hs:""},o5={[yk]:[new RegExp("rv:"+Ht)],[bk]:[new RegExp(Pb+"?\\/"+Ht)],[sa]:[new RegExp("("+sa+"|CrMo)\\/"+Ht)],[vk]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Yc]:[_y],[xk]:[_y],[jb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Hs]:[new RegExp(Hs+"\\/"+Ht)],[_k]:[new RegExp("FxiOS\\/"+Ht)],[db]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Fs]:[new RegExp(Fs+" "+Ht),_y],[Sk]:[new RegExp("android\\s"+Ht,"i")],[mk]:[new RegExp(gk+"\\/"+Ht)],[Vb]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},a5=function(t,e){var n=Ck(t,e),i=o5[n];if($(i))return null;for(var r=0;r<i.length;r++){var o=i[r],a=t.match(o);if(a)return parseFloat(a[a.length-2])}return null},gT=[[new RegExp(zs+"; "+zs+" (.*?)[);]","i"),t=>[zs,t&&t[1]||""]],[new RegExp(Wc,"i"),[Wc,""]],[new RegExp(Xc,"i"),[Xc,""]],[qb,[Fs,""]],[new RegExp($c,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[cb,""];if(new RegExp(In).test(e)&&!/IEMobile\b/.test(e))return[$c+" "+In,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=i5[i]||"";return/arm/i.test(e)&&(r="RT"),[$c,r]}return[$c,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Tp,e.join(".")]}return[Tp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=$(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+pi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[pi,e.join(".")]}return[pi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[K3,""]],[/Linux|debian/i,["Linux",""]]],mT=function(t){return n5.test(t)?Wc:t5.test(t)?Xc:e5.test(t)?zs:new RegExp(ub,"i").test(t)?ub:new RegExp("("+cb+"|WPDesktop)","i").test(t)?cb:/iPad/.test(t)?dk:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?pk:qb.test(t)?Fs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(hT,"i").test(t)?hT:/(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(In).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)?pi:uk:pi:new RegExp("(pda|"+In+")","i").test(t)?J3:new RegExp(Gc,"i").test(t)&&!new RegExp(Gc+" pc","i").test(t)?Ek:""},up="https?://(.*)",Vs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],s5=Us(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Vs),eu="<masked>",l5=["li_fat_id"];function Ak(t,e,n){if(!U)return{};var i,r=e?Us([],Vs,n||[]):[],o=Tk(Jc(U.URL,r,eu),t),a=(i={},Me(l5,(function(s){var l=hi.q(s);i[s]=l||null})),i);return Xe(a,o)}function Tk(t,e){var n=s5.concat(e||[]),i={};return Me(n,(function(r){var o=Ep(t,r);i[r]=o||null})),i}function kk(t){var e=(function(o){return o?o.search(up+"google.([^/?]*)")===0?"google":o.search(up+"bing.com")===0?"bing":o.search(up+"yahoo.com")===0?"yahoo":o.search(up+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!ir(e)){i.$search_engine=e;var r=U?Ep(U.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function vT(){return navigator.language||navigator.userLanguage}function Rk(){return U?.referrer||"$direct"}function Ok(t,e){var n=t?Us([],Vs,e||[]):[],i=Kt?.href.substring(0,1e3);return{r:Rk().substring(0,1e3),u:i?Jc(i,n,eu):void 0}}function Mk(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=wp(n))==null?void 0:e.host};if(i){r.$current_url=i;var o=wp(i);r.$host=o?.host,r.$pathname=o?.pathname;var a=Tk(i);Xe(r,a)}if(n){var s=kk(n);Xe(r,s)}return r}function Nk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function c5(){try{return new Date().getTimezoneOffset()}catch{return}}function u5(t,e){if(!Xt)return{};var n,i,r,o=t?Us([],Vs,e||[]):[],[a,s]=(function(l){for(var c=0;c<gT.length;c++){var[u,d]=gT[c],h=u.exec(l),m=h&&(io(d)?d(h,l):d);if(m)return m}return["",""]})(Xt);return Xe(Bb({$os:a,$os_version:s,$browser:Ck(Xt,navigator.vendor),$device:mT(Xt),$device_type:(i=Xt,r=mT(i),r===dk||r===uk||r==="Kobo"||r==="Kindle Fire"||r===Ek?Gc:r===Wc||r===zs||r===Xc||r===ub?"Console":r===pk?"Wearable":r?In:"Desktop"),$timezone:Nk(),$timezone_offset:c5()}),{$current_url:Jc(Kt?.href,o,eu),$host:Kt?.host,$pathname:Kt?.pathname,$raw_user_agent:Xt.length>1e3?Xt.substring(0,997)+"...":Xt,$browser_version:a5(Xt,navigator.vendor),$browser_language:vT(),$browser_language_prefix:(n=vT(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:Ji.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Qr=ct("[Web Vitals]"),yT=9e5,fb=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>q({},i,{["$web_vitals_"+r.name+"_event"]:q({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if($(o))Qr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();$(a)||(Ce(i?.name)||Ce(i?.value)?Qr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Qr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),$(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=$(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(q({},i,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,o,a,s=ee.__PosthogExtensions__;$(s)||$(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),i&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Qr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[tT]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=pt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return $(i)?((n=this._instance.persistence)==null?void 0:n.props[nT])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=pt(this._instance.config.capture_performance)&&gi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:yT;return 0<e&&e<=6e4?yT:e}get isEnabled(){var e=Kt?.protocol;if(e!=="http:"&&e!=="https:")return Qr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ro(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ro(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Qr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=pt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=pt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tT]:n}),this._instance.persistence.register({[nT]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Qr.error("failed to load script",r):e()}))}Tt(){var e=O?O.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Us([],Vs,i||[]):[];return Jc(e,r,eu)}Qr.error("Could not determine current URL")}},d5=ct("[Heatmaps]");function bT(t){return pt(t)&&"clientX"in t&&"clientY"in t&&gi(t.clientX)&&gi(t.clientY)}var pb=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[Py]),this.rageclicks=new xp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return pt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return $(this.instance.config.capture_heatmaps)?$(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;d5.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Py]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(U)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){O&&U&&(this.jt=this.Dt.bind(this),it(O,"beforeunload",this.jt),this.Lt=e=>this.At(e||O?.event),it(U,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||O?.event),it(U,"mousemove",this.Nt,{capture:!0}),this.zt=new Ap(this.instance,Z3,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),it(U,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;O&&U&&(this.jt&&O.removeEventListener("beforeunload",this.jt),this.Lt&&U.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&U.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&U.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=(function(s,l,c){for(var u=s;u&&Bp(u)&&!ao(u,"body");){if(u===c)return!1;if(de(l,O?.getComputedStyle(u).position))return!0;u=ek(u)}return!1})(QT(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!iT(e.target)&&bT(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(q({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!iT(e.target)&&bT(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(O){var n=O.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=i?Us([],Vs,r||[]):[],a=Jc(n,o,eu);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Ls(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},hb=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=O?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!($(a)||$(s)||$(l)||$(c)||$(u)||$(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var h=a<=1?1:fi(s/a,0,1,V),m=a<=1?1:fi(l/a,0,1,V),S=c<=1?1:fi(u/c,0,1,V),_=c<=1?1:fi(d/c,0,1,V);r=Xe(r,{$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:u,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},Hn=Uint8Array,zt=Uint16Array,$s=Uint32Array,Zb=new Hn([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]),Gb=new Hn([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]),_T=new Hn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dk=function(t,e){for(var n=new zt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new $s(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},Lk=Dk(Zb,2),f5=Lk[0],gb=Lk[1];f5[28]=258,gb[258]=28;for(mb=Dk(Gb,0)[1],kp=new zt(32768),Ne=0;Ne<32768;++Ne)Jr=(43690&Ne)>>>1|(21845&Ne)<<1,Jr=(61680&(Jr=(52428&Jr)>>>2|(13107&Jr)<<2))>>>4|(3855&Jr)<<4,kp[Ne]=((65280&Jr)>>>8|(255&Jr)<<8)>>>1;var Jr,mb,kp,Ne,jc=function(t,e,n){for(var i=t.length,r=0,o=new zt(e);r<i;++r)++o[t[r]-1];var a,s=new zt(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(n){a=new zt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=s[t[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)a[kp[d]>>>l]=c}else for(a=new zt(i),r=0;r<i;++r)a[r]=kp[s[t[r]-1]++]>>>15-t[r];return a},la=new Hn(288);for(Ne=0;Ne<144;++Ne)la[Ne]=8;for(Ne=144;Ne<256;++Ne)la[Ne]=9;for(Ne=256;Ne<280;++Ne)la[Ne]=7;for(Ne=280;Ne<288;++Ne)la[Ne]=8;var Rp=new Hn(32);for(Ne=0;Ne<32;++Ne)Rp[Ne]=5;var p5=jc(la,9,0),h5=jc(Rp,5,0),Ik=function(t){return(t/8>>0)+(7&t&&1)},Hk=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof zt?zt:t instanceof $s?$s:Hn)(n-e);return i.set(t.subarray(e,n)),i},Qi=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},Oc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Sy=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Hn(0),0];if(r==1){var a=new Hn(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(w,A){return w.f-A.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(i=1;i<r;++i)o[i].s>h&&(h=o[i].s);var m=new zt(h+1),S=vb(n[u-1],m,0);if(S>e){i=0;var _=0,b=S-e,f=1<<b;for(o.sort((function(w,A){return m[A.s]-m[w.s]||w.f-A.f}));i<r;++i){var p=o[i].s;if(!(m[p]>e))break;_+=f-(1<<S-m[p]),m[p]=e}for(_>>>=b;_>0;){var v=o[i].s;m[v]<e?_-=1<<e-m[v]++-1:++i}for(;i>=0&&_;--i){var y=o[i].s;m[y]==e&&(--m[y],++_)}S=e}return[new Hn(m),S]},vb=function(t,e,n){return t.s==-1?Math.max(vb(t.l,e,n+1),vb(t.r,e,n+1)):e[t.s]=n},ST=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zt(++e),i=0,r=t[0],o=1,a=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=t[s]}return[n.subarray(0,i),e]},Mc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},yb=function(t,e,n){var i=n.length,r=Ik(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<i;++o)t[r+o+4]=n[o];return 8*(r+4+i)},xT=function(t,e,n,i,r,o,a,s,l,c,u){Qi(e,u++,n),++r[256];for(var d=Sy(r,15),h=d[0],m=d[1],S=Sy(o,15),_=S[0],b=S[1],f=ST(h),p=f[0],v=f[1],y=ST(_),w=y[0],A=y[1],x=new zt(19),T=0;T<p.length;++T)x[31&p[T]]++;for(T=0;T<w.length;++T)x[31&w[T]]++;for(var k=Sy(x,7),E=k[0],R=k[1],D=19;D>4&&!E[_T[D-1]];--D);var N,H,B,z,te=c+5<<3,I=Mc(r,la)+Mc(o,Rp)+a,G=Mc(r,h)+Mc(o,_)+a+14+3*D+Mc(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(te<=I&&te<=G)return yb(e,u,t.subarray(l,l+c));if(Qi(e,u,1+(G<I)),u+=2,G<I){N=jc(h,m,0),H=h,B=jc(_,b,0),z=_;var J=jc(E,R,0);for(Qi(e,u,v-257),Qi(e,u+5,A-1),Qi(e,u+10,D-4),u+=14,T=0;T<D;++T)Qi(e,u+3*T,E[_T[T]]);u+=3*D;for(var me=[p,w],Ke=0;Ke<2;++Ke){var Mt=me[Ke];for(T=0;T<Mt.length;++T){var Qt=31&Mt[T];Qi(e,u,J[Qt]),u+=E[Qt],Qt>15&&(Qi(e,u,Mt[T]>>>5&127),u+=Mt[T]>>>12)}}}else N=p5,H=la,B=h5,z=Rp;for(T=0;T<s;++T)if(i[T]>255){Qt=i[T]>>>18&31,Oc(e,u,N[Qt+257]),u+=H[Qt+257],Qt>7&&(Qi(e,u,i[T]>>>23&31),u+=Zb[Qt]);var da=31&i[T];Oc(e,u,B[da]),u+=z[da],da>3&&(Oc(e,u,i[T]>>>5&8191),u+=Gb[da])}else Oc(e,u,N[i[T]]),u+=H[i[T]];return Oc(e,u,N[256]),u+H[256]},g5=new $s([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),m5=(function(){for(var t=new $s(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),v5=function(t,e,n,i,r){return(function(o,a,s,l,c,u){var d=o.length,h=new Hn(l+d+5*(1+Math.floor(d/7e3))+c),m=h.subarray(l,h.length-c),S=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var b=_+65535;b<d?S=yb(m,S,o.subarray(_,b)):(m[_]=u,S=yb(m,S,o.subarray(_,d)))}else{for(var f=g5[a-1],p=f>>>13,v=8191&f,y=(1<<s)-1,w=new zt(32768),A=new zt(y+1),x=Math.ceil(s/3),T=2*x,k=function(Sh){return(o[Sh]^o[Sh+1]<<x^o[Sh+2]<<T)&y},E=new $s(25e3),R=new zt(288),D=new zt(32),N=0,H=0,B=(_=0,0),z=0,te=0;_<d;++_){var I=k(_),G=32767&_,J=A[I];if(w[G]=J,A[I]=G,z<=_){var me=d-_;if((N>7e3||B>24576)&&me>423){S=xT(o,m,0,E,R,D,H,B,te,_-te,S),B=N=H=0,te=_;for(var Ke=0;Ke<286;++Ke)R[Ke]=0;for(Ke=0;Ke<30;++Ke)D[Ke]=0}var Mt=2,Qt=0,da=v,sr=G-J&32767;if(me>2&&I==k(_-sr))for(var ER=Math.min(p,me)-1,CR=Math.min(32767,_),AR=Math.min(258,me);sr<=CR&&--da&&G!=J;){if(o[_+Mt]==o[_+Mt-sr]){for(var lr=0;lr<AR&&o[_+lr]==o[_+lr-sr];++lr);if(lr>Mt){if(Mt=lr,Qt=sr,lr>ER)break;var TR=Math.min(sr,lr-2),W0=0;for(Ke=0;Ke<TR;++Ke){var _h=_-sr+Ke+32768&32767,X0=_h-w[_h]+32768&32767;X0>W0&&(W0=X0,J=_h)}}}sr+=(G=J)-(J=w[G])+32768&32767}if(Qt){E[B++]=268435456|gb[Mt]<<18|mb[Qt];var K0=31&gb[Mt],Q0=31&mb[Qt];H+=Zb[K0]+Gb[Q0],++R[257+K0],++D[Q0],z=_+Mt,++N}else E[B++]=o[_],++R[o[_]]}}S=xT(o,m,u,E,R,D,H,B,te,_-te,S)}return Hk(h,0,l+Ik(S)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},xy=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function y5(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=m5[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,o=v5(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=o.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&xy(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(o,e),xy(o,a-8,n.d()),xy(o,a-4,i),o}var b5=function(t){var e,n,i,r,o="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
455
|
+
`,Dn,Vr,jr,Zi,Gi,Pr,Yi,Of=class extends HTMLElement{constructor(){super();ur(this,Dn);ur(this,Vr);ur(this,jr);ur(this,Zi);ur(this,Gi);ur(this,Pr,null);ur(this,Yi,null);ti(this,Dn,this.attachShadow({mode:"open",delegatesFocus:!0})),ti(this,Vr,document.createElement("div")),ge(this,Vr).setAttribute("part","mount"),ge(this,Dn).appendChild(ge(this,Vr)),ti(this,jr,document.createElement("div")),ge(this,jr).id="portalRoot",ge(this,Dn).appendChild(ge(this,jr)),ti(this,Zi,document.createElement("div")),ge(this,Zi).id="overlayContainer",Object.assign(ge(this,Zi).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,Dn).appendChild(ge(this,Zi)),ti(this,Gi,Tv()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Pr)?.unmount(),ti(this,Pr,null)}getMountNode(){return ge(this,Vr)}getController(){return ge(this,Gi)}getPortalRoot(){return ge(this,jr)}getOverlayContainer(){return ge(this,Zi)}getShadowRoot(){return ge(this,Dn)}open(){ge(this,Gi).setOpen(!0)}close(){ge(this,Gi).setOpen(!1)}toggle(){ge(this,Gi).toggle()}setOverrideFetcher(n){ge(this,Yi)&&(ti(this,Yi,{...ge(this,Yi),fetcher:n}),this.render())}mountReactApp(n){ti(this,Yi,n),this.render()}render(){!this.isConnected||!ge(this,Yi)||(ge(this,Pr)||ti(this,Pr,(0,UC.createRoot)(ge(this,Vr))),ge(this,Pr).render((0,Vv.jsx)(Rv,{shadowRoot:ge(this,Dn),portalRoot:ge(this,jr),overlayContainer:ge(this,Zi),children:(0,Vv.jsx)(Uv,{...ge(this,Yi),controller:ge(this,Gi),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Dn).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(FC),ge(this,Dn).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=FC,ge(this,Dn).appendChild(n)}}};Dn=new WeakMap,Vr=new WeakMap,jr=new WeakMap,Zi=new WeakMap,Gi=new WeakMap,Pr=new WeakMap,Yi=new WeakMap;var jv=()=>{typeof window>"u"||customElements.get($C)||customElements.define($C,Of)};var Mf=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let b=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=pC(b)}let n=null,i=null,r=null,{runtime:o}=t;async function a(b){!o?.actions||b.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(b))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();n=b,console.log("[SmartCanvas] Config fetched:",`tiles=${b.tiles?.length??0},`,`actions=${b.actions?.length??0},`,`theme=${b.theme?.mode??"default"}`),b.actions?.length&&console.log("[SmartCanvas] Actions to apply:",b.actions.map((f,g)=>`[${g}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await a(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&pc(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=bC();jv();let c=document.createElement("smart-canvas");if(EC(c.getOverlayContainer()),t.tokens)for(let[b,f]of Object.entries(t.tokens))c.style.setProperty(b,f);let u=()=>{let b=t.target??document.body;b&&b.appendChild(c)};document.body?u():document.addEventListener("DOMContentLoaded",u,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),_C(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,m=t.fetcher??zo({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=m);let x={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:r,workspaceTheme:t.workspaceTheme};c.mountReactApp(x),t.defaultOpen&&c.open();let _={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{s(),c.remove()},setTokens:b=>{for(let[f,g]of Object.entries(b))c.style.setProperty(f,g)},getConfig:async()=>{if(i)try{let b=await i();return n=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return n??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?n&&await a(n.actions):await s()},setOverrideFetcher:b=>{i=b,c.setOverrideFetcher(b),o?.accumulator&&b().then(f=>{f?.tiles&&pc(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{h?.register?.(b)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(b,f)=>h?.track?(h.track(b,f),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=_)}return _};typeof window<"u"&&(window.SmartCanvas={async create(t){return Mf(t)}});var Zr=Q(Ke(),1);var qr=Q(Fe(),1);function zD({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,Zr.useState)(0),o=(0,Zr.useMemo)(()=>[...t].sort((a,s)=>(a.priority??0)-(s.priority??0)),[t]);return(0,Zr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,Zr.useEffect)(()=>{if(o.length<=1)return;let a=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(a)},[o,e]),(0,Zr.useEffect)(()=>{let a=o[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,o,n]),o.length?(0,qr.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,qr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${o.length*100}%`},children:o.map(a=>(0,qr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,qr.jsx)(fs,{config:a,surface:"wheel",telemetry:n})},a.id))}),(0,qr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((a,s)=>(0,qr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},a.id))})]}):null}function hs(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function BD(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",o=hs(r),a=hs(Pi);return o.major>a.major&&e.push(`Config schema v${r} is newer than SDK v${Pi}. Some features may not work. Update SDK to latest version.`),o.major<a.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${Pi}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:$D(i,r)}):{valid:!0,warnings:e,errors:n}}function $D(t,e){let n={...t};return hs(e).major===1&&(n=FD(n)),n.schemaVersion=Pi,n}function FD(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function UD(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=hs(n),r=hs(Pi);return i.major<r.major||!e.schemaVersion}var jC={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function PC(){return jC}function Pv(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function mc(t,e,n){return n===2?Pv(Pv(t+e)+"")%1e4/1e4:n===1?Pv(e+t)%1e3/1e3:null}function VD(t){return t<=0?[]:new Array(t).fill(1/t)}function Nf(t,e){return t>=e[0]&&t<e[1]}function qC(t,e){let n=mc("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function ZC(t,e){for(let n=0;n<e.length;n++)if(Nf(t,e[n]))return n;return-1}function Zv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Df(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let o=qD(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else n=!0,o&&(i=!0)}return i||!n}function jD(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function PD(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,o)=>{i.push([t.searchParams.get(o)||"",r,!1])}),!i.some(r=>!jD(r[0],r[1],r[2]))}catch{return!1}}function qD(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=Zv(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return PD(i,n);return!1}catch{return!1}}function GC(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=VD(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,s)=>s+a,0);(r<.99||r>1.01)&&(n=i);let o=0;return n.map(a=>{let s=o;return o+=a,[s,s+e*a]})}function YC(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function WC(t){try{return t()}catch(e){return console.error(e),!1}}var qv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Uo(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||jC.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",qv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:qv(r)},i,qv(o));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function vc(t){return typeof t=="string"?t:JSON.stringify(t)}function gn(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function XC(){let t;try{t="1.6.4"}catch{t=""}return t}function KC(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,o)=>{i.searchParams.has(o)||i.searchParams.set(o,r)}),i.toString()}function VC(t){return typeof t=="object"&&t!==null}function Lf(t){return t.urlPatterns&&t.variations.some(e=>VC(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>VC(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function If(t,e){return new Promise(n=>{let i=!1,r,o=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>o(),e)),t.then(a=>o(a)).catch(()=>o())})}var Tt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},di=PC(),gs={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>di.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return di.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new di.EventSource(`${t}/sub/${e}`,{headers:n}):new di.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),YD()):document.visibilityState==="hidden"&&(t=window.setTimeout(GD,Tt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(di.localStorage=globalThis.localStorage)}catch{}var ms=new Map,QC=!1,Wi=new Map,Hf=new Map,vs=new Map,ys=new Set;function eA(t){Object.assign(Tt,t),Tt.backgroundSync||Qv()}async function tA({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Tt.backgroundSync=!1),WD({instance:t,allowStale:i,timeout:e,skipCache:n})}function ZD(t){let e=yc(t),n=ms.get(e)||new Set;n.add(t),ms.set(e,n)}function nA(t){ms.forEach(e=>e.delete(t))}function GD(){vs.forEach(t=>{t&&(t.state="idle",Xv(t))})}function YD(){vs.forEach(t=>{t&&t.state==="idle"&&Kv(t)})}async function JC(){try{if(!di.localStorage)return;await di.localStorage.setItem(Tt.cacheKey,JSON.stringify(Array.from(Wi.entries())))}catch{}}async function WD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=yc(t),o=Yv(t),a=new Date,s=new Date(a.getTime()-Tt.maxAge+Tt.staleTTL);await XD();let l=!Tt.disableCache&&!i?Wi.get(o):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>s?(l.sse&&ys.add(r),l.staleAt<a?Gv(t):Wv(t),{data:l.data,success:!0,source:"cache"}):await If(Gv(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function yc(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function Yv(t){let e=yc(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let o=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:a})}`}async function XD(){if(!QC){QC=!0;try{if(di.localStorage){let t=await di.localStorage.getItem(Tt.cacheKey);if(!Tt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{Wi.set(n,{...i,staleAt:new Date(i.staleAt)})}),iA()}}}catch{}if(!Tt.disableIdleStreams){let t=gs.startIdleListener();t&&(gs.stopIdleListener=t)}}}function iA(){let t=Array.from(Wi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,Wi.size-Tt.maxEntries),Wi.size);for(let n=0;n<e;n++)Wi.delete(t[n].key)}function rA(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Tt.staleTTL),o=Tt.disableCache?void 0:Wi.get(e);if(o&&i&&o.version===i){o.staleAt=r,JC();return}Tt.disableCache||(Wi.set(e,{data:n,version:i,staleAt:r,sse:ys.has(t)}),iA()),JC();let a=ms.get(t);a&&a.forEach(s=>KD(s,n))}async function KD(t,e){await t.setPayload(e||t.getPayload())}async function Gv(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=yc(t),a=Yv(t),s=Hf.get(a);return s||(s=(r?gs.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):gs.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&ys.add(o),c.json()}).then(c=>(rA(o,a,c),Wv(t),Hf.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(Hf.delete(a),{data:null,source:"error",success:!1,error:c})),Hf.set(a,s)),s}function Wv(t,e=!1){let n=yc(t),i=Yv(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),a=t.getClientKey();if(e&&ys.add(n),Tt.backgroundSync&&ys.has(n)&&di.EventSource){if(vs.has(n))return;let s={src:null,host:r,clientKey:a,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=ms.get(n);c&&c.forEach(u=>{Gv(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);rA(n,i,c)}s.errors=0}catch{oA(s)}},errors:0,state:"active"};vs.set(n,s),Kv(s)}}function oA(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);Xv(t),setTimeout(()=>{["idle","active"].includes(t.state)||Kv(t)},Math.min(e,3e5))}}function Xv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Kv(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=()=>oA(t),t.src.onopen=()=>{t.errors=0}}function QD(t,e){Xv(t),vs.delete(e)}function Qv(){ys.clear(),vs.forEach(QD),ms.clear(),gs.stopIdleListener()}function zf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Wv(t,!0),ZD(t)}}var JD=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,ty={revert:function(){}},Uf=new Map,ny=new Set;function e4(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Vf(t){var e=Uf.get(t);return e||(e={element:t,attributes:{}},Uf.set(t,e)),e}function jf(t,e,n,i,r){var o=n(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&a._positionTimeout)){e==="position"&&(a._positionTimeout=setTimeout(function(){a._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===a.virtualValue.parentNode&&s.insertBeforeNode===a.virtualValue.insertBeforeNode||s!==a.virtualValue&&(a.originalValue=s,r(a))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,e4(e)),a}function Pf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,aA()):t!==n&&(e.isDirty=!0,aA())}function t4(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Pf(g4(e),t)}function n4(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),Pf(Array.from(e).filter(Boolean).join(" "),t)}function i4(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Pf(e,t)}function r4(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function o4(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=r4(i);e=r||e}),Pf(e,t)}var a4=function(e){return e.innerHTML},s4=function(e,n){return e.innerHTML=n};function lA(t){var e=Vf(t);return e.html||(e.html=jf(t,"html",a4,s4,t4)),e.html}var l4=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},c4=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function cA(t){var e=Vf(t);return e.position||(e.position=jf(t,"position",l4,c4,o4)),e.position}var u4=function(e,n){return n?e.className=n:e.removeAttribute("class")},d4=function(e){return e.className};function uA(t){var e=Vf(t);return e.classes||(e.classes=jf(t,"class",d4,u4,n4)),e.classes}var f4=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},p4=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function dA(t,e){var n=Vf(t);return n.attributes[e]||(n.attributes[e]=jf(t,e,f4(e),p4(e),i4)),n.attributes[e]}function h4(t,e){var n=Uf.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var o,a;(o=n.classes)==null||(a=o.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,d;(c=n.attributes)==null||(u=c[e])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[e]}}var Bf;function g4(t){return Bf||(Bf=document.createElement("div")),Bf.innerHTML=t,Bf.innerHTML}function $f(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||h4(t,e),n.setValue(t,i)}}function m4(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(n){$f(e,n,t.attributes[n])})}function aA(){Uf.forEach(m4)}function v4(t,e){var n=null;t.kind==="html"?n=lA(e):t.kind==="class"?n=uA(e):t.kind==="attribute"?n=dA(e,t.attribute):t.kind==="position"&&(n=cA(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function y4(t,e){var n=null;if(t.kind==="html"?n=lA(e):t.kind==="class"?n=uA(e):t.kind==="attribute"?n=dA(e,t.attribute):t.kind==="position"&&(n=cA(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function fA(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),v4(t,i))})}}function b4(t){t.elements.forEach(function(e){return y4(t,e)}),t.elements.clear(),ny.delete(t)}function sA(){ny.forEach(fA)}var Jv;function _4(){typeof document>"u"||(Jv||(Jv=new MutationObserver(function(){sA()})),sA(),Jv.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}_4();function qf(t){return typeof document>"u"?ty:(ny.add(t),fA(t),{revert:function(){b4(t)}})}function ey(t,e){return qf({kind:"html",elements:new Set,mutate:e,selector:t})}function pA(t,e){return qf({kind:"position",elements:new Set,mutate:e,selector:t})}function bc(t,e){return qf({kind:"class",elements:new Set,mutate:e,selector:t})}function Ff(t,e,n){return JD.test(e)?e==="class"||e==="className"?bc(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return i.add(o)})}):qf({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):ty}function x4(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return ey(e,function(s){return s+(i??"")});if(n==="set")return ey(e,function(){return i??""})}else if(r==="class"){if(n==="append")return bc(e,function(s){i&&s.add(i)});if(n==="remove")return bc(e,function(s){i&&s.delete(i)});if(n==="set")return bc(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&o)return pA(e,function(){return{insertBeforeSelector:a,parentSelector:o}})}else{if(n==="append")return Ff(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return Ff(e,r,function(){return i??""});if(n==="remove")return Ff(e,r,function(){return null})}return ty}var S4={html:ey,classes:bc,attribute:Ff,position:pA,declarative:x4},hA=S4;var iy={};function Gr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!vA(t,r,n))return!1;break;case"$nor":if(vA(t,r,n))return!1;break;case"$and":if(!k4(t,r,n))return!1;break;case"$not":if(Gr(t,r,n))return!1;break;default:if(!_c(r,w4(t,i),n))return!1}return!0}function w4(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function gA(t,e=!1){let n=`${t}${e?"/i":""}`;return iy[n]||(iy[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),iy[n]}function _c(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!yA(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!A4(r,e,t[r],n))return!1;return!0}function yA(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function E4(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 C4(t,e,n){if(!Array.isArray(t))return!1;let i=yA(e)?r=>_c(e,r,n):r=>Gr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function bs(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>i(r)===i(o))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function mA(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let a=0;a<t.length;a++)if(_c(e[r],t[a],n,i)){o=!0;break}if(!o)return!1}return!0}function A4(t,e,n,i){switch(t){case"$veq":return gn(e)===gn(n);case"$vne":return gn(e)!==gn(n);case"$vgt":return gn(e)>gn(n);case"$vgte":return gn(e)>=gn(n);case"$vlt":return gn(e)<gn(n);case"$vlte":return gn(e)<=gn(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?bs(e,n):!1;case"$ini":return Array.isArray(n)?bs(e,n,!0):!1;case"$inGroup":return bs(e,i[n]||[]);case"$notInGroup":return!bs(e,i[n]||[]);case"$nin":return Array.isArray(n)?!bs(e,n):!1;case"$nini":return Array.isArray(n)?!bs(e,n,!0):!1;case"$not":return!_c(n,e,i);case"$size":return Array.isArray(e)?_c(n,e.length,i):!1;case"$elemMatch":return C4(e,n,i);case"$all":return Array.isArray(n)?mA(e,n,i):!1;case"$alli":return Array.isArray(n)?mA(e,n,i,!0):!1;case"$regex":try{return gA(n).test(e)}catch{return!1}case"$regexi":try{return gA(n,!0).test(e)}catch{return!1}case"$type":return E4(e)===n;default:return console.error("Unknown operator: "+t),!1}}function vA(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Gr(t,e[i],n))return!0;return!1}function k4(t,e,n){for(let i=0;i<e.length;i++)if(!Gr(t,e[i],n))return!1;return!0}var T4="Feature Evaluated",R4="Experiment Viewed";function O4(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function M4(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 _s(t){try{await t()}catch{}}function bA(t,e,n){if(t.user.trackedExperiments){let r=Yf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(_s(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(_s(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(_s(()=>r(R4,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function N4(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;_s(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;_s(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;_s(()=>i(T4,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function Zf(t,e){if(e.stack.evaluatedFeatures.has(t))return Yr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=O4(e);if(n.has(t))return Yr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Yr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of i.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=Zf(l.id,e);if(c.source==="cyclicPrerequisite")return Yr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Gr(u,l.condition||{})){if(l.gate)return Yr(e,t,null,"prerequisite");continue e}}if(o.filters&&SA(o.filters,e))continue;if("force"in o){if(o.condition&&!xA(o.condition,e)||!D4(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=>{!bA(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Yr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let a={variations:o.variations,key:o.key||t};"coverage"in o&&(a.coverage=o.coverage),o.weights&&(a.weights=o.weights),o.hashAttribute&&(a.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(a.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(a.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(a.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(a.minBucketVersion=o.minBucketVersion),o.namespace&&(a.namespace=o.namespace),o.meta&&(a.meta=o.meta),o.ranges&&(a.ranges=o.ranges),o.name&&(a.name=o.name),o.phase&&(a.phase=o.phase),o.seed&&(a.seed=o.seed),o.hashVersion&&(a.hashVersion=o.hashVersion),o.filters&&(a.filters=o.filters),o.condition&&(a.condition=o.condition);let{result:s}=Gf(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,s),s.inExperiment&&!s.passthrough)return Yr(e,t,s.value,"experiment",o.id,a,s)}}return Yr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function Gf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:je(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:je(n,t,-1,!1,e)};if(t=L4(t,n),t.urlPatterns&&!Df(n.user.url||"",t.urlPatterns))return{result:je(n,t,-1,!1,e)};let o=YC(i,n.user.url||"",r);if(o!==null)return{result:je(n,t,o,!1,e)};let a=M4(n);if(i in a){let b=a[i];return{result:je(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:je(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Vo(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:je(n,t,-1,!1,e)};let c=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:f}=z4({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=b>=0,c=b,d=!!f}if(!u){if(t.filters){if(SA(t.filters,n))return{result:je(n,t,-1,!1,e)}}else if(t.namespace&&!qC(l,t.namespace))return{result:je(n,t,-1,!1,e)};if(t.include&&!WC(t.include))return{result:je(n,t,-1,!1,e)};if(t.condition&&!xA(t.condition,n))return{result:je(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let f of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let g=Zf(f.id,n);if(g.source==="cyclicPrerequisite")return{result:je(n,t,-1,!1,e)};let v={value:g.value};if(!Gr(v,f.condition||{}))return{result:je(n,t,-1,!1,e)}}}if(t.groups&&!H4(t.groups,n))return{result:je(n,t,-1,!1,e)}}if(t.url&&!I4(t.url,n))return{result:je(n,t,-1,!1,e)};let h=mc(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:je(n,t,-1,!1,e)};if(!u){let b=t.ranges||GC(r,t.coverage===void 0?1:t.coverage,t.weights);c=ZC(h,b)}if(d)return{result:je(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:je(n,t,-1,!1,e)};if("force"in t)return{result:je(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:je(n,t,-1,!1,e)};if(t.status==="stopped")return{result:je(n,t,-1,!1,e)};let m=je(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:f,doc:g}=$4(n,s,vc(l),{[ry(t.key,t.bucketVersion)]:m.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[f]=g,n.user.saveStickyBucketAssignmentDoc(g))}let x=bA(n,t,m);x.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:m});let _=x.length?x.length===1?x[0]:Promise.all(x).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:m,trackingCall:_}}function Yr(t,e,n,i,r,o,a){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return o&&(s.experiment=o),a&&(s.experimentResult=a),i!=="override"&&N4(t,e,s),s}function _A(t){return{...t.user.attributes,...t.user.attributeOverrides}}function xA(t,e){return Gr(_A(e),t,e.global.savedGroups||{})}function SA(t,e){return t.some(n=>{let{hashValue:i}=Vo(e,n.attribute);if(!i)return!0;let r=mc(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(o=>Nf(r,o))})}function D4(t,e,n,i,r,o,a){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=Vo(t,n,i);if(!s)return!1;let l=mc(e,s,a||1);return l===null?!1:r?Nf(l,r):o!==void 0?l<=o:!0}function je(t,e,n,i,r,o,a){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=Vo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},d={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(d.name=u.name),o!==void 0&&(d.bucket=o),u.passthrough&&(d.passthrough=u.passthrough),d}function L4(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=Zv(t.url))),t}function Vo(t,e,n){let i=e||"id",r="",o=_A(t);return o[i]&&(r=o[i]),!r&&n&&(o[n]&&(r=o[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function I4(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function H4(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function z4({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:a}){n=n||0,o=o||0,i=i||"id",a=a||[];let s=ry(e,n),l=B4(t,i,r);if(o>0)for(let d=0;d<o;d++){let h=ry(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=a.findIndex(d=>d.key===c);return u<0?{variation:-1}:{variation:u}}function ry(t,e){return e=e||0,`${t}__${e}`}function oy(t,e){return`${t}||${e}`}function B4(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Vo(t,e),o=oy(i,vc(r)),{hashAttribute:a,hashValue:s}=Vo(t,n),l=s?oy(a,vc(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function $4(t,e,n,i){let r=oy(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...o,...i},s=JSON.stringify(o)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:s}}function F4(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(o=>{let a=i[o];if(a.rules)for(let s of a.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function wA(t,e,n){let i=ay(t,n);return e.getAllAssignments(i)}function ay(t,e){let n={};return F4(t,e).forEach(r=>{let{hashValue:o}=Vo(t,r);n[r]=vc(o)}),n}async function EA(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Uo(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Uo(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Uo(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function CA(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 Yf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var xs=typeof window<"u"&&typeof document<"u",U4=XC(),xc=class{constructor(e){if(e=e||{},this.version=U4,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),xs&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await EA(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,zf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&eA(e.cacheSettings),e.payload)return await this.setPayload(e.payload),zf(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return zf(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return CA(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return tA({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await Uo(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await Uo(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,nA(this),e.destroyAllStreams&&Qv(),this.logs=[],xs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=Gf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),o,a;r?o=je(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:a}=Gf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!n&&o.inExperiment&&i&&i.valueHash===s)return o;if(i&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Lf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?KC(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Df(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:d}=this._getNavigateFunction();if(u)if(xs)Promise.all([...a?[If(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,o)=>{i.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of n){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&Lf(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return Zf(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[Yf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Yf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(xs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Lf(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==i.protocol||o.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:xs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!xs)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(hA.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await wA(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=ay(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var V4="https://experiment.syntrologie.com",sy=class{constructor(e={}){P(this,"gb");P(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new xc({...e,apiHost:e.apiHost??V4,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let n of this.featureListeners)n()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function Wf(t={}){return new sy(t)}var AA="syntro_session_metrics",Sc=class{constructor(e={}){P(this,"metrics",new Map);P(this,"experiments");P(this,"attributePrefix");P(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(AA);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(AA,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Xf(t={}){return new Sc(t)}var p={};e_(p,{BRAND:()=>hL,DIRTY:()=>jo,EMPTY_PATH:()=>Z4,INVALID:()=>X,NEVER:()=>QL,OK:()=>Rt,ParseStatus:()=>wt,Schema:()=>le,ZodAny:()=>Kr,ZodArray:()=>Ji,ZodBigInt:()=>qo,ZodBoolean:()=>Zo,ZodBranded:()=>Ec,ZodCatch:()=>ia,ZodDate:()=>Go,ZodDefault:()=>na,ZodDiscriminatedUnion:()=>Jf,ZodEffects:()=>Hn,ZodEnum:()=>ea,ZodError:()=>Wt,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>tp,ZodIntersection:()=>Ko,ZodIssueCode:()=>I,ZodLazy:()=>Qo,ZodLiteral:()=>Jo,ZodMap:()=>ks,ZodNaN:()=>Rs,ZodNativeEnum:()=>ta,ZodNever:()=>Kn,ZodNull:()=>Wo,ZodNullable:()=>hi,ZodNumber:()=>Po,ZodObject:()=>Xt,ZodOptional:()=>Ln,ZodParsedType:()=>j,ZodPipeline:()=>Cc,ZodPromise:()=>Qr,ZodReadonly:()=>ra,ZodRecord:()=>ep,ZodSchema:()=>le,ZodSet:()=>Ts,ZodString:()=>Xr,ZodSymbol:()=>Cs,ZodTransformer:()=>Hn,ZodTuple:()=>pi,ZodType:()=>le,ZodUndefined:()=>Yo,ZodUnion:()=>Xo,ZodUnknown:()=>Qi,ZodVoid:()=>As,addIssueToContext:()=>$,any:()=>wL,array:()=>kL,bigint:()=>yL,boolean:()=>zA,coerce:()=>KL,custom:()=>LA,date:()=>bL,datetimeRegex:()=>NA,defaultErrorMap:()=>Xi,discriminatedUnion:()=>ML,effect:()=>jL,enum:()=>FL,function:()=>zL,getErrorMap:()=>Ss,getParsedType:()=>fi,instanceof:()=>mL,intersection:()=>NL,isAborted:()=>Kf,isAsync:()=>ws,isDirty:()=>Qf,isValid:()=>Wr,late:()=>gL,lazy:()=>BL,literal:()=>$L,makeIssue:()=>wc,map:()=>IL,nan:()=>vL,nativeEnum:()=>UL,never:()=>CL,null:()=>SL,nullable:()=>qL,number:()=>HA,object:()=>TL,objectUtil:()=>ly,oboolean:()=>XL,onumber:()=>WL,optional:()=>PL,ostring:()=>YL,pipeline:()=>GL,preprocess:()=>ZL,promise:()=>VL,quotelessJson:()=>j4,record:()=>LL,set:()=>HL,setErrorMap:()=>q4,strictObject:()=>RL,string:()=>IA,symbol:()=>_L,transformer:()=>jL,tuple:()=>DL,undefined:()=>xL,union:()=>OL,unknown:()=>EL,util:()=>de,void:()=>AL});var de;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},t.find=(r,o)=>{for(let a of r)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(de||(de={}));var ly;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ly||(ly={}));var j=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fi=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.unknown}};var I=de.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"]),j4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Wt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Wt.create=t=>new Wt(t);var P4=(t,e)=>{let n;switch(t.code){case I.invalid_type:t.received===j.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case I.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case I.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}},Xi=P4;var kA=Xi;function q4(t){kA=t}function Ss(){return kA}var wc=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},Z4=[];function $(t,e){let n=Ss(),i=wc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xi?void 0:Xi].filter(r=>!!r)});t.common.issues.push(i)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return X;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return X;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},X=Object.freeze({status:"aborted"}),jo=t=>({status:"dirty",value:t}),Rt=t=>({status:"valid",value:t}),Kf=t=>t.status==="aborted",Qf=t=>t.status==="dirty",Wr=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 In=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},TA=(t,e)=>{if(Wr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Wt(t.common.issues);return this._error=n,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var le=class{get description(){return this._def.description}_getType(e){return fi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:fi(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:fi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ws(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fi(e)},r=this._parseSync({data:e,path:i.path,parent:i});return TA(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fi(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Wr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Wr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fi(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(ws(r)?r:Promise.resolve(r));return TA(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=e(r),s=()=>o.addIssue({code:I.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Hn({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ln.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ji.create(this)}promise(){return Qr.create(this,this._def)}or(e){return Xo.create([this,e],this._def)}and(e){return Ko.create(this,e,this._def)}transform(e){return new Hn({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new na({...se(this._def),innerType:this,defaultValue:n,typeName:J.ZodDefault})}brand(){return new Ec({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ia({...se(this._def),innerType:this,catchValue:n,typeName:J.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Cc.create(this,e)}readonly(){return ra.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},G4=/^c[^\s-]{8,}$/i,Y4=/^[0-9a-z]+$/,W4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,X4=/^[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,K4=/^[a-z0-9_-]{21}$/i,Q4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J4=/^[-+]?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)?)??$/,eL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cy,nL=/^(?:(?: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])$/,iL=/^(?:(?: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])$/,rL=/^(([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]))$/,oL=/^(([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])$/,aL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OA="((\\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])))",lL=new RegExp(`^${OA}$`);function MA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function cL(t){return new RegExp(`^${MA(t)}$`)}function NA(t){let e=`${OA}T${MA(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function uL(t,e){return!!((e==="v4"||!e)&&nL.test(t)||(e==="v6"||!e)&&rL.test(t))}function dL(t,e){if(!Q4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function fL(t,e){return!!((e==="v4"||!e)&&iL.test(t)||(e==="v6"||!e)&&oL.test(t))}var Xr=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let o=this._getOrReturnCtx(e);return $(o,{code:I.invalid_type,expected:j.string,received:o.parsedType}),X}let i=new wt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:I.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:I.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?$(r,{code:I.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&$(r,{code:I.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")eL.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"email",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")cy||(cy=new RegExp(tL,"u")),cy.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"emoji",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")X4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"uuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")K4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"nanoid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")G4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Y4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid2",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")W4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ulid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),$(r,{validation:"url",code:I.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"regex",code:I.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?NA(o).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?lL.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?cL(o).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:I.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?J4.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"duration",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?uL(e.data,o.version)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ip",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?dL(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"jwt",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?fL(e.data,o.version)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cidr",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?aL.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"base64",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?sL.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"base64url",code:I.invalid_string,message:o.message}),i.dirty()):de.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:I.invalid_string,...Z.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Z.errToObj(n)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Xr.create=t=>new Xr({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function pL(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}var Po=class t extends le{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)!==j.number){let o=this._getOrReturnCtx(e);return $(o,{code:I.invalid_type,expected:j.number,received:o.parsedType}),X}let i,r=new wt;for(let o of this._def.checks)o.kind==="int"?de.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),$(i,{code:I.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?pL(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),$(i,{code:I.not_finite,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Po.create=t=>new Po({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var qo=class t extends le{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)!==j.bigint)return this._getInvalidInput(e);let i,r=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),$(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return $(n,{code:I.invalid_type,expected:j.bigint,received:n.parsedType}),X}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};qo.create=t=>new qo({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var Zo=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.boolean,received:i.parsedType}),X}return Rt(e.data)}};Zo.create=t=>new Zo({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var Go=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let o=this._getOrReturnCtx(e);return $(o,{code:I.invalid_type,expected:j.date,received:o.parsedType}),X}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return $(o,{code:I.invalid_date}),X}let i=new wt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:I.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:I.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):de.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Go.create=t=>new Go({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var Cs=class extends le{_parse(e){if(this._getType(e)!==j.symbol){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.symbol,received:i.parsedType}),X}return Rt(e.data)}};Cs.create=t=>new Cs({typeName:J.ZodSymbol,...se(t)});var Yo=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.undefined,received:i.parsedType}),X}return Rt(e.data)}};Yo.create=t=>new Yo({typeName:J.ZodUndefined,...se(t)});var Wo=class extends le{_parse(e){if(this._getType(e)!==j.null){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.null,received:i.parsedType}),X}return Rt(e.data)}};Wo.create=t=>new Wo({typeName:J.ZodNull,...se(t)});var Kr=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Rt(e.data)}};Kr.create=t=>new Kr({typeName:J.ZodAny,...se(t)});var Qi=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rt(e.data)}};Qi.create=t=>new Qi({typeName:J.ZodUnknown,...se(t)});var Kn=class extends le{_parse(e){let n=this._getOrReturnCtx(e);return $(n,{code:I.invalid_type,expected:j.never,received:n.parsedType}),X}};Kn.create=t=>new Kn({typeName:J.ZodNever,...se(t)});var As=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.void,received:i.parsedType}),X}return Rt(e.data)}};As.create=t=>new As({typeName:J.ZodVoid,...se(t)});var Ji=class t extends le{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==j.array)return $(n,{code:I.invalid_type,expected:j.array,received:n.parsedType}),X;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&($(n,{code:a?I.too_big:I.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&($(n,{code:I.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&($(n,{code:I.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new In(n,a,n.path,s)))).then(a=>wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new In(n,a,n.path,s)));return wt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};Ji.create=(t,e)=>new Ji({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function Es(t){if(t instanceof Xt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Ln.create(Es(i))}return new Xt({...t._def,shape:()=>e})}else return t instanceof Ji?new Ji({...t._def,type:Es(t.element)}):t instanceof Ln?Ln.create(Es(t.unwrap())):t instanceof hi?hi.create(Es(t.unwrap())):t instanceof pi?pi.create(t.items.map(e=>Es(e))):t}var Xt=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==j.object){let c=this._getOrReturnCtx(e);return $(c,{code:I.invalid_type,expected:j.object,received:c.parsedType}),X}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=o[c],d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new In(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Kn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&($(r,{code:I.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new In(r,d,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(i,c)):wt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:Z.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of de.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of de.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return Es(this)}partial(e){let n={};for(let i of de.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of de.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Ln;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return DA(de.objectKeys(this.shape))}};Xt.create=(t,e)=>new Xt({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:J.ZodObject,...se(e)});Xt.strictCreate=(t,e)=>new Xt({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:J.ZodObject,...se(e)});Xt.lazycreate=(t,e)=>new Xt({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:J.ZodObject,...se(e)});var Xo=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Wt(s.ctx.common.issues));return $(n,{code:I.invalid_union,unionErrors:a}),X}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Wt(l));return $(n,{code:I.invalid_union,unionErrors:s}),X}}get options(){return this._def.options}};Xo.create=(t,e)=>new Xo({options:t,typeName:J.ZodUnion,...se(e)});var Ki=t=>t instanceof Qo?Ki(t.schema):t instanceof Hn?Ki(t.innerType()):t instanceof Jo?[t.value]:t instanceof ea?t.options:t instanceof ta?de.objectValues(t.enum):t instanceof na?Ki(t._def.innerType):t instanceof Yo?[void 0]:t instanceof Wo?[null]:t instanceof Ln?[void 0,...Ki(t.unwrap())]:t instanceof hi?[null,...Ki(t.unwrap())]:t instanceof Ec||t instanceof ra?Ki(t.unwrap()):t instanceof ia?Ki(t._def.innerType):[],Jf=class t extends le{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.object)return $(n,{code:I.invalid_type,expected:j.object,received:n.parsedType}),X;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):($(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let a=Ki(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...se(i)})}};function uy(t,e){let n=fi(t),i=fi(e);if(t===e)return{valid:!0,data:t};if(n===j.object&&i===j.object){let r=de.objectKeys(e),o=de.objectKeys(t).filter(s=>r.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=uy(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===j.array&&i===j.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=uy(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===j.date&&i===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ko=class extends le{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,a)=>{if(Kf(o)||Kf(a))return X;let s=uy(o.value,a.value);return s.valid?((Qf(o)||Qf(a))&&n.dirty(),{status:n.value,value:s.data}):($(i,{code:I.invalid_intersection_types}),X)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ko.create=(t,e,n)=>new Ko({left:t,right:e,typeName:J.ZodIntersection,...se(n)});var pi=class t extends le{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.array)return $(i,{code:I.invalid_type,expected:j.array,received:i.parsedType}),X;if(i.data.length<this._def.items.length)return $(i,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&i.data.length>this._def.items.length&&($(i,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new In(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>wt.mergeArray(n,a)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};pi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pi({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var ep=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.object)return $(i,{code:I.invalid_type,expected:j.object,received:i.parsedType}),X;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new In(i,s,i.path,s)),value:a._parse(new In(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?wt.mergeObjectAsync(n,r):wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof le?new t({keyType:e,valueType:n,typeName:J.ZodRecord,...se(i)}):new t({keyType:Xr.create(),valueType:e,typeName:J.ZodRecord,...se(n)})}},ks=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.map)return $(i,{code:I.invalid_type,expected:j.map,received:i.parsedType}),X;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new In(i,s,i.path,[c,"key"])),value:o._parse(new In(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return X;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return X;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};ks.create=(t,e,n)=>new ks({valueType:e,keyType:t,typeName:J.ZodMap,...se(n)});var Ts=class t extends le{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.set)return $(i,{code:I.invalid_type,expected:j.set,received:i.parsedType}),X;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&($(i,{code:I.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&($(i,{code:I.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return X;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>o._parse(new In(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ts.create=(t,e)=>new Ts({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var tp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.function)return $(n,{code:I.invalid_type,expected:j.function,received:n.parsedType}),X;function i(s,l){return wc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ss(),Xi].filter(c=>!!c),issueData:{code:I.invalid_arguments,argumentsError:l}})}function r(s,l){return wc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ss(),Xi].filter(c=>!!c),issueData:{code:I.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Qr){let s=this;return Rt(async function(...l){let c=new Wt([]),u=await s._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(i(l,m)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(r(d,m)),c})})}else{let s=this;return Rt(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new Wt([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Wt([r(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:pi.create(e).rest(Qi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||pi.create([]).rest(Qi.create()),returns:n||Qi.create(),typeName:J.ZodFunction,...se(i)})}},Qo=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Qo.create=(t,e)=>new Qo({getter:t,typeName:J.ZodLazy,...se(e)});var Jo=class extends le{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return $(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:e.data}}get value(){return this._def.value}};Jo.create=(t,e)=>new Jo({value:t,typeName:J.ZodLiteral,...se(e)});function DA(t,e){return new ea({values:t,typeName:J.ZodEnum,...se(e)})}var ea=class t extends le{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return $(n,{expected:de.joinValues(i),received:n.parsedType,code:I.invalid_type}),X}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return $(n,{received:n.data,code:I.invalid_enum_value,options:i}),X}return Rt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};ea.create=DA;var ta=class extends le{_parse(e){let n=de.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==j.string&&i.parsedType!==j.number){let r=de.objectValues(n);return $(i,{expected:de.joinValues(r),received:i.parsedType,code:I.invalid_type}),X}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=de.objectValues(n);return $(i,{received:i.data,code:I.invalid_enum_value,options:r}),X}return Rt(e.data)}get enum(){return this._def.values}};ta.create=(t,e)=>new ta({values:t,typeName:J.ZodNativeEnum,...se(e)});var Qr=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.promise&&n.common.async===!1)return $(n,{code:I.invalid_type,expected:j.promise,received:n.parsedType}),X;let i=n.parsedType===j.promise?n.data:Promise.resolve(n.data);return Rt(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Qr.create=(t,e)=>new Qr({type:t,typeName:J.ZodPromise,...se(e)});var Hn=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{$(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return X;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?X:l.status==="dirty"?jo(l.value):n.value==="dirty"?jo(l.value):l});{if(n.value==="aborted")return X;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?X:s.status==="dirty"?jo(s.value):n.value==="dirty"?jo(s.value):s}}if(r.type==="refinement"){let a=s=>{let l=r.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?X:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?X:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Wr(a))return X;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Wr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):X);de.assertNever(r)}};Hn.create=(t,e,n)=>new Hn({schema:t,typeName:J.ZodEffects,effect:e,...se(n)});Hn.createWithPreprocess=(t,e,n)=>new Hn({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(n)});var Ln=class extends le{_parse(e){return this._getType(e)===j.undefined?Rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ln.create=(t,e)=>new Ln({innerType:t,typeName:J.ZodOptional,...se(e)});var hi=class extends le{_parse(e){return this._getType(e)===j.null?Rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hi.create=(t,e)=>new hi({innerType:t,typeName:J.ZodNullable,...se(e)});var na=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===j.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};na.create=(t,e)=>new na({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var ia=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ws(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Wt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Wt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};ia.create=(t,e)=>new ia({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Rs=class extends le{_parse(e){if(this._getType(e)!==j.nan){let i=this._getOrReturnCtx(e);return $(i,{code:I.invalid_type,expected:j.nan,received:i.parsedType}),X}return{status:"valid",value:e.data}}};Rs.create=t=>new Rs({typeName:J.ZodNaN,...se(t)});var hL=Symbol("zod_brand"),Ec=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Cc=class t extends le{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?X:o.status==="dirty"?(n.dirty(),jo(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?X:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:J.ZodPipeline})}},ra=class extends le{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Wr(r)&&(r.value=Object.freeze(r.value)),r);return ws(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};ra.create=(t,e)=>new ra({innerType:t,typeName:J.ZodReadonly,...se(e)});function RA(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function LA(t,e={},n){return t?Kr.create().superRefine((i,r)=>{let o=t(i);if(o instanceof Promise)return o.then(a=>{if(!a){let s=RA(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=RA(e,i),s=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:s})}}):Kr.create()}var gL={object:Xt.lazycreate},J;(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"})(J||(J={}));var mL=(t,e={message:`Input not instance of ${t.name}`})=>LA(n=>n instanceof t,e),IA=Xr.create,HA=Po.create,vL=Rs.create,yL=qo.create,zA=Zo.create,bL=Go.create,_L=Cs.create,xL=Yo.create,SL=Wo.create,wL=Kr.create,EL=Qi.create,CL=Kn.create,AL=As.create,kL=Ji.create,TL=Xt.create,RL=Xt.strictCreate,OL=Xo.create,ML=Jf.create,NL=Ko.create,DL=pi.create,LL=ep.create,IL=ks.create,HL=Ts.create,zL=tp.create,BL=Qo.create,$L=Jo.create,FL=ea.create,UL=ta.create,VL=Qr.create,jL=Hn.create,PL=Ln.create,qL=hi.create,ZL=Hn.createWithPreprocess,GL=Cc.create,YL=()=>IA().optional(),WL=()=>HA().optional(),XL=()=>zA().optional(),KL={string:(t=>Xr.create({...t,coerce:!0})),number:(t=>Po.create({...t,coerce:!0})),boolean:(t=>Zo.create({...t,coerce:!0})),bigint:(t=>qo.create({...t,coerce:!0})),date:(t=>Go.create({...t,coerce:!0}))};var QL=X;var dy=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()})]),BA=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:dy,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()}),$A=p.object({kind:p.literal("highlight"),id:p.string(),anchor:dy,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()}),np=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([BA,$A]))});function JL(t){return np.parse(t)}var e3=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=vf({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:i});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let a=await o.json();return np.parse(a)};var ip=Q(Ke(),1),FA=Q(tl(),1);function t3({element:t,children:e}){let[n,i]=(0,ip.useState)(null);return(0,ip.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,FA.createPortal)(e,n):null}function n3(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var fy=class{constructor(){P(this,"sessionId");this.sessionId=n3(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function rp(){return new fy}var O=typeof window<"u"?window:void 0,Ct=typeof globalThis<"u"?globalThis:O;typeof self>"u"&&(Ct.self=Ct),typeof File>"u"&&(Ct.File=function(){});var Hk=Array.prototype,UA=Hk.forEach,VA=Hk.indexOf,mn=Ct?.navigator,U=Ct?.document,Qt=Ct?.location,Ty=Ct?.fetch,Ry=Ct!=null&&Ct.XMLHttpRequest&&"withCredentials"in new Ct.XMLHttpRequest?Ct.XMLHttpRequest:void 0,jA=Ct?.AbortController,Kt=mn?.userAgent,te=O??{},tr={DEBUG:!1,LIB_VERSION:"1.302.2"};function PA(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function qA(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(l){PA(o,i,r,a,s,"next",l)}function s(l){PA(o,i,r,a,s,"throw",l)}a(void 0)}))}}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},q.apply(null,arguments)}function zk(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var i3=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ZA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return i3.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},r3=["$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 fe(t,e){return t.indexOf(e)!==-1}var Hp=function(t){return t.trim()},Oy=function(t){return t.replace(/^\$/,"")},o3=Array.isArray,Bk=Object.prototype,$k=Bk.hasOwnProperty,zp=Bk.toString,Re=o3||function(t){return zp.call(t)==="[object Array]"},ro=t=>typeof t=="function",ht=t=>t===Object(t)&&!Re(t),Ds=t=>{if(ht(t)){for(var e in t)if($k.call(t,e))return!1;return!0}return!1},F=t=>t===void 0,lt=t=>zp.call(t)=="[object String]",My=t=>lt(t)&&t.trim().length===0,or=t=>t===null,Ce=t=>F(t)||or(t),yi=t=>zp.call(t)=="[object Number]",oo=t=>zp.call(t)==="[object Boolean]",a3=t=>t instanceof FormData,s3=t=>fe(r3,t);function Ny(t){return t===null||typeof t!="object"}function gp(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Fk(t){return!F(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var l3=[!0,"true",1,"1","yes"],py=t=>fe(l3,t),c3=[!1,"false",0,"0","no"];function gi(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),yi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),gi(r||n,e,n,i))}var Dy=class{constructor(e){this.t={},this.i=e.i,this.o=gi(e.bucketSize,0,100,e.h),this.m=gi(e.refillRate,0,this.o,e.h),this.S=gi(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,i):(o={tokens:this.o,lastAccess:i},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},op,GA,hy,u3=t=>t instanceof Error;function d3(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return hy&&n.length===GA||(GA=n.length,hy=n.reduce(((i,r)=>{op||(op={});var o=op[r];if(o)i[o[0]]=o[1];else for(var a=t(r),s=a.length-1;s>=0;s--){var l=a[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,op[r]=[c,u];break}}return i}),{})),hy}}var Ly=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(),a=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return qA((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Re(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),q({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return qA((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,o,a={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,q({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:d3(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(o,a)=>{if(a<=4){var s=this.buildCoercingContext(e,n,a);return this.applyCoercers(o,s)}};return q({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:o=>r(o,i),next:o=>r(o,i+1)})}},zs="?";function Iy(t,e,n,i,r){var o={platform:t,filename:e,function:n==="<anonymous>"?zs:n,in_app:!0};return F(i)||(o.lineno=i),F(r)||(o.colno=r),o}var Uk=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:zs,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},f3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,p3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h3=/\((\S*)(?::(\d+))(?::(\d+))\)/,g3=(t,e)=>{var n=f3.exec(t);if(n){var[,i,r,o]=n;return Iy(e,i,zs,+r,+o)}var a=p3.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var s=h3.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[l,c]=Uk(a[1]||zs,a[2]);return Iy(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},m3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,v3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y3=(t,e)=>{var n=m3.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=v3.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],o=n[1]||zs;return[o,r]=Uk(o,r),Iy(e,r,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},YA=/\(error: (.*)\)/,WA=50;function b3(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
|
|
456
|
+
`),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=YA.test(c)?c.replace(YA,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var h=d(u,t);if(h){a.push(h);break}}if(a.length>=WA)break}}}return(function(m){if(!m.length)return[];var x=Array.from(m);return x.reverse(),x.slice(0,WA).map((_=>{return q({},_,{filename:_.filename||(b=x,b[b.length-1]||{}).filename,function:_.function||zs});var b}))})(a)}}var Hy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return gp(e,"DOMException")}isDOMError(e){return gp(e,"DOMError")}},zy=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},By=class{constructor(){}match(e){return gp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},_3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,$y=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(_3);return r&&(n=r[1],i=r[2]),[n,i]}},x3=["fatal","error","warning","log","info","debug"];function Vk(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var Fy=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Fk(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+Vk(e)}isSeverityLevel(e){return lt(e)&&!My(e)&&x3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(u3(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Uy=class{match(e){return Fk(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Vk(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Vy=class{match(e){return Ny(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},jy=class{match(e){return gp(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return Ny(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(Ny(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}},jk=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(O&&(tr.DEBUG||te.POSTHOG_DEBUG||n)&&!F(O.console)&&O.console){for(var o=("__rrweb_original__"in O.console[r])?O.console[r].__rrweb_original__:O.console[r],a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];console.error(t,...o)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>jk(t+" "+r,o)};return i},V=jk("[PostHog.js]"),ct=V.createLogger,S3=ct("[ExternalScriptsLoader]"),XA=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return S3.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=U?.querySelectorAll("script");if(i){for(var r,o=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},a=0;a<i.length;a++)if(r=o())return r.v}var s=()=>{if(!U)return n("document not found");var l=U.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=U.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):U.body.appendChild(l)};U!=null&&U.body?s():U?.addEventListener("DOMContentLoaded",s)};te.__PosthogExtensions__=te.__PosthogExtensions__||{},te.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",i);XA(t,o,n)},te.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);XA(t,i,n)};var mp={};function ao(t,e,n){if(Re(t)){if(UA&&t.forEach===UA)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===mp)return}}}function Me(t,e,n){if(!Ce(t)){if(Re(t))return ao(t,e,n);if(a3(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===mp)return}else for(var r in t)if($k.call(t,r)&&e.call(n,t[r],r)===mp)return}}var Xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return ao(n,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Fs=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return ao(n,(function(r){ao(r,(function(o){t.push(o)}))})),t};function fp(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var KA=function(t){try{return t()}catch{return}},w3=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){V.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),V.critical(r)}}},Bb=function(t){var e={};return Me(t,(function(n,i){(lt(n)&&n.length>0||yi(n))&&(e[i]=n)})),e};function E3(t,e){return n=t,i=o=>lt(o)&&!or(e)?o.slice(0,e):o,r=new Set,(function o(a,s){return a!==Object(a)?i?i(a,s):a:r.has(a)?void 0:(r.add(a),Re(a)?(l=[],ao(a,(c=>{l.push(o(c))}))):(l={},Me(a,((c,u)=>{r.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,i,r}var C3=["herokuapp.com","vercel.app","netlify.app"];function A3(t){var e=t?.hostname;if(!lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of C3)if(n===i)return!1;return!0}function Pk(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function nt(t,e,n,i){var{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}var qk="$people_distinct_id",Ic="__alias",Hc="__timers",QA="$autocapture_disabled_server_side",Py="$heatmaps_enabled_server_side",JA="$exception_capture_enabled_server_side",qy="$error_tracking_suppression_rules",ek="$error_tracking_capture_extension_exceptions",tk="$web_vitals_enabled_server_side",Zk="$dead_clicks_enabled_server_side",nk="$web_vitals_allowed_metrics",gy="$session_recording_remote_config",vp="$sesid",Gk="$session_is_sampled",Ls="$enabled_feature_flags",zc="$early_access_features",Zy="$feature_flag_details",Bc="$stored_person_properties",sa="$stored_group_properties",Gy="$surveys",ap="$surveys_activated",yp="$flag_call_reported",nr="$user_state",Yy="$client_session_props",Wy="$capture_rate_limit",Xy="$initial_campaign_params",Ky="$initial_referrer_info",bp="$initial_person_info",_p="$epp",Yk="__POSTHOG_TOOLBAR__",Ac="$posthog_cookieless",k3=[qk,Ic,"__cmpns",Hc,"$session_recording_enabled_server_side",Py,vp,Ls,qy,nr,zc,Zy,sa,Bc,Gy,yp,Yy,Wy,Xy,Ky,_p,bp];function ik(t){return t instanceof Element&&(t.id===Yk||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Bp(t){return!!t&&t.nodeType===1}function so(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Wk(t){return!!t&&t.nodeType===3}function Xk(t){return!!t&&t.nodeType===11}function $b(t){return t?Hp(t).split(/\s+/):[]}function rk(t){var e=O?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function xp(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 $b(e)}function Kk(t){return Ce(t)?null:Hp(t).split(/(\s+)/).filter((e=>qc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Kc(t){var e="";return Qy(t)&&!nT(t)&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;Wk(n)&&n.textContent&&(e+=(i=Kk(n.textContent))!==null&&i!==void 0?i:"")})),Hp(e)}function Qk(t){return F(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Fb=["a","button","form","input","select","textarea","label"];function Jk(t,e){if(F(e))return!0;var n,i=function(o){if(e.some((a=>o.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function eT(t){var e=t.parentNode;return!(!e||!Bp(e))&&e}var T3=["next","previous","prev",">","<"],ok=10,ak=[".ph-no-rageclick",".ph-no-capture"];function R3(t,e){if(!O||Ub(t))return!1;var n,i,r;if(oo(e)?(n=!!e&&ak,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:ak,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=tT(t,!1);return!(function(a,s){if(a===!1||F(a))return!1;var l;if(a===!0)l=T3;else{if(!Re(a))return!1;if(a.length>ok)return V.error("[PostHog] content_ignorelist array cannot exceed "+ok+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((h=>u.includes(h)||d.includes(h)))}))})(i,o.map((a=>{var s;return{safeText:Kc(a).toLowerCase(),ariaLabel:((s=a.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!Jk(o,n)}var Ub=t=>!t||so(t,"html")||!Bp(t),tT=(t,e)=>{if(!O||Ub(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!so(r,"body");)if(Xk(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var o=eT(r);if(!o)break;if(e||Fb.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var a=O.getComputedStyle(o);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function O3(t,e,n,i,r){var o,a,s,l;if(n===void 0&&(n=void 0),!O||Ub(t)||(o=n)!=null&&o.url_allowlist&&!rk(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&rk(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((x=>e.type===x)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=tT(t,i);if(!(function(x,_){var b=_?.element_allowlist;if(F(b))return!0;var f,g=function(y){if(b.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var v of x)if(f=g(v))return f.v;return!1})(d,n)||!Jk(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=O.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(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Fb.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function Qy(t){for(var e=t;e.parentNode&&!so(e,"body");e=e.parentNode){var n=xp(e);if(fe(n,"ph-sensitive")||fe(n,"ph-no-capture"))return!1}if(fe(xp(t),"ph-include"))return!0;var i=t.type||"";if(lt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(lt(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function nT(t){return!!(so(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||so(t,"select")||so(t,"textarea")||t.getAttribute("contenteditable")==="true")}var iT="(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})",M3=new RegExp("^(?:"+iT+")$"),N3=new RegExp(iT),rT="\\d{3}-?\\d{2}-?\\d{4}",D3=new RegExp("^("+rT+")$"),L3=new RegExp("("+rT+")");function qc(t,e){return e===void 0&&(e=!0),!(Ce(t)||lt(t)&&(t=Hp(t),(e?M3:N3).test((t||"").replace(/[- ]/g,""))||(e?D3:L3).test(t)))}function oT(t){var e=Kc(t);return qc(e=(e+" "+aT(t)).trim())?e:""}function aT(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Kc(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+aT(n)).trim())}catch(o){V.error("[AutoCapture]",o)}})),e}function I3(t){return(function(e){var n=e.map((i=>{var r,o,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))a+="."+s.replace(/"/g,"");var l=q({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=i.nth_of_type)!==null&&o!==void 0?o:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return fp(l).sort(((u,d)=>{var[h]=u,[m]=d;return h.localeCompare(m)})).forEach((u=>{var[d,h]=u;return c[sk(d.toString())]=sk(h.toString())})),a+=":",a+=fp(c).map((u=>{var[d,h]=u;return d+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,o={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:H3(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return fp(n).filter((a=>{var[s]=a;return s.indexOf("attr__")===0})).forEach((a=>{var[s,l]=a;return o.attributes[s]=l})),o}))})(t))}function sk(t){return t.replace(/"|\\"/g,'\\"')}function H3(t){var e=t.attr__class;return e?Re(e)?e:$b(e):void 0}var Sp=class{constructor(e){this.disabled=e===!1;var n=ht(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},my="$copy_autocapture",rr=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var wp=t=>{var e=U?.createElement("a");return F(e)?null:(e.href=t,e)},z3=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Me(t,(function(o,a){F(o)||F(a)||a==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},Ep=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===e){n=o;break}}if(!Re(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{V.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Qc=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",o=i[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");Re(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var m=l;return s!=null&&(m+="?"+u.join("&")),o!=null&&(m+="#"+o),m},Cp=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},lk=ct("[AutoCapture]");function vy(t,e){return e.length>t?e.slice(0,t)+"...":e}function B3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Bp(e));return e}function $3(t,e,n,i){var r=t.tagName.toLowerCase(),o={tag_name:r};Fb.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=vy(1024,oT(t)):o.$el_text=vy(1024,Kc(t)));var a=xp(t);a.length>0&&(o.classes=a.filter((function(u){return u!==""}))),Me(t.attributes,(function(u){var d;if((!nT(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&qc(u.value)&&(d=u.name,!lt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=$b(h).join(" ")),o["attr__"+u.name]=vy(1024,h)}}));for(var s=1,l=1,c=t;c=B3(c);)s++,c.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function F3(t,e){for(var n,i,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!so(u,"body");)Xk(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],m={},x=!1,_=!1;if(Me(c,(y=>{var w=Qy(y);y.tagName.toLowerCase()==="a"&&(x=y.getAttribute("href"),x=w&&x&&qc(x)&&x),fe(xp(y),"ph-no-capture")&&(_=!0),h.push($3(y,o,a,s));var E=(function(S){if(!Qy(S))return{};var k={};return Me(S.attributes,(function(T){if(T.name&&T.name.indexOf("data-ph-capture-attribute")===0){var C=T.name.replace("data-ph-capture-attribute-",""),R=T.value;C&&R&&qc(R)&&(k[C]=R)}})),k})(y);Xe(m,E)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=oT(t):h[0].$el_text=Kc(t)),x){var b,f;h[0].attr__href=x;var g=(b=wp(x))==null?void 0:b.host,v=O==null||(f=O.location)==null?void 0:f.host;g&&v&&g!==v&&(d=x)}return{props:Xe({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:I3(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},m)}}var Jy=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Sp(e.config.rageclick),this.I=null}get F(){var e,n,i=ht(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(O&&U){var e=i=>{i=i||O?.event;try{this.M(i)}catch(r){lk.error("Failed to capture event",r)}};if(nt(U,"submit",e,{capture:!0}),nt(U,"change",e,{capture:!0}),nt(U,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||O?.event,this.M(i,my)};nt(U,"copy",n,{capture:!0}),nt(U,"cut",n,{capture:!0})}}}else lk.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({[QA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var o=U?.querySelectorAll(r);o?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[QA],r=this.T;if(or(r)&&!oo(i)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=Qk(e);Wk(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&R3(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===my;if(r&&O3(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=F3(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===my){var c,u=Kk(O==null||(c=O.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return ro(U?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return yi(t)&&isFinite(t)&&Math.floor(t)===t});var ck="0123456789abcdef",eb=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+ck.charAt(this.bytes[n]>>>4)+ck.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},tb=class{constructor(){this.A=0,this.D=0,this.j=new nb}generate(){var e=this.generateOrAbort();if(F(e)){this.A=0;var n=this.generateOrAbort();if(F(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return eb.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())}},uk,sT=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};O&&!F(O.crypto)&&crypto.getRandomValues&&(sT=t=>crypto.getRandomValues(t));var nb=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(sT(this.N),this.U=0),this.N[this.U++]}},io=()=>U3().toString(),U3=()=>(uk||(uk=new tb)).generate(),kc="",V3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function j3(t,e){if(e){var n=(function(r,o){if(o===void 0&&(o=U),kc)return kc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+io();!kc&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",kc=c)}return kc})(t);if(!n){var i=(r=>{var o=r.match(V3);return o?o[0]:""})(t);i!==n&&V.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var vi={H:()=>!!U,B:function(t){V.error("cookieStore error: "+t)},q:function(t){if(U){try{for(var e=t+"=",n=U.cookie.split(";").filter((o=>o.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(vi.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(U)try{var o="",a="",s=j3(U.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&V.warn("cookieStore warning: large cookie, len="+c.length),U.cookie=c,c}catch{return}},V:function(t,e){if(U!=null&&U.cookie)try{vi.G(t,"",-1,e)}catch{return}}},yy=null,qe={H:function(){if(!or(yy))return yy;var t=!0;if(F(O))t=!1;else try{var e="__mplssupport__";qe.G(e,"xyz"),qe.q(e)!=='"xyz"'&&(t=!1),qe.V(e)}catch{t=!1}return t||V.error("localStorage unsupported; falling back to cookie store"),yy=t,t},B:function(t){V.error("localStorage error: "+t)},q:function(t){try{return O?.localStorage.getItem(t)}catch(e){qe.B(e)}return null},W:function(t){try{return JSON.parse(qe.q(t))||{}}catch{}return null},G:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(n){qe.B(n)}},V:function(t){try{O?.localStorage.removeItem(t)}catch(e){qe.B(e)}}},P3=["distinct_id",vp,Gk,_p,bp],sp=q({},qe,{W:function(t){try{var e={};try{e=vi.W(t)||{}}catch{}var n=Xe(e,JSON.parse(qe.q(t)||"{}"));return qe.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,o){try{qe.G(t,e,void 0,void 0,o);var a={};P3.forEach((s=>{e[s]&&(a[s]=e[s])})),Object.keys(a).length&&vi.G(t,a,n,i,r,o)}catch(s){qe.B(s)}},V:function(t,e){try{O?.localStorage.removeItem(t),vi.V(t,e)}catch(n){qe.B(n)}}}),lp={},q3={H:function(){return!0},B:function(t){V.error("memoryStorage error: "+t)},q:function(t){return lp[t]||null},W:function(t){return lp[t]||null},G:function(t,e){lp[t]=e},V:function(t){delete lp[t]}},oa=null,Et={H:function(){if(!or(oa))return oa;if(oa=!0,F(O))oa=!1;else try{var t="__support__";Et.G(t,"xyz"),Et.q(t)!=='"xyz"'&&(oa=!1),Et.V(t)}catch{oa=!1}return oa},B:function(t){V.error("sessionStorage error: ",t)},q:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){Et.B(e)}return null},W:function(t){try{return JSON.parse(Et.q(t))||null}catch{}return null},G:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Et.B(n)}},V:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){Et.B(e)}}},ir=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),ib=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?ir.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===ir.DENIED||this.consent===ir.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ir.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return py(e)?ir.GRANTED:fe(c3,e)?ir.DENIED:ir.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?qe:vi;var n=e==="localStorage"?vi:qe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(py(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!Pk([mn?.doNotTrack,mn?.msDoNotTrack,te.doNotTrack],(e=>py(e)))}},cp=ct("[Dead Clicks]"),Z3=()=>!0,G3=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Zk)),i=t.instance.config.capture_dead_clicks;return oo(i)?i:!!ht(i)||n},Ap=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Zk]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=te.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?cp.error("failed to load script",r):e()}))}et(){var e;if(U){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=ht(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=te.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(U),cp.info("starting...")}}else cp.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,cp.info("stopping..."))}},Tc=ct("[ExceptionAutocapture]"),rb=class{constructor(e){var n,i,r;this.rt=()=>{var o;if(O&&this.isEnabled&&(o=te.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=te.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=te.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=te.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){Tc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[JA]),this.F=this.ht(),this.vt=new Dy({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:Tc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ht(e)?n=q({},n,e):(F(e)?this.ut:e)&&(n=q({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Tc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=te.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Tc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[JA]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?Tc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function dk(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return ro(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var ob=class{constructor(e){var n;this._instance=e,this.dt=(O==null||(n=O.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(O&&O.history){var i=this;(e=O.history.pushState)!=null&&e.__posthog_wrapped__||dk(O.history,"pushState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("pushState")})),(n=O.history.replaceState)!=null&&n.__posthog_wrapped__||dk(O.history,"replaceState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=O==null||(n=O.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){V.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};nt(O,"popstate",e),this.ct=()=>{O&&O.removeEventListener("popstate",e)}}}},by=ct("[SegmentIntegration]");function Y3(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var o=i.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||io();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(nr,"identified")),r()},s=o.user();"then"in s&&ro(s.then)?s.then((l=>a(l))):a(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||by.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===i.get_distinct_id()||(by.info("No userId set, resetting PostHog"),i.reset()),o.event.userId&&o.event.userId!==i.get_distinct_id()&&(by.info("UserId set, identifying with PostHog"),i.identify(o.event.userId));var s=i.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var lT="posthog-js";function cT(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return s=>{var l,c,u,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var 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 x=((l=s.exception)==null?void 0:l.values)||[],_=x.map((f=>q({},f,{stacktrace:f.stacktrace?q({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((g=>q({},g,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=x[0])==null?void 0:c.value)||s.message,$exception_type:(u=x[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:_,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=x[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(h=x[0])==null?void 0:h.type,$sentry_tags:s.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),a&&t.exceptions.sendExceptionEvent(b),s}}var ab=class{constructor(e,n,i,r,o,a){this.name=lT,this.setupOnce=function(s){s(cT(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:a==null||a}))}}},W3=O!=null&&O.location?Cp(O.location.hash,"__posthog")||Cp(location.hash,"state"):null,fk="_postHogToolbarParams",pk=ct("[Toolbar]"),no=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(no||{}),sb=class{constructor(e){this.instance=e}_t(e){te.ph_toolbar_state=e}yt(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:no.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!O||!U)return!1;e=e??O.location,i=i??O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var r,o=W3||Cp(e.hash,"__posthog")||Cp(e.hash,"state"),a=o?KA((()=>JSON.parse(atob(decodeURIComponent(o)))))||KA((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(fk)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=te.ph_load_toolbar||te.ph_load_editor;!Ce(n)&&ro(n)?n(e,this.instance):pk.warn("No toolbar load function found")}loadToolbar(e){var n=!(U==null||!U.getElementById(Yk));if(!O||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=q({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(O.localStorage.setItem(fk,JSON.stringify(q({},r,{source:void 0}))),this.yt()===no.LOADED)this.bt(r);else if(this.yt()===no.UNINITIALIZED){var o;this._t(no.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return pk.error("[Toolbar] Failed to load",a),void this._t(no.UNINITIALIZED);this._t(no.LOADED),this.bt(r)})),nt(O,"turbolinks:load",(()=>{this._t(no.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},X3=ct("[TracingHeaders]"),lb=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;F(this.xt)&&((n=te.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),F(this.St)&&((i=te.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=te.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return X3.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},zn="Mobile",kp="iOS",mi="Android",Zc="Tablet",uT=mi+" "+Zc,dT="iPad",fT="Apple",pT=fT+" Watch",Gc="Safari",Bs="BlackBerry",hT="Samsung",gT=hT+"Browser",mT=hT+" Internet",la="Chrome",K3=la+" OS",vT=la+" "+kp,Vb="Internet Explorer",yT=Vb+" "+zn,jb="Opera",Q3=jb+" Mini",Pb="Edge",bT="Microsoft "+Pb,Is="Firefox",_T=Is+" "+kp,Yc="Nintendo",Wc="PlayStation",Hs="Xbox",xT=mi+" "+zn,ST=zn+" "+Gc,$c="Windows",cb=$c+" Phone",hk="Nokia",ub="Ouya",wT="Generic",J3=wT+" "+zn.toLowerCase(),ET=wT+" "+Zc.toLowerCase(),db="Konqueror",Ht="(\\d+(\\.\\d+)?)",_y=new RegExp("Version/"+Ht),e5=new RegExp(Hs,"i"),t5=new RegExp(Wc+" \\w+","i"),n5=new RegExp(Yc+" \\w+","i"),qb=new RegExp(Bs+"|PlayBook|BB10","i"),i5={"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"},r5=(t,e)=>e&&fe(e,fT)||(function(n){return fe(n,Gc)&&!fe(n,la)&&!fe(n,mi)})(t),CT=function(t,e){return e=e||"",fe(t," OPR/")&&fe(t,"Mini")?Q3:fe(t," OPR/")?jb:qb.test(t)?Bs:fe(t,"IE"+zn)||fe(t,"WPDesktop")?yT:fe(t,gT)?mT:fe(t,Pb)||fe(t,"Edg/")?bT:fe(t,"FBIOS")?"Facebook "+zn:fe(t,"UCWEB")||fe(t,"UCBrowser")?"UC Browser":fe(t,"CriOS")?vT:fe(t,"CrMo")||fe(t,la)?la:fe(t,mi)&&fe(t,Gc)?xT:fe(t,"FxiOS")?_T:fe(t.toLowerCase(),db.toLowerCase())?db:r5(t,e)?fe(t,zn)?ST:Gc:fe(t,Is)?Is:fe(t,"MSIE")||fe(t,"Trident/")?Vb:fe(t,"Gecko")?Is:""},o5={[yT]:[new RegExp("rv:"+Ht)],[bT]:[new RegExp(Pb+"?\\/"+Ht)],[la]:[new RegExp("("+la+"|CrMo)\\/"+Ht)],[vT]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Gc]:[_y],[ST]:[_y],[jb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Is]:[new RegExp(Is+"\\/"+Ht)],[_T]:[new RegExp("FxiOS\\/"+Ht)],[db]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Bs]:[new RegExp(Bs+" "+Ht),_y],[xT]:[new RegExp("android\\s"+Ht,"i")],[mT]:[new RegExp(gT+"\\/"+Ht)],[Vb]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},a5=function(t,e){var n=CT(t,e),i=o5[n];if(F(i))return null;for(var r=0;r<i.length;r++){var o=i[r],a=t.match(o);if(a)return parseFloat(a[a.length-2])}return null},gk=[[new RegExp(Hs+"; "+Hs+" (.*?)[);]","i"),t=>[Hs,t&&t[1]||""]],[new RegExp(Yc,"i"),[Yc,""]],[new RegExp(Wc,"i"),[Wc,""]],[qb,[Bs,""]],[new RegExp($c,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[cb,""];if(new RegExp(zn).test(e)&&!/IEMobile\b/.test(e))return[$c+" "+zn,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=i5[i]||"";return/arm/i.test(e)&&(r="RT"),[$c,r]}return[$c,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[kp,e.join(".")]}return[kp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=F(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[mi,e.join(".")]}return[mi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[K3,""]],[/Linux|debian/i,["Linux",""]]],mk=function(t){return n5.test(t)?Yc:t5.test(t)?Wc:e5.test(t)?Hs:new RegExp(ub,"i").test(t)?ub:new RegExp("("+cb+"|WPDesktop)","i").test(t)?cb:/iPad/.test(t)?dT:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?pT:qb.test(t)?Bs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(hk,"i").test(t)?hk:/(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(zn).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)?mi:uT:mi:new RegExp("(pda|"+zn+")","i").test(t)?J3:new RegExp(Zc,"i").test(t)&&!new RegExp(Zc+" pc","i").test(t)?ET:""},up="https?://(.*)",Us=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],s5=Fs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Us),Jc="<masked>",l5=["li_fat_id"];function AT(t,e,n){if(!U)return{};var i,r=e?Fs([],Us,n||[]):[],o=kT(Qc(U.URL,r,Jc),t),a=(i={},Me(l5,(function(s){var l=vi.q(s);i[s]=l||null})),i);return Xe(a,o)}function kT(t,e){var n=s5.concat(e||[]),i={};return Me(n,(function(r){var o=Ep(t,r);i[r]=o||null})),i}function TT(t){var e=(function(o){return o?o.search(up+"google.([^/?]*)")===0?"google":o.search(up+"bing.com")===0?"bing":o.search(up+"yahoo.com")===0?"yahoo":o.search(up+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!or(e)){i.$search_engine=e;var r=U?Ep(U.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function vk(){return navigator.language||navigator.userLanguage}function RT(){return U?.referrer||"$direct"}function OT(t,e){var n=t?Fs([],Us,e||[]):[],i=Qt?.href.substring(0,1e3);return{r:RT().substring(0,1e3),u:i?Qc(i,n,Jc):void 0}}function MT(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=wp(n))==null?void 0:e.host};if(i){r.$current_url=i;var o=wp(i);r.$host=o?.host,r.$pathname=o?.pathname;var a=kT(i);Xe(r,a)}if(n){var s=TT(n);Xe(r,s)}return r}function NT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function c5(){try{return new Date().getTimezoneOffset()}catch{return}}function u5(t,e){if(!Kt)return{};var n,i,r,o=t?Fs([],Us,e||[]):[],[a,s]=(function(l){for(var c=0;c<gk.length;c++){var[u,d]=gk[c],h=u.exec(l),m=h&&(ro(d)?d(h,l):d);if(m)return m}return["",""]})(Kt);return Xe(Bb({$os:a,$os_version:s,$browser:CT(Kt,navigator.vendor),$device:mk(Kt),$device_type:(i=Kt,r=mk(i),r===dT||r===uT||r==="Kobo"||r==="Kindle Fire"||r===ET?Zc:r===Yc||r===Hs||r===Wc||r===ub?"Console":r===pT?"Wearable":r?zn:"Desktop"),$timezone:NT(),$timezone_offset:c5()}),{$current_url:Qc(Qt?.href,o,Jc),$host:Qt?.host,$pathname:Qt?.pathname,$raw_user_agent:Kt.length>1e3?Kt.substring(0,997)+"...":Kt,$browser_version:a5(Kt,navigator.vendor),$browser_language:vk(),$browser_language_prefix:(n=vk(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:tr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Jr=ct("[Web Vitals]"),yk=9e5,fb=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>q({},i,{["$web_vitals_"+r.name+"_event"]:q({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(F(o))Jr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();F(a)||(Ce(i?.name)||Ce(i?.value)?Jr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Jr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),F(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=F(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(q({},i,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,o,a,s=te.__PosthogExtensions__;F(s)||F(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),i&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Jr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[tk]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=ht(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return F(i)?((n=this._instance.persistence)==null?void 0:n.props[nk])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(ht(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=ht(this._instance.config.capture_performance)&&yi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:yk;return 0<e&&e<=6e4?yk:e}get isEnabled(){var e=Qt?.protocol;if(e!=="http:"&&e!=="https:")return Jr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=ht(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:oo(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return oo(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Jr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=ht(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=ht(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tk]:n}),this._instance.persistence.register({[nk]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=te.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Jr.error("failed to load script",r):e()}))}Tt(){var e=O?O.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Fs([],Us,i||[]):[];return Qc(e,r,Jc)}Jr.error("Could not determine current URL")}},d5=ct("[Heatmaps]");function bk(t){return ht(t)&&"clientX"in t&&"clientY"in t&&yi(t.clientX)&&yi(t.clientY)}var pb=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[Py]),this.rageclicks=new Sp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return ht(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 F(this.instance.config.capture_heatmaps)?F(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;d5.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Py]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(U)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){O&&U&&(this.jt=this.Dt.bind(this),nt(O,"beforeunload",this.jt),this.Lt=e=>this.At(e||O?.event),nt(U,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||O?.event),nt(U,"mousemove",this.Nt,{capture:!0}),this.zt=new Ap(this.instance,Z3,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),nt(U,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;O&&U&&(this.jt&&O.removeEventListener("beforeunload",this.jt),this.Lt&&U.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&U.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&U.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=(function(s,l,c){for(var u=s;u&&Bp(u)&&!so(u,"body");){if(u===c)return!1;if(fe(l,O?.getComputedStyle(u).position))return!0;u=eT(u)}return!1})(Qk(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!ik(e.target)&&bk(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(q({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!ik(e.target)&&bk(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(O){var n=O.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=i?Fs([],Us,r||[]):[],a=Qc(n,o,Jc);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Ds(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},hb=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=O?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!(F(a)||F(s)||F(l)||F(c)||F(u)||F(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var h=a<=1?1:gi(s/a,0,1,V),m=a<=1?1:gi(l/a,0,1,V),x=c<=1?1:gi(u/c,0,1,V),_=c<=1?1:gi(d/c,0,1,V);r=Xe(r,{$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:u,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},Bn=Uint8Array,zt=Uint16Array,$s=Uint32Array,Zb=new Bn([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]),Gb=new Bn([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]),_k=new Bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DT=function(t,e){for(var n=new zt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new $s(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},LT=DT(Zb,2),f5=LT[0],gb=LT[1];f5[28]=258,gb[258]=28;for(mb=DT(Gb,0)[1],Tp=new zt(32768),Ne=0;Ne<32768;++Ne)eo=(43690&Ne)>>>1|(21845&Ne)<<1,eo=(61680&(eo=(52428&eo)>>>2|(13107&eo)<<2))>>>4|(3855&eo)<<4,Tp[Ne]=((65280&eo)>>>8|(255&eo)<<8)>>>1;var eo,mb,Tp,Ne,Vc=function(t,e,n){for(var i=t.length,r=0,o=new zt(e);r<i;++r)++o[t[r]-1];var a,s=new zt(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(n){a=new zt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=s[t[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)a[Tp[d]>>>l]=c}else for(a=new zt(i),r=0;r<i;++r)a[r]=Tp[s[t[r]-1]++]>>>15-t[r];return a},ca=new Bn(288);for(Ne=0;Ne<144;++Ne)ca[Ne]=8;for(Ne=144;Ne<256;++Ne)ca[Ne]=9;for(Ne=256;Ne<280;++Ne)ca[Ne]=7;for(Ne=280;Ne<288;++Ne)ca[Ne]=8;var Rp=new Bn(32);for(Ne=0;Ne<32;++Ne)Rp[Ne]=5;var p5=Vc(ca,9,0),h5=Vc(Rp,5,0),IT=function(t){return(t/8>>0)+(7&t&&1)},HT=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof zt?zt:t instanceof $s?$s:Bn)(n-e);return i.set(t.subarray(e,n)),i},er=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},Rc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},xy=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Bn(0),0];if(r==1){var a=new Bn(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(w,E){return w.f-E.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(i=1;i<r;++i)o[i].s>h&&(h=o[i].s);var m=new zt(h+1),x=vb(n[u-1],m,0);if(x>e){i=0;var _=0,b=x-e,f=1<<b;for(o.sort((function(w,E){return m[E.s]-m[w.s]||w.f-E.f}));i<r;++i){var g=o[i].s;if(!(m[g]>e))break;_+=f-(1<<x-m[g]),m[g]=e}for(_>>>=b;_>0;){var v=o[i].s;m[v]<e?_-=1<<e-m[v]++-1:++i}for(;i>=0&&_;--i){var y=o[i].s;m[y]==e&&(--m[y],++_)}x=e}return[new Bn(m),x]},vb=function(t,e,n){return t.s==-1?Math.max(vb(t.l,e,n+1),vb(t.r,e,n+1)):e[t.s]=n},xk=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zt(++e),i=0,r=t[0],o=1,a=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=t[s]}return[n.subarray(0,i),e]},Oc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},yb=function(t,e,n){var i=n.length,r=IT(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<i;++o)t[r+o+4]=n[o];return 8*(r+4+i)},Sk=function(t,e,n,i,r,o,a,s,l,c,u){er(e,u++,n),++r[256];for(var d=xy(r,15),h=d[0],m=d[1],x=xy(o,15),_=x[0],b=x[1],f=xk(h),g=f[0],v=f[1],y=xk(_),w=y[0],E=y[1],S=new zt(19),k=0;k<g.length;++k)S[31&g[k]]++;for(k=0;k<w.length;++k)S[31&w[k]]++;for(var T=xy(S,7),C=T[0],R=T[1],L=19;L>4&&!C[_k[L-1]];--L);var N,z,B,H,K=c+5<<3,D=Oc(r,ca)+Oc(o,Rp)+a,G=Oc(r,h)+Oc(o,_)+a+14+3*L+Oc(S,C)+(2*S[16]+3*S[17]+7*S[18]);if(K<=D&&K<=G)return yb(e,u,t.subarray(l,l+c));if(er(e,u,1+(G<D)),u+=2,G<D){N=Vc(h,m,0),z=h,B=Vc(_,b,0),H=_;var ut=Vc(C,R,0);for(er(e,u,v-257),er(e,u+5,E-1),er(e,u+10,L-4),u+=14,k=0;k<L;++k)er(e,u+3*k,C[_k[k]]);u+=3*L;for(var Jn=[g,w],it=0;it<2;++it){var W=Jn[it];for(k=0;k<W.length;++k){var oe=31&W[k];er(e,u,ut[oe]),u+=C[oe],oe>15&&(er(e,u,W[k]>>>5&127),u+=W[k]>>>12)}}}else N=p5,z=ca,B=h5,H=Rp;for(k=0;k<s;++k)if(i[k]>255){oe=i[k]>>>18&31,Rc(e,u,N[oe+257]),u+=z[oe+257],oe>7&&(er(e,u,i[k]>>>23&31),u+=Zb[oe]);var Bt=31&i[k];Rc(e,u,B[Bt]),u+=H[Bt],Bt>3&&(Rc(e,u,i[k]>>>5&8191),u+=Gb[Bt])}else Rc(e,u,N[i[k]]),u+=z[i[k]];return Rc(e,u,N[256]),u+z[256]},g5=new $s([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),m5=(function(){for(var t=new $s(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),v5=function(t,e,n,i,r){return(function(o,a,s,l,c,u){var d=o.length,h=new Bn(l+d+5*(1+Math.floor(d/7e3))+c),m=h.subarray(l,h.length-c),x=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var b=_+65535;b<d?x=yb(m,x,o.subarray(_,b)):(m[_]=u,x=yb(m,x,o.subarray(_,d)))}else{for(var f=g5[a-1],g=f>>>13,v=8191&f,y=(1<<s)-1,w=new zt(32768),E=new zt(y+1),S=Math.ceil(s/3),k=2*S,T=function(xh){return(o[xh]^o[xh+1]<<S^o[xh+2]<<k)&y},C=new $s(25e3),R=new zt(288),L=new zt(32),N=0,z=0,B=(_=0,0),H=0,K=0;_<d;++_){var D=T(_),G=32767&_,ut=E[D];if(w[G]=ut,E[D]=G,H<=_){var Jn=d-_;if((N>7e3||B>24576)&&Jn>423){x=Sk(o,m,0,C,R,L,z,B,K,_-K,x),B=N=z=0,K=_;for(var it=0;it<286;++it)R[it]=0;for(it=0;it<30;++it)L[it]=0}var W=2,oe=0,Bt=v,Ot=G-ut&32767;if(Jn>2&&D==T(_-Ot))for(var ER=Math.min(g,Jn)-1,CR=Math.min(32767,_),AR=Math.min(258,Jn);Ot<=CR&&--Bt&&G!=ut;){if(o[_+W]==o[_+W-Ot]){for(var cr=0;cr<AR&&o[_+cr]==o[_+cr-Ot];++cr);if(cr>W){if(W=cr,oe=Ot,cr>ER)break;var kR=Math.min(Ot,cr-2),W0=0;for(it=0;it<kR;++it){var _h=_-Ot+it+32768&32767,X0=_h-w[_h]+32768&32767;X0>W0&&(W0=X0,ut=_h)}}}Ot+=(G=ut)-(ut=w[G])+32768&32767}if(oe){C[B++]=268435456|gb[W]<<18|mb[oe];var K0=31&gb[W],Q0=31&mb[oe];z+=Zb[K0]+Gb[Q0],++R[257+K0],++L[Q0],H=_+W,++N}else C[B++]=o[_],++R[o[_]]}}x=Sk(o,m,u,C,R,L,z,B,K,_-K,x)}return HT(h,0,l+IT(x)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},Sy=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function y5(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=m5[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,o=v5(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=o.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Sy(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(o,e),Sy(o,a-8,n.d()),Sy(o,a-4,i),o}var b5=function(t){var e,n,i,r,o="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
442
457
|
`).replace(/\r/g,`
|
|
443
|
-
`)).length,r=0;r<i;r++){var a=t.charCodeAt(r),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),ir(s)||(n>e&&(o+=t.substring(e,n)),o+=s,e=n=r+1)}return n>e&&(o+=t.substring(e,t.length)),o},_5=!!Ry||!!ky,wT="text/plain",Op=function(t,e,n){var i;n===void 0&&(n=!0);var[r,o]=t.split("?"),a=q({},e),s=(i=o?.split("&").map((c=>{var u,[d,h]=c.split("="),m=n&&(u=a[d])!==null&&u!==void 0?u:h;return delete a[d],d+"="+m})))!==null&&i!==void 0?i:[],l=z3(a);return l&&s.push(l),r+"?"+s.join("&")},Uc=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),wy=t=>{var{data:e,compression:n}=t;if(e){if(n===nr.GZipJS){var i=y5((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Hn(l.length+(l.length>>>1)),h=0,m=function(f){d[h++]=f},S=0;S<u;++S){if(h+5>d.length){var _=new Hn(h+8+(u-S<<1));_.set(d),d=_}var b=l.charCodeAt(S);b<128||c?m(b):b<2048?(m(192|b>>>6),m(128|63&b)):b>55295&&b<57344?(m(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),m(128|b>>>12&63),m(128|b>>>6&63),m(128|63&b)):(m(224|b>>>12),m(128|b>>>6&63),m(128|63&b))}return Hk(d,0,h)})(Uc(e)),{mtime:0}),r=new Blob([i],{type:wT});return{contentType:wT,body:r,estimatedSize:r.size}}if(n===nr.Base64){var o=(function(l){var c,u,d,h,m,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,f="",p=[];if(!l)return l;l=b5(l);do c=(m=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=m>>12&63,d=m>>6&63,h=63&m,p[b++]=S.charAt(c)+S.charAt(u)+S.charAt(d)+S.charAt(h);while(_<l.length);switch(f=p.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Uc(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Uc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=Uc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},pp=[];ky&&pp.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:o}=(e=wy(t))!==null&&e!==void 0?e:{},a=new Headers;Me(t.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var s=t.url,l=null;if(jA){var c=new jA;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}ky(s,q({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((d=>{var h={statusCode:u.status,text:d};if(u.status===200)try{h.json=JSON.parse(d)}catch(m){V.error(m)}t.callback==null||t.callback(h)})))).catch((u=>{V.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Ry&&pp.push({transport:"XHR",method:t=>{var e,n=new Ry;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=wy(t))!==null&&e!==void 0?e:{};Me(t.headers,(function(o,a){n.setRequestHeader(a,o)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(r)}}),hn!=null&&hn.sendBeacon&&pp.push({transport:"sendBeacon",method:t=>{var e=Op(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=wy(t))!==null&&n!==void 0?n:{},o=typeof r=="string"?new Blob([r],{type:i}):r;hn.sendBeacon(e,o)}catch{}}});var Mp=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function ET(t,e,n){return Uc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var zk={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Mp(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Mp(n,i))))),icontains:(t,e)=>e.map(dp).some((n=>t.map(dp).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(dp).every((n=>t.map(dp).every((i=>!n.includes(i)))))},dp=t=>t.toLowerCase();function Bk(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,o=e?.[i];if($(o)||ir(o))return!1;var a=[String(o)],s=zk[r.operator];return!!s&&s(r.values,a)}))}var Ey=ct("[Error tracking]"),bb=class{constructor(e){var n,i;this.Jt=[],this.Kt=new Ly([new Hy,new jy,new By,new zy,new Uy,new $y,new Fy,new Vy],b3("web:javascript",g3,y3)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(qy))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,o=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[qy]:this.Jt,[eT]:a})}get Yt(){var e,n=!!this._instance.get_property(eT),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Ey.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Ey.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))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 n=e.reduce(((i,r)=>{var{type:o,value:a}=r;return lt(o)&&o.length>0&&i.$exception_types.push(o),lt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((o=>{var a,s=zk[o.operator],l=Re(o.value)?o.value:[o.value],c=(a=n[o.key])!==null&&a!==void 0?a:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,o,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=a[a.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ce(e)&&Re(e)}},Wn=ct("[FeatureFlags]"),Nc=ct("[FeatureFlags]",{debugEnabled:!0}),Cy="$active_feature_flags",Ms="$override_feature_flags",CT="$feature_flag_payloads",Dc="$override_feature_flag_payloads",AT="$feature_flag_request_id",TT="$feature_flag_evaluated_at",kT=t=>{var e={};for(var[n,i]of fp(t||{}))i&&(e[n]=i);return e},S5=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Wn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},x5=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),_b=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Wn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Zy),n=this._instance.get_property(Ms),i=this._instance.get_property(Dc);if(!i&&!n)return e||{};var r=Xe({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of o){var s,l,c=r[a],u=n?.[a],d=$(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,h=$(u)?c.variant:typeof u=="string"?u:void 0,m=i?.[a],S=q({},c,{enabled:d,variant:d?h??c?.variant:void 0});d!==c?.enabled&&(S.original_enabled=c?.enabled),h!==c?.variant&&(S.original_variant=c?.variant),m&&(S.metadata=q({},c?.metadata,{payload:m,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=S}return this.ii||(Wn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Is),n=this._instance.get_property(Ms);if(!n)return e||{};for(var i=Xe({},e),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(CT),n=this._instance.get_property(Dc);if(!n)return e||{};for(var i=Xe({},e||{}),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Wn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:q({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Fc)||{}),group_properties:this._instance.get_property(aa)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+a);r&&(i.timezone=Nk()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:nr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(x5.FeatureFlags))Wn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,o=this._instance.get_property(AT)||void 0,a=this._instance.get_property(TT)||void 0,s=this._instance.get_property(yp)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,d,h,m,S,_,b;Re(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[yp]:s});var f=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};$(f==null||(d=f.metadata)==null?void 0:d.version)||(p.$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&&(p.$feature_flag_reason=y),f!=null&&(_=f.metadata)!=null&&_.id&&(p.$feature_flag_id=f.metadata.id),$(f?.original_variant)&&$(f?.original_enabled)||(p.$feature_flag_original_response=$(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(b=f.metadata)!=null&&b.original_payload&&(p.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",p)}return i}Wn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:nr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,s=(a=o.json)==null?void 0:a.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return $(i)?void 0:!!i}Wn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=S5(a),h=d.flags,m=d.featureFlags,S=d.featureFlagPayloads;if(m){var _=a.requestId,b=a.evaluatedAt;if(Re(m)){Wn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(m)for(var p=0;p<m.length;p++)f[m[p]]=!0;s&&s.register({[Cy]:m,[Is]:f})}else{var v=m,y=S,w=h;a.errorsWhileComputingFlags&&(v=q({},l,v),y=q({},c,y),w=q({},u,w)),s&&s.register(q({[Cy]:Object.keys(kT(v)),[Is]:v||{},[CT]:y||{},[Zy]:w||{}},_?{[AT]:_}:{},b?{[TT]:b}:{}))}}})(e,this._instance.persistence,i,r,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Wn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Wn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Ms),this._instance.persistence.unregister(Dc),this.pi(),Nc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Ms),Nc.info("Flag overrides cleared");else if(i.flags){if(Re(i.flags)){for(var r={},o=0;o<i.flags.length;o++)r[i.flags[o]]=!0;this._instance.persistence.register({[Ms]:r})}else this._instance.persistence.register({[Ms]:i.flags});Nc.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(Dc),Nc.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[Dc]:i.payloads}),Nc.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,o=(this._instance.get_property(Bc)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:a};o&&(s.$early_access_feature_name=o.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var l=q({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Cy]:Object.keys(kT(l)),[Is]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(Bc),o=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s,l;if(a.json){var c=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Bc),(l=this._instance.persistence)==null||l.register({[Bc]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Fc)||{};this._instance.register({[Fc]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Fc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(aa)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=q({},i[r],e[r]),delete e[r]})),this._instance.register({[aa]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(aa)||{};this._instance.register({[aa]:q({},n,{[e]:{}})})}else this._instance.unregister(aa)}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}},w5=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Pc=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&V.info("Persistence loaded",e.persistence,q({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){w5.indexOf(e.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&qe.H()?qe:n==="localstorage+cookie"&&sp.H()?sp:n==="sessionstorage"&&Et.H()?Et:n==="memory"?q3:n==="cookie"?hi:sp.H()?sp:hi}properties(){var e={};return Me(this.props,(function(n,i){if(i===Is&&pt(n))for(var r=Object.keys(n),o=0;o<r.length;o++)e["$feature/"+r[o]]=n[r[o]];else s=i,l=!1,(ir(a=T3)?l:VA&&a.indexOf===VA?a.indexOf(s)!=-1:(Me(a,(function(c){if(l||(l=c===s))return mp})),l))||(e[i]=n);var a,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Xe({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(pt(e)){$(n)&&(n="None"),this.xi=$(i)?this.$i:i;var r=!1;if(Me(e,((o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(pt(e)){this.xi=$(n)?this.$i:n;var i=!1;if(Me(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=Ak(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Ls(Bb(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=U?.referrer)?kk(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Rk(),$referring_domain:U!=null&&U.referrer&&((e=wp(U.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Xy]||this.props[Ky]||this.register_once({[bp]:Ok(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Me([Ky,Xy],(a=>{var s=this.props[a];s&&Me(s,(function(l,c){e["$initial_"+Oy(c)]=l}))}));var n,i,r=this.props[bp];if(r){var o=(n=Mk(r),i={},Me(n,(function(a,s){i["$initial_"+Oy(s)]=a})),i);Xe(e,o)}return e}safe_merge(e){return Me(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var i=this.props[zc]||{};i[e]=n,this.props[zc]=i,this.save()}remove_event_timer(e){var n=(this.props[zc]||{})[e];return $(n)||(delete this.props[zc][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},Lc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),BF=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),FF=(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})({}),$F=(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})({}),UF=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),VF=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),jF=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),hp=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),RT=(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})({}),Fk=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Kc=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function Ns(t,e,n){if(Ce(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Sb=class{constructor(e){this.Pi=new Kc,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!$((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!$((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var s,l;(s=this.Oi)==null||s.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,o=new Set;e.forEach((a=>{var s;(s=a.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!Ns(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>Ns(s.href,n.href,n.href_matching||"exact")));var o,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&Ns((o=a.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>Ns(c.text,n.text,n.text_matching||"exact")||Ns(c.$el_text,n.text,n.text_matching||"exact")));var o,a,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,d=[],h=/(?::|")text="(.*?)"/g;!Ce(u=h.exec(c));)d.includes(u[1])||d.push(u[1]);return d})(l),a=n.text,s=n.text_matching||"exact",o.some((c=>Ns(c,a,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var o=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||Bk(n.properties.reduce(((i,r)=>{var o=Re(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:o,operator:r.operator||"exact"},i}),{}),e?.properties)}},xe=ct("[Surveys]"),xb="seenSurvey_",E5=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},OT=t=>{var e=""+xb+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+xb+t.id+"_"+t.current_iteration),e},C5=[Ay.Popover,Ay.Widget,Ay.API],A5={ignoreConditions:!1,ignoreDelay:!1,displayType:Fk.Popover},wb=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&Bk(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((a=>{if(a!=null&&a.name){var s=i.get(a.name)||[];s.push(r.id),i.set(a.name,s)}}))})),i}Vi(e,n,i){var r,o=(i===Lc.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((s=>{a=s.filter((l=>o?.includes(l.id)))})),a.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;$((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,o;return((r=i.conditions)==null?void 0:r.actions)&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Sb(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,o,a,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(o=i.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((o,a)=>{this.onEvent(o,a)})),this.Hi=this.Gi(e,Lc.Activation),this.Bi=this.Gi(e,Lc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[ap])||[];if(hp.SHOWN===e&&n&&r.length>0){var o;xe.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,Lc.Cancellation);l.length>0&&(xe.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var d,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){xe.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,Lc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[ap])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;xe.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[ap]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[ap];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Eb=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ce(n))return xe.warn("Flags not loaded yet. Not loading surveys.");var i=Re(n);this.Zi=i?n.length>0:n,xe.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(xb)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)xe.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)xe.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())xe.info("Not loading surveys in cookieless mode without consent.");else{var e=ee?.__PosthogExtensions__;if(e){if(!$(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else xe.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new wb(this._instance),xe.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){xe.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return xe.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Gy);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return xe.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var 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 u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Gy]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){xe.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ce(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);xe.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ce(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ce(this._surveyManager))return xe.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ce(this._surveyManager)?(xe.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var o,a=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(a){var s=this.ae(a);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(C5.includes(r.type)){var o=U?.querySelector(n);if(o)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(xe.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,s;xe.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),xe.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);xe.warn("Survey element not found")}else xe.warn("Surveys of type "+r.type+" cannot be rendered in the app");else xe.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=q({},r,{appearance:q({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void xe.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==Fk.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else xe.warn("Survey not found")}}cancelPendingSurvey(e){Ce(this._surveyManager)?xe.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},MT=ct("[RateLimiter]"),Cb=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((a=>{MT.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void MT.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(Wy))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(Wy,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},oa=ct("[RemoteConfig]"),Ab=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(oa.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return oa.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void oa.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return oa.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){oa.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()):oa.info("__preview_remote_config is disabled. Logging config instead",e):oa.error("Failed to fetch remote config from PostHog.")}},Tb=3e3,kb=class{constructor(e,n){this.he=!0,this.ve=[],this.de=fi(n?.flush_interval_ms||Tb,250,5e3,V.createLogger("flush interval"),Tb),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(q({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var o=n[r],a=new Date().getTime();o.data&&Re(o.data)&&Me(o.data,(s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp})),e.ce(o)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Me(this.ve,(n=>{var i,r=n,o=(r?r.batchKey:null)||r.url;$(e[o])&&(e[o]=q({},r,{data:[]})),(i=e[o].data)==null||i.push(r.data)})),this.ve=[],e}},T5=["retriesPerformedSoFar"],Rb=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!$(O)&&"onLine"in O.navigator&&(this.be=O.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},it(O,"online",this.we),it(O,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=zT(e,T5);gi(n)&&n>0&&(i.url=Op(i.url,{retry_count:n})),this._instance.ci(q({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(q({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),V.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],i=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,$(O)||(this.we&&(O.removeEventListener("online",this.we),this.we=void 0),this.xe&&(O.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(q({},e,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.ve=[]}},Ob=class{constructor(e){this.ke=()=>{var n,i,r,o;this.Pe||(this.Pe={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){it(O,"scroll",this.ke,{capture:!0}),it(O,"scrollend",this.ke,{capture:!0}),it(O,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return O?.document.documentElement;var e=Re(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=O?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return O&&(O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft)||0}},k5=t=>Ok(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Np=class{constructor(e,n,i,r){this.Te=o=>{var a=this.Re();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Yy]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||k5,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Yy]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?Mk(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Me(Bb(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Oy(i)]=n})),e}},Ty=ct("[SessionId]"),Dp=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Kc,this.De=(u,d)=>Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||no,this.Ue=i||no;var o=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*fi(a,60,36e3,Ty.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Et.W(this.He),l=Et.W(this.Be);s&&!l?this.je=s:Et.V(this.He),Et.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Ty.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Et.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Et.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Et.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[vp]:[n,e,i]}))}Ke(){var e=this.Fe.props[vp];return Re(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&&O&&(O.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Et.V(this.Be)},it(O,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,o,a]=this.Ke(),s=this.Je(),l=gi(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!o,d=!u&&!e&&this.De(i,r);u||d||l?(o=this.Ne(),s=this.Ue(),Ty.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):s||(s=this.Ue(),c=!0);var h=r===0||!e||l?i:r,m=a===0?new Date().getTime():a;return this.Ve(s),this.We(o,h,m),e||this.ze(),c&&this.Oe.forEach((S=>S(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},R5=["$set_once","$set"],eo=ct("[SiteApps]"),Mb=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,m]of Object.entries(d))c[h]={id:u[h],type:h,properties:m};var{$set_once:S,$set:_}=e;return{event:q({},zT(e,R5),{properties:q({},e.properties,_?{$set:q({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},S?{$set_once:q({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},S)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(eo.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{n.errored=!s,n.loaded=!0,eo.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(n.processEvent=a),r=!0}catch(s){eo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&n.loaded)try{i()}catch(s){eo.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){eo.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void eo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;ee["__$$ph_site_app_"+c]=o._instance,(u=ee.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(d=>{if(d)return eo.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:s,url:l}of e.siteApps)a(s)}else eo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},$k=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&ZA(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>ZA(r?.brand,e))))return!0}catch{}return!!t.webdriver},Vc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),NT="i.posthog.com",Nb=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+NT,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Vc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Vc.EU:this.er[this.apiHost]=Vc.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Vc.CUSTOM)return this.apiHost+n;var i=NT+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},O5={icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!O&&Mp(e.href,t),not_regex:(t,e)=>!!O&&!Mp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Db=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n.sr)==null||a.set(o.feature_flag_key,o));var s=n._instance.getFeatureFlag(o.feature_flag_key);lt(s)&&o.variants[s]&&n.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ce(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,o=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);o&&a!=null&&a.variants[o]&&this.nr(a.name,o,a.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Ep(e?.search,"__experiment_id"),i=Ep(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ce(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.url))return!0;var i,r,o,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||O5[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return O?.location}static hr(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.utm))return!0;var i=Ak();if(i.utm_source){var r,o,a,s,l,c,u,d,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==i.utm_campaign,m=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return h&&S&&_&&m}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];V.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return hn&&this._instance?$k(hn,this._instance.config.custom_blocked_useragents):void 0}},M5=ct("[PostHog ExternalIntegrations]"),N5={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Lb=class{constructor(e){this._instance=e}it(e,n){var i;(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return M5.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var s,l,c;!r||(s=ee.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.it(N5[a],(()=>{var u;(u=ee.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=ee.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=ee.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(i)}}},Ib="[SessionRecording]",Ic=ct(Ib),Lp=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 Ic.error("started without valid sessionManager"),new Error(Ib+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ib+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(gy))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return O&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!$(Object.assign)&&!$(Array.from);this.cr&&i?(this.gr(e),Ic.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(ee!=null&&(n=ee.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=ee.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Ic.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(GT)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,o=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,s=a?.sampleRate,l=Ce(s)?null:parseFloat(s);Ce(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[gy]:q({enabled:!!a},a,{networkPayloadCapture:q({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:$(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Ic.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):Ic.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(gy);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=ee.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=ee.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},qc={},Hb=()=>{},Ds="posthog",Uk=!_5&&Xt?.indexOf("MSIE")===-1&&Xt?.indexOf("Mozilla")===-1,DT=t=>{var e;return q({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:A3(U?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Hb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:Kt&<(Kt?.search)&&Kt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(O==null||(e=O.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Tb},error_tracking:{},_onCapture:Hb,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},LT=t=>{var e={};$(t.process_person)||(e.person_profiles=t.process_person),$(t.xhr_headers)||(e.request_headers=t.xhr_headers),$(t.cookie_name)||(e.persistence_name=t.cookie_name),$(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),$(t.store_google)||(e.save_campaign_params=t.store_google),$(t.verbose)||(e.debug=t.verbose);var n=Xe({},e,t);return Re(t.property_blacklist)&&($(t.property_denylist)?n.property_denylist=t.property_blacklist:Re(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:V.error("Invalid value for property_denylist config: "+t.property_denylist)),n},zb=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ip=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new zb,this.Sr=!1,this.version=Ji.LIB_VERSION,this.Er=new Kc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=DT(),this.SentryIntegration=ab,this.sentryIntegration=e=>(function(n,i){var r=ck(n,i);return{name:lk,processEvent:o=>r(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new _b(this),this.toolbar=new sb(this),this.scrollManager=new Ob(this),this.pageViewManager=new hb(this),this.surveys=new Eb(this),this.experiments=new Db(this),this.exceptions=new bb(this),this.rateLimiter=new Cb(this),this.requestRouter=new Nb(this),this.consent=new ib(this),this.externalIntegrations=new Lb(this),this.people={set:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>V.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ds){var r,o=(r=qc[i])!==null&&r!==void 0?r:new t;return o._init(e,n,i),qc[i]=o,qc[Ds][i]=o,o}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),$(e)||My(e))return V.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Xe({},DT(n.defaults),LT(n),{name:i,token:e})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:nr.GZipJS;var o=this.Cr();this.persistence=new Pc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pc(q({},this.config,{persistence:"sessionStorage"}),o);var a=q({},this.persistence.props),s=q({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new kb((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new Rb(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 Dp(this),this.sessionPropsManager=new Np(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(V.info("Initializing extensions synchronously"),this.Dr(l)),Ji.DEBUG=Ji.DEBUG||this.config.debug,Ji.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:q({},this.config),p:a,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,d=this.config.get_device_id(no()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(er,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var m,S,_=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlags)||{}).filter((p=>{var v;return!((v=n.bootstrap)==null||(v=v.featureFlags)==null||!v[p])})).reduce(((p,v)=>{var y;return p[v]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,p}),{}),b=Object.keys(((S=n.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,v)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(p[v]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[v]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:Tc,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(no());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(er,"anonymous")}return it(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Y3(this,(()=>this.Lr())):this.Lr(),io(this.config._onCapture)&&this.config._onCapture!==Hb&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&V.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new ob(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new lb(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Mb(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new Lp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new Jy(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new pb(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new fb(this)})),i.push((()=>{this.exceptionObserver=new rb(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Ap(this,G3),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(o){V.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,o,a,s,l,c;if(!U||!U.body)return V.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=de(e.supportedCompression,nr.GZipJS)?nr.GZipJS:de(e.supportedCompression,nr.Base64)?nr.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){V.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Ab(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()&&oo(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(Uk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Op(e.url,{ip:this.config.ip?1:0}),e.headers=q({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,o,a=q({},n);a.timeout=a.timeout||6e4,a.url=Op(a.url,{_:new Date().getTime().toString(),ver:Ji.LIB_VERSION,compression:a.compression});var s=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=pp.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(o=PT(l,(u=>u.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(q({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],o=[];oo(e,(s=>{s&&(n=s[0],Re(n)?o.push(s):io(s)?s.call(this):Re(s)&&n==="alias"?i.push(s):Re(s)&&n.indexOf("capture")!==-1&&io(this[n])?o.push(s):r.push(s))}));var a=function(s,l){oo(s,(function(c){if(Re(c[0])){var u=l;Me(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!$(e)&<(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!lt(n?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=no(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var d,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=E3(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,$(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===hp.DISMISSED||e===hp.SENT){var m=n?.[RT.SURVEY_ID],S=n?.[RT.SURVEY_ITERATION];d={id:m,current_iteration:S},localStorage.getItem(OT(d))||localStorage.setItem(OT(d),"true"),u.$set=q({},u.$set,{[E5({id:m,current_iteration:S},e===hp.SENT?"responded":"dismissed")]:!0})}var _=q({},u.properties.$set,u.$set);if(Ls(_)||this.setPersonPropertiesForFlags(_),!Ce(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var f={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(f):this.Mr.enqueue(f),u}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=o?void 0:this.persistence.remove_event_timer(e),s=q({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=q({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!lt(s.distinct_id)&&!gi(s.distinct_id)||My(s.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=u5(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Xe(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Xe(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===Vc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Xe(s,c),e==="$pageview"&&U&&(s.title=U.title),!$(a)){var S=i.getTime()-a;s.$duration=parseFloat((S/1e3).toFixed(3))}Xt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Xe({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Re(this.config.property_denylist)?Me(this.config.property_denylist,(function(f){delete s[f]})):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(V.error("sanitize_properties is deprecated. Use before_send instead"),s=_(s,e));var b=this.Gr();return s.$process_person_profile=b,b&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Xe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.Sr=!0,Ls(o)?void 0:o}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=A5),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(gi(e)&&(e=e.toString(),V.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()))V.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!==Tc){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Hc)&&(this.unregister(Hc),this.register({distinct_id:e}));var a=(this.persistence.get_property(er)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(er,"identified"),this.setPersonPropertiesForFlags(q({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=ET(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(yp))}}else V.critical('The string "'+Tc+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=ET(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(q({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:q({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,o;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(er,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Tc,$device_id:null},"");else{var s=this.config.get_device_id(no());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(qT)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?($(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Hc,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=q({},this.config);if(pt(e)){var i,r,o,a,s;Xe(this.config,LT(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pc(q({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);ro(c)&&(this.config.debug=c),ro(this.config.debug)&&(this.config.debug?(Ji.DEBUG=!0,qe.H()&&qe.G("ph_debug","true"),V.info("set_config",{config:e,oldConfig:n,newConfig:q({},this.config)})):(Ji.DEBUG=!1,qe.H()&&qe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(q({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ds;return n!==Ds&&(n=Ds+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(er))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(er))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ls(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Hc])&&((n=this.persistence)==null||(n=n.props)==null||!n[_p]))}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"?(V.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(_p,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new Dp(this),this.persistence&&(this.sessionPropsManager=new Np(this,this.sessionManager,this.persistence)),this.sessionRecording=new Lp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),($(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Tc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):V.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===tr.GRANTED?"granted":e===tr.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return hn?$k(hn,this.config.custom_blocked_useragents):void 0}Hr(){U&&(U.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:U.title},{send_instantly:!0}),this.kr&&(U.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),it(U,"visibilitychange",this.kr)))}debug(e){e===!1?(O?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,i,r,o,a,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(V.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=!1,o=V,a=(n="advanced_disable_flags")in(e=l)&&!$(e[n]),s=i in e&&!$(e[i]),a?e[n]:s?(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ce(this.config.before_send))return e;var n=Re(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ce(i)){var o="Event '"+e.event+"' was rejected in beforeSend function";return s3(e.event)?V.warn(o+". This can cause unexpected behavior."):V.info(o),null}i.properties&&!Ls(i.properties)||V.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=ro(e)&&!e,i=qe.H()&&qe.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=w3(t.prototype[e[n]])})(Ip,["identify"]);var IT,Vk=(IT=qc[Ds]=new Ip,(function(){function t(){t.done||(t.done=!0,Uk=!1,Me(qc,(function(e){e._dom_loaded()})))}U!=null&&U.addEventListener?U.readyState==="complete"?t():it(U,"DOMContentLoaded",t,{capture:!1}):O&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),IT);var Yb=class{constructor(e={}){this.options=e;P(this,"client");P(this,"featureFlagsCallback");P(this,"captureCallback");P(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=Vk.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let a=this.getAllFeatureFlags();a&&this.featureFlagsCallback&&this.featureFlagsCallback(a)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let a=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof a=="string"&&this.captureCallback?.(a,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Fp(t={}){return new Yb(t)}var Wb=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},Xb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let o=await Promise.allSettled(i);for(let a of o)a.status==="fulfilled"&&a.value!==r&&n.push(a.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},Kb=async(t,e)=>{let n,i,r=!1,o={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(a=>{n=e.subscribeEvent(t.event,()=>{r||a()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||a()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(a=>{i=setTimeout(()=>{r||a()},t.durationMs)}),o};var tu=class{constructor(){P(this,"executors",new Map);for(let{kind:e,executor:n}of lv)this.registerCore(e,n);for(let{kind:e,executor:n}of bv)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",Wb),this.registerCore("core:parallel",Xb),this.registerCore("core:wait",Kb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let a of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:a.message,field:a.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},mi=new tu;function jk(t){return mi.get(t)}function $p(t){return mi.has(t)}var D5=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Pk=5e4,qk=50;function rr(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!$p(i)&&i!=="core:mountWidget"){let r=mi.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":so(t,e,n);break;case"overlays:badge":so(t,e,n),L5(t,e,n);break;case"overlays:tooltip":so(t,e,n),I5(t,e,n);break;case"overlays:modal":Z5(t,e,n);break;case"content:insertHtml":so(t,e,n),H5(t,e,n);break;case"content:setText":so(t,e,n),z5(t,e,n);break;case"content:setAttr":so(t,e,n),B5(t,e,n);break;case"content:addClass":case"content:removeClass":so(t,e,n),F5(t,e,n);break;case"content:setStyle":so(t,e,n),$5(t,e,n);break;case"core:mountWidget":U5(t,e,n);break;case"core:wait":V5(t,e,n);break;case"core:sequence":j5(t,e,n);break;case"core:parallel":P5(t,e,n);break;case"core:tour":G5(t,e,n);break;case"navigation:navigate":q5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function so(t,e,n){let i=t.anchorId;if(!i||typeof i!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!i.selector||typeof i.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):i.selector.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),i.route===void 0||i.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let r=Array.isArray(i.route)?i.route:[i.route];for(let o of r)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function L5(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function I5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function H5(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>Pk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Pk}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function z5(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function B5(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(D5.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 F5(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function $5(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>qk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${qk}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function U5(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function V5(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function j5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=rr(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function P5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=rr(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function q5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function Z5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function G5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),i.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let a=rr(o.action);for(let s of a.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of a.warnings)n.push(s)}if(o.onAction)for(let[a,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Up(t){let e=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=rr(t[i]);if(!r.valid){let o=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(a=>`${a.code}: ${a.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${i}].${o.field}`:`[${i}]`});for(let o of r.warnings)n.push({...o,suggestion:o.suggestion?`Action ${i}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var Y5=0;function Vp(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,waitForAnchor:o,adaptiveId:a,executorRegistry:s=mi,subscribeNavigation:l,runtime:c}=t,u=new Map,d=new Map;function h(){return`action-${++Y5}`}function m(x,T){n&&n.publish(x,T)}function S(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:h,publishEvent:m,adaptiveId:a,applyAction:p,subscribeEvent:n?(x,T)=>n.subscribe({names:[x]},k=>T(k.props)):void 0,subscribeNavigation:l}}async function _(x,T){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let k=i.mount(x.slot,{type:"widget",widgetId:x.widget.widgetId,config:x.widget.props},{priority:x.widget.priority});return T.publishEvent("action.applied",{id:T.generateId(),kind:"core:mountWidget",slot:x.slot,widgetId:x.widget.widgetId}),{cleanup:()=>{k.unmount()},updateFn:E=>{if("widget"in E&&E.widget){let R=E.widget;R.props&&k.update({type:"widget",widgetId:x.widget.widgetId,config:R.props})}}}}async function b(x,T){if(x.kind==="core:mountWidget")return _(x,T);let k=s.get(x.kind);if(!k){let E="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${x.kind}".`,`Registered: [${E}]`),new Error(`No executor for action kind: ${x.kind}`)}return k(x,T)}function f(x,T,k,E){if(!c)return;let R=[],D=async()=>{let N=u.get(x);if(!N)return;let B=c.evaluateSync(k).value;if(N.state==="applied"&&!B){try{await N.cleanup()}catch(z){console.error(`[ActionEngine] Error reverting conditional action ${x}:`,z)}N.state="deferred",N.cleanup=()=>{},N.updateFn=void 0,m("action.deferred",{id:x,kind:T.kind})}else if(N.state==="deferred"&&B)try{let z=S(),te=await b(T,z);N.state="applied",N.cleanup=te.cleanup,N.updateFn=te.updateFn,N.appliedTs=Date.now(),m("action.applied",{id:x,kind:T.kind,anchorId:"anchorId"in T?T.anchorId:void 0})}catch(z){console.error(`[ActionEngine] Error applying deferred action ${x}:`,z),N.state="failed"}};c.context&&R.push(c.context.subscribe(D)),c.accumulator&&R.push(c.accumulator.subscribe(D)),d.set(x,R)}async function p(x){let T=rr(x);if(!T.valid){let B=T.errors.map(z=>z.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${x?.kind}":`,B,x),new Error(`Action validation failed: ${B}`)}let k=h(),E=x.triggerWhen;if(E&&c&&!c.evaluateSync(E).value){let z={id:k,action:x,adaptiveId:a,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};u.set(k,z);let te={id:k,action:x,async revert(){let I=u.get(k);if(!I)return;let G=d.get(k);if(G){for(let J of G)J();d.delete(k)}I.state="reverted",u.delete(k)},isApplied(){return u.get(k)?.state==="applied"},async update(I){let G=u.get(k);if(!G||G.state!=="applied")throw new Error("Cannot update action that is not applied");if(G.updateFn)await G.updateFn(I);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(k)?.state??"reverted"}};return f(k,x,E,te),te}let R=S(),D=await b(x,R),N={id:k,action:x,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};u.set(k,N),m("action.applied",{id:k,kind:x.kind,anchorId:"anchorId"in x?x.anchorId:void 0});let H={id:k,action:x,async revert(){let B=u.get(k);if(!B||B.state!=="applied")return;let z=d.get(k);if(z){for(let te of z)te();d.delete(k)}try{await B.cleanup(),B.state="reverted",m("action.reverted",{id:k,kind:x.kind})}catch(te){throw B.state="failed",m("action.failed",{id:k,kind:x.kind,error:String(te)}),te}finally{u.delete(k)}},isApplied(){return u.get(k)?.state==="applied"},async update(B){let z=u.get(k);if(!z||z.state!=="applied")throw new Error("Cannot update action that is not applied");if(z.updateFn)await z.updateFn(B);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(k)?.state??"reverted"}};return E&&c&&f(k,x,E,H),H}async function v(x){console.log(`[ActionEngine] applyBatch: ${x.length} action(s)`,x.map(N=>N.kind).join(", "));let T=Up(x);if(!T.valid){let N=T.errors.map(H=>H.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${x.length} action(s):`,N,`
|
|
444
|
-
Actions:`,
|
|
445
|
-
`)),new Error(`Batch validation failed: ${N}`)}let k=h(),E=[],R=[];try{for(let N of x){let H=await p(N);E.push(H),R.push(H)}}catch(N){console.error(`[ActionEngine] Batch apply FAILED at action ${R.length+1}/${x.length}.`,`Successfully applied: ${R.length}. Rolling back...`,N);for(let H of R)try{await H.revert()}catch{}throw N}return{id:k,handles:E,async revertAll(){for(let N=E.length-1;N>=0;N--)try{await E[N].revert()}catch(H){console.error(`[ActionEngine] Error reverting action ${E[N].id}:`,H)}},isApplied(){return E.every(N=>N.isApplied())}}}function y(x){return rr(x)}function w(){return Array.from(u.values()).map(x=>({id:x.id,action:x.action,adaptiveId:x.adaptiveId,appliedTs:x.appliedTs,state:x.state}))}function A(){for(let x of d.values())for(let T of x)try{T()}catch{}d.clear();for(let x of u.values())if(x.state==="applied")try{x.cleanup()}catch(T){console.error("[ActionEngine] Error during cleanup:",T)}u.clear()}return{apply:p,applyBatch:v,validate:y,getActive:w,destroy:A}}var W5=g.object({selector:g.string(),route:g.union([g.string(),g.array(g.string())])}).strict(),jp=g.object({type:g.literal("page_url"),url:g.string()}),Pp=g.object({type:g.literal("route"),routeId:g.string()}),qp=g.object({type:g.literal("anchor_visible"),anchorId:g.string(),state:g.enum(["visible","present","absent"])}),Zp=g.object({type:g.literal("event_occurred"),eventName:g.string(),withinMs:g.number().optional()}),Gp=g.object({type:g.literal("state_equals"),key:g.string(),value:g.unknown()}),Yp=g.object({type:g.literal("viewport"),minWidth:g.number().optional(),maxWidth:g.number().optional(),minHeight:g.number().optional(),maxHeight:g.number().optional()}),Wp=g.object({type:g.literal("session_metric"),key:g.string(),operator:g.enum(["gte","lte","eq","gt","lt"]),threshold:g.number()}),Xp=g.object({type:g.literal("dismissed"),key:g.string(),inverted:g.boolean().optional()}),Kp=g.object({type:g.literal("cooldown_active"),key:g.string(),inverted:g.boolean().optional()}),Qp=g.object({type:g.literal("frequency_limit"),key:g.string(),limit:g.number(),inverted:g.boolean().optional()}),js=g.object({equals:g.union([g.string(),g.number(),g.boolean()]).optional(),contains:g.string().optional()}),Ps=g.object({events:g.array(g.string()).min(1),match:g.record(g.string(),js).optional()}),Jp=g.object({type:g.literal("event_count"),key:g.string(),operator:g.enum(["gte","lte","eq","gt","lt"]),count:g.number().int().min(0),withinMs:g.number().positive().optional(),counter:Ps.optional()}),ca=g.discriminatedUnion("type",[jp,Pp,qp,Zp,Gp,Yp,Wp,Xp,Kp,Qp,Jp]),qs=g.object({conditions:g.array(ca),value:g.unknown()}),Zs=g.object({type:g.literal("rules"),rules:g.array(qs),default:g.unknown()}),Gs=g.object({type:g.literal("score"),field:g.string(),threshold:g.number(),above:g.unknown(),below:g.unknown()}),Ys=g.object({type:g.literal("model"),modelId:g.string(),inputs:g.array(g.string()),outputMapping:g.record(g.string(),g.unknown()),default:g.unknown()}),Ws=g.object({type:g.literal("external"),endpoint:g.string(),method:g.enum(["GET","POST"]).optional(),default:g.unknown(),timeoutMs:g.number().optional()}),or=g.discriminatedUnion("type",[Zs,Gs,Ys,Ws]),X5=or.nullable().optional(),K5=g.object({events:g.array(g.string()),urlContains:g.string().optional(),props:g.record(g.union([g.string(),g.number(),g.boolean()])).optional()}),Q5=g.object({title:g.string().optional(),body:g.string().optional(),icon:g.string().optional()}).nullable().optional();var Qb=g.object({include:g.array(g.string()).optional(),exclude:g.array(g.string()).optional()}),ua=g.object({routes:Qb,strategy:or.optional()});function J5(t){return ca.safeParse(t)}function eI(t){return or.safeParse(t)}function tI(t){return ua.safeParse(t)}var nI=[{defName:"matchOp",schema:js},{defName:"counterDef",schema:Ps},{defName:"activationConfig",schema:ua},{defName:"routeFilter",schema:Qb},{defName:"ruleStrategy",schema:Zs},{defName:"scoreStrategy",schema:Gs},{defName:"modelStrategy",schema:Ys},{defName:"externalStrategy",schema:Ws},{defName:"rule",schema:qs},{defName:"condition",schema:ca}];var Jb=g.object({tileId:g.string(),itemId:g.string().optional()}).strict(),iI=g.object({on:g.string(),title:g.string(),body:g.string().optional(),icon:g.string().optional(),ttl:g.number().optional(),cooldown:g.number().optional(),deepLink:Jb.optional()}).strict(),rI=g.object({id:g.string(),title:g.string().optional(),priority:g.number().optional(),widget:g.string(),props:g.record(g.unknown()).optional(),activation:ua.optional(),notifications:g.array(iI).optional()}).strict(),oI=g.object({position:g.enum(["left","right"]).optional(),background:g.string().optional(),blur:g.string().optional(),border:g.string().optional(),width:g.string().optional()}),aI=g.object({background:g.string().optional(),backgroundHover:g.string().optional(),color:g.string().optional(),size:g.string().optional(),shadow:g.string().optional()}),sI=g.object({background:g.string().optional(),backgroundHover:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),shadow:g.string().optional(),titleColor:g.string().optional(),textColor:g.string().optional(),iconBackground:g.string().optional(),iconShadow:g.string().optional()}),lI=g.object({background:g.string().optional(),textColor:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),scrimOpacity:g.string().optional(),highlightRing:g.string().optional()}),cI=g.object({background:g.string().optional(),textColor:g.string().optional(),textSecondaryColor:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),successColor:g.string().optional(),warningColor:g.string().optional(),errorColor:g.string().optional(),iconBackground:g.string().optional(),progressGradient:g.string().optional()}),uI=g.object({mode:g.enum(["dark","light"]).optional(),fontFamily:g.string().optional(),colorPrimary:g.string().optional(),colorPrimaryHover:g.string().optional(),borderRadius:g.string().optional(),canvas:oI.optional(),launcher:aI.optional(),tile:sI.optional(),overlay:lI.optional(),notification:cI.optional()}).strict(),dI=g.object({enabled:g.boolean().optional(),label:g.string().optional(),position:g.string().optional(),animate:g.boolean().optional(),animationStyle:g.enum(["pulse","bounce","glow"]).optional(),notificationCount:g.number().optional()}).strict(),S$=g.object({schemaVersion:g.string().optional(),fetchedAt:g.string().datetime(),configVersion:g.string().optional(),canvasTitle:g.string().optional(),tiles:g.array(rI),actions:g.array(g.any()),theme:uI.optional(),launcher:dI.optional(),verificationSteps:g.array(g.string()).optional()}).strict();var ht={activation:ua.optional(),triggerWhen:or.nullable().optional()},gn=g.object({selector:g.string(),route:g.union([g.string(),g.array(g.string())])}).strict(),e0=g.object({color:g.string().optional(),scrimOpacity:g.number().min(0).max(1).optional(),paddingPx:g.number().optional(),radiusPx:g.number().optional()}).strict(),t0=g.enum(["top-left","top-right","bottom-left","bottom-right"]),n0=g.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),th=g.object({label:g.string(),actionId:g.string(),primary:g.boolean().optional()}).strict(),i0=g.object({title:g.string().optional(),body:g.string(),ctaButtons:g.array(th).optional()}).strict(),r0=g.object({title:g.string().optional(),body:g.string()}).strict(),o0=g.enum(["before","after","prepend","append","replace"]),a0=g.enum(["immediate","hover","click"]),s0=g.object({widgetId:g.string(),props:g.record(g.unknown()).optional(),priority:g.number().optional()}).strict(),l0=g.object({id:g.string(),action:g.any(),route:g.string().optional(),onAction:g.record(g.string()).optional()}).passthrough(),c0=g.enum(["auto","smooth","instant"]),eh=g.enum(["start","center","end","nearest"]),u0=g.object({kind:g.literal("content:setText"),anchorId:gn,text:g.string(),label:g.string().optional()}).extend(ht).strict(),d0=g.object({kind:g.literal("content:setAttr"),anchorId:gn,attr:g.string(),value:g.string(),label:g.string().optional()}).extend(ht).strict(),f0=g.object({kind:g.literal("content:addClass"),anchorId:gn,className:g.string(),label:g.string().optional()}).extend(ht).strict(),p0=g.object({kind:g.literal("content:removeClass"),anchorId:gn,className:g.string(),label:g.string().optional()}).extend(ht).strict(),h0=g.object({kind:g.literal("content:setStyle"),anchorId:gn,styles:g.record(g.string()),label:g.string().optional()}).extend(ht).strict(),g0=g.object({kind:g.literal("content:insertHtml"),anchorId:gn,html:g.string(),position:o0,deepLink:Jb.optional(),label:g.string().optional()}).extend(ht).strict(),m0=g.object({kind:g.literal("overlays:highlight"),anchorId:gn,style:e0.optional(),duration:g.number().optional(),label:g.string().optional()}).extend(ht).strict(),v0=g.object({kind:g.literal("overlays:pulse"),anchorId:gn,duration:g.number().optional(),label:g.string().optional()}).extend(ht).strict(),y0=g.object({kind:g.literal("overlays:badge"),anchorId:gn,content:g.string(),position:t0.optional(),label:g.string().optional()}).extend(ht).strict(),b0=g.object({kind:g.literal("overlays:tooltip"),anchorId:gn,content:i0,trigger:a0.optional(),placement:n0.optional(),waitFor:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),_0=g.object({kind:g.literal("overlays:modal"),content:r0,size:g.enum(["sm","md","lg"]).optional(),blocking:g.boolean().optional(),scrim:g.object({opacity:g.number().min(0).max(1).optional()}).strict().optional(),dismiss:g.object({onEsc:g.boolean().optional(),closeButton:g.boolean().optional(),timeoutMs:g.number().min(0).optional()}).strict().optional(),ctaButtons:g.array(th).optional(),waitFor:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),S0=g.object({kind:g.literal("navigation:scrollTo"),anchorId:gn,behavior:c0.optional(),block:eh.optional(),inline:eh.optional(),label:g.string().optional()}).extend(ht).strict(),x0=g.object({kind:g.literal("navigation:navigate"),url:g.string(),target:g.enum(["_self","_blank"]).optional(),label:g.string().optional()}).extend(ht).strict(),w0=g.object({kind:g.literal("core:mountWidget"),slot:g.string(),widget:s0,label:g.string().optional()}).extend(ht).strict(),E0=g.object({kind:g.literal("core:wait"),durationMs:g.number().min(0).optional(),event:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),C0=g.object({kind:g.literal("core:sequence"),actions:g.array(g.any()),label:g.string().optional()}).extend(ht).strict(),A0=g.object({kind:g.literal("core:parallel"),actions:g.array(g.any()),waitFor:g.enum(["all","any"]).optional(),label:g.string().optional()}).extend(ht).strict(),T0=g.object({kind:g.literal("core:tour"),tourId:g.string(),steps:g.array(l0).min(1),startStep:g.string().optional(),autoStart:g.boolean().optional(),label:g.string().optional()}).extend(ht).passthrough(),Zk=[{defName:"setText",schema:u0},{defName:"setAttr",schema:d0},{defName:"addClass",schema:f0},{defName:"removeClass",schema:p0},{defName:"setStyle",schema:h0},{defName:"insertHtml",schema:g0},{defName:"highlight",schema:m0},{defName:"pulse",schema:v0},{defName:"badge",schema:y0},{defName:"tooltip",schema:b0},{defName:"modal",schema:_0},{defName:"scrollTo",schema:S0},{defName:"navigate",schema:x0},{defName:"mountWidget",schema:w0},{defName:"wait",schema:E0},{defName:"sequence",schema:C0},{defName:"parallel",schema:A0},{defName:"tour",schema:T0}];function nh(t){let e=t?.root??(typeof document<"u"?document.body:null),n=t?.defaultTimeoutMs??5e3,i=new Map,r=new Map,o=null,a=!1;function s(b){if(!e)return null;try{return e.querySelector(b)}catch{return null}}function l(){for(let[b,f]of i){let p=s(b);if(p){for(let v of f)clearTimeout(v.timer),v.resolve(p);i.delete(b)}}for(let[b,f]of r){let p=s(b);if(p){for(let v of f)v.cancelled||v.cb(p);r.delete(b)}}i.size===0&&r.size===0&&u()}function c(){o||a||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function u(){o&&(o.disconnect(),o=null)}function d(b,f){let p=i.get(b);p&&(p.delete(f),p.size===0&&i.delete(b)),i.size===0&&r.size===0&&u()}function h(b,f){if(a)return Promise.reject(new Error("AnchorResolver destroyed"));let p=s(b);if(p)return Promise.resolve(p);let v=f??n;return new Promise((y,w)=>{let A={resolve:y,reject:w,timer:setTimeout(()=>{d(b,A),w(new Error(`waitFor("${b}") timed out after ${v}ms`))},v)},x=i.get(b);x||(x=new Set,i.set(b,x)),x.add(A),c()})}function m(b,f){if(a)return()=>{};let p=s(b);if(p)return f(p),()=>{};let v={cb:f,cancelled:!1},y=r.get(b);return y||(y=new Set,r.set(b,y)),y.add(v),c(),()=>{v.cancelled=!0;let w=r.get(b);w&&(w.delete(v),w.size===0&&r.delete(b)),i.size===0&&r.size===0&&u()}}function S(){let b=0;for(let f of i.values())b+=f.size;return b}function _(){a=!0,u();let b=new Error("AnchorResolver destroyed");for(let f of i.values())for(let p of f)clearTimeout(p.timer),p.reject(b);i.clear(),r.clear()}return{resolve:s,waitFor:h,onAppear:m,pendingCount:S,destroy:_}}function fI(){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 k0(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(Gk(n,i))return}if(e.include){for(let i of e.include)if(Gk(n,i))return i;return}return n}function Gk(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var nu=class{constructor(e={}){P(this,"context");P(this,"previousContext");P(this,"listeners",new Set);P(this,"telemetry");P(this,"routes");P(this,"navigation");P(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=fI(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=k0(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=k0(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),queueMicrotask(()=>this.updatePage())},history.replaceState=(...a)=>{o(...a),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=k0(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function ih(t={}){return new nu(t)}var Yk=g.object({url:g.string(),routeId:g.string().optional(),title:g.string().optional(),locale:g.string().optional()}),Wk=g.object({url:g.string(),ts:g.number()}),Xk=g.object({sessionId:g.string(),startTs:g.number(),pageHistory:g.array(Wk).optional()}),Kk=g.object({width:g.number(),height:g.number()}),Qk=g.object({x:g.number(),y:g.number(),w:g.number(),h:g.number()}),Jk=g.object({anchorId:g.string(),present:g.boolean(),visible:g.boolean().optional(),boundingBox:Qk.optional()}),eR=g.record(g.string(),g.union([g.number(),g.string(),g.boolean(),g.undefined()])),tR=g.object({page:Yk,session:Xk,viewport:Kk,anchors:g.array(Jk).optional(),augmented:eR.optional()});function pI(t){return tR.safeParse(t)}function R0(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,a=n.page.url,s=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${s}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",a=n.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:a}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let o=i.getSessionMetric(t.key),{operator:a,threshold:s}=t;switch(a){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let o=i.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!i)return t.inverted??!1;let o=i.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}case"event_count":{if(!e.accumulator)return!1;let o=t,a=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return a>=o.count;case"lte":return a<=o.count;case"eq":return a===o.count;case"gt":return a>o.count;case"lt":return a<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function O0(t,e){let n=[];for(let i of t.conditions){let r=R0(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function iu(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:o}=O0(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function ru(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function nR(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:o}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0,accumulator:o?{getCount:(a,s)=>o.getCount(a,s)}:void 0}}async function M0(t,e,n={}){let i=nR(e,n);switch(t.type){case"rules":return iu(t,i);case"score":return ru(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function N0(t,e,n={}){let i=nR(e,n);switch(t.type){case"rules":return iu(t,i);case"score":return ru(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function rh(t){return{evaluate:(e,n)=>M0(e,n,t),evaluateSync:(e,n)=>N0(e,n,t)}}function oh(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,o=null,a=n.ns("accumulator");function s(c){let u=!1;for(let d of i.values()){if(!d.predicate(c))continue;let h=a.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(c.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),a.set(d.stateKey,h),u=!0}if(u)for(let d of r)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||i.size===0||(o=e.subscribe(s))}return{register(c,u,d=!1){let h=`ev:${c}`,m=i.get(h);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}i.set(h,{stateKey:h,needsTimestamps:d,predicate:u}),l()},getCount(c,u){let d=`ev:${c}`,h=a.get(d);if(!h)return 0;if(u===void 0||!h.timestamps)return h.count;let m=Date.now()-u;return h.timestamps.filter(S=>S>=m).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){o&&(o(),o=null),i.clear(),r.clear()}}}function D0(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var ou=class{constructor(e={}){P(this,"subscriptions",new Set);P(this,"history",[]);P(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let o={filter:i,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:Fo};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(D0(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>D0(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=r&&(i===void 0||o.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>D0(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(o=>o.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Xs(t={}){return new ou(t)}var iR={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function hI(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(iR[e])return iR[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?be.UI_SUBMIT:i==="change"?be.UI_CHANGE:n==="input"||n==="textarea"?be.UI_INPUT:be.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function gI(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function L0(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:hI(t),source:"posthog",props:gI(t),schemaVersion:Fo}}function I0(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 ah(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(I0(i)){let r=L0(i);t(r)}}}var H0=g.enum(["posthog","canvas","derived"]),rR=g.object({ts:g.number(),name:g.string(),source:H0,props:g.record(g.string(),g.unknown()).optional(),schemaVersion:g.string()}),oR=g.object({names:g.array(g.string()).optional(),patterns:g.array(g.string()).optional(),sources:g.array(H0).optional()});function mI(t){return rR.safeParse(t)}function vI(t){return oR.safeParse(t)}var Ks=class{constructor(){P(this,"listeners",new Set);P(this,"capturedPushState");P(this,"capturedReplaceState");P(this,"wasNative");P(this,"destroyed",!1);P(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var z0="cooldown:";function aR(t){return{set(e,n){let i=z0+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=z0+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=z0+e;t.remove(n)}}}var au="dismissed:";function sR(t,e){return{mark(n,i=!1){let r=au+n;(i?e:t).set(r,!0)},isDismissed(n){let i=au+n;return t.has(i)||e.has(i)},clear(n){let i=au+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(au)&&t.remove(n);for(let n of e.keys())n.startsWith(au)&&e.remove(n)}}}var B0="freq:";function lR(t){function e(n){let i=B0+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=B0+n,o=e(n),a=(o?.count??0)+1,s={count:a,resetAt:o?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),a},count(n){return e(n)?.count??0},reset(n){let i=B0+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var yI="syntro";function F0(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+i);return}return o.value}catch{return}},set(i,r,o){if(t)try{let a={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(n+i,JSON.stringify(a))}catch(a){console.warn("[StateStore] Failed to save:",a)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(n)&&i.push(o.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function $0(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,o){e.set(n+i,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var su=class{constructor(e={}){P(this,"session");P(this,"user");P(this,"dismissals");P(this,"cooldowns");P(this,"frequency");P(this,"namespace");P(this,"namespacedStorages",new Map);this.namespace=e.namespace??yI,typeof window<"u"?(this.session=F0(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=F0(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=$0(this.namespace),this.user=$0(this.namespace)),this.dismissals=sR(this.session,this.user),this.cooldowns=aR(this.user),this.frequency=lR(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?F0(sessionStorage,n):$0(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function sh(t={}){return new su(t)}function Qs(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function lu(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var U0={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"}},Js={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:[]},cR={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function lh(t,e,n){let i=U0[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function ch(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[tf(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(rf()),n.shift!==!1&&r.push(nf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",ef(e,t,async()=>{let{x:a,y:s,strategy:l}=await of(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${s}px`})})}function uh(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function dh(t,e){return e==="none"||Js[e].length===0?null:t.animate(Js[e],cR)}function fh(t,e){if(e==="none"||Js[e].length===0)return Promise.resolve();let n=[...Js[e]].reverse(),i=t.animate(n,cR);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function ph(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function hh(t){switch(Qs(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 uR(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),a=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){a.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),d=c.value.trim().toLowerCase(),h=u.startsWith("on"),m=(u==="href"||u==="src")&&d.startsWith("javascript:");(h||m)&&s.removeAttribute(c.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var bI=0;function gh(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:o}=t,a=new Map,s=new Map,l=new Map;function c(){return`mount-${++bI}`}function u(y,w){n&&n.publish(y,w)}function d(y){let w=l.get(y);if(w){let A=b(y);for(let x of w)try{x(A)}catch(T){console.error("[Surfaces] State callback error:",T)}}}let h=new Map;function m(y,w,A){switch(w.type){case"html":y.innerHTML=uR(w.content);return;case"widget":{if(o?.has(w.widgetId)){let x=o.mount(w.widgetId,y,w.config);return A&&h.set(A,x),()=>{x.unmount(),A&&h.delete(A)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,w,A){let x=c(),T=Qs(y),k=A?.priority??0,E=A?.animation??r,R=A?.exclusive??!0,D=a.get(y);if(D&&R){if(D.options.priority>k)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${k})`);_(D)}let N=ph(y,x);N.style.zIndex=String(hh(y));let H;if(T==="static")lh(N,y,A?.constraints),e.appendChild(N);else if(T==="inline"){let I=lu(y);if(!I)throw new Error(`Invalid inline slot: ${y}`);if(!i)throw new Error("Anchor resolver required for inline slots");let G=i({selector:I,route:"**"});if(!G)throw new Error(`Anchor not found for inline slot: ${I}`);H=uh(N,G)}else if(T==="adjacent"){let I=lu(y);if(!I)throw new Error(`Invalid adjacent slot: ${y}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let G=i({selector:I,route:"**"});if(!G)throw new Error(`Anchor not found for adjacent slot: ${I}`);e.appendChild(N),H=ch(N,G,A?.position??{placement:"bottom"})}let B=m(N,w,x);dh(N,E);let z={id:x,slot:y,content:w,options:{priority:k,exclusive:R,animation:E,position:A?.position??{placement:"auto"},constraints:A?.constraints??{},adaptiveId:A?.adaptiveId,autoUnmountOnRouteChange:A?.autoUnmountOnRouteChange??!0},container:N,cleanup:()=>{H?.(),B?.()},mountedAt:Date.now()};return a.set(y,z),s.set(y,(s.get(y)??0)+1),u("surface.mounted",{slot:y,id:x,adaptiveId:A?.adaptiveId}),d(y),{id:x,update(I){let G=a.get(y);if(!G||G.id!==x)throw new Error("Mount no longer active");let J=h.get(x);if(J){if(I.type==="widget"){J.update(I.config),G.content=I;return}J.unmount(),h.delete(x)}G.container.innerHTML="";let me=m(G.container,I,x);if(G.content=I,me){let Ke=G.cleanup;G.cleanup=()=>{Ke?.(),me()}}},setOptions(I){let G=a.get(y);if(!G||G.id!==x)throw new Error("Mount no longer active");I.priority!==void 0&&(G.options.priority=I.priority),I.animation!==void 0&&(G.options.animation=I.animation),I.constraints&&T==="static"&&(I.constraints.maxWidth&&(G.container.style.maxWidth=I.constraints.maxWidth),I.constraints.maxHeight&&(G.container.style.maxHeight=I.constraints.maxHeight),I.constraints.minWidth&&(G.container.style.minWidth=I.constraints.minWidth),I.constraints.minHeight&&(G.container.style.minHeight=I.constraints.minHeight)),d(y)},async unmount(){let I=a.get(y);!I||I.id!==x||await _(I)},isMounted(){return a.get(y)?.id===x},getContainer(){let I=a.get(y);return I?.id===x?I.container:null}}}async function _(y){await fh(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),a.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function b(y){let w=a.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:w?.id}}function f(y,w){let A=l.get(y);return A||(A=new Set,l.set(y,A)),A.add(w),()=>{A?.delete(w),A?.size===0&&l.delete(y)}}function p(y,w){let A=a.get(y);return A?w!==void 0?w>=A.options.priority:!1:!0}function v(){for(let y of a.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}a.clear(),l.clear()}return{mount:S,getState:b,onStateChange:f,canMount:p,destroy:v}}var cu=class{constructor(){P(this,"widgets",new Map);P(this,"mountedWidgets",new Map);P(this,"mountIdCounter",0);P(this,"runtimeRef");P(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let a={...i,runtime:this.runtimeRef},s=r.widget.mount(n,a);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(o);c&&(c.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let d={...c,runtime:this.runtimeRef},h=r.widget.mount(n,d);u.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},mh=new cu;var j0="2.0.0";function _I(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(V0(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(V0(i,r))return!0;return!1}return!0}function V0(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function dR(t){let n=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>V0(n,r))}function vh(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:o}=t,a=t.widgets??mh,s=t.executors??mi,l=t.apps??ls,c=new Ks,u=ih({telemetry:e,routes:i,navigation:c}),d=t.events??Xs(),h=sh({namespace:o}),m=oh({eventBus:d,stateStore:h}),S=rh({state:h,events:d,sessionMetrics:n,accumulator:m}),_=CC(),b=nh(),f=A=>dR(A)?b.resolve(A.selector):null,p=async(A,x)=>{if(!dR(A))return null;try{return await b.waitFor(A.selector,x)}catch{return null}},v=gh({overlayRoot:_,eventBus:d,anchorResolver:f,widgetRegistry:a}),y=Vp({overlayRoot:_,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:p,executorRegistry:s,subscribeNavigation:A=>c.subscribe(A),runtime:{evaluateSync:A=>S.evaluateSync(A,u.get()),context:u,accumulator:m}}),w={telemetry:e,context:u,events:d,state:h,sessionMetrics:n,actions:y,surfaces:v,widgets:a,executors:s,apps:l,accumulator:m,anchorResolver:b,navigation:c,version:j0,mode:r,async evaluate(A){return S.evaluate(A,u.get())},evaluateSync(A){return S.evaluateSync(A,u.get())},async filterTiles(A){let x=u.get().page.url,T=[];for(let k of A){let E=k.activation;if(!E){T.push(k);continue}if(!_I(x,E.routes))continue;if(!E.strategy){T.push(k);continue}(await this.evaluate(E.strategy)).value&&T.push(k)}return T},setRoutes(A){u.setRoutes(A)},destroy(){l.unbind().catch(A=>{console.error("[Runtime] Error unbinding apps registry:",A)}),b.destroy(),m.destroy(),c.destroy(),u.destroy(),y.destroy(),v.destroy()}};return l.bind(w),a.bindRuntime(w),w}var fR=g.object({value:g.unknown(),expiresAt:g.number().optional()}),pR=g.object({count:g.number(),resetAt:g.number().optional()});function SI(t){return fR.safeParse(t)}function xI(t){return pR.safeParse(t)}var hR={growthbook:t=>Wf({...t,autoInit:!0})};function gR(t,e){let n=hR[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(hR).join(", ")}`);return n(e)}var wI=["cdn.syntrologie.com","localhost","127.0.0.1"];function EI(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):wI.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var P0=class{constructor(e){P(this,"name","cdn");P(this,"url");P(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!EI(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await CI(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),o=performance.now()-e,a=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:a?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function CI(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function mR(t){return new P0(t)}var AI="syntro_exp",TI="syntro_var",q0=class{constructor(e){P(this,"name","experiments");P(this,"client");P(this,"featureKey");P(this,"manifestKey");P(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),o=r.get(AI),a=r.get(TI);if(o&&a!==null&&this.client.setForcedVariations){let s=parseInt(a,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:hf(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function vR(t){return new q0(t)}var kI="https://cdn.syntrologie.com/configs",yR={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return mR({baseUrl:t.baseUrl??kI,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return vR({featureKey:t.featureKey})}};function bR(t,e={}){let n=yR[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(yR).join(", ")}`);return n(e)}var _R={posthog:t=>Fp(t),noop:()=>rp()};function SR(t,e){let n=_R[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(_R).join(", ")}`);return n(e)}var Z0="syn_";function uu(t){if(!t.startsWith(Z0))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Z0.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function yh(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Z0+n}function ar(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 RI(){if(typeof window>"u")return Y("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=zo(),n=!!($r()?.token&&t?.mode==="editor");return Y("Syntro Bootstrap","isEditorMode:",n),n}function OI(){if(typeof window>"u")return Y("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=zo(),n=!!($r()?.token&&t?.mode==="audit");return Y("Syntro Bootstrap","isAuditMode:",n),n}function MI(){if(typeof window>"u")return Y("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=zo(),n=!!($r()?.token&&t?.mode==="review");return Y("Syntro Bootstrap","isReviewMode:",n),n}var xR="syntro_segment_attributes";function NI(){if(typeof window>"u")return{};try{let t=localStorage.getItem(xR);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){fn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function DI(t){if(!(typeof window>"u"))try{localStorage.setItem(xR,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){fn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function LI(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function II(t){Tv(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=RI(),n=OI(),i=MI(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",$r()),console.log("[DIAG] editorConf:",zo()),Y("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,R=!!window.__SYNTRO_AUDIT_LEGEND__,D=!!window.__SYNTRO_REVIEW_DATA__;if(E||R||D){let N=[E&&"__SYNTRO_EDITOR_PARAMS__",R&&"__SYNTRO_AUDIT_LEGEND__",D&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${N.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&r){let R=zo()?.syntro_token;R?.startsWith("syn_")&&(o=R,Y("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let a;if(o)if(o.startsWith("syn_"))Y("Syntro Bootstrap","Token starts with syn_, decoding..."),a=uu(o),Tv(a.d);else if(r)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw gf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),gf("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)Y("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw gf("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=ar("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ar("VITE_SYNTRO_EXPERIMENT_HOST")||a?.eh,l=ar("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ar("VITE_SYNTRO_TELEMETRY_HOST")||a?.th,c=ar("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ar("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=NI();Y("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let d,h=Xs();console.log("[Syntro Bootstrap] EventBus created");let m=ah(E=>{h.publishEvent(E)}),S=E=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let R=LI(E);if(Y("Syntro Bootstrap","Segment flags from PostHog:",R),DI(R),d){let N={...b?.getAll?.()??{},...R};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",N),d.setAttributes?.(N)}},_;if(a?.t){let E=a.t==="noop"?"noop":"posthog";_=SR(E,{apiKey:a.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:S,onCapture:m}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`)}let b;a?.e&&(d=gR("growthbook",{clientKey:a.e,apiHost:s,attributes:u,onExperimentViewed:_?.trackExperiment?(E,R,D)=>{_.trackExperiment(E,R,D)}:void 0})),t.enableSessionMetrics&&(b=Xf({experiments:d,onMetricChange:(E,R)=>{Y("Syntro Bootstrap",`Session metric changed: ${E} = ${R}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":n?f="audit":ar("NODE_ENV")==="development"&&(f="development");let p=vh({telemetry:_,sessionMetrics:b,mode:f,events:h});Y("Syntro Bootstrap","Runtime created:",{version:p.version,mode:p.mode,hasContext:!!p.context,hasEvents:!!p.events,hasState:!!p.state}),Y("Syntro Bootstrap","Core app executors already registered");let v=t.cdnBase||ar("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ar("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=df({cdnBase:v,registry:p.apps,onLoadStart:E=>{Y("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,R,D)=>{R?Y("Syntro Bootstrap",`App loaded successfully: ${E}`):fn("Syntro Bootstrap",`Failed to load app: ${E}`,D)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:p.apps,runtime:p,version:p.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let w=p.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${w.length} apps in registry:`,w.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of w)if(E.state==="registered")try{await p.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${p.widgets.list().join(", ")}]`)}catch(R){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,R),fn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,R)}if(console.log(`[DIAG] Activation complete. Total widgets: [${p.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(E){fn("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let A;if(t.fetcher)A=t.fetcher;else if(a?.f){let E=bR(a.f,a.o??{});A=async()=>{let R=await E.fetch();return{...R.config,tiles:R.config.tiles??[]}}}else d&&(A=Ho({experiments:d}));let x=new Set,T=A?async()=>{let E=await A();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((N,H)=>`[${H}] ${N.kind}${N.anchorId?` anchor="${typeof N.anchorId=="string"?N.anchorId:N.anchorId.selector}"`:""}${N.label?` "${N.label}"`:""}`).join(", "));let R=E,D=y.getRequiredApps(R);return D.length>0?console.log("[Syntro Bootstrap] Required external apps:",D.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),D.length>0&&await y.loadAppsForConfig(R).then(async H=>{let B=H.filter(I=>I.success),z=H.filter(I=>!I.success);B.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${B.map(I=>I.appId).join(", ")}`);let te=z.filter(I=>!x.has(I.appId));te.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",te.map(I=>`${I.appId} (${I.error})`).join(", ")),te.forEach(I=>x.add(I.appId)));for(let I of D)if(p.apps.has(I))try{await p.apps.activate(I),console.log(`[Syntro Bootstrap] App activated: ${I}`)}catch(G){console.error(`[Syntro Bootstrap] Failed to activate app: ${I}`,G)}else console.error(`[Syntro Bootstrap] App "${I}" required by config but NOT registered.`,`Available apps: [${Array.from(p.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await Mf({...t.canvas,fetcher:T,integrations:{experiments:d,telemetry:_},editorUrl:c,runtime:p}),runtime:p,experiments:d,telemetry:_,sessionMetrics:b,appLoader:y}}var G0={init:II,encodeToken:yh,decodeToken:uu};typeof window<"u"&&(window.Syntro=G0);var Y0="2026-03-03T00:37:32.113Z (bf0eb79411)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${Y0}`);let t=window.SynOS,e=t?.appRegistry||ls;window.SynOS={...t,appRegistry:e,_runtimeBuild:Y0,React:wR.default,ReactDOM:{...HI,createPortal:bh.createPortal,flushSync:bh.flushSync}},dC(e)}return LR(zI);})();
|
|
458
|
+
`)).length,r=0;r<i;r++){var a=t.charCodeAt(r),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),or(s)||(n>e&&(o+=t.substring(e,n)),o+=s,e=n=r+1)}return n>e&&(o+=t.substring(e,t.length)),o},_5=!!Ry||!!Ty,wk="text/plain",Op=function(t,e,n){var i;n===void 0&&(n=!0);var[r,o]=t.split("?"),a=q({},e),s=(i=o?.split("&").map((c=>{var u,[d,h]=c.split("="),m=n&&(u=a[d])!==null&&u!==void 0?u:h;return delete a[d],d+"="+m})))!==null&&i!==void 0?i:[],l=z3(a);return l&&s.push(l),r+"?"+s.join("&")},Fc=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),wy=t=>{var{data:e,compression:n}=t;if(e){if(n===rr.GZipJS){var i=y5((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Bn(l.length+(l.length>>>1)),h=0,m=function(f){d[h++]=f},x=0;x<u;++x){if(h+5>d.length){var _=new Bn(h+8+(u-x<<1));_.set(d),d=_}var b=l.charCodeAt(x);b<128||c?m(b):b<2048?(m(192|b>>>6),m(128|63&b)):b>55295&&b<57344?(m(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++x))>>>18),m(128|b>>>12&63),m(128|b>>>6&63),m(128|63&b)):(m(224|b>>>12),m(128|b>>>6&63),m(128|63&b))}return HT(d,0,h)})(Fc(e)),{mtime:0}),r=new Blob([i],{type:wk});return{contentType:wk,body:r,estimatedSize:r.size}}if(n===rr.Base64){var o=(function(l){var c,u,d,h,m,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,f="",g=[];if(!l)return l;l=b5(l);do c=(m=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=m>>12&63,d=m>>6&63,h=63&m,g[b++]=x.charAt(c)+x.charAt(u)+x.charAt(d)+x.charAt(h);while(_<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})(Fc(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Fc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=Fc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},pp=[];Ty&&pp.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:o}=(e=wy(t))!==null&&e!==void 0?e:{},a=new Headers;Me(t.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var s=t.url,l=null;if(jA){var c=new jA;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Ty(s,q({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((d=>{var h={statusCode:u.status,text:d};if(u.status===200)try{h.json=JSON.parse(d)}catch(m){V.error(m)}t.callback==null||t.callback(h)})))).catch((u=>{V.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Ry&&pp.push({transport:"XHR",method:t=>{var e,n=new Ry;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=wy(t))!==null&&e!==void 0?e:{};Me(t.headers,(function(o,a){n.setRequestHeader(a,o)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(r)}}),mn!=null&&mn.sendBeacon&&pp.push({transport:"sendBeacon",method:t=>{var e=Op(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=wy(t))!==null&&n!==void 0?n:{},o=typeof r=="string"?new Blob([r],{type:i}):r;mn.sendBeacon(e,o)}catch{}}});var Mp=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Ek(t,e,n){return Fc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var zT={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Mp(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Mp(n,i))))),icontains:(t,e)=>e.map(dp).some((n=>t.map(dp).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(dp).every((n=>t.map(dp).every((i=>!n.includes(i)))))},dp=t=>t.toLowerCase();function BT(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,o=e?.[i];if(F(o)||or(o))return!1;var a=[String(o)],s=zT[r.operator];return!!s&&s(r.values,a)}))}var Ey=ct("[Error tracking]"),bb=class{constructor(e){var n,i;this.Jt=[],this.Kt=new Ly([new Hy,new jy,new By,new zy,new Uy,new Fy,new $y,new Vy],b3("web:javascript",g3,y3)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(qy))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,o=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[qy]:this.Jt,[ek]:a})}get Yt(){var e,n=!!this._instance.get_property(ek),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Ey.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Ey.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))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 n=e.reduce(((i,r)=>{var{type:o,value:a}=r;return lt(o)&&o.length>0&&i.$exception_types.push(o),lt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((o=>{var a,s=zT[o.operator],l=Re(o.value)?o.value:[o.value],c=(a=n[o.key])!==null&&a!==void 0?a:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,o,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=a[a.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ce(e)&&Re(e)}},Qn=ct("[FeatureFlags]"),Mc=ct("[FeatureFlags]",{debugEnabled:!0}),Cy="$active_feature_flags",Os="$override_feature_flags",Ck="$feature_flag_payloads",Nc="$override_feature_flag_payloads",Ak="$feature_flag_request_id",kk="$feature_flag_evaluated_at",Tk=t=>{var e={};for(var[n,i]of fp(t||{}))i&&(e[n]=i);return e},x5=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Qn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},S5=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),_b=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Qn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Zy),n=this._instance.get_property(Os),i=this._instance.get_property(Nc);if(!i&&!n)return e||{};var r=Xe({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of o){var s,l,c=r[a],u=n?.[a],d=F(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,h=F(u)?c.variant:typeof u=="string"?u:void 0,m=i?.[a],x=q({},c,{enabled:d,variant:d?h??c?.variant:void 0});d!==c?.enabled&&(x.original_enabled=c?.enabled),h!==c?.variant&&(x.original_variant=c?.variant),m&&(x.metadata=q({},c?.metadata,{payload:m,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=x}return this.ii||(Qn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Ls),n=this._instance.get_property(Os);if(!n)return e||{};for(var i=Xe({},e),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Qn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(Ck),n=this._instance.get_property(Nc);if(!n)return e||{};for(var i=Xe({},e||{}),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Qn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:q({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Bc)||{}),group_properties:this._instance.get_property(sa)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+a);r&&(i.timezone=NT()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:rr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(S5.FeatureFlags))Qn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,o=this._instance.get_property(Ak)||void 0,a=this._instance.get_property(kk)||void 0,s=this._instance.get_property(yp)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,d,h,m,x,_,b;Re(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[yp]:s});var f=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};F(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||(x=f.reason)==null?void 0:x.code;y&&(g.$feature_flag_reason=y),f!=null&&(_=f.metadata)!=null&&_.id&&(g.$feature_flag_id=f.metadata.id),F(f?.original_variant)&&F(f?.original_enabled)||(g.$feature_flag_original_response=F(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(b=f.metadata)!=null&&b.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 i}Qn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:rr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,s=(a=o.json)==null?void 0:a.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return F(i)?void 0:!!i}Qn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=x5(a),h=d.flags,m=d.featureFlags,x=d.featureFlagPayloads;if(m){var _=a.requestId,b=a.evaluatedAt;if(Re(m)){Qn.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({[Cy]:m,[Ls]:f})}else{var v=m,y=x,w=h;a.errorsWhileComputingFlags&&(v=q({},l,v),y=q({},c,y),w=q({},u,w)),s&&s.register(q({[Cy]:Object.keys(Tk(v)),[Ls]:v||{},[Ck]:y||{},[Zy]:w||{}},_?{[Ak]:_}:{},b?{[kk]:b}:{}))}}})(e,this._instance.persistence,i,r,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Qn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Qn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Os),this._instance.persistence.unregister(Nc),this.pi(),Mc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Os),Mc.info("Flag overrides cleared");else if(i.flags){if(Re(i.flags)){for(var r={},o=0;o<i.flags.length;o++)r[i.flags[o]]=!0;this._instance.persistence.register({[Os]:r})}else this._instance.persistence.register({[Os]:i.flags});Mc.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(Nc),Mc.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[Nc]:i.payloads}),Mc.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,o=(this._instance.get_property(zc)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:a};o&&(s.$early_access_feature_name=o.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var l=q({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Cy]:Object.keys(Tk(l)),[Ls]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(zc),o=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s,l;if(a.json){var c=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(zc),(l=this._instance.persistence)==null||l.register({[zc]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Bc)||{};this._instance.register({[Bc]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Bc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(sa)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=q({},i[r],e[r]),delete e[r]})),this._instance.register({[sa]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(sa)||{};this._instance.register({[sa]:q({},n,{[e]:{}})})}else this._instance.unregister(sa)}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}},w5=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],jc=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&V.info("Persistence loaded",e.persistence,q({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){w5.indexOf(e.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&qe.H()?qe:n==="localstorage+cookie"&&sp.H()?sp:n==="sessionstorage"&&Et.H()?Et:n==="memory"?q3:n==="cookie"?vi:sp.H()?sp:vi}properties(){var e={};return Me(this.props,(function(n,i){if(i===Ls&&ht(n))for(var r=Object.keys(n),o=0;o<r.length;o++)e["$feature/"+r[o]]=n[r[o]];else s=i,l=!1,(or(a=k3)?l:VA&&a.indexOf===VA?a.indexOf(s)!=-1:(Me(a,(function(c){if(l||(l=c===s))return mp})),l))||(e[i]=n);var a,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Xe({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(ht(e)){F(n)&&(n="None"),this.xi=F(i)?this.$i:i;var r=!1;if(Me(e,((o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(ht(e)){this.xi=F(n)?this.$i:n;var i=!1;if(Me(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=AT(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Ds(Bb(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=U?.referrer)?TT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:RT(),$referring_domain:U!=null&&U.referrer&&((e=wp(U.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Xy]||this.props[Ky]||this.register_once({[bp]:OT(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Me([Ky,Xy],(a=>{var s=this.props[a];s&&Me(s,(function(l,c){e["$initial_"+Oy(c)]=l}))}));var n,i,r=this.props[bp];if(r){var o=(n=MT(r),i={},Me(n,(function(a,s){i["$initial_"+Oy(s)]=a})),i);Xe(e,o)}return e}safe_merge(e){return Me(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var i=this.props[Hc]||{};i[e]=n,this.props[Hc]=i,this.save()}remove_event_timer(e){var n=(this.props[Hc]||{})[e];return F(n)||(delete this.props[Hc][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},Dc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),$$=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),F$=(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})({}),U$=(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})({}),V$=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),j$=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),P$=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),hp=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),Rk=(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})({}),$T=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Xc=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function Ms(t,e,n){if(Ce(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var xb=class{constructor(e){this.Pi=new Xc,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!F((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!F((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var s,l;(s=this.Oi)==null||s.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,o=new Set;e.forEach((a=>{var s;(s=a.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!Ms(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>Ms(s.href,n.href,n.href_matching||"exact")));var o,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&Ms((o=a.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>Ms(c.text,n.text,n.text_matching||"exact")||Ms(c.$el_text,n.text,n.text_matching||"exact")));var o,a,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,d=[],h=/(?::|")text="(.*?)"/g;!Ce(u=h.exec(c));)d.includes(u[1])||d.push(u[1]);return d})(l),a=n.text,s=n.text_matching||"exact",o.some((c=>Ms(c,a,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var o=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||BT(n.properties.reduce(((i,r)=>{var o=Re(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:o,operator:r.operator||"exact"},i}),{}),e?.properties)}},Se=ct("[Surveys]"),Sb="seenSurvey_",E5=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},Ok=t=>{var e=""+Sb+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Sb+t.id+"_"+t.current_iteration),e},C5=[Ay.Popover,Ay.Widget,Ay.API],A5={ignoreConditions:!1,ignoreDelay:!1,displayType:$T.Popover},wb=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&BT(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((a=>{if(a!=null&&a.name){var s=i.get(a.name)||[];s.push(r.id),i.set(a.name,s)}}))})),i}Vi(e,n,i){var r,o=(i===Dc.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((s=>{a=s.filter((l=>o?.includes(l.id)))})),a.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;F((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,o;return((r=i.conditions)==null?void 0:r.actions)&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new xb(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,o,a,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(o=i.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((o,a)=>{this.onEvent(o,a)})),this.Hi=this.Gi(e,Dc.Activation),this.Bi=this.Gi(e,Dc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[ap])||[];if(hp.SHOWN===e&&n&&r.length>0){var o;Se.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,Dc.Cancellation);l.length>0&&(Se.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var d,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){Se.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,Dc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[ap])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;Se.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[ap]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[ap];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Eb=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ce(n))return Se.warn("Flags not loaded yet. Not loading surveys.");var i=Re(n);this.Zi=i?n.length>0:n,Se.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(Sb)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Se.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Se.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Se.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!F(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else Se.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new wb(this._instance),Se.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){Se.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Se.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Gy);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return Se.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((d=>(function(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 u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Gy]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){Se.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ce(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);Se.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ce(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ce(this._surveyManager))return Se.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ce(this._surveyManager)?(Se.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var o,a=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(a){var s=this.ae(a);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ce(this._surveyManager))Se.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(C5.includes(r.type)){var o=U?.querySelector(n);if(o)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(Se.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,s;Se.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),Se.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);Se.warn("Survey element not found")}else Se.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Se.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ce(this._surveyManager))Se.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=q({},r,{appearance:q({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void Se.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==$T.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else Se.warn("Survey not found")}}cancelPendingSurvey(e){Ce(this._surveyManager)?Se.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},Mk=ct("[RateLimiter]"),Cb=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((a=>{Mk.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void Mk.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(Wy))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(Wy,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},aa=ct("[RemoteConfig]"),Ab=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=te.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(aa.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return aa.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void aa.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return aa.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){aa.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()):aa.info("__preview_remote_config is disabled. Logging config instead",e):aa.error("Failed to fetch remote config from PostHog.")}},kb=3e3,Tb=class{constructor(e,n){this.he=!0,this.ve=[],this.de=gi(n?.flush_interval_ms||kb,250,5e3,V.createLogger("flush interval"),kb),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(q({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var o=n[r],a=new Date().getTime();o.data&&Re(o.data)&&Me(o.data,(s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp})),e.ce(o)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Me(this.ve,(n=>{var i,r=n,o=(r?r.batchKey:null)||r.url;F(e[o])&&(e[o]=q({},r,{data:[]})),(i=e[o].data)==null||i.push(r.data)})),this.ve=[],e}},k5=["retriesPerformedSoFar"],Rb=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!F(O)&&"onLine"in O.navigator&&(this.be=O.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},nt(O,"online",this.we),nt(O,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=zk(e,k5);yi(n)&&n>0&&(i.url=Op(i.url,{retry_count:n})),this._instance.ci(q({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(q({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),V.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],i=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,F(O)||(this.we&&(O.removeEventListener("online",this.we),this.we=void 0),this.xe&&(O.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(q({},e,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.ve=[]}},Ob=class{constructor(e){this.ke=()=>{var n,i,r,o;this.Pe||(this.Pe={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){nt(O,"scroll",this.ke,{capture:!0}),nt(O,"scrollend",this.ke,{capture:!0}),nt(O,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return O?.document.documentElement;var e=Re(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=O?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return O&&(O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft)||0}},T5=t=>OT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Np=class{constructor(e,n,i,r){this.Te=o=>{var a=this.Re();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Yy]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||T5,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Yy]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?MT(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Me(Bb(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Oy(i)]=n})),e}},ky=ct("[SessionId]"),Dp=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Xc,this.De=(u,d)=>Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||io,this.Ue=i||io;var o=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gi(a,60,36e3,ky.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Et.W(this.He),l=Et.W(this.Be);s&&!l?this.je=s:Et.V(this.He),Et.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){ky.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Et.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Et.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Et.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[vp]:[n,e,i]}))}Ke(){var e=this.Fe.props[vp];return Re(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&&O&&(O.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Et.V(this.Be)},nt(O,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,o,a]=this.Ke(),s=this.Je(),l=yi(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!o,d=!u&&!e&&this.De(i,r);u||d||l?(o=this.Ne(),s=this.Ue(),ky.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):s||(s=this.Ue(),c=!0);var h=r===0||!e||l?i:r,m=a===0?new Date().getTime():a;return this.Ve(s),this.We(o,h,m),e||this.ze(),c&&this.Oe.forEach((x=>x(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},R5=["$set_once","$set"],to=ct("[SiteApps]"),Mb=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,m]of Object.entries(d))c[h]={id:u[h],type:h,properties:m};var{$set_once:x,$set:_}=e;return{event:q({},zk(e,R5),{properties:q({},e.properties,_?{$set:q({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},x?{$set_once:q({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},x)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(to.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{n.errored=!s,n.loaded=!0,to.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(n.processEvent=a),r=!0}catch(s){to.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&n.loaded)try{i()}catch(s){to.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){to.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void to.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;te["__$$ph_site_app_"+c]=o._instance,(u=te.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(d=>{if(d)return to.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:s,url:l}of e.siteApps)a(s)}else to.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},FT=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&ZA(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>ZA(r?.brand,e))))return!0}catch{}return!!t.webdriver},Uc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),Nk="i.posthog.com",Nb=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Nk,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Uc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Uc.EU:this.er[this.apiHost]=Uc.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Uc.CUSTOM)return this.apiHost+n;var i=Nk+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},O5={icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!O&&Mp(e.href,t),not_regex:(t,e)=>!!O&&!Mp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Db=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n.sr)==null||a.set(o.feature_flag_key,o));var s=n._instance.getFeatureFlag(o.feature_flag_key);lt(s)&&o.variants[s]&&n.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ce(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,o=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);o&&a!=null&&a.variants[o]&&this.nr(a.name,o,a.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Ep(e?.search,"__experiment_id"),i=Ep(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ce(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.url))return!0;var i,r,o,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||O5[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return O?.location}static hr(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.utm))return!0;var i=AT();if(i.utm_source){var r,o,a,s,l,c,u,d,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==i.utm_campaign,m=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,x=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return h&&x&&_&&m}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];V.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return mn&&this._instance?FT(mn,this._instance.config.custom_blocked_useragents):void 0}},M5=ct("[PostHog ExternalIntegrations]"),N5={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Lb=class{constructor(e){this._instance=e}it(e,n){var i;(i=te.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return M5.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var s,l,c;!r||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.it(N5[a],(()=>{var u;(u=te.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=te.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(i)}}},Ib="[SessionRecording]",Lc=ct(Ib),Lp=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 Lc.error("started without valid sessionManager"),new Error(Ib+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ib+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(gy))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return O&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!F(Object.assign)&&!F(Array.from);this.cr&&i?(this.gr(e),Lc.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(te!=null&&(n=te.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=te.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Lc.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(Gk)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,o=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,s=a?.sampleRate,l=Ce(s)?null:parseFloat(s);Ce(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[gy]:q({enabled:!!a},a,{networkPayloadCapture:q({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:F(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Lc.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):Lc.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(gy);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=te.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=te.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},Pc={},Hb=()=>{},Ns="posthog",UT=!_5&&Kt?.indexOf("MSIE")===-1&&Kt?.indexOf("Mozilla")===-1,Dk=t=>{var e;return q({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:A3(U?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Hb,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:Qt&<(Qt?.search)&&Qt.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:(O==null||(e=O.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:kb},error_tracking:{},_onCapture:Hb,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Lk=t=>{var e={};F(t.process_person)||(e.person_profiles=t.process_person),F(t.xhr_headers)||(e.request_headers=t.xhr_headers),F(t.cookie_name)||(e.persistence_name=t.cookie_name),F(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),F(t.store_google)||(e.save_campaign_params=t.store_google),F(t.verbose)||(e.debug=t.verbose);var n=Xe({},e,t);return Re(t.property_blacklist)&&(F(t.property_denylist)?n.property_denylist=t.property_blacklist:Re(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:V.error("Invalid value for property_denylist config: "+t.property_denylist)),n},zb=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ip=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new zb,this.Sr=!1,this.version=tr.LIB_VERSION,this.Er=new Xc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Dk(),this.SentryIntegration=ab,this.sentryIntegration=e=>(function(n,i){var r=cT(n,i);return{name:lT,processEvent:o=>r(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new _b(this),this.toolbar=new sb(this),this.scrollManager=new Ob(this),this.pageViewManager=new hb(this),this.surveys=new Eb(this),this.experiments=new Db(this),this.exceptions=new bb(this),this.rateLimiter=new Cb(this),this.requestRouter=new Nb(this),this.consent=new ib(this),this.externalIntegrations=new Lb(this),this.people={set:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>V.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ns){var r,o=(r=Pc[i])!==null&&r!==void 0?r:new t;return o._init(e,n,i),Pc[i]=o,Pc[Ns][i]=o,o}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),F(e)||My(e))return V.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Xe({},Dk(n.defaults),Lk(n),{name:i,token:e})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:rr.GZipJS;var o=this.Cr();this.persistence=new jc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new jc(q({},this.config,{persistence:"sessionStorage"}),o);var a=q({},this.persistence.props),s=q({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Tb((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new Rb(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 Dp(this),this.sessionPropsManager=new Np(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(V.info("Initializing extensions synchronously"),this.Dr(l)),tr.DEBUG=tr.DEBUG||this.config.debug,tr.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:q({},this.config),p:a,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,d=this.config.get_device_id(io()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(nr,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var m,x,_=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlags)||{}).filter((g=>{var v;return!((v=n.bootstrap)==null||(v=v.featureFlags)==null||!v[g])})).reduce(((g,v)=>{var y;return g[v]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,g}),{}),b=Object.keys(((x=n.bootstrap)==null?void 0:x.featureFlagPayloads)||{}).filter((g=>_[g])).reduce(((g,v)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(g[v]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[v]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:Ac,$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(nr,"anonymous")}return nt(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Y3(this,(()=>this.Lr())):this.Lr(),ro(this.config._onCapture)&&this.config._onCapture!==Hb&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&V.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new ob(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new lb(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Mb(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new Lp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new Jy(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new pb(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new fb(this)})),i.push((()=>{this.exceptionObserver=new rb(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Ap(this,G3),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(o){V.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,o,a,s,l,c;if(!U||!U.body)return V.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=fe(e.supportedCompression,rr.GZipJS)?rr.GZipJS:fe(e.supportedCompression,rr.Base64)?rr.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){V.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Ab(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()&&ao(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(UT?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Op(e.url,{ip:this.config.ip?1:0}),e.headers=q({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,o,a=q({},n);a.timeout=a.timeout||6e4,a.url=Op(a.url,{_:new Date().getTime().toString(),ver:tr.LIB_VERSION,compression:a.compression});var s=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=pp.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(o=Pk(l,(u=>u.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(q({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],o=[];ao(e,(s=>{s&&(n=s[0],Re(n)?o.push(s):ro(s)?s.call(this):Re(s)&&n==="alias"?i.push(s):Re(s)&&n.indexOf("capture")!==-1&&ro(this[n])?o.push(s):r.push(s))}));var a=function(s,l){ao(s,(function(c){if(Re(c[0])){var u=l;Me(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!F(e)&<(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!lt(n?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=io(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var d,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=E3(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===hp.DISMISSED||e===hp.SENT){var m=n?.[Rk.SURVEY_ID],x=n?.[Rk.SURVEY_ITERATION];d={id:m,current_iteration:x},localStorage.getItem(Ok(d))||localStorage.setItem(Ok(d),"true"),u.$set=q({},u.$set,{[E5({id:m,current_iteration:x},e===hp.SENT?"responded":"dismissed")]:!0})}var _=q({},u.properties.$set,u.$set);if(Ds(_)||this.setPersonPropertiesForFlags(_),!Ce(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var f={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(f):this.Mr.enqueue(f),u}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=o?void 0:this.persistence.remove_event_timer(e),s=q({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=q({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!lt(s.distinct_id)&&!yi(s.distinct_id)||My(s.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=u5(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Xe(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Xe(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===Uc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Xe(s,c),e==="$pageview"&&U&&(s.title=U.title),!F(a)){var x=i.getTime()-a;s.$duration=parseFloat((x/1e3).toFixed(3))}Kt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Xe({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Re(this.config.property_denylist)?Me(this.config.property_denylist,(function(f){delete s[f]})):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(V.error("sanitize_properties is deprecated. Use before_send instead"),s=_(s,e));var b=this.Gr();return s.$process_person_profile=b,b&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Xe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.Sr=!0,Ds(o)?void 0:o}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=A5),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(yi(e)&&(e=e.toString(),V.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()))V.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!==Ac){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Ic)&&(this.unregister(Ic),this.register({distinct_id:e}));var a=(this.persistence.get_property(nr)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(nr,"identified"),this.setPersonPropertiesForFlags(q({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=Ek(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(yp))}}else V.critical('The string "'+Ac+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=Ek(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(q({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:q({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,o;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(nr,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ac,$device_id:null},"");else{var s=this.config.get_device_id(io());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(qk)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(F(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Ic,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=q({},this.config);if(ht(e)){var i,r,o,a,s;Xe(this.config,Lk(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new jc(q({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);oo(c)&&(this.config.debug=c),oo(this.config.debug)&&(this.config.debug?(tr.DEBUG=!0,qe.H()&&qe.G("ph_debug","true"),V.info("set_config",{config:e,oldConfig:n,newConfig:q({},this.config)})):(tr.DEBUG=!1,qe.H()&&qe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(q({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ns;return n!==Ns&&(n=Ns+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(nr))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(nr))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ds(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ic])&&((n=this.persistence)==null||(n=n.props)==null||!n[_p]))}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"?(V.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(_p,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new Dp(this),this.persistence&&(this.sessionPropsManager=new Np(this,this.sessionManager,this.persistence)),this.sessionRecording=new Lp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Ac,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):V.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===ir.GRANTED?"granted":e===ir.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 mn?FT(mn,this.config.custom_blocked_useragents):void 0}Hr(){U&&(U.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:U.title},{send_instantly:!0}),this.kr&&(U.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),nt(U,"visibilitychange",this.kr)))}debug(e){e===!1?(O?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,i,r,o,a,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(V.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=!1,o=V,a=(n="advanced_disable_flags")in(e=l)&&!F(e[n]),s=i in e&&!F(e[i]),a?e[n]:s?(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ce(this.config.before_send))return e;var n=Re(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ce(i)){var o="Event '"+e.event+"' was rejected in beforeSend function";return s3(e.event)?V.warn(o+". This can cause unexpected behavior."):V.info(o),null}i.properties&&!Ds(i.properties)||V.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=oo(e)&&!e,i=qe.H()&&qe.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=w3(t.prototype[e[n]])})(Ip,["identify"]);var Ik,VT=(Ik=Pc[Ns]=new Ip,(function(){function t(){t.done||(t.done=!0,UT=!1,Me(Pc,(function(e){e._dom_loaded()})))}U!=null&&U.addEventListener?U.readyState==="complete"?t():nt(U,"DOMContentLoaded",t,{capture:!1}):O&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Ik);var Yb=class{constructor(e={}){this.options=e;P(this,"client");P(this,"featureFlagsCallback");P(this,"captureCallback");P(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=VT.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let a=this.getAllFeatureFlags();a&&this.featureFlagsCallback&&this.featureFlagsCallback(a)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let a=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof a=="string"&&this.captureCallback?.(a,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function $p(t={}){return new Yb(t)}var Wb=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},Xb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let o=await Promise.allSettled(i);for(let a of o)a.status==="fulfilled"&&a.value!==r&&n.push(a.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},Kb=async(t,e)=>{let n,i,r=!1,o={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(a=>{n=e.subscribeEvent(t.event,()=>{r||a()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||a()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(a=>{i=setTimeout(()=>{r||a()},t.durationMs)}),o};var eu=class{constructor(){P(this,"executors",new Map);for(let{kind:e,executor:n}of lv)this.registerCore(e,n);for(let{kind:e,executor:n}of bv)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",Wb),this.registerCore("core:parallel",Xb),this.registerCore("core:wait",Kb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let a of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:a.message,field:a.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},bi=new eu;function jT(t){return bi.get(t)}function Fp(t){return bi.has(t)}var D5=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),PT=5e4,qT=50;function ar(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!Fp(i)&&i!=="core:mountWidget"){let r=bi.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":lo(t,e,n);break;case"overlays:badge":lo(t,e,n),L5(t,e,n);break;case"overlays:tooltip":lo(t,e,n),I5(t,e,n);break;case"overlays:modal":Z5(t,e,n);break;case"content:insertHtml":lo(t,e,n),H5(t,e,n);break;case"content:setText":lo(t,e,n),z5(t,e,n);break;case"content:setAttr":lo(t,e,n),B5(t,e,n);break;case"content:addClass":case"content:removeClass":lo(t,e,n),$5(t,e,n);break;case"content:setStyle":lo(t,e,n),F5(t,e,n);break;case"core:mountWidget":U5(t,e,n);break;case"core:wait":V5(t,e,n);break;case"core:sequence":j5(t,e,n);break;case"core:parallel":P5(t,e,n);break;case"core:tour":G5(t,e,n);break;case"navigation:navigate":q5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function lo(t,e,n){let i=t.anchorId;if(!i||typeof i!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!i.selector||typeof i.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):i.selector.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),i.route===void 0||i.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let r=Array.isArray(i.route)?i.route:[i.route];for(let o of r)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function L5(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function I5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function H5(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>PT&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${PT}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function z5(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function B5(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(D5.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 $5(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function F5(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>qT&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${qT}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function U5(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function V5(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function j5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=ar(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function P5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=ar(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function q5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function Z5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function G5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),i.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let a=ar(o.action);for(let s of a.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of a.warnings)n.push(s)}if(o.onAction)for(let[a,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Up(t){let e=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=ar(t[i]);if(!r.valid){let o=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(a=>`${a.code}: ${a.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${i}].${o.field}`:`[${i}]`});for(let o of r.warnings)n.push({...o,suggestion:o.suggestion?`Action ${i}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var Y5=0;function Vp(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,waitForAnchor:o,adaptiveId:a,executorRegistry:s=bi,subscribeNavigation:l,runtime:c}=t,u=new Map,d=new Map;function h(){return`action-${++Y5}`}function m(S,k){n&&n.publish(S,k)}function x(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:h,publishEvent:m,adaptiveId:a,applyAction:g,subscribeEvent:n?(S,k)=>n.subscribe({names:[S]},T=>k(T.props)):void 0,subscribeNavigation:l}}async function _(S,k){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let T=i.mount(S.slot,{type:"widget",widgetId:S.widget.widgetId,config:S.widget.props},{priority:S.widget.priority});return k.publishEvent("action.applied",{id:k.generateId(),kind:"core:mountWidget",slot:S.slot,widgetId:S.widget.widgetId}),{cleanup:()=>{T.unmount()},updateFn:C=>{if("widget"in C&&C.widget){let R=C.widget;R.props&&T.update({type:"widget",widgetId:S.widget.widgetId,config:R.props})}}}}async function b(S,k){if(S.kind==="core:mountWidget")return _(S,k);let T=s.get(S.kind);if(!T){let C="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${S.kind}".`,`Registered: [${C}]`),new Error(`No executor for action kind: ${S.kind}`)}return T(S,k)}function f(S,k,T,C){if(!c)return;let R=[],L=async()=>{let N=u.get(S);if(!N)return;let B=c.evaluateSync(T).value;if(N.state==="applied"&&!B){try{await N.cleanup()}catch(H){console.error(`[ActionEngine] Error reverting conditional action ${S}:`,H)}N.state="deferred",N.cleanup=()=>{},N.updateFn=void 0,m("action.deferred",{id:S,kind:k.kind})}else if(N.state==="deferred"&&B)try{let H=x(),K=await b(k,H);N.state="applied",N.cleanup=K.cleanup,N.updateFn=K.updateFn,N.appliedTs=Date.now(),m("action.applied",{id:S,kind:k.kind,anchorId:"anchorId"in k?k.anchorId:void 0})}catch(H){console.error(`[ActionEngine] Error applying deferred action ${S}:`,H),N.state="failed"}};c.context&&R.push(c.context.subscribe(L)),c.accumulator&&R.push(c.accumulator.subscribe(L)),d.set(S,R)}async function g(S){let k=ar(S);if(!k.valid){let B=k.errors.map(H=>H.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${S?.kind}":`,B,S),new Error(`Action validation failed: ${B}`)}let T=h(),C=S.triggerWhen;if(C&&c&&!c.evaluateSync(C).value){let H={id:T,action:S,adaptiveId:a,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};u.set(T,H);let K={id:T,action:S,async revert(){let D=u.get(T);if(!D)return;let G=d.get(T);if(G){for(let ut of G)ut();d.delete(T)}D.state="reverted",u.delete(T)},isApplied(){return u.get(T)?.state==="applied"},async update(D){let G=u.get(T);if(!G||G.state!=="applied")throw new Error("Cannot update action that is not applied");if(G.updateFn)await G.updateFn(D);else throw new Error(`Action kind ${S.kind} does not support updates`)},getState(){return u.get(T)?.state??"reverted"}};return f(T,S,C,K),K}let R=x(),L=await b(S,R),N={id:T,action:S,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:L.cleanup,updateFn:L.updateFn};u.set(T,N),m("action.applied",{id:T,kind:S.kind,anchorId:"anchorId"in S?S.anchorId:void 0});let z={id:T,action:S,async revert(){let B=u.get(T);if(!B||B.state!=="applied")return;let H=d.get(T);if(H){for(let K of H)K();d.delete(T)}try{await B.cleanup(),B.state="reverted",m("action.reverted",{id:T,kind:S.kind})}catch(K){throw B.state="failed",m("action.failed",{id:T,kind:S.kind,error:String(K)}),K}finally{u.delete(T)}},isApplied(){return u.get(T)?.state==="applied"},async update(B){let H=u.get(T);if(!H||H.state!=="applied")throw new Error("Cannot update action that is not applied");if(H.updateFn)await H.updateFn(B);else throw new Error(`Action kind ${S.kind} does not support updates`)},getState(){return u.get(T)?.state??"reverted"}};return C&&c&&f(T,S,C,z),z}async function v(S){console.log(`[ActionEngine] applyBatch: ${S.length} action(s)`,S.map(N=>N.kind).join(", "));let k=Up(S);if(!k.valid){let N=k.errors.map(z=>z.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${S.length} action(s):`,N,`
|
|
459
|
+
Actions:`,S.map((z,B)=>` [${B}] ${z.kind} ${z.anchorId?`anchor="${typeof z.anchorId=="string"?z.anchorId:z.anchorId.selector}"`:""} ${z.label?`label="${z.label}"`:""}`).join(`
|
|
460
|
+
`)),new Error(`Batch validation failed: ${N}`)}let T=h(),C=[],R=[];try{for(let N of S){let z=await g(N);C.push(z),R.push(z)}}catch(N){console.error(`[ActionEngine] Batch apply FAILED at action ${R.length+1}/${S.length}.`,`Successfully applied: ${R.length}. Rolling back...`,N);for(let z of R)try{await z.revert()}catch{}throw N}return{id:T,handles:C,async revertAll(){for(let N=C.length-1;N>=0;N--)try{await C[N].revert()}catch(z){console.error(`[ActionEngine] Error reverting action ${C[N].id}:`,z)}},isApplied(){return C.every(N=>N.isApplied())}}}function y(S){return ar(S)}function w(){return Array.from(u.values()).map(S=>({id:S.id,action:S.action,adaptiveId:S.adaptiveId,appliedTs:S.appliedTs,state:S.state}))}function E(){for(let S of d.values())for(let k of S)try{k()}catch{}d.clear();for(let S of u.values())if(S.state==="applied")try{S.cleanup()}catch(k){console.error("[ActionEngine] Error during cleanup:",k)}u.clear()}return{apply:g,applyBatch:v,validate:y,getActive:w,destroy:E}}var W5=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),jp=p.object({type:p.literal("page_url"),url:p.string()}),Pp=p.object({type:p.literal("route"),routeId:p.string()}),qp=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),Zp=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),Gp=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),Yp=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),Wp=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),Xp=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),Kp=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),Qp=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),Vs=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),js=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),Vs).optional()}),Jp=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:js.optional()}),ua=p.discriminatedUnion("type",[jp,Pp,qp,Zp,Gp,Yp,Wp,Xp,Kp,Qp,Jp]),Ps=p.object({conditions:p.array(ua),value:p.unknown()}),qs=p.object({type:p.literal("rules"),rules:p.array(Ps),default:p.unknown()}),Zs=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),Gs=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),Ys=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),sr=p.discriminatedUnion("type",[qs,Zs,Gs,Ys]),X5=sr.nullable().optional(),K5=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),Q5=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var Qb=p.object({include:p.array(p.string()).optional(),exclude:p.array(p.string()).optional()}),tu=p.object({routes:Qb,strategy:sr.optional()});function J5(t){return ua.safeParse(t)}function eI(t){return sr.safeParse(t)}function tI(t){return tu.safeParse(t)}var nI=[{defName:"matchOp",schema:Vs},{defName:"counterDef",schema:js},{defName:"activationConfig",schema:tu},{defName:"routeFilter",schema:Qb},{defName:"ruleStrategy",schema:qs},{defName:"scoreStrategy",schema:Zs},{defName:"modelStrategy",schema:Gs},{defName:"externalStrategy",schema:Ys},{defName:"rule",schema:Ps},{defName:"condition",schema:ua}];var Jb=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),iI=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:Jb.optional()}).strict(),rI=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:tu.optional(),notifications:p.array(iI).optional()}).strict(),oI=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()}),aI=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()}),sI=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()}),lI=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()}),cI=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()}),uI=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()}),dI=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:oI.optional(),launcher:aI.optional(),tile:sI.optional(),overlay:lI.optional(),notification:cI.optional(),content:uI.optional()}).strict(),fI=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(),SF=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(rI),actions:p.array(p.any()),theme:dI.optional(),launcher:fI.optional(),verificationSteps:p.array(p.string()).optional()}).strict();var gt={triggerWhen:sr.nullable().optional()},vn=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),e0=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),t0=p.enum(["top-left","top-right","bottom-left","bottom-right"]),n0=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),th=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),i0=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(th).optional()}).strict(),r0=p.object({title:p.string().optional(),body:p.string()}).strict(),o0=p.enum(["before","after","prepend","append","replace"]),a0=p.enum(["immediate","hover","click"]),s0=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),l0=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),c0=p.enum(["auto","smooth","instant"]),eh=p.enum(["start","center","end","nearest"]),u0=p.object({kind:p.literal("content:setText"),anchorId:vn,text:p.string(),label:p.string().optional()}).extend(gt).strict(),d0=p.object({kind:p.literal("content:setAttr"),anchorId:vn,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(gt).strict(),f0=p.object({kind:p.literal("content:addClass"),anchorId:vn,className:p.string(),label:p.string().optional()}).extend(gt).strict(),p0=p.object({kind:p.literal("content:removeClass"),anchorId:vn,className:p.string(),label:p.string().optional()}).extend(gt).strict(),h0=p.object({kind:p.literal("content:setStyle"),anchorId:vn,styles:p.record(p.string()),label:p.string().optional()}).extend(gt).strict(),g0=p.object({kind:p.literal("content:insertHtml"),anchorId:vn,html:p.string(),position:o0,deepLink:Jb.optional(),label:p.string().optional()}).extend(gt).strict(),m0=p.object({kind:p.literal("overlays:highlight"),anchorId:vn,style:e0.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),v0=p.object({kind:p.literal("overlays:pulse"),anchorId:vn,duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),y0=p.object({kind:p.literal("overlays:badge"),anchorId:vn,content:p.string(),position:t0.optional(),label:p.string().optional()}).extend(gt).strict(),b0=p.object({kind:p.literal("overlays:tooltip"),anchorId:vn,content:i0,trigger:a0.optional(),placement:n0.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),_0=p.object({kind:p.literal("overlays:modal"),content:r0,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(th).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),x0=p.object({kind:p.literal("navigation:scrollTo"),anchorId:vn,behavior:c0.optional(),block:eh.optional(),inline:eh.optional(),label:p.string().optional()}).extend(gt).strict(),S0=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(gt).strict(),w0=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:s0,label:p.string().optional()}).extend(gt).strict(),E0=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),C0=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(gt).strict(),A0=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(),k0=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(l0).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(gt).passthrough(),ZT=[{defName:"setText",schema:u0},{defName:"setAttr",schema:d0},{defName:"addClass",schema:f0},{defName:"removeClass",schema:p0},{defName:"setStyle",schema:h0},{defName:"insertHtml",schema:g0},{defName:"highlight",schema:m0},{defName:"pulse",schema:v0},{defName:"badge",schema:y0},{defName:"tooltip",schema:b0},{defName:"modal",schema:_0},{defName:"scrollTo",schema:x0},{defName:"navigate",schema:S0},{defName:"mountWidget",schema:w0},{defName:"wait",schema:E0},{defName:"sequence",schema:C0},{defName:"parallel",schema:A0},{defName:"tour",schema:k0}];function nh(t){let e=t?.root??(typeof document<"u"?document.body:null),n=t?.defaultTimeoutMs??5e3,i=new Map,r=new Map,o=null,a=!1;function s(b){if(!e)return null;try{return e.querySelector(b)}catch{return null}}function l(){for(let[b,f]of i){let g=s(b);if(g){for(let v of f)clearTimeout(v.timer),v.resolve(g);i.delete(b)}}for(let[b,f]of r){let g=s(b);if(g){for(let v of f)v.cancelled||v.cb(g);r.delete(b)}}i.size===0&&r.size===0&&u()}function c(){o||a||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function u(){o&&(o.disconnect(),o=null)}function d(b,f){let g=i.get(b);g&&(g.delete(f),g.size===0&&i.delete(b)),i.size===0&&r.size===0&&u()}function h(b,f){if(a)return Promise.reject(new Error("AnchorResolver destroyed"));let g=s(b);if(g)return Promise.resolve(g);let v=f??n;return new Promise((y,w)=>{let E={resolve:y,reject:w,timer:setTimeout(()=>{d(b,E),w(new Error(`waitFor("${b}") timed out after ${v}ms`))},v)},S=i.get(b);S||(S=new Set,i.set(b,S)),S.add(E),c()})}function m(b,f){if(a)return()=>{};let g=s(b);if(g)return f(g),()=>{};let v={cb:f,cancelled:!1},y=r.get(b);return y||(y=new Set,r.set(b,y)),y.add(v),c(),()=>{v.cancelled=!0;let w=r.get(b);w&&(w.delete(v),w.size===0&&r.delete(b)),i.size===0&&r.size===0&&u()}}function x(){let b=0;for(let f of i.values())b+=f.size;return b}function _(){a=!0,u();let b=new Error("AnchorResolver destroyed");for(let f of i.values())for(let g of f)clearTimeout(g.timer),g.reject(b);i.clear(),r.clear()}return{resolve:s,waitFor:h,onAppear:m,pendingCount:x,destroy:_}}function pI(){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 T0(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(GT(n,i))return}if(e.include){for(let i of e.include)if(GT(n,i))return i;return}return n}function GT(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var nu=class{constructor(e={}){P(this,"context");P(this,"previousContext");P(this,"listeners",new Set);P(this,"telemetry");P(this,"routes");P(this,"navigation");P(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=pI(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=T0(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=T0(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),queueMicrotask(()=>this.updatePage())},history.replaceState=(...a)=>{o(...a),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=T0(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function ih(t={}){return new nu(t)}var YT=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),WT=p.object({url:p.string(),ts:p.number()}),XT=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(WT).optional()}),KT=p.object({width:p.number(),height:p.number()}),QT=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),JT=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:QT.optional()}),eR=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),tR=p.object({page:YT,session:XT,viewport:KT,anchors:p.array(JT).optional(),augmented:eR.optional()});function hI(t){return tR.safeParse(t)}function R0(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,a=n.page.url,s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",a=n.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:a}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let o=i.getSessionMetric(t.key),{operator:a,threshold:s}=t;switch(a){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let o=i.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!i)return t.inverted??!1;let o=i.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}case"event_count":{if(!e.accumulator)return!1;let o=t,a=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return a>=o.count;case"lte":return a<=o.count;case"eq":return a===o.count;case"gt":return a>o.count;case"lt":return a<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function O0(t,e){let n=[];for(let i of t.conditions){let r=R0(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function iu(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:o}=O0(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function ru(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function nR(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:o}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0,accumulator:o?{getCount:(a,s)=>o.getCount(a,s)}:void 0}}async function M0(t,e,n={}){let i=nR(e,n);switch(t.type){case"rules":return iu(t,i);case"score":return ru(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function N0(t,e,n={}){let i=nR(e,n);switch(t.type){case"rules":return iu(t,i);case"score":return ru(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function rh(t){return{evaluate:(e,n)=>M0(e,n,t),evaluateSync:(e,n)=>N0(e,n,t)}}function oh(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,o=null,a=n.ns("accumulator");function s(c){let u=!1;for(let d of i.values()){if(!d.predicate(c))continue;let h=a.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(c.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),a.set(d.stateKey,h),u=!0}if(u)for(let d of r)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||i.size===0||(o=e.subscribe(s))}return{register(c,u,d=!1){let h=`ev:${c}`,m=i.get(h);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}i.set(h,{stateKey:h,needsTimestamps:d,predicate:u}),l()},getCount(c,u){let d=`ev:${c}`,h=a.get(d);if(!h)return 0;if(u===void 0||!h.timestamps)return h.count;let m=Date.now()-u;return h.timestamps.filter(x=>x>=m).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){o&&(o(),o=null),i.clear(),r.clear()}}}function D0(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var ou=class{constructor(e={}){P(this,"subscriptions",new Set);P(this,"history",[]);P(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let o={filter:i,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:Fo};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(D0(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>D0(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=r&&(i===void 0||o.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>D0(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(o=>o.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Ws(t={}){return new ou(t)}var iR={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function gI(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(iR[e])return iR[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?be.UI_SUBMIT:i==="change"?be.UI_CHANGE:n==="input"||n==="textarea"?be.UI_INPUT:be.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function mI(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function L0(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:gI(t),source:"posthog",props:mI(t),schemaVersion:Fo}}function I0(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 ah(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(I0(i)){let r=L0(i);t(r)}}}var H0=p.enum(["posthog","canvas","derived"]),rR=p.object({ts:p.number(),name:p.string(),source:H0,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),oR=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(H0).optional()});function vI(t){return rR.safeParse(t)}function yI(t){return oR.safeParse(t)}var Xs=class{constructor(){P(this,"listeners",new Set);P(this,"capturedPushState");P(this,"capturedReplaceState");P(this,"wasNative");P(this,"destroyed",!1);P(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var z0="cooldown:";function aR(t){return{set(e,n){let i=z0+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=z0+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=z0+e;t.remove(n)}}}var au="dismissed:";function sR(t,e){return{mark(n,i=!1){let r=au+n;(i?e:t).set(r,!0)},isDismissed(n){let i=au+n;return t.has(i)||e.has(i)},clear(n){let i=au+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(au)&&t.remove(n);for(let n of e.keys())n.startsWith(au)&&e.remove(n)}}}var B0="freq:";function lR(t){function e(n){let i=B0+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=B0+n,o=e(n),a=(o?.count??0)+1,s={count:a,resetAt:o?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),a},count(n){return e(n)?.count??0},reset(n){let i=B0+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var bI="syntro";function $0(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+i);return}return o.value}catch{return}},set(i,r,o){if(t)try{let a={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(n+i,JSON.stringify(a))}catch(a){console.warn("[StateStore] Failed to save:",a)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(n)&&i.push(o.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function F0(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,o){e.set(n+i,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var su=class{constructor(e={}){P(this,"session");P(this,"user");P(this,"dismissals");P(this,"cooldowns");P(this,"frequency");P(this,"namespace");P(this,"namespacedStorages",new Map);this.namespace=e.namespace??bI,typeof window<"u"?(this.session=$0(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=$0(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=F0(this.namespace),this.user=F0(this.namespace)),this.dismissals=sR(this.session,this.user),this.cooldowns=aR(this.user),this.frequency=lR(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?$0(sessionStorage,n):F0(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function sh(t={}){return new su(t)}function Ks(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function lu(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var U0={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"}},Qs={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:[]},cR={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function lh(t,e,n){let i=U0[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function ch(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[tf(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(rf()),n.shift!==!1&&r.push(nf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",ef(e,t,async()=>{let{x:a,y:s,strategy:l}=await of(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${s}px`})})}function uh(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function dh(t,e){return e==="none"||Qs[e].length===0?null:t.animate(Qs[e],cR)}function fh(t,e){if(e==="none"||Qs[e].length===0)return Promise.resolve();let n=[...Qs[e]].reverse(),i=t.animate(n,cR);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function ph(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function hh(t){switch(Ks(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 uR(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),a=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){a.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),d=c.value.trim().toLowerCase(),h=u.startsWith("on"),m=(u==="href"||u==="src")&&d.startsWith("javascript:");(h||m)&&s.removeAttribute(c.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var _I=0;function gh(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:o}=t,a=new Map,s=new Map,l=new Map;function c(){return`mount-${++_I}`}function u(y,w){n&&n.publish(y,w)}function d(y){let w=l.get(y);if(w){let E=b(y);for(let S of w)try{S(E)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let h=new Map;function m(y,w,E){switch(w.type){case"html":y.innerHTML=uR(w.content);return;case"widget":{if(o?.has(w.widgetId)){let S=o.mount(w.widgetId,y,w.config);return E&&h.set(E,S),()=>{S.unmount(),E&&h.delete(E)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function x(y,w,E){let S=c(),k=Ks(y),T=E?.priority??0,C=E?.animation??r,R=E?.exclusive??!0,L=a.get(y);if(L&&R){if(L.options.priority>T)throw new Error(`Slot ${y} is occupied by higher priority content (${L.options.priority} > ${T})`);_(L)}let N=ph(y,S);N.style.zIndex=String(hh(y));let z;if(k==="static")lh(N,y,E?.constraints),e.appendChild(N);else if(k==="inline"){let D=lu(y);if(!D)throw new Error(`Invalid inline slot: ${y}`);if(!i)throw new Error("Anchor resolver required for inline slots");let G=i({selector:D,route:"**"});if(!G)throw new Error(`Anchor not found for inline slot: ${D}`);z=uh(N,G)}else if(k==="adjacent"){let D=lu(y);if(!D)throw new Error(`Invalid adjacent slot: ${y}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let G=i({selector:D,route:"**"});if(!G)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(N),z=ch(N,G,E?.position??{placement:"bottom"})}let B=m(N,w,S);dh(N,C);let H={id:S,slot:y,content:w,options:{priority:T,exclusive:R,animation:C,position:E?.position??{placement:"auto"},constraints:E?.constraints??{},adaptiveId:E?.adaptiveId,autoUnmountOnRouteChange:E?.autoUnmountOnRouteChange??!0},container:N,cleanup:()=>{z?.(),B?.()},mountedAt:Date.now()};return a.set(y,H),s.set(y,(s.get(y)??0)+1),u("surface.mounted",{slot:y,id:S,adaptiveId:E?.adaptiveId}),d(y),{id:S,update(D){let G=a.get(y);if(!G||G.id!==S)throw new Error("Mount no longer active");let ut=h.get(S);if(ut){if(D.type==="widget"){ut.update(D.config),G.content=D;return}ut.unmount(),h.delete(S)}G.container.innerHTML="";let Jn=m(G.container,D,S);if(G.content=D,Jn){let it=G.cleanup;G.cleanup=()=>{it?.(),Jn()}}},setOptions(D){let G=a.get(y);if(!G||G.id!==S)throw new Error("Mount no longer active");D.priority!==void 0&&(G.options.priority=D.priority),D.animation!==void 0&&(G.options.animation=D.animation),D.constraints&&k==="static"&&(D.constraints.maxWidth&&(G.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(G.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(G.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(G.container.style.minHeight=D.constraints.minHeight)),d(y)},async unmount(){let D=a.get(y);!D||D.id!==S||await _(D)},isMounted(){return a.get(y)?.id===S},getContainer(){let D=a.get(y);return D?.id===S?D.container:null}}}async function _(y){await fh(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),a.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function b(y){let w=a.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:w?.id}}function f(y,w){let E=l.get(y);return E||(E=new Set,l.set(y,E)),E.add(w),()=>{E?.delete(w),E?.size===0&&l.delete(y)}}function g(y,w){let E=a.get(y);return E?w!==void 0?w>=E.options.priority:!1:!0}function v(){for(let y of a.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}a.clear(),l.clear()}return{mount:x,getState:b,onStateChange:f,canMount:g,destroy:v}}var cu=class{constructor(){P(this,"widgets",new Map);P(this,"mountedWidgets",new Map);P(this,"mountIdCounter",0);P(this,"runtimeRef");P(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let a={...i,runtime:this.runtimeRef},s=r.widget.mount(n,a);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(o);c&&(c.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let d={...c,runtime:this.runtimeRef},h=r.widget.mount(n,d);u.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},mh=new cu;var j0="2.0.0";function xI(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(V0(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(V0(i,r))return!0;return!1}return!0}function V0(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function dR(t){let n=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>V0(n,r))}function vh(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:o}=t,a=t.widgets??mh,s=t.executors??bi,l=t.apps??ss,c=new Xs,u=ih({telemetry:e,routes:i,navigation:c}),d=t.events??Ws(),h=sh({namespace:o}),m=oh({eventBus:d,stateStore:h}),x=rh({state:h,events:d,sessionMetrics:n,accumulator:m}),_=CC(),b=nh(),f=E=>dR(E)?b.resolve(E.selector):null,g=async(E,S)=>{if(!dR(E))return null;try{return await b.waitFor(E.selector,S)}catch{return null}},v=gh({overlayRoot:_,eventBus:d,anchorResolver:f,widgetRegistry:a}),y=Vp({overlayRoot:_,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:g,executorRegistry:s,subscribeNavigation:E=>c.subscribe(E),runtime:{evaluateSync:E=>x.evaluateSync(E,u.get()),context:u,accumulator:m}}),w={telemetry:e,context:u,events:d,state:h,sessionMetrics:n,actions:y,surfaces:v,widgets:a,executors:s,apps:l,accumulator:m,anchorResolver:b,navigation:c,version:j0,mode:r,async evaluate(E){return x.evaluate(E,u.get())},evaluateSync(E){return x.evaluateSync(E,u.get())},async filterTiles(E){let S=u.get().page.url,k=[];for(let T of E){let C=T.activation;if(!C){k.push(T);continue}if(!xI(S,C.routes))continue;if(!C.strategy){k.push(T);continue}(await this.evaluate(C.strategy)).value&&k.push(T)}return k},setRoutes(E){u.setRoutes(E)},destroy(){l.unbind().catch(E=>{console.error("[Runtime] Error unbinding apps registry:",E)}),b.destroy(),m.destroy(),c.destroy(),u.destroy(),y.destroy(),v.destroy()}};return l.bind(w),a.bindRuntime(w),w}var fR=p.object({value:p.unknown(),expiresAt:p.number().optional()}),pR=p.object({count:p.number(),resetAt:p.number().optional()});function SI(t){return fR.safeParse(t)}function wI(t){return pR.safeParse(t)}var hR={growthbook:t=>Wf({...t,autoInit:!0})};function gR(t,e){let n=hR[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(hR).join(", ")}`);return n(e)}var EI=["cdn.syntrologie.com","localhost","127.0.0.1"];function CI(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):EI.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var P0=class{constructor(e){P(this,"name","cdn");P(this,"url");P(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!CI(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await AI(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),o=performance.now()-e,a=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:a?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function AI(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function mR(t){return new P0(t)}var kI="syntro_exp",TI="syntro_var",q0=class{constructor(e){P(this,"name","experiments");P(this,"client");P(this,"featureKey");P(this,"manifestKey");P(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),o=r.get(kI),a=r.get(TI);if(o&&a!==null&&this.client.setForcedVariations){let s=parseInt(a,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:hf(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function vR(t){return new q0(t)}var RI="https://cdn.syntrologie.com/configs",yR={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return mR({baseUrl:t.baseUrl??RI,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return vR({featureKey:t.featureKey})}};function bR(t,e={}){let n=yR[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(yR).join(", ")}`);return n(e)}var _R={posthog:t=>$p(t),noop:()=>rp()};function xR(t,e){let n=_R[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(_R).join(", ")}`);return n(e)}var Z0="syn_";function uu(t){if(!t.startsWith(Z0))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Z0.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function yh(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Z0+n}function lr(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 OI(){if(typeof window>"u")return Y("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Bo(),n=!!(Ur()?.token&&t?.mode==="editor");return Y("Syntro Bootstrap","isEditorMode:",n),n}function MI(){if(typeof window>"u")return Y("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Bo(),n=!!(Ur()?.token&&t?.mode==="audit");return Y("Syntro Bootstrap","isAuditMode:",n),n}function NI(){if(typeof window>"u")return Y("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Bo(),n=!!(Ur()?.token&&t?.mode==="review");return Y("Syntro Bootstrap","isReviewMode:",n),n}var SR="syntro_segment_attributes";function DI(){if(typeof window>"u")return{};try{let t=localStorage.getItem(SR);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){hn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function LI(t){if(!(typeof window>"u"))try{localStorage.setItem(SR,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){hn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function II(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function HI(t){kv(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=OI(),n=MI(),i=NI(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",Ur()),console.log("[DIAG] editorConf:",Bo()),Y("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let C=!!window.__SYNTRO_EDITOR_PARAMS__,R=!!window.__SYNTRO_AUDIT_LEGEND__,L=!!window.__SYNTRO_REVIEW_DATA__;if(C||R||L){let N=[C&&"__SYNTRO_EDITOR_PARAMS__",R&&"__SYNTRO_AUDIT_LEGEND__",L&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${N.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&r){let R=Bo()?.syntro_token;R?.startsWith("syn_")&&(o=R,Y("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let a;if(o)if(o.startsWith("syn_"))Y("Syntro Bootstrap","Token starts with syn_, decoding..."),a=uu(o),kv(a.d);else if(r)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw gf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),gf("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)Y("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw gf("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=lr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||lr("VITE_SYNTRO_EXPERIMENT_HOST")||a?.eh,l=lr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||lr("VITE_SYNTRO_TELEMETRY_HOST")||a?.th,c=lr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||lr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=DI();Y("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let d,h=Ws();console.log("[Syntro Bootstrap] EventBus created");let m=ah(C=>{h.publishEvent(C)}),x=C=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let R=II(C);if(Y("Syntro Bootstrap","Segment flags from PostHog:",R),LI(R),d){let N={...b?.getAll?.()??{},...R};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",N),d.setAttributes?.(N)}},_;if(a?.t){let C=a.t==="noop"?"noop":"posthog";_=xR(C,{apiKey:a.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:x,onCapture:m}),console.log(`[Syntro Bootstrap] Telemetry client created (${C}) with EventBus wiring`)}let b;a?.e&&(d=gR("growthbook",{clientKey:a.e,apiHost:s,attributes:u,onExperimentViewed:_?.trackExperiment?(C,R,L)=>{_.trackExperiment(C,R,L)}:void 0})),t.enableSessionMetrics&&(b=Xf({experiments:d,onMetricChange:(C,R)=>{Y("Syntro Bootstrap",`Session metric changed: ${C} = ${R}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":n?f="audit":lr("NODE_ENV")==="development"&&(f="development");let g=vh({telemetry:_,sessionMetrics:b,mode:f,events:h});Y("Syntro Bootstrap","Runtime created:",{version:g.version,mode:g.mode,hasContext:!!g.context,hasEvents:!!g.events,hasState:!!g.state}),Y("Syntro Bootstrap","Core app executors already registered");let v=t.cdnBase||lr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||lr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=df({cdnBase:v,registry:g.apps,onLoadStart:C=>{Y("Syntro Bootstrap",`Loading app from CDN: ${C}`)},onLoadEnd:(C,R,L)=>{R?Y("Syntro Bootstrap",`App loaded successfully: ${C}`):hn("Syntro Bootstrap",`Failed to load app: ${C}`,L)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:g.apps,runtime:g,version:g.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let w=g.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${w.length} apps in registry:`,w.map(C=>`${C.manifest.id}(${C.state})`).join(", "));for(let C of w)if(C.state==="registered")try{await g.apps.activate(C.manifest.id),console.log(`[DIAG] Activated: ${C.manifest.id} \u2192 widgets: [${g.widgets.list().join(", ")}]`)}catch(R){console.error(`[DIAG] FAILED to activate: ${C.manifest.id}`,R),hn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${C.manifest.id}`,R)}if(console.log(`[DIAG] Activation complete. Total widgets: [${g.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(C){hn("Syntro Bootstrap","Failed to load GrowthBook features:",C)}let E;if(t.fetcher)E=t.fetcher;else if(a?.f){let C=bR(a.f,a.o??{});E=async()=>{let R=await C.fetch();return{...R.config,tiles:R.config.tiles??[]}}}else d&&(E=zo({experiments:d}));let S=new Set,k=E?async()=>{let C=await E();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${C.tiles?.length??0},`,`actions=${C.actions?.length??0},`,`theme=${C.theme?.name??"none"}`),C.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",C.actions.map((N,z)=>`[${z}] ${N.kind}${N.anchorId?` anchor="${typeof N.anchorId=="string"?N.anchorId:N.anchorId.selector}"`:""}${N.label?` "${N.label}"`:""}`).join(", "));let R=C,L=y.getRequiredApps(R);return L.length>0?console.log("[Syntro Bootstrap] Required external apps:",L.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),L.length>0&&await y.loadAppsForConfig(R).then(async z=>{let B=z.filter(D=>D.success),H=z.filter(D=>!D.success);B.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${B.map(D=>D.appId).join(", ")}`);let K=H.filter(D=>!S.has(D.appId));K.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",K.map(D=>`${D.appId} (${D.error})`).join(", ")),K.forEach(D=>S.add(D.appId)));for(let D of L)if(g.apps.has(D))try{await g.apps.activate(D),console.log(`[Syntro Bootstrap] App activated: ${D}`)}catch(G){console.error(`[Syntro Bootstrap] Failed to activate app: ${D}`,G)}else console.error(`[Syntro Bootstrap] App "${D}" required by config but NOT registered.`,`Available apps: [${Array.from(g.apps.list?.()??[]).join(", ")}]`)}),C}:void 0;return{canvas:await Mf({...t.canvas,fetcher:k,integrations:{experiments:d,telemetry:_},editorUrl:c,runtime:g}),runtime:g,experiments:d,telemetry:_,sessionMetrics:b,appLoader:y}}var G0={init:HI,encodeToken:yh,decodeToken:uu};typeof window<"u"&&(window.Syntro=G0);var Y0="2026-03-03T23:31:20.312Z (19510df2c8)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${Y0}`);let t=window.SynOS,e=t?.appRegistry||ss;window.SynOS={...t,appRegistry:e,_runtimeBuild:Y0,React:wR.default,ReactDOM:{...zI,createPortal:bh.createPortal,flushSync:bh.flushSync}},dC(e)}return LR(BI);})();
|
|
446
461
|
/*! Bundled license information:
|
|
447
462
|
|
|
448
463
|
react/cjs/react.production.js:
|