playthrough 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTRUCTIONS.md +35 -6
- package/README.md +3 -1
- package/package.json +2 -2
- package/src/{flows-DDB6AdQ-.js → flows-CbrwgoHB.js} +159 -24
- package/src/playthrough.js +228 -149
- package/src/playwright.config.js +1 -1
- package/src/{reporter-Dr7dWwSf.js → reporter-DlS7qehW.js} +7 -1
- package/src/reporter.js +1 -1
- package/src/test.js +113 -76
- package/types/cli/src/app.d.ts +3 -1
- package/types/cli/src/changes.d.ts +4 -0
- package/types/cli/src/command.d.ts +6 -0
- package/types/cli/src/flows.d.ts +21 -16
- package/types/cli/src/repo.d.ts +1 -0
- package/types/cli/src/test.d.ts +21 -8
- package/types/page/src/found.d.ts +5 -0
- package/types/page/src/index.d.ts +1 -0
- package/types/page/src/names.d.ts +1 -0
- package/types/page/src/scheme.d.ts +6 -0
- package/types/review/src/model.d.ts +46 -0
- package/types/review/src/rules.d.ts +6 -0
- package/viewer/assets/index-BbNKJRwK.css +2 -0
- package/viewer/assets/index-DwbSPQMk.js +194 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-DVlUrKEE.js +0 -194
- package/viewer/assets/index-DhzHaV6E.css +0 -2
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=ee(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),o=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=e((e=>{var t=n(),r=i(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},L=[],_e=-1;function ve(e){return{current:e}}function ye(e){0>_e||(e.current=L[_e],L[_e]=null,_e--)}function R(e,t){_e++,L[_e]=e.current,e.current=t}var be=ve(null),xe=ve(null),Se=ve(null),Ce=ve(null);function we(e,t){switch(R(Se,t),R(xe,e),R(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ye(be),R(be,e)}function z(){ye(be),ye(xe),ye(Se)}function Te(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,R(Ce,e)),t=be.current;var n=hp(t,e.type);t!==n&&(R(xe,e),R(be,n))}function Ee(e){xe.current===e&&(ye(be),ye(xe)),Ce.current===e&&(ye(Ce),dh._currentValue=ge)}var De,Oe;function ke(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+De+e+Oe}var Ae=!1;function je(e,t){if(!e||Ae)return``;Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ke(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke(`Lazy`);case 13:return e.child!==t&&t!==null?ke(`Suspense Fallback`):ke(`Suspense`);case 19:return ke(`SuspenseList`);case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return ke(`Activity`);case 30:return ke(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,ze=t.unstable_now,Be=t.unstable_getCurrentPriorityLevel,Ve=t.unstable_ImmediatePriority,He=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,We=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,qe=t.unstable_setDisableYieldValue,Je=null,Ye=null;function Xe(e){if(typeof Ke==`function`&&qe(e),Ye&&typeof Ye.setStrictMode==`function`)try{Ye.setStrictMode(Je,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function B(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function st(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 ct(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&V(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function V(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function _t(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[yt])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=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]*$`),Bt={},Vt={};function Ht(e){return Pe.call(Vt,e)?!0:Pe.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var H=!1;function Ut(){var e=H;return H=!1,e}function Wt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(he(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=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 ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(s(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,H=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(ln(e,i,r),H=!0)}else for(var a in t)t.hasOwnProperty(a)&&ln(e,a,t[a])}function dn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 fn=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`],[`maskType`,`mask-type`],[`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`]]),pn=/^[\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 mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[bt]||null;if(!i)throw Error(s(90));en(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Ud(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(s(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(D({},Hn,{dataTransfer:0})),Gn=Pn(D({},Ln,{relatedTarget:0})),Kn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(D({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={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`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(D({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(D({},Fn,{submitter:0})),rr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(D({},Hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=Pn(D({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function U(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!cr&&U(e,t)?(e=An(),kn=On=Dn=null,hr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return dr&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=J(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Kf(e,0)}function wr(e){if(Zt(jt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(wn){var Dr;if(wn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,_n(e)),Sn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Pe.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Gr=wn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&Rr(Jr,r)||(Jr=r,r=J(qr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};wn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Lt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Nd)throw Nd=0,Pd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(e,t,n,r){this.tag=e,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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,i,a){var o=0;if(r=e,typeof r==`function`)ki(r)&&(o=1);else if(typeof r==`string`)o=Zm(e,n,be.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Oi(31,n,t,i),e.elementType=se,e.lanes=a,e;case j:return Ni(n.children,i,a,t);case M:o=8,i|=24;break;case N:return e=Oi(12,n,t,i|2),e.elementType=N,e.lanes=a,e;case re:return e=Oi(13,n,t,i),e.elementType=re,e.lanes=a,e;case ie:return e=Oi(19,n,t,i),e.elementType=ie,e.lanes=a,e;case ce:case ue:return e=i|32,e=Oi(30,n,t,e),e.elementType=ue,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:o=10;break a;case ee:o=9;break a;case ne:o=11;break a;case ae:o=14;break a;case oe:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Ze(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,W=!1,ta=null,na=!1,ra=Error(s(519));function ia(e){throw ua(Ri(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:q(`cancel`,t),q(`close`,t);break;case`iframe`:case`object`:case`embed`:q(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)q(Wf[n],t);break;case`source`:q(`error`,t);break;case`img`:case`image`:case`link`:q(`error`,t),q(`load`,t);break;case`details`:q(`toggle`,t);break;case`input`:q(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:q(`invalid`,t);break;case`textarea`:q(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||rp(t.textContent,n)?(r.popover!=null&&(q(`beforetoggle`,t),q(`toggle`,t)),r.onScroll!=null&&q(`scroll`,t),r.onScrollEnd!=null&&q(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:$i=$i.return}}function sa(e){if(e!==$i)return!1;if(!W)return oa(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&ea&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ea=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ea=hm(e)}else t===27?(t=ea,Ep(e.type)?(e=mm,mm=null,ea=e):ea=t):ea=$i?pm(e.stateNode.nextSibling):null;return!0}function ca(){ea=$i=null,W=!1}function la(){var e=ta;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=ve(null),fa=null,pa=null;function ma(e,t,n){R(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ye(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ga(a.return,n,e),r||(o=null);break a}a=c.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(s(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ga(o,n,e),o=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ga(i.return,n,e),o=i.child,o=o===null?null:o.sibling):o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function va(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(s(387));if(o=o.memoizedProps,o!==null){var c=i.type;Lr(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===Ce.current){if(o=i.alternate,o===null)throw Error(s(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}i=i.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(s(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=zf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=F.S;F.S=function(e,t){if(yd=ze(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Tf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=ve(null);function Ha(){var e=Va.current;return e===null?ed.pooledCache:e}function Ua(e,t){t===null?R(Va,Va.current):R(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(s(460)),Ka=Error(s(474)),qa=Error(s(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(s(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(s(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(s(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function o(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===oe&&Za(a)===t.type)?(t=i(t,n.props),io(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Ii(t,e.mode,n),t.return=e,t;case oe:return t=Za(t),f(e,t,n)}if(he(t)||P(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===te)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=Za(n),p(e,t,n,r)}if(he(n)||P(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===te)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=Za(r),m(e,t,n,r,i)}if(he(r)||P(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===te)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return W&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ji(i,h),l}function g(i,o,c,l){if(c==null)throw Error(s(151));for(var u=null,d=null,h=o,g=o=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),o=a(y,o,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),W&&Ji(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return W&&Ji(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),W&&Ji(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),io(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&Za(l)===r.type){n(e,r.sibling),c=i(r,a.props),io(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Ni(a.props.children,e.mode,c,a.key),io(c,a),c.return=e,e=c):(c=Mi(a.type,a.key,a.props,null,e.mode,c),io(c,a),c.return=e,e=c)}return o(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(a,e.mode,c),c.return=e,e=c}return o(e);case oe:return a=Za(a),_(e,r,a,c)}if(he(a))return h(e,r,a,c);if(P(a)){if(l=P(a),typeof l!=`function`)throw Error(s(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,ro(a),c);if(a.$$typeof===te)return _(e,r,Sa(e,a),c);ao(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Pi(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nd&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=ve(null),Co=ve(0);function wo(e,t){e=cd,R(Co,e),R(So,t),cd=e|t.baseLanes}function To(){R(Co,cd),R(So,So.current)}function Eo(){cd=Co.current,ye(So),ye(Co)}var Do=ve(null),Oo=null;function ko(e){var t=e.alternate;R(Po,Po.current&1),R(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){R(Po,Po.current),R(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(R(Po,Po.current),R(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){R(Po,Po.current),R(Do,Do.current)}function No(e){ye(Do),Oo===e&&(Oo=null),ye(Po)}var Po=ve(0);function Fo(e,t){R(Do,Do.current),R(Po,t)}function Io(e){ye(Po),ye(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ro=0,G=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(s(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Ro=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){F.H=fc;var t=zo!==null&&zo.next!==null;if(Ro=0,Bo=zo=G=null,Vo=!1,Go=0,Ko=null,t)throw Error(s(300));e===null||jc||(e=e.dependencies,e!==null&&ya(e)&&(jc=!0))}function Qo(e,t,n,r){G=e;var i=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=i)throw Error(s(301));if(i+=1,Bo=zo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}F.H=hc,a=t(n,r)}while(Ho);return a}function $o(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(G.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Ro=0,Bo=zo=G=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?G.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw G.alternate===null?Error(s(467)):Error(s(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Xa(Ko,e,t),t=G,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===de)return;if(e.$$typeof===te)return xa(e)}throw Error(s(438,String(e)))}function cs(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=o=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:(nd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,o=a):l=l.next=f,G.lanes|=p,ud|=p;f=u.action,Uo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,o=a):l=l.next=p,G.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!Lr(a,e.memoizedState)&&(jc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Lr(a,t.memoizedState)||(jc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ps(e,t,n){var r=G,i=is(),a=W;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!Lr((zo||i).memoizedState,n);if(o&&(i.memoizedState=n,jc=!0),i=i.queue,Rs(gs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(s(349));a||Ro&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=as(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function vs(e){var t=Ci(e,2);t!==null&&Rd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Xe(!0);try{n()}finally{Xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,i){if(lc(e))throw Error(s(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};F.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ss(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(W){var n=ed.formState;if(n!==null){a:{var r=G;if(W){if(ea){b:{for(var i=ea,a=na;i.nodeType!==8;)if(!a||(i=pm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=pm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,G,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,G,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ga?qa:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=as(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();G.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(G.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=as(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Ro&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),G.lanes|=e,ud|=e,n)}function Ys(e,t,n,r){return Lr(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(nd&261930)?(jc=!0,e.memoizedState=n):(e=Id(),G.lanes|=e,ud|=e,t):(e=Js(e,n,r),Lr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,cc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,za(c,r),Fd(e)):sc(e,t,r,Fd(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=$s(e).queue;Xs(e,i,t,ge,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Fd())}function tc(){return xa(dh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=po(n);var r=mo(t,e,n);r!==null&&(Rd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Si(e,t,n,r),n!==null&&(Rd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Fd())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return xi(e,t,i,0),ed===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Rd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(s(479))}else t=Si(e,n,r,2),t!==null&&Rd(t,e,2)}function lc(e){var t=e.alternate;return e===G||t!==null&&t===G}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var fc={readContext:xa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:xa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){Xe(!0);try{n(t)}finally{Xe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,G,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,i=rs();if(W){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),ed===null)throw Error(s(349));nd&127||ms(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ls(gs.bind(null,r,a,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,a,n,t),null),n},useId:function(){var e=rs(),t=ed.identifierPrefix;if(W){var n=qi,r=Ki;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,G)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Rd(t,e,n),ho(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){gi(e)}function Sc(e){console.error(e)}function Cc(e){gi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=po(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,i,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,i)),!1}throw Error(s(435,n.tag))}return yf(e,r,i),Xd(),!1}if(W)return t=Do.current,t===null?(r!==ra&&(t=Error(s(423),{cause:r}),ua(Ri(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ri(r,n),i=Ec(e.stateNode,r,i),go(e,i),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ra&&(e=Error(s(422),{cause:r}),ua(Ri(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=Ri(a,n),hd===null?hd=[a]:hd.push(a),ld!==4&&(ld=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ec(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(Sd===null||!Sd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Dc(i),Oc(i,e,n,r),go(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(s(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(W&&s&&Xi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return so(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Ao(t),(e=ea)?(e=lm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return zc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(Ao(t),i){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558))}else if(jc||va(e,t,n,!1),i=(n&e.childLanes)!==0,jc||i){if(So.current===null){if(r=ed,r!==null&&(o=pt(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,Ci(e,o),Rd(r,e,o),Ac;Xd()}t=Bc(e,t,n)}else e=a.treeContext,ea=pm(o.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return ba(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(W&&r&&Xi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(W&&r&&Xi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=lo||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=lo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return ca(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Wa()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(W){if(i?ko(t):Mo(),(e=ea)?(e=lm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(ko(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return so(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,i,a,o,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Mo(),a=i.fallback,o=t.mode,i=Qc({mode:`visible`,children:i.children},o),a=Ni(a,o,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,so(t,e.child,null,c),i=t.child,i.memoizedState=Jc(c),i.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,i)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),dm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(s(419)),i.stack=``,i.digest=r,ua({value:i,source:null,stack:null})),$c(e,t,c)}if(jc||va(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(So.current!==null)return $c(e,t,c);if(r=ed,r!==null&&(i=pt(r,c),i!==0&&i!==o.retryLane))throw o.retryLane=i,Ci(e,i),Rd(r,e,i),Ac;return um(a)||Xd(),$c(e,t,c)}return um(a)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,ea=pm(a.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Zc(t,i.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=W?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ll(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Te(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(ko(t),e=sl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,W&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ne){t.tag=11,t=Nc(null,t,e,r,n);break a}if(i===ae){t.tag=14,t=Pc(null,t,e,r,n);break a}if(i===te){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=me(e)||e,Error(s(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=bc(r,t.pendingProps),Gc(e,t,r,i,n);case 3:a:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fo(e,t),yo(t,r,null,n);var o=t.memoizedState;if(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0),vo(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==i){i=Ri(Error(s(424)),t),ua(i),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=pm(e.firstChild),$i=t,W=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===i){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(t.stateNode=gp(t.type,t.pendingProps,Se.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&W&&(r=t.stateNode=ym(t.type,t.pendingProps,Se.current),$i=t,na=!0,i=ea,Ep(t.type)?(mm=i,ea=pm(r.firstChild)):ea=i),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((i=r=ea)&&(r=sm(r,t.type,t.pendingProps,na),r===null?i=!1:(t.stateNode=r,$i=t,ea=pm(r.firstChild),na=!1,i=!0)),i||ia(t)),Te(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,r=a.children,_p(i,a)?r=null:o!==null&&_p(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Xo(e,t,$o,null,null,n),dh._currentValue=i),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ea)&&(n=cm(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||ia(t)),null;case 13:return Xc(e,t,n);case 4:return we(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ba(t),i=xa(i),r=r(i),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(i=Ha(),i===null&&(i=ed,a=Oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},uo(t),ma(t,Da,i)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ma(t,Da,r),r!==i.cache&&_a(t,[Da],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ma(t,Da,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:W&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ct(),e.lanes|=t,md|=t)}function hl(e,t){if(!W)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),z(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),gl(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(dl(t),a===null?(gl(t),fl(t,i,null,r,n)):(gl(t),pl(t,a))):a?a===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,a)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,i,e,r,n)),null;case 27:if(Ee(t),n=Se.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return gl(t),t.subtreeFlags&=-33554433,null}e=be.current,sa(t)?aa(t,e):(e=ym(i,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ee(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return gl(t),t.subtreeFlags&=-33554433,null}if(a=be.current,sa(t))aa(t,a);else{var o=pp(Se.current);switch(a){case 1:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=o.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?o.createElement(`select`,{is:r.is}):o.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?o.createElement(i,{is:r.is}):o.createElement(i)}}a[yt]=t,a[bt]=r;a:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break a;for(;o.sibling===null;){if(o.return===null||o.return===t)break a;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;a:switch(op(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=Se.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=$i,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||ia(t,!0)}else e=pp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(557));e[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(s(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(s(317));i[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),i=!1}else i=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(No(t),t):(No(t),null)}return No(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return z(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ha(t.type),gl(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return gl(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)hl(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Lo(e),a!==null){for(t.flags|=128,hl(r,!1),e=a.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Fo(t,Po.current&1|2),W&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ze()>bd&&(t.flags|=128,i=!0,hl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Lo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!W)return gl(t),null}else 2*ze()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,i=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,a=Po.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||W?Fo(t,a):(n=a,R(Do,t),R(Po,n),Oo===null&&(Oo=t)),W&&Ji(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ye(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(s(156,t.tag))}function vl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),z(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ee(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(s(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return z(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&ye(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function yl(e,t){switch(Zi(t),t.tag){case 3:ha(Da),z();break;case 26:case 27:case 5:Ee(t);break;case 4:z();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&ye(Va);break;case 24:ha(Da)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){vf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);h(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&im(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&am(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[bt]=t}catch(t){vf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ep(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),El(e,r),H=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),H=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[yt]=e,t[bt]=n}catch(t){vf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Rl=!0,kp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Kl(e.child,t),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(s(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Ld(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Ld(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function K(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:K(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=K(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,ru=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,dp=bh,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},bh=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Zl(e),pu(n))}}zl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var o=bc(t.type,i);n=a.getSnapshotBeforeUpdate(o,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=hi(i.default,i.update),i!==`none`&&Wl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(s(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&bl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Pu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||ru;t=nu,i=ru,nu=r,(ru=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),nu=t,ru=i}break;case 30:Pu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,H=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount==`function`)try{Ye.onCommitFiberUnmount(Je,n)}catch{}switch(n.tag){case 26:ru||Tl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ru&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ru||Tl(n,t),Ol(n);var r=yu,i=bu;Ep(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:ru||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),H=!0}catch(e){vf(n,t,e)}else try{yu.removeChild(n.stateNode),H=!0}catch(e){vf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kh(e)):Dp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),ru||xl(4,n,t),xu(e,t,n);break;case 1:ru||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:ru=(r=ru)||n.memoizedState!==null,xu(e,t,n),ru=r;break;case 30:Tl(n,t),xu(e,t,n);break;case 7:ru||Tl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(s(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(s(160));Su(o,c,a),yu=null,bu=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var o=r[a];o.ref.impl=o.nextImpl}Du(t,e,n),Au(e),i&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),i&512&&(ru||r===null||Tl(r,r.return)),i&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Ou,Du(t,e,n),Au(e),i&512&&(ru||r===null||Tl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),op(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(a=Ym(`link`,`href`,i).get(t+(n.href||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Ym(`meta`,`content`,i).get(t+(n.content||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(o,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;default:throw Error(s(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else nu||Xm(a,e.type,e.stateNode)}else e.stateNode=Wm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||ru||t.parentNode.removeChild(t)):i.count--,n===null?nu||Xm(a,e.type,e.stateNode):Wm(a,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),i&512&&(ru||r===null||Tl(r,r.return)),r!==null&&i&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=iu,iu=!1,Du(t,e,n),iu=a,Au(e),i&512&&(ru||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),H=!0}catch(t){vf(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),i&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),i&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,H=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(H=!1,Jm=null,a=Ou,Ou=wm(t.containerInfo),Du(t,e,n),Ou=a,Au(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Kh(t.containerInfo)}catch(t){vf(e,e.return,t)}au&&(au=!1,ju(e)),H=!1;break;case 4:i=iu,iu=nu,r=Ut(),a=Ou,Ou=wm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=a,H&&lu&&(uu=!0),H=r,iu=i;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=ze()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:a=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var c=nu,l=ru,u=iu;nu=c||a,iu=u||a,ru=l||o,Du(t,e,n),ru=l,iu=u,nu=c,Au(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||o||nu||ru||(t=o||ru,n=nu,r=ru,nu=a||nu,ru=t,Fu(e,2),nu=n,ru=r),!a&&iu||hu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:i&512&&(ru||r===null||Tl(r,r.return)),i=Ut(),a=lu,o=(n&335544064)===n,c=e.memoizedProps,lu=o&&hi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),o&&r!==null&&H&&(e.flags|=4),lu=a,H=i;break;case 21:break;case 7:i&512&&(ru||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Al(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(kl(i))break;i=i.return}var o=r;if(n==null)throw Error(s(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,o);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Il(e,Pl(e),l,o);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,o);break;default:throw Error(s(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else tu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Hl(),Mu(t,e),!cu&&!uu){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Vl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Jl(e,!1));break;case 30:r=cu,i=Hl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=K(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Fu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Fu(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Fu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ru||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:Tl(n,n.return),Fu(n,r);break;case 7:Tl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),bl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||Xm(wm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),wl(a,a.return);break;case 30:Iu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&bl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=Ou;Ou=wm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&xl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:F.T===null?gt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||W){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),pd=e}else pd=536870912}return e=Do.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(pi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),ut(e,n),$u&2&&e===ed||(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(s(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||at(e,t),i=r?$d(e,t):Zd(e,t,!0),a=r;do{if(i===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Vd(n))i=Zd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o===0?o&536870912?536870912:0:o;if(o!==0){t=o;a:{var c=e;i=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,o).flags|=256),o=Zd(c,o,!1),o!==2&&o!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=a,dd|=a,i=4;break a}a=gd,gd=i,a!==null&&(gd===null?gd=a:gd.push.apply(gd,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Gd(e,0),Hd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=vd+300-ze(),10<i)){if(Hd(r,t,pd,!ad),B(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=bp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,a,`Throttled`,-0,0),i);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,a,null,-0,0)}break}}while(1);jf(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},zl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-ze():(a&4194048)===a?yd-ze():0,m=ih(d,m),m!==null)?(Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l)):sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hd(e,t,n,r){t=ot(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&V(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,pa=fa=null,ns(e),to=null,no=0,e=td;for(;e!==null;)yl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=Ai(e.current,null),nd=t,rd=0,id=null,ad=!1,od=at(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=ot(e,t),bi(),n}function Kd(e,t){G=null,F.H=fc,t===Ga||t===qa?(t=$a(),rd=3):t===Ka?(t=$a(),rd=4):rd=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,wc(e,Ri(t,e.current)))}function qd(){var e=Do.current;return e===null?!0:(nd&4194048)===nd?Oo===null:(nd&62914560)===nd||nd&536870912?e===Oo:!1}function Jd(){var e=F.H;return F.H=fc,e===null?fc:e}function Yd(){var e=F.A;return F.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Do.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,$u=r,F.H=i,F.A=a,td===null&&(ed=null,nd=0,bi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),i=Yd();ed!==e||nd!==t?(xd=null,bd=ze()+500,Gd(e,t)):od=at(e,t);a:do try{if(rd!==0&&td!==null){t=td;var a=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,a,1);break;case 2:case 9:if(Ya(a)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},a.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Ya(a)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,a,7));break;case 5:var o=null;switch(td.tag){case 26:o=td.memoizedState;case 5:case 27:var c=td;if(o?$m(o):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,a,5);break;case 6:rd=0,id=null,rf(e,t,a,6);break;case 8:Wd(),ld=6;break a;default:throw Error(s(462))}}ef();break}catch(t){Kd(e,t)}while(1);return pa=fa=null,F.H=r,F.A=i,$u=n,td===null?(ed=null,nd=0,bi(),ld):0}function ef(){for(;td!==null&&!Le();)tf(td)}function tf(e){var t=ul(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:ns(t);var r=t;r===$i&&(W?(oa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(oa(r),W=!0));default:yl(n,t),t=td=ji(t,cd),t=ul(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){pa=fa=null,ns(t),to=null,no=0;var i=t.return;try{if(kc(e,i,t,n,nd)){ld=1,wc(e,Ri(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,wc(e,Ri(n,e.current)),td=null;return}t.flags&32768?(W||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=_l(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,i,a,o,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=i,kd=r,cf(e,t,n,o,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=yi,dt(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Ma(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Ue,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=$u,$u|=4;try{fu(e,t,n)}finally{$u=a,I.p=i,F.T=r}}Cd=1,Rl?Ad=Ip(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=$u;$u|=4;try{lu=uu=!1,ku(t,e,n),n=fp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}bh=!!dp,fp=dp=null}finally{$u=a,I.p=i,F.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=$u;$u|=4;try{mu(e,t.alternate,t)}finally{$u=i,I.p=r,F.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Re();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),ht(r),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot==`function`)try{Ye.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{F.T=n,I.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=ht(Ed),r=F.T,i=I.p;try{I.p=32>n?32:n,F.T=null,n=Od,Od=null;var a=wd,o=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(s(331));var c=$u;if($u|=4,Ju(a.current),Bu(a,a.current,o,n),$u=c,Mf(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot==`function`)try{Ye.onPostCommitFiberRoot(Je,a)}catch{}return!0}finally{I.p=i,F.T=r,mf(e,t)}}function _f(e,t,n){t=Ri(n,t),t=Ec(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ut(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Ri(n,e),n=Dc(2),r=mo(t,n,2),r!==null&&(Oc(n,r,t,e),ut(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>ze()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=ct()),e=Ci(e,t),e!==null&&(ut(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Fe(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=B(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&yp()&&(e=Af);for(var t=ze(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=st(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=B(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||at(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),ht(n)){case 2:case 8:n=He;break;case 32:n=Ue;break;case 268435456:n=Ge;break;default:n=Ue}return r=If.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=B(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,ze()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){wp(function(){$u&6?Fe(Ve,Nf):Pf()})}function zf(){if(Af===0){var e=Fa;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<ui.length;Hf++){var Uf=ui[Hf];di(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}}}}function q(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(Dh(t)){case 2:var i=xh;break;case 8:i=Sh;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=kt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),o=[];a:{var s=li.get(e);if(s!==void 0){var c=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=er;break;case`focusin`:u=`focus`,c=Gn;break;case`focusout`:u=`blur`,c=Gn;break;case`beforeblur`:case`afterblur`:c=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=rr;break;case ni:case ri:case ii:c=Kn;break;case ci:c=ir;break;case`scroll`:case`scrollend`:c=Rn;break;case`wheel`:c=ar;break;case`copy`:case`cut`:case`paste`:c=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=tr;break;case`submit`:c=nr;break;case`toggle`:case`beforetoggle`:c=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?kt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:jt(s),h=c==null?u:jt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,$f):null,s!==null&&ep(o,u,s,d,!1),c!==null&&f!==null&&ep(o,f,c,d,!0)))}a:{if(s=r?jt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Tr;else if(yr(s)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&dn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?jt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(o,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(o,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else hr?U(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,hr=!0)),v=J(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=ur?gr(e,n):_r(e,n))&&(b=J(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Vf(o,e,r,n,i)}Kf(o,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function J(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function $f(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var tp=/\r\n?/g,Y=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(tp,`
|
|
9
|
-
`).replace(Y,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,a);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.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}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,i.name,i,null),ip(e,t,`formEncType`,i.formEncType,i,null),ip(e,t,`formMethod`,i.formMethod,i,null),ip(e,t,`formTarget`,i.formTarget,i,null)):(ip(e,t,`encType`,i.encType,i,null),ip(e,t,`method`,i.method,i,null),ip(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&q(`scroll`,e);return;case`onScrollEnd`:r!=null&&q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:q(`beforetoggle`,e),q(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}H=!0}function ap(e,t,n,r,i,a){switch(n){case`style`:un(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&q(`scroll`,e);return;case`onScrollEnd`:r!=null&&q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}H=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}H=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:q(`error`,e),q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:ip(e,t,a,o,n,null)}}i&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:ip(e,t,r,d,n,null)}}tn(e,a,c,l,u,o,i,!1);return;case`select`:for(i in q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:ip(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(o in q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:ip(e,t,o,c,n,null)}on(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ip(e,t,l,r,n,null)}return;case`dialog`:q(`beforetoggle`,e),q(`toggle`,e),q(`cancel`,e),q(`close`,e);break;case`iframe`:case`object`:q(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)q(Wf[r],e);break;case`image`:q(`error`,e),q(`load`,e);break;case`details`:q(`toggle`,e);break;case`embed`:case`source`:case`link`:q(`error`,e),q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:ip(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ip(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(H=!0),a=m;break;case`name`:m!==f&&(H=!0),i=m;break;case`checked`:m!==f&&(H=!0),u=m;break;case`defaultChecked`:m!==f&&(H=!0),d=m;break;case`value`:m!==f&&(H=!0),o=m;break;case`defaultValue`:m!==f&&(H=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}en(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ip(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(H=!0),p=a;break;case`defaultValue`:a!==l&&(H=!0),c=a;break;case`multiple`:a!==l&&(H=!0),o=a;default:a!==l&&ip(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ip(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:i!==a&&(H=!0),p=i;break;case`defaultValue`:i!==a&&(H=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&ip(e,t,o,i,r,a)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ip(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(H=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ip(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:ip(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&lp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&lp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function hp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function gp(e,t,n,r){return n=pp(n).createElement(e),n[yt]=r,n[bt]=t,op(n,e,t),Nt(n),n}function _p(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Kh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Kh(t)}function Op(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=pp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(s(566));var t=[];h(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),tm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),tm(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:om(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Ot(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=I.d;I.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Ud();return e||t}function Dm(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=Mt(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Nt(c),op(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=Mt(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Nt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=Mt(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Nt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var i=(i=Se.current)?wm(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Rm(n.href),t=Mt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rm(n.href);var a=Mt(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(zm(e)))?a._p||(o.instance=a,o.state.loading=5):(a=Sm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,a)),Vm(i,e,a,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Hm(n),t=Mt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Rm(e){return`href="`+$t(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),op(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+$t(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),op(r,`style`,i),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Rm(n.href);var a=e.querySelector(zm(i));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=Bm(n),(i=Sm.get(i))&&Km(r,i),a=(e.ownerDocument||e).createElement(`link`),Nt(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),t.state.loading|=4,Gm(a,n.precedence,e),t.instance=a;case`script`:return a=Hm(n.src),(i=e.querySelector(Um(a)))?(t.instance=i,Nt(i),i):(r=n,(i=Sm.get(a))&&(r=D({},n),qm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Nt(i),op(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gm(r,n.precedence,e));return t.instance}function Gm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=oh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var dh={$$typeof:te,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function fh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function mh(e){return e?(e=Ei,e):Ei}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Rd(n,e,t),ho(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Rd(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Fd();t=mt(t);var n=Ci(e,t);n!==null&&Rd(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,Ch(e,t,n,r)}finally{I.p=a,F.T=i}}function Sh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,Ch(e,t,n,r)}finally{I.p=a,F.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Zf(e,t,r,Th,n),Ih(e,r);else if(Rh(i,e,t,n,r))r.stopPropagation();else if(Ih(e,r),t&4&&-1<Fh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=ze()+500,Mf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Rd(s,a,2),Ud(),_h(a,2)}if(a=wh(r),a===null&&Zf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function wh(e){return e=_n(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=kt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Th=e,null}function Dh(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=new Map,Nh=new Map,Ph=[],Fh=`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 Ih(e,t){switch(e){case`focusin`:case`focusout`:kh=null;break;case`dragenter`:case`dragleave`:Ah=null;break;case`mouseover`:case`mouseout`:jh=null;break;case`pointerover`:case`pointerout`:Mh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Nh.delete(t.pointerId)}}function Lh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rh(e,t,n,r,i){switch(t){case`focusin`:return kh=Lh(kh,e,t,n,r,i),!0;case`dragenter`:return Ah=Lh(Ah,e,t,n,r,i),!0;case`mouseover`:return jh=Lh(jh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mh.set(a,Lh(Mh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Nh.set(a,Lh(Nh.get(a)||null,e,t,n,r,i)),!0}return!1}function zh(e){var t=kt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,_t(e.priority,function(){yh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,_t(e.priority,function(){yh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=At(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Vh(e,t,n){Bh(e)&&n.delete(t)}function Hh(){Oh=!1,kh!==null&&Bh(kh)&&(kh=null),Ah!==null&&Bh(Ah)&&(Ah=null),jh!==null&&Bh(jh)&&(jh=null),Mh.forEach(Vh),Nh.forEach(Vh)}function Uh(e,n){e.blockedOn===n&&(e.blockedOn=null,Oh||(Oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hh)))}var Wh=null;function Gh(e){Wh!==e&&(Wh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wh===e&&(Wh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Eh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kh(e){function t(t){return Uh(t,e)}kh!==null&&Uh(kh,e),Ah!==null&&Uh(Ah,e),jh!==null&&Uh(jh,e),Mh.forEach(t),Nh.forEach(t);for(var n=0;n<Ph.length;n++){var r=Ph[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ph.length&&(n=Ph[0],n.blockedOn===null);)zh(n),n.blockedOn===null&&Ph.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Gh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Eh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gh(n)}}}function qh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Jh(e){this._internalRoot=e}Yh.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;hh(n,Fd(),e,t,null,null)},Yh.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Ud(),t[xt]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ph.length&&t!==0&&t<Ph[n].priority;n++);Ph.splice(n,0,e),n===0&&zh(e)}};var Xh=r.version;if(Xh!==`19.3.1`)throw Error(s(527,Xh,`19.3.1`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Zh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Je=Qh.inject(Zh),Ye=Qh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=xc,a=Sc,o=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ph(e,1,!1,null,null,n,r,null,i,a,o,qh),e[xt]=t.current,Yf(e),new Jh(t)}})),c=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=i(),u=c(),d={button:`button`,link:`link`,dialog:`dialog`,alertdialog:`dialog`,table:`table`,grid:`table`,treegrid:`table`,heading:`heading`,textbox:`field`,searchbox:`search field`,combobox:`menu`,checkbox:`checkbox`,radio:`option`,switch:`switch`,slider:`slider`,listbox:`list`,option:`option`,tab:`tab`,menu:`menu`,menuitem:`menu item`,img:`image`,group:`choice`,radiogroup:`choice`},f=e=>d[e.role]??e.role,p=e=>(e.role===`button`||e.role===`link`)&&!!e.name&&e.words.replace(/\s/g,``).length<=2&&!/[\p{L}\p{N}]/u.test(e.words),m=(e,t=60)=>e.length>t?e.slice(0,t-1).trimEnd()+`…`:e;function h(e){return e.role===`status`||e.role===`alert`?`Message`:e.role===`box`?`“${m(g(e))}” ${e.live?`message`:`area`}`:e.role===`text`?`“${m(e.words)}”`:!d[e.role]&&e.name?`“${m(e.name)}”`:e.role===`menuitem`&&e.name?`“${m(e.name)}” in the menu`:p(e)?e.name:`${m(e.name)} ${f(e)}`.trim()}function g({name:e,wordsInside:t}){return e.length>2||!t?.startsWith(e)?e:t.slice(e.length).trim()||e}var _=(e,t,n=4)=>Math.abs(e-t)<=n,v=/^(dialog|alertdialog|status|alert|group|radiogroup|table|grid|treegrid|listbox|menu|box)$/,y=(e,t)=>t.holder===void 0?void 0:e.things[t.holder],b=(e,t)=>t.parent===void 0?void 0:e.things[t.parent],x=/^(for|from|of|in|on|at|to|by|and|with|·|–|—|-|:|,)$/i;function S(e){let t=e.replace(/[“”"]/g,``).split(/\s+/).filter(e=>e&&!/\d/.test(e)&&!/^[$€£¥%#+−-]+$/.test(e));for(;t.length&&x.test(t.at(-1));)t.pop();for(;t.length&&x.test(t[0]);)t.shift();return t.join(` `)}var C=e=>`${e.role}:${e.name}|${e.words}`,w=(e,t)=>JSON.stringify(e.look)===JSON.stringify(t.look),T=(e,t)=>Math.hypot(e.page.x-t.page.x,e.page.y-t.page.y),E=(e,t)=>_(e.page.x,t.page.x,8)&&_(e.page.y,t.page.y,8);function D(e,t){let n=Math.min(e.page.x+e.box.width,t.page.x+t.box.width)-Math.max(e.page.x,t.page.x),r=Math.min(e.page.y+e.box.height,t.page.y+t.box.height)-Math.max(e.page.y,t.page.y);return Math.max(0,n)*Math.max(0,r)/Math.max(1,Math.min(e.box.width*e.box.height,t.box.width*t.box.height))}function O(e,t){let n=new Map,r=[],i=(e,t)=>{let n=y(e,t);return n?C(n):``},a=(e,t)=>{n.set(t,e);let i=A(e,t);i&&r.push(i)},o=new Map,s=e=>o.get(e)??o.set(e,{then:[],now:[]}).get(e);for(let t of e.things)s(C(t)).then.push(t);for(let e of t.things)s(C(e)).now.push(e);let c=[],l=[];for(let{then:r,now:s}of o.values()){let o=[],u=[];for(let n of new Set(r.map(t=>i(e,t)))){let c=r.filter(t=>i(e,t)===n),l=s.filter(e=>i(t,e)===n);c.length===l.length?c.forEach((e,t)=>a(e,l[t])):o.push(...c)}u.push(...s.filter(e=>!n.has(e)));let d=o.flatMap(n=>u.map(r=>({a:n,b:r,cost:T(n,r)+(w(n,r)?0:200)+(i(e,n)===i(t,r)?0:400)}))),f=new Set;for(let{a:e,b:t}of d.sort((e,t)=>e.cost-t.cost))f.has(e)||f.has(t)||(f.add(e).add(t),a(e,t));c.push(...o.filter(e=>!f.has(e))),l.push(...u.filter(e=>!f.has(e)))}c.sort((t,n)=>e.things.indexOf(t)-e.things.indexOf(n)),l.sort((e,n)=>t.things.indexOf(e)-t.things.indexOf(n));let u=(e,t)=>{let n=new Map;for(let r of t){if(r.role!==`text`||!y(e,r))continue;let t=i(e,r);n.set(t,(n.get(t)??0)+1)}return n},d=u(e,c),f=u(t,l),p=e=>{let t=c.findIndex(e);return t<0?void 0:c.splice(t,1)[0]};for(let o of l){let s=/^(button|link|tab|checkbox|switch)$/.test(o.role)?p(e=>e.role===`text`&&e.words===o.name&&D(e,o)>.5):void 0;s?(n.set(o,s),r.push({what:`became`,then:s,now:o})):(s=o.role===`text`?void 0:p(n=>n.role===o.role&&(M(t,o,n.name)||M(e,n,o.name)||ee(e,n)&&ee(t,o)&&D(n,o)>.5)),s?(n.set(o,s),w(s,o)||r.push({what:`looks different`,then:s,now:o})):(s=o.role===`text`?p(e=>e.role===`text`&&E(e,o))??(y(t,o)&&d.get(i(t,o))===f.get(i(t,o))?p(n=>n.role===`text`&&i(e,n)===i(t,o)):void 0)??p(n=>n.role===`text`&&i(e,n)===i(t,o)&&!!S(o.words)&&S(n.words)===S(o.words)):p(e=>e.role===o.role&&(e.name===o.name||E(e,o)||te(e,o)||ne(e,o)||N.test(o.role)&&(!!S(o.name)&&S(e.name)===S(o.name)||D(e,o)>.5))),s?o.role===`box`?a(s,o):(n.set(o,s),r.push({what:`reworded`,then:s,now:o})):r.push({what:`new`,now:o})))}for(let e of c)r.push({what:`gone`,then:e});for(let[e,i]of[...r.entries()].reverse()){if(i.what!==`new`||i.now.role!==`box`)continue;let a=i.now,o=t.things.find(e=>e.role===`text`&&y(t,e)===a&&e.words===a.name),s=o&&n.get(o);if(!s||!E(s,a)||!_(s.box.width,a.box.width)||!_(s.box.height,a.box.height))continue;n.set(a,s),r.splice(e,1);let c=r.findIndex(e=>`now`in e&&e.now===o);c>=0&&r.splice(c,1);let{background:l,...u}=s.look,{background:d,...f}=o.look;JSON.stringify(u)!==JSON.stringify(f)&&r.push({what:`looks different`,then:s,now:o})}let m=new Set(r.flatMap(e=>e.what===`new`&&v.test(e.now.role)?[e.now]:[])),h=e=>[y(t,e),b(t,e)].some(e=>e&&(m.has(e)||h(e)));for(let[e,t]of[...n]){if(!h(e))continue;n.delete(e);let i=r.findIndex(t=>`now`in t&&t.now===e);i>=0&&r.splice(i,1),r.push({what:`new`,now:e},{what:`gone`,then:t})}let g=new Set(r.flatMap(e=>e.what===`new`?[e.now]:[])),x=new Set(r.flatMap(e=>e.what===`gone`?[e.then]:[])),O=new Set(r.flatMap(e=>e.what===`reworded`&&e.now.role===`text`?[e.now]:[])),j=new Set(r.flatMap(e=>e.what===`reworded`&&e.then.role===`text`?[e.then]:[])),re=(e,t,n)=>[y(e,t),b(e,t)].some(e=>e&&n.has(e));return{differences:k(r.filter(n=>{if(n.what===`new`&&re(t,n.now,g)||n.what===`gone`&&re(e,n.then,x))return!1;if(n.what===`looks different`)return!0;let[r,i,a]=n.what===`gone`?[e,n.then,j]:[t,n.now,O],o=b(r,i);return!(i.role===`text`&&o&&a.has(o))}),e,t),was:n}}function k(e,t,n){let r=new Map,i=new Set;for(let t of[`new`,`gone`]){let n=new Map;for(let r of e){if(r.what!==t)continue;let e=r.what===`new`?r.now:r.then;if(e.role!==`text`)continue;let a=[...n.keys()].find(t=>t.parent===e.parent&&_(t.page.y,e.page.y));a?n.get(a).push(e):n.set(e,[e]),i.add(e)}for(let[e,t]of n)r.set(e,t)}return e.flatMap(e=>{if(e.what!==`new`&&e.what!==`gone`)return[e];let a=e.what===`new`?e.now:e.then,o=r.get(a);if(!o)return i.has(a)?[]:[e];if(o.length===1)return[e];let s=e.what===`new`?n:t,c=o.sort((e,t)=>s.things.indexOf(e)-s.things.indexOf(t)),l=c.map(e=>e.words).join(` `),u=Math.min(...c.map(e=>e.page.x)),d=Math.max(...c.map(e=>e.page.x+e.box.width)),f={...c[0],name:l,words:l,box:{...c[0].box,x:c[0].box.x+u-c[0].page.x,width:d-u},page:{...c[0].page,x:u}};return[e.what===`new`?{what:`new`,now:f}:{what:`gone`,then:f}]})}function A(e,t){if(!w(e,t))return{what:`looks different`,then:e,now:t};if(!j(e,t)){if(!_(e.box.width,t.box.width)||!_(e.box.height,t.box.height))return{what:`resized`,then:e,now:t};if(!_(e.page.x,t.page.x)||!_(e.page.y,t.page.y))return{what:`moved`,then:e,now:t}}}function j(e,t){let n=e=>/^(transparent|rgba\(0, 0, 0, 0\))$/.test(e.look.background)&&e.look.border===`none`,r=_(e.page.x,t.page.x)||_(e.page.x+e.box.width,t.page.x+t.box.width);return e.role===`text`&&e.words===t.words&&n(e)&&n(t)&&_(e.box.height,t.box.height)&&_(e.page.y,t.page.y)&&r}function M(e,t,n){if(!n||!t.name.startsWith(n+` `))return!1;let r=t.name.slice(n.length+1);return e.things.some(n=>b(e,n)===t&&n.words===r)}var N=/^(button|link|textbox|searchbox|combobox|checkbox|radio|switch|slider|tab|menuitem|option)$/,ee=(e,t)=>e.things.some(n=>b(e,n)===t&&N.test(n.role)),te=(e,t)=>v.test(t.role)&&D(e,t)>.5,ne=(e,t)=>/^(box|menu)$/.test(t.role)&&!!e.wordsInside&&re(e)===re(t),re=e=>(e.wordsInside??``).split(` `).sort().join(` `);function ie(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ae(e,t=`|`){return e.map(e=>Te(e)).join(t)}function oe(e,t){return typeof t==`bigint`?t.toString():t}var se=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ce(e){return new se(e)}function le(e){return e==null}function ue(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function de(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function fe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function P(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pe(e){return P(e._zod.def)??e._zod.def.shape}function me(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return fe(this,t,e),e},enumerable:!0,configurable:!0})}function he(e,t,n){t in e?fe(e,t,n):e[t]=n}function F(e,t,n,r){let i=pe(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?me(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):he(e,a,r?r(n.value,a):n.value))}}function I(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?me(e,n,()=>t[n]):he(e,n,r.value))}}function ge(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function L(e){return JSON.stringify(e)}function _e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ve=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var R=ce(()=>{if(mt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function be(e){if(ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ye(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function xe(e){return be(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Se=new Set([`string`,`number`,`symbol`]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function we(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Te(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ee(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var De={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Oe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ke(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return F(i,e,Ae(e,t)),we(e,ge(n,{shape:i,checks:[]}))}function Ae(e,t){let n=pe(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function je(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Ae(e,t)),a={};return F(a,e,Reflect.ownKeys(pe(e)).filter(e=>!i.has(e))),we(e,ge(n,{shape:a,checks:[]}))}function Me(e,t){if(!be(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pe(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return we(e,ge(e._zod.def,{shape:Ne(e,t)}))}function Ne(e,t){let n={};return F(n,e,Reflect.ownKeys(pe(e))),I(n,t),n}function Pe(e,t){if(!be(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return we(e,ge(e._zod.def,{shape:Ne(e,t)}))}function Fe(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return F(n,e,Reflect.ownKeys(pe(e))),F(n,t,Reflect.ownKeys(pe(t))),we(e,ge(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ie(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ae(t,n)):void 0,o={};return F(o,t,Reflect.ownKeys(pe(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),we(t,ge(t._zod.def,{shape:o,checks:[]}))}function Le(e,t,n){let r=n?new Set(Ae(t,n)):void 0,i={};return F(i,t,Reflect.ownKeys(pe(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),we(t,ge(t._zod.def,{shape:i}))}function Re(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ze(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Be(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ve(e){return typeof e==`string`?e:e?.message}function He(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ue(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function We(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ve(e.inst?._zod.def?.error?.(e))??Ve(a?.(e))??Ve(t?.error?.(e))??Ve(n.customError?.(e))??Ve(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Ge=/[\uD800-\uDBFF]/;function Ke(e){let t=e.length;if(!Ge.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function qe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Je(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ye(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Xe(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):et(e,n,r.value)}}function Ze(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Qe(e,t,n){return Ze(e,t,n,!1)}function $e(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ze(this,n,r(this))},set(e){Ze(this,n,e)}})}return t}function et(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ze(this,t,n.bind(this))},set(e){Ze(this,t,e)}})}function tt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var nt,rt=!1,it={configurable:!0,get(){rt=!0}};function B(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&nt!==e._zod?nt=void 0:(nt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,it);let e=rt;rt=!1;try{let r=n(this);return rt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),rt||=e,r}catch(n){throw delete this[t],rt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function at(e,t,n,r){let i=tt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ot=`~constantCatch`;function st(e){let t=()=>e;return t[ot]=!0,t}var ct,lt={value:void 0,enumerable:!1},ut=`captureStackTrace`in Error?Error:null;function dt(e){let t=ut;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ut=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function V(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){lt.value=new a(r);try{Object.defineProperty(n,"_zod",lt)}finally{lt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Xe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?dt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ft=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},pt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ct=globalThis).__zod_globalConfig??(ct.__zod_globalConfig={});var mt=globalThis.__zod_globalConfig;function ht(e){return e&&Object.assign(mt,e),mt}function gt(){let e=this._zod;return e.message??=JSON.stringify(e.def,oe,2),e.message}function _t(e){this._zod.message=e}var vt={get:gt,set:_t,enumerable:!0,configurable:!0},yt={value:void 0,enumerable:!1},bt=new WeakSet([Object.prototype,Error.prototype]),xt=V(`$ZodError`,(e,t)=>{e.name=`$ZodError`,yt.value=t,Object.defineProperty(e,"issues",yt),yt.value=void 0,Object.defineProperty(e,"message",vt);let n=Object.getPrototypeOf(e);bt.has(n)||(bt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function St(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ct(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?St(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Tt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Et=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ft;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>We(e,o,ht())));throw ve(n,a?.callee??t),n}return s.value};return t},Dt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>We(e,o,ht())));throw ve(n,a?.callee??t),n}return s.value};return t},Ot=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ft;return a.issues.length?kt(e,a.issues,i):{success:!0,data:a.value}};function kt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>We(e,n,ht()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var At=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?kt(e,a.issues,i):{success:!0,data:a.value}},jt=Symbol.for(`zod.compile.invalid`),Mt=Symbol.for(`zod.compile.fallback`),Nt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==jt)return!0;if(r.definite===!0&&n===void 0)return!1}return Pt(e,t,n)});function Pt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Mt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new ft;return a.issues.length===0}var Ft=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},It=e=>{let t=Et(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Tt(n,a))};return n},Lt=e=>{let t=Et(e),n=(e,r,i,a)=>t(e,r,i,Tt(n,a));return n},Rt=e=>{let t=Dt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Tt(n,a))};return n},zt=e=>{let t=Dt(e),n=async(e,r,i,a)=>await t(e,r,i,Tt(n,a));return n},Bt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ot(e)(t,n,i)},Vt=e=>(t,n,r)=>Ot(e)(t,n,r),Ht=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return At(e)(t,n,i)},H=e=>async(t,n,r)=>At(e)(t,n,r),Ut=/^[cC][0-9a-z]{6,}$/,Wt=/^[0-9a-z]+$/,Gt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Kt=/^[0-9a-vA-V]{20}$/,qt=/^[A-Za-z0-9]{27}$/,Jt=/^[a-zA-Z0-9_-]{21}$/;function Yt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Xt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$t=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,en=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function tn(){return new RegExp(en,`u`)}var nn=/^(?:(?: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])$/,rn=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,an=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,on=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,sn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ln=/^https?$/,un=/^\+[1-9]\d{6,14}$/,dn=`(?:(?:\\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])))`;function fn(e){return RegExp(`^${e}$`)}var pn=fn(dn);function mn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hn(e){return RegExp(`^${mn(e)}$`)}function gn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${mn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${mn({precision:e.precision})}`:n;return RegExp(`^${dn}T(?:${r})$`)}var _n=/^[\s\S]{0,}$/,vn=/^-?\d+$/,yn=/^-?\d+(?:\.\d+)?$/,bn=/^(?:true|false)$/i,xn=/^[^A-Z]*$/,Sn=/^[^a-z]*$/,Cn=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wn=e=>{let t=e.value;return!le(t)&&t.length!==void 0},Tn={number:`number`,bigint:`bigint`,object:`date`},En=V(`$ZodCheckLessThan`,(e,t)=>{Cn.init(e,t);let n=Tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Tn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dn=V(`$ZodCheckGreaterThan`,(e,t)=>{Cn.init(e,t);let n=Tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Tn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),On=V(`$ZodCheckMultipleOf`,(e,t)=>{Cn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):de(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),kn=V(`$ZodCheckNumberFormat`,(e,t)=>{Cn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=De[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),An=V(`$ZodCheckMaxLength`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ke(r):i)<=t.maximum)return;let a=qe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jn=V(`$ZodCheckMinLength`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ke(r):i)>=t.minimum)return;let a=qe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mn=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ke(r):i;if(a===t.length)return;let o=qe(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Nn=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Cn.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Pn=V(`$ZodCheckRegex`,(e,t)=>{Nn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Fn=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xn,Nn.init(e,t)}),In=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Sn,Nn.init(e,t)}),Ln=V(`$ZodCheckIncludes`,(e,t)=>{Cn.init(e,t);let n=Ce(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Rn=V(`$ZodCheckStartsWith`,(e,t)=>{Cn.init(e,t);let n=RegExp(`^${Ce(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),zn=V(`$ZodCheckEndsWith`,(e,t)=>{Cn.init(e,t);let n=RegExp(`.*${Ce(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Bn=V(`$ZodCheckOverwrite`,(e,t)=>{Cn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Vn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
10
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
11
|
-
`)}\n};`)(...Object.values(this.closed))}},Hn={major:4,minor:6,patch:7},Un=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Re(t),a;for(let o of n){if(o._zod.def.when){if(ze(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new ft;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ue(t.issues,n,e),i||=Re(t,n))});else{if(t.issues.length===n)continue;Ue(t.issues,n,e),i||=Re(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Re(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new ft;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new ft;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Qe(this,`~standard`,Kn(this))},set"~standard"(e){Ze(this,`~standard`,e)}}),Wn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>We(e,t,ht()))}:{value:e.value};async function Gn(e,t){let n={async:!0};return Wn(await e._zod.run({value:t,issues:[]},n),n)}function Kn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Wn(r,n)}catch{}return Gn(e,t)},vendor:`zod`,version:1}}var qn=V(`$ZodString`,(e,t)=>{Un.init(e,t),e._zod.pattern=t.pattern??_n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Jn=V(`$ZodStringFormat`,(e,t)=>{Nn.init(e,t),qn.init(e,t)}),Yn=V(`$ZodGUID`,(e,t)=>{t.pattern??=Zt,Jn.init(e,t)}),Xn=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Qt(e)}else t.pattern??=Qt();Jn.init(e,t)}),Zn=V(`$ZodEmail`,(e,t)=>{t.pattern??=$t,Jn.init(e,t)});function Qn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function $n(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Qn(e)||2:er(e,t)}function er(e,t){if(!t.normalize&&t.protocol?.source===ln.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var tr=/[\t\n\r]/g;function nr(e){return e.replace(tr,``)}function rr(e,t){return t.lastIndex=0,t.test(e.hostname)}function ir(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ar=V(`$ZodURL`,(e,t)=>{Jn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=$n(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=nr(r);return}t.hostname&&!rr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!ir(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:nr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),or=V(`$ZodEmoji`,(e,t)=>{t.pattern??=tn(),Jn.init(e,t)}),sr=V(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Jt:Yt(t.length),Jn.init(e,t)}),cr=V(`$ZodCUID`,(e,t)=>{t.pattern??=Ut,Jn.init(e,t)}),lr=V(`$ZodCUID2`,(e,t)=>{t.pattern??=Wt,Jn.init(e,t)}),ur=V(`$ZodULID`,(e,t)=>{t.pattern??=Gt,Jn.init(e,t)}),dr=V(`$ZodXID`,(e,t)=>{t.pattern??=Kt,Jn.init(e,t)}),fr=V(`$ZodKSUID`,(e,t)=>{t.pattern??=qt,Jn.init(e,t)}),pr=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=gn(t),Jn.init(e,t)}),U=V(`$ZodISODate`,(e,t)=>{t.pattern??=pn,Jn.init(e,t)}),mr=V(`$ZodISOTime`,(e,t)=>{t.pattern??=hn(t),Jn.init(e,t)}),hr=V(`$ZodISODuration`,(e,t)=>{t.pattern??=Xt,Jn.init(e,t)}),gr=V(`$ZodIPv4`,(e,t)=>{t.pattern??=nn,Jn.init(e,t)}),_r=/^[0-9a-fA-F:.]+$/;function vr(e){return _r.test(e)?Qn(`http://[${e}]`):!1}var yr=V(`$ZodIPv6`,(e,t)=>{t.pattern??=rn,Jn.init(e,t),e._zod.check=n=>{vr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),br=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=an,Jn.init(e,t)});function xr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:vr(n)}var Sr=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=on,Jn.init(e,t),e._zod.check=n=>{xr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Cr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var wr=/^[0-9a-zA-Z+/]*={0,2}$/,Tr=V(`$ZodBase64`,(e,t)=>{t.pattern??=wr,Jn.init(e,t),e._zod.check=n=>{Cr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Er=/^[A-Za-z0-9_-]*$/;function Dr(e){if(!Er.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Or=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=Er,Jn.init(e,t),e._zod.check=n=>{Dr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),kr=V(`$ZodE164`,(e,t)=>{t.pattern??=un,Jn.init(e,t)});function Ar(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var jr=V(`$ZodJWT`,(e,t)=>{Jn.init(e,t),e._zod.check=n=>{Ar(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Mr=V(`$ZodNumber`,(e,t)=>{Un.init(e,t),e._zod.pattern=yn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Nr=V(`$ZodNumberFormat`,(e,t)=>{kn.init(e,t),Mr.init(e,t)}),Pr=V(`$ZodBoolean`,(e,t)=>{Un.init(e,t),e._zod.pattern=bn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Fr=V(`$ZodUnknown`,(e,t)=>{Un.init(e,t),e._zod.parse=e=>e}),Ir=V(`$ZodNever`,(e,t)=>{Un.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Lr(e,t){let n=He(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of He(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ue(n.issues,t,e),n}}return i(n,a)}}var Rr=e=>Array.isArray(e)?e.length:-1;function zr(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var Br=V(`$ZodArray`,(e,t)=>{Un.init(e,t);let n=mt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>zr(t,r,e)));else if(zr(c,r,e),s&&c.issues.length!==0&&Re(c))break}return o.length?Promise.all(o).then(()=>r):r},Lr(e,Rr)});function Vr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Be(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Hr=[];function Ur(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Hr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ee(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Wr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Re(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Vr(e,n,i,t,d,f))):Vr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Gr=V(`$ZodObject`,(e,t)=>{Un.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=ce(()=>Ur(t));B(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||fe(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ye,o=t.catchall,s,c=mt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Re(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Vr(n,t,e,r,a,o))):Vr(s,t,e,r,a,o)}return o?Wr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Kr=V(`$ZodObjectJIT`,(e,t)=>{Gr.init(e,t);let n=e._zod.parse,r=ce(()=>Ur(t)),i=mt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Vn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
12
|
-
let ${e}_ab = false;
|
|
13
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
14
|
-
const iss = ${e}.issues[i];
|
|
15
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
16
|
-
payload.issues.push(iss);
|
|
17
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
18
|
-
}
|
|
19
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
20
|
-
payload.value = newResult;
|
|
21
|
-
return payload;
|
|
22
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:L(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
23
|
-
const ${n}_present = ${i};
|
|
24
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
25
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (${e}) {
|
|
29
|
-
newResult[${r}] = ${n}.value;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
`)}else f?(o.write(`
|
|
34
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
-
}
|
|
36
|
-
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
37
|
-
if (${n}.value !== undefined || ${i}) {
|
|
38
|
-
newResult[${r}] = ${n}.value;
|
|
39
|
-
}
|
|
40
|
-
`)):o.write(`
|
|
41
|
-
const ${n}_present = ${i};
|
|
42
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
43
|
-
}
|
|
44
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
45
|
-
payload.issues.push({
|
|
46
|
-
code: "invalid_type",
|
|
47
|
-
expected: "nonoptional",
|
|
48
|
-
input: undefined,
|
|
49
|
-
path: [${r}]
|
|
50
|
-
});
|
|
51
|
-
if (ctx && ctx.abortEarly) {
|
|
52
|
-
payload.value = newResult;
|
|
53
|
-
return payload;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (${n}_present) {
|
|
58
|
-
newResult[${r}] = ${n}.value;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ye,c=!mt.jitless,l=c&&R.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Wr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function qr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Re(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>We(e,r,ht())))}),t)}var Jr=V(`$ZodUnion`,(e,t)=>{Un.init(e,t),B(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),B(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),B(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),B(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ue(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>qr(t,r,e,i)):qr(o,r,e,i)}}),Yr=V(`$ZodIntersection`,(e,t)=>{Un.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Zr(e,t,n)):Zr(e,i,a)}});function Xr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(be(e)&&be(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Xr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Xr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Xr(t.value,n.value);if(!c.valid){if(Re(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Qr=V(`$ZodRecord`,(e,t)=>{Un.init(e,t);let n=mt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!be(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>We(e,i,ht())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Be(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Be(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&yn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>We(e,i,ht())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Be(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Be(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),$r=V(`$ZodEnum`,(e,t)=>{Un.init(e,t);let n=ie(t.entries),r=new Set(n);e._zod.values=r,B(e,`pattern`,e=>{let t=ie(e.def.entries).filter(e=>Se.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ce(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ei=V(`$ZodLiteral`,(e,t)=>{Un.init(e,t);let n=new Set(t.values);e._zod.values=n,B(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ce(e):e?Ce(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ti=V(`$ZodTransform`,(e,t)=>{Un.init(e,t),e._zod.optin=`optional`,mt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new pt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ft;return n.value=i,n}});function ni(e,t){return e.value=t.issues.length?void 0:t.value,e}var ri=V(`$ZodOptional`,(e,t)=>{Un.init(e,t),B(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,B(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),B(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ue(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ni(e,t)):ni(e,r)}return t.innerType._zod.run(e,n)}}),ii=V(`$ZodExactOptional`,(e,t)=>{ri.init(e,t),B(e,`values`,e=>e.def.innerType._zod.values),B(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ai=V(`$ZodNullable`,(e,t)=>{Un.init(e,t),B(e,`optin`,e=>e.def.innerType._zod.optin),B(e,`optout`,e=>e.def.innerType._zod.optout),B(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ue(t.source)}|null)$`):void 0}),B(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),oi=V(`$ZodDefault`,(e,t)=>{Un.init(e,t),e._zod.optin=`defaulted`,B(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>si(e,t)):si(r,t)}});function si(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ci=V(`$ZodPrefault`,(e,t)=>{Un.init(e,t),e._zod.optin=`defaulted`,B(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),li=V(`$ZodNonOptional`,(e,t)=>{Un.init(e,t),B(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ui(t,e)):ui(i,e)}});function ui(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function di(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>We(e,r,ht()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var fi=V(`$ZodCatch`,(e,t)=>{Un.init(e,t),B(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),B(e,`optout`,e=>e.def.innerType._zod.optout),B(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>di(e,r,t,n)):di(e,r,t,n)}}),pi=V(`$ZodPipe`,(e,t)=>{Un.init(e,t),B(e,`values`,e=>e.def.in._zod.values),B(e,`optin`,e=>e.def.in._zod.optin),B(e,`optout`,e=>e.def.out._zod.optout),B(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>mi(e,t.in,n)):mi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>mi(e,t.out,n)):mi(r,t.out,n)}});function mi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var hi=V(`$ZodReadonly`,(e,t)=>{Un.init(e,t),B(e,`propValues`,e=>e.def.innerType._zod.propValues),B(e,`values`,e=>e.def.innerType._zod.values),B(e,`optin`,e=>e.def.innerType?._zod?.optin),B(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(gi):gi(r)}});function gi(e){return e.memo||(e.value=Object.freeze(e.value)),e}var _i=V(`$ZodCustom`,(e,t)=>{Cn.init(e,t),Un.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>vi(t,n,r,e));vi(i,n,r,e)}});function vi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ye(e))}}var yi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},bi=`~memo`,xi=[];function Si(e){return typeof e==`object`&&!!e}function Ci(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var wi=new WeakMap,Ti=0,Ei=1,Di=2;function Oi(e,t,n){let r=wi.get(e);if(r!==void 0)return r?Di:Ti;if(t.has(e))return Di;t.add(e);let i=Ti,a=e=>{if(i!==Di&&e?._zod){let r=Oi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Ti;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ei:o.value?._zod?Oi(o.value,t,n):Ti;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=P(c);s(e?o(e,!0):Ei),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Oi(r,t,!1):Ei);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ki(e,i)}function ki(e,t){return t!==Ei&&wi.set(e,t===Di),t}function Ai(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ji,Mi=[],Ni={alloc(e,t,n){let r=ji;if(!r)return n;ji=void 0;let i={value:n,issues:null};return r.set(t.value,i),Mi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Fi(n,e.value))throw new yi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Oi(e,new Set,!1);if(i===Ti)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Di||r?n=!0:r=!0}let l=s.value;if(!Si(l))return t(s,c);let u=c[bi];u||(u={buckets:new WeakMap,backEdges:void 0},c[bi]=u);let d;i===c?d=a:(d=Ai(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ci(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ji=d;let p=Mi.length,m=t(s,c);ji=void 0;let h=Mi.length>p?Mi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ci(e.issues):xi),e)):(h&&(h.issues=m.issues.length?Ci(m.issues):xi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Pi(){return Ni}function Fi(e,t){let n=e[bi]?.backEdges;return n!==void 0&&Si(t)&&n.has(t)}var Ii=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Je(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Te(e.values[0])}`:`Invalid option: expected one of ${ae(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${ae(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Li(){return{localeError:Ii()}}var Ri,zi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Bi(){return new zi}(Ri=globalThis).__zod_globalRegistry??(Ri.__zod_globalRegistry=Bi());var Vi=globalThis.__zod_globalRegistry;function Hi(e){return e.checks&&=[...e.checks],e}function Ui(e,t){return new e(Hi({type:`string`,...z(t)}))}function Wi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...z(t)})}function Gi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...z(t)})}function Ki(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...z(t)})}function qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...z(t)})}function Ji(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...z(t)})}function Yi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...z(t)})}function Xi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...z(t)})}function Zi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...z(t)})}function Qi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...z(t)})}function $i(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...z(t)})}function ea(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...z(t)})}function W(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...z(t)})}function ta(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...z(t)})}function na(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...z(t)})}function ra(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...z(t)})}function ia(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...z(t)})}function aa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...z(t)})}function oa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...z(t)})}function sa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...z(t)})}function ca(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...z(t)})}function la(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...z(t)})}function ua(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...z(t)})}function da(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...z(t)})}function fa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...z(t)})}function pa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...z(t)})}function ma(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...z(t)})}function ha(e,t){return new e(Hi({type:`number`,checks:[],...z(t)}))}function ga(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...z(t)})}function _a(e,t){return new e({type:`boolean`,...z(t)})}function va(e){return new e({type:`unknown`})}function ya(e,t){return new e({type:`never`,...z(t)})}function ba(e,t){return new En({check:`less_than`,...z(t),value:e,inclusive:!1})}function xa(e,t){return new En({check:`less_than`,...z(t),value:e,inclusive:!0})}function Sa(e,t){return new Dn({check:`greater_than`,...z(t),value:e,inclusive:!1})}function Ca(e,t){return new Dn({check:`greater_than`,...z(t),value:e,inclusive:!0})}function wa(e,t){return new On({check:`multiple_of`,...z(t),value:e})}function Ta(e,t){return new An({check:`max_length`,...z(t),maximum:e})}function Ea(e,t){return new jn({check:`min_length`,...z(t),minimum:e})}function Da(e,t){return new Mn({check:`length_equals`,...z(t),length:e})}function Oa(e,t){return new Pn({check:`string_format`,format:`regex`,...z(t),pattern:e})}function ka(e){return new Fn({check:`string_format`,format:`lowercase`,...z(e)})}function Aa(e){return new In({check:`string_format`,format:`uppercase`,...z(e)})}function ja(e,t){return new Ln({check:`string_format`,format:`includes`,...z(t),includes:e})}function Ma(e,t){return new Rn({check:`string_format`,format:`starts_with`,...z(t),prefix:e})}function Na(e,t){return new zn({check:`string_format`,format:`ends_with`,...z(t),suffix:e})}function Pa(e){return new Bn({check:`overwrite`,tx:e})}function Fa(e){return Pa(t=>t.normalize(e))}function Ia(){return Pa(e=>e.trim())}function La(){return Pa(e=>e.toLowerCase())}function Ra(){return Pa(e=>e.toUpperCase())}function za(){return Pa(e=>_e(e))}function Ba(e,t,n){return new e({type:`array`,element:t,...z(n)})}function Va(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...z(n)})}function Ha(e,t){let n=Ua(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ye(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ye(r))}},e(t.value,t)),t);return n}function Ua(e,t){let n=new Cn({check:`custom`,...z(t)});return n._zod.check=e,n}function Wa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&fe(e,t,n[t]);return e}function Ga(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Vi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Ka(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function qa(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,qa(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Wa(o.schema,c),t.io===`input`&&ro(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ja(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ya(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ja(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ja(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
|
-
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Xa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Xa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Za=new Set([`type`,`properties`,`required`,`additionalProperties`]),Qa=[`oneOf`,`anyOf`];function $a(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function eo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Za.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??$a(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}fe(n,r,e.length===1?e[0]:eo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=$a(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function to(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Za)if(t in e)return;let n=t.filter(e=>Qa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=eo(t);else{let e=n[0],i=Qa.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>eo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Wa(e,r))}function no(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Wa(i,s),Wa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Xa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])to(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Wa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,fe(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ao(t,`input`,e.processors),output:ao(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ro(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ro(r.element,n);if(r.type===`set`)return ro(r.valueType,n);if(r.type===`lazy`)return ro(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return ro(r.innerType,n);if(r.type===`intersection`)return ro(r.left,n)||ro(r.right,n);if(r.type===`record`||r.type===`map`)return ro(r.keyType,n)||ro(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ro(r.in,n)||ro(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ro(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ro(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ro(e,n))return!0;return!!(r.rest&&ro(r.rest,n))}return!1}var io=(e,t={})=>n=>{let r=Ga({...n,processors:t});return qa(e,r),Ya(r,e),no(r,e)},ao=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ga({...i??{},target:a,io:t,processors:n});return qa(e,o),Ya(o,e),no(o,e)},oo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},so=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},co=(e,t)=>{oo(e,`minimum`,t),so(e,`maximum`,t)},lo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},uo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},fo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},po=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},mo=(e,t)=>oo(e,`minimum`,t.minimum),ho=(e,t)=>so(e,`maximum`,t.maximum),go=e=>(t,n)=>{po(t,n.format);let[r,i]=e[n.format];oo(t,`minimum`,r),so(t,`maximum`,i)},_o={greater_than:(e,t)=>oo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>so(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>lo(e,t.value),number_format:go(De),bigint_format:go(Oe),min_length:mo,max_length:ho,length_equals:(e,t)=>co(e,t.length),min_size:mo,max_size:ho,size_equals:(e,t)=>co(e,t.size),string_format:(e,t)=>{po(e,t.format),t.pattern&&uo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>fo(e,t.mime)};function vo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)_o[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&oo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&oo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&so(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&so(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&lo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&fo(t,i.mime);for(let e of i.patterns??[])uo(t,e);return t}var yo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},bo=new Map([[wr,sn],[Er,cn]]),xo=e=>bo.get(e)??e,So=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=vo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=yo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(xo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Co=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=vo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Ka(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},wo=(e,t,n,r)=>{n.type=`boolean`},To=(e,t,n,r)=>{n.not={}},Eo=(e,t,n,r)=>{let i=e._zod.def,a=ie(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Do=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Ka(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Ka(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Oo=(e,t,n,r)=>{Ka(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ko=(e,t,n,r)=>{Ka(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ao=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=vo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qa(a.element,t,{...r,path:[...r.path,`items`]})};function jo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jo(t.out):t.type===`catch`?jo(t.innerType):e._zod.optin}var Mo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Ka(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)fe(i.properties,e,qa(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?jo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qa(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},No=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qa(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Po=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qa(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Fo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Fo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Fo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?yn:vn).source)),p}var Io=new WeakMap;function Lo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Io.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Fo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ro=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=vo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qa(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)fe(i.patternProperties,xo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=qa(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Io.get(t);n||(n=[],Io.set(t,n),t.deferred.push(()=>Lo(t))),n.push(e)}i.additionalProperties=qa(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},G=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},zo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bo=Symbol();function Vo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Ka(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Bo):JSON.parse(o)}var Ho=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Vo(i.defaultValue,e,t,n,r);o!==Bo&&(n.default=o)},Uo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Vo(i.defaultValue,e,t,n,r);o!==Bo&&(n._prefault=o)},Wo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Ka(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Go=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;qa(o,t,r);let s=t.seen.get(e);s.ref=o},Ko=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},qo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Jo=new WeakSet([Object.prototype,Error.prototype]);function Yo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Xo=V(`ZodError`,(e,t)=>{xt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Jo.has(n)||(Jo.add(n),Yo(n,`format`,e=>t=>wt(e,t)),Yo(n,`flatten`,e=>t=>Ct(e,t)),Yo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,oe,2)}),Yo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,oe,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Zo=Et(Xo),Qo=Dt(Xo),$o=Ot(Xo),es=At(Xo),ts=It(Xo),ns=Lt(Xo),rs=Rt(Xo),is=zt(Xo),as=Bt(Xo),os=Vt(Xo),ss=Ht(Xo),cs=H(Xo);function ls(){mt.localeError||ht(Li())}function us(){mt.memoizer||ht({memoizer:Pi()})}var ds=V(`ZodType`,(e,t)=>(ls(),Un.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ge(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return we(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ac(e,t))},superRefine(e,t){return this.check(jc(e,t))},overwrite(e){return this.check(Pa(e))},optional(){return fc(this)},exactOptional(){return mc(this)},nullable(){return gc(this)},nullish(){return fc(gc(this))},nonoptional(e){return Sc(this,e)},array(){return Xs(this)},or(e){return ec([this,e])},and(e){return nc(this,e)},transform(e){return Ec(this,uc(e))},default(e){return vc(this,e)},prefault(e){return bc(this,e)},catch(e){return wc(this,e)},pipe(e){return Ec(this,e)},readonly(){return Oc(this)},describe(e){let t=this.clone();return Vi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Vi.get(this);let t=this.clone();return Vi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Qe(this,`~standard`,{...Kn(this),jsonSchema:{input:ao(this,`input`),output:ao(this,`output`)}})},set"~standard"(e){Ze(this,`~standard`,e)},parse:function e(t,n){return Zo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Qo(this,t,n,{callee:e})},safeParse(e,t){return $o(this,e,t)},async safeParseAsync(e,t){return es(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ze(this,`spa`,e)},validate(e,t){return Nt(this,e,t)},validateAsync(e,t){return Ft(this,e,t)},encode:function e(t,n){return ts(this,t,n,{callee:e})},decode:function e(t,n){return ns(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await rs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await is(this,t,n,{callee:e})},safeEncode(e,t){return as(this,e,t)},safeDecode(e,t){return os(this,e,t)},async safeEncodeAsync(e,t){return ss(this,e,t)},async safeDecodeAsync(e,t){return cs(this,e,t)},toJSONSchema(e){return io(this,{})(e)},get description(){return Vi.get(this)?.description},get _def(){return this._zod.def}}),fs=V(`_ZodString`,(e,t)=>{qn.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r)},$e({format:e=>vo(e).format??null,minLength:e=>vo(e).minimum??null,maxLength:e=>vo(e).maximum??null},{regex(...e){return this.check(Oa(...e))},includes(...e){return this.check(ja(...e))},startsWith(...e){return this.check(Ma(...e))},endsWith(...e){return this.check(Na(...e))},min(...e){return this.check(Ea(...e))},max(...e){return this.check(Ta(...e))},length(...e){return this.check(Da(...e))},nonempty(...e){return this.check(Ea(1,...e))},lowercase(e){return this.check(ka(e))},uppercase(e){return this.check(Aa(e))},trim(){return this.check(Ia())},normalize(...e){return this.check(Fa(...e))},toLowerCase(){return this.check(La())},toUpperCase(){return this.check(Ra())},slugify(){return this.check(za())}})),ps=V(`ZodString`,(e,t)=>{qn.init(e,t),fs.init(e,t)},{email(e){return this.check(Wi(bs,e))},url(e){return this.check(Xi(Cs,e))},jwt(e){return this.check(ua(Rs,e))},emoji(e){return this.check(Zi(ws,e))},guid(e){return this.check(Gi(xs,e))},uuid(e){return this.check(Ki(Ss,e))},uuidv4(e){return this.check(qi(Ss,e))},uuidv6(e){return this.check(Ji(Ss,e))},uuidv7(e){return this.check(Yi(Ss,e))},nanoid(e){return this.check(Qi(Ts,e))},cuid(e){return this.check($i(Es,e))},cuid2(e){return this.check(ea(Ds,e))},ulid(e){return this.check(W(Os,e))},base64(e){return this.check(sa(Fs,e))},base64url(e){return this.check(ca(Is,e))},xid(e){return this.check(ta(ks,e))},ksuid(e){return this.check(na(As,e))},ipv4(e){return this.check(ra(js,e))},ipv6(e){return this.check(ia(Ms,e))},cidrv4(e){return this.check(aa(Ns,e))},cidrv6(e){return this.check(oa(Ps,e))},e164(e){return this.check(la(Ls,e))},datetime(e){return this.check(da(gs,e))},date(e){return this.check(fa(_s,e))},time(e){return this.check(pa(vs,e))},duration(e){return this.check(ma(ys,e))}});function ms(e){return Ui(ps,e)}var hs=V(`ZodStringFormat`,(e,t)=>{Jn.init(e,t),fs.init(e,t)}),gs=V(`ZodISODateTime`,(e,t)=>{pr.init(e,t),hs.init(e,t)}),_s=V(`ZodISODate`,(e,t)=>{U.init(e,t),hs.init(e,t)}),vs=V(`ZodISOTime`,(e,t)=>{mr.init(e,t),hs.init(e,t)}),ys=V(`ZodISODuration`,(e,t)=>{hr.init(e,t),hs.init(e,t)}),bs=V(`ZodEmail`,(e,t)=>{Zn.init(e,t),hs.init(e,t)}),xs=V(`ZodGUID`,(e,t)=>{Yn.init(e,t),hs.init(e,t)}),Ss=V(`ZodUUID`,(e,t)=>{Xn.init(e,t),hs.init(e,t)}),Cs=V(`ZodURL`,(e,t)=>{ar.init(e,t),hs.init(e,t)}),ws=V(`ZodEmoji`,(e,t)=>{or.init(e,t),hs.init(e,t)}),Ts=V(`ZodNanoID`,(e,t)=>{sr.init(e,t),hs.init(e,t)}),Es=V(`ZodCUID`,(e,t)=>{cr.init(e,t),hs.init(e,t)}),Ds=V(`ZodCUID2`,(e,t)=>{lr.init(e,t),hs.init(e,t)}),Os=V(`ZodULID`,(e,t)=>{ur.init(e,t),hs.init(e,t)}),ks=V(`ZodXID`,(e,t)=>{dr.init(e,t),hs.init(e,t)}),As=V(`ZodKSUID`,(e,t)=>{fr.init(e,t),hs.init(e,t)}),js=V(`ZodIPv4`,(e,t)=>{gr.init(e,t),hs.init(e,t)}),Ms=V(`ZodIPv6`,(e,t)=>{yr.init(e,t),hs.init(e,t)}),Ns=V(`ZodCIDRv4`,(e,t)=>{br.init(e,t),hs.init(e,t)}),Ps=V(`ZodCIDRv6`,(e,t)=>{Sr.init(e,t),hs.init(e,t)}),Fs=V(`ZodBase64`,(e,t)=>{Tr.init(e,t),hs.init(e,t)}),Is=V(`ZodBase64URL`,(e,t)=>{Or.init(e,t),hs.init(e,t)}),Ls=V(`ZodE164`,(e,t)=>{kr.init(e,t),hs.init(e,t)}),Rs=V(`ZodJWT`,(e,t)=>{jr.init(e,t),hs.init(e,t)}),zs=V(`ZodNumber`,(e,t)=>{Mr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.isFinite=!0},$e({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=vo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=vo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=vo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>vo(e).format??null},{gt(e,t){return this.check(Sa(e,t))},gte(e,t){return this.check(Ca(e,t))},min(e,t){return this.check(Ca(e,t))},lt(e,t){return this.check(ba(e,t))},lte(e,t){return this.check(xa(e,t))},max(e,t){return this.check(xa(e,t))},int(e){return this.check(Hs(e))},safe(e){return this.check(Hs(e))},positive(e){return this.check(Sa(0,e))},nonnegative(e){return this.check(Ca(0,e))},negative(e){return this.check(ba(0,e))},nonpositive(e){return this.check(xa(0,e))},multipleOf(e,t){return this.check(wa(e,t))},step(e,t){return this.check(wa(e,t))},finite(){return this}}));function Bs(e){return ha(zs,e)}var Vs=V(`ZodNumberFormat`,(e,t)=>{Nr.init(e,t),zs.init(e,t)});function Hs(e){return ga(Vs,e)}var Us=V(`ZodBoolean`,(e,t)=>{Pr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function Ws(e){return _a(Us,e)}var Gs=V(`ZodUnknown`,(e,t)=>{Fr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ks(){return va(Gs)}var qs=V(`ZodNever`,(e,t)=>{Ir.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r)});function Js(e){return ya(qs,e)}var Ys=V(`ZodArray`,(e,t)=>{us(),Br.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ea(e,t))},nonempty(e){return this.check(Ea(1,e))},max(e,t){return this.check(Ta(e,t))},length(e,t){return this.check(Da(e,t))},unwrap(){return this.element}});function Xs(e,t){return Ba(Ys,e,t)}var Zs=V(`ZodObject`,(e,t)=>{us(),Kr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),at(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ge(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ge(this._zod.def,{catchall:Ks()}))},loose(){return this.clone(ge(this._zod.def,{catchall:Ks()}))},strict(){return this.clone(ge(this._zod.def,{catchall:Js()}))},strip(){return this.clone(ge(this._zod.def,{catchall:void 0}))},extend(e){return Me(this,e)},safeExtend(e){return Pe(this,e)},merge(e){return Fe(this,e)},pick(e){return ke(this,e)},omit(e){return je(this,e)},partial(...e){return Ie(dc,this,e[0])},exactPartial(...e){return Ie(pc,this,e[0],`exactPartial`)},required(...e){return Le(xc,this,e[0])}});function Qs(e,t){return new Zs({type:`object`,shape:e,catchall:Js(),...z(t)})}var $s=V(`ZodUnion`,(e,t)=>{Jr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.options=t.options});function ec(e,t){return new $s({type:`union`,options:e,...z(t)})}var tc=V(`ZodIntersection`,(e,t)=>{Yr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r)});function nc(e,t){return new tc({type:`intersection`,left:e,right:t})}var rc=V(`ZodRecord`,(e,t)=>{us(),Qr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ic(e,t,n){return!t||!t._zod?new rc({type:`record`,keyType:ms(),valueType:e,...z(t)}):new rc({type:`record`,keyType:e,valueType:t,...z(n)})}var ac=V(`ZodEnum`,(e,t)=>{$r.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ac({...t,checks:[],...z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ac({...t,checks:[],...z(r),entries:i})}});function oc(e,t){return new ac({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...z(t)})}var sc=V(`ZodLiteral`,(e,t)=>{ei.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cc(e,t){return new sc({type:`literal`,values:Array.isArray(e)?e:[e],...z(t)})}var lc=V(`ZodTransform`,(e,t)=>{us(),ti.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new pt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ye(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ye(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function uc(e){return new lc({type:`transform`,transform:e})}var dc=V(`ZodOptional`,(e,t)=>{ri.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}var pc=V(`ZodExactOptional`,(e,t)=>{ii.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`optional`,innerType:e})}var hc=V(`ZodNullable`,(e,t)=>{ai.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`nullable`,innerType:e})}var _c=V(`ZodDefault`,(e,t)=>{oi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vc(e,t){return new _c({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}var yc=V(`ZodPrefault`,(e,t)=>{ci.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}var xc=V(`ZodNonOptional`,(e,t)=>{li.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sc(e,t){return new xc({type:`nonoptional`,innerType:e,...z(t)})}var Cc=V(`ZodCatch`,(e,t)=>{fi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wc(e,t){return new Cc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:st(t)})}var Tc=V(`ZodPipe`,(e,t)=>{pi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.in=t.in,e.out=t.out});function Ec(e,t){return new Tc({type:`pipe`,in:e,out:t})}var Dc=V(`ZodReadonly`,(e,t)=>{hi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Dc({type:`readonly`,innerType:e})}var kc=V(`ZodCustom`,(e,t)=>{_i.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r)});function Ac(e,t={}){return Va(kc,e,t)}function jc(e,t){return Ha(e,t)}function Mc(e){return da(gs,e)}var Nc=e=>ms({error:e}).refine(e=>e.trim()!==``,{error:e}),Pc=e=>ms({error:e}).regex(/^[\w-]+$/,{error:e}),Fc=e=>Bs({error:e}).min(0,{error:e}),Ic=e=>Bs({error:e}).min(0,{error:e}).max(1,{error:e}),Lc=e=>ms({error:e}).regex(/^[\w.-]+(\/[\w.-]+)*$/,{error:e}).refine(e=>!e.split(`/`).some(e=>e===`.`||e===`..`),{error:e}),Rc=Qs({role:Nc(`needs its role`).describe(`As getByRole takes it, or text, row or box for something with no role of its own`),name:Nc(`needs its name`),css:ms().optional(),node:Bs().int().optional().describe(`The element in that round's recording`)}),zc=`isn't on the screen. Boxes and points are shares of the screen, from 0 to 1`,Bc=Qs({x:Ic(zc),y:Ic(zc),width:Ic(zc),height:Ic(zc)}).refine(e=>e.x+e.width<=1&&e.y+e.height<=1,{error:zc}),Vc=Qs({x:Ic(zc),y:Ic(zc)}),Hc=Qs({does:Nc(`needs what it did`),on:Nc(`needs the path to what it was done on`),with:ec([ms(),Ws(),Xs(ms())]).optional(),what:ms().optional().describe(`The words of what it was done on`)}),Uc=Qs({flow:Nc(`needs the flow it's on`),at:Fc(`needs its moment, in seconds`).optional().describe(`Without it, the whole flow`),until:Fc(`needs its end, in seconds`).optional().describe(`The end of a stretch`),element:Rc.optional(),alike:Xs(Rc).optional().describe(`The other things changed alike with its element, each where it is`),box:Bc.optional().describe(`Something with no words of its own, or where only the pixels changed`),point:Vc.optional().describe(`Empty space`),app:Qs({from:Qs({flow:Nc(`needs the flow it was taken over in`),at:Fc(`needs the moment it was taken over at, in seconds`)}),did:Xs(Hc).describe(`What the person did there, in order`),recording:Lc(`needs its recording: the name of a file in the round`).describe(`The flow up to where it was taken over, then the person's own steps`),length:Bs({error:`needs its length, in seconds`}).positive({error:`needs its length, in seconds`})}).optional().describe(`In the app: on the person's own recording, which branches off a flow where they took it over. Its flow names the branch`)}).refine(e=>[e.element,e.box,e.point].filter(e=>e).length<=1,{error:`is on more than one thing. Choose an element, a box or a point`}).refine(e=>e.at!==void 0||!(e.element||e.box||e.point),{error:`is on something but at no moment. Give it one`}).refine(e=>e.until===void 0||e.at!==void 0&&e.until>e.at,{error:`ends before it starts. A stretch ends after its moment`}),Wc=Qs({title:Nc(`needs a title`).describe(`Steps are matched across rounds by their title`),at:Fc(`needs the moment it starts, in seconds`),actions:Xs(Fc(`needs the moment each of its actions was done, in seconds`)).optional().describe(`When each of its actions was done: between them the page rests, and a person can take the flow over there`),person:Nc(`needs the name of who does it, or no person`).optional().describe(`Who does it, once the flow has changed hands: someone other than who the flow is done as`)}),Gc=Qs({name:Nc(`needs a name`).describe(`Its identity: a new name is a new flow`),length:Bs({error:`needs its length, in seconds`}).positive({error:`needs its length, in seconds`}),steps:Xs(Wc),recording:Lc(`needs its recording: the name of a file in the round`),line:Nc(`needs words in its line, or no line`).optional().describe(`The agent's, at the flow's start: what it starts from, or the choice it shows`),stopped:Nc(`needs the step it stopped at`).optional().describe(`On Before, the step the flow couldn't take there, or that the app as it was had something else for: it's kept as far as that`),person:Nc(`needs the name of who it acts as, or no person`).optional().describe(`Who the flow is done as, as its file or the app's setup names them: the name on the recorded pointer, handed to you when you take over`),unsteady:Xs(Nc(`needs the ids of the changes it makes by itself`)).optional().describe(`Changes found between two recordings of the same app, like a time the server stamps: left out of every comparison, in every flow`)}),Kc=Qs({id:Nc(`needs an id`).describe(`Its thing and its kind of change, so it keeps its id in every round while it's the same change`),words:Nc(`needs its words`).describe(`What changed, for the agent: “Download CSV and Cancel have swapped places”`),seen:Xs(Uc,{error:`needs where it's seen, a list`}).min(1,{error:`needs where it's seen: each flow, at its moment there`}).describe(`Each flow it's seen in, at its moment there; a flow that's gone, with no moment`),pictureOnly:cc(!0).optional().describe(`Seen only in the pictures, with nothing read there changed: shown to the person, who can see what it is, and not put to the agent, who can't see more of it than Playthrough did`)}),qc=Qs({round:Bs({error:`needs its round`}).int().min(1,{error:`needs its round, after Before`}),since:Bs({error:`needs the round it's compared with`}).int().min(0).describe(`0 is Before`),changes:Xs(Kc,{error:`needs its changes, a list, even if it's empty`})}),Jc=ec([Qs({line:Nc(`needs words in its line`)}).describe(`Why it's there, in the agent's voice: what it meant or chose`),Qs({note:Nc(`needs the id of the note it was made for`)}).describe(`Made for that note: the reply on the note says why`),Qs({notReal:Nc(`needs to say why nothing really changed`)}).describe(`Nothing really changed; nobody is shown it`)],{error:`says one of { line }, { note } or { notReal }`}),Yc=Qs({note:Nc(`needs the note it answers`),words:ms({error:`needs its words, even if empty until it's answered`}),on:Uc.optional().describe(`Where it shows on this round's recording; without it, the note's place was lost`),watch:Nc(`needs a step's title`).optional().describe(`For an answer that moves: the step of its flow it's seen in, which the note then plays`)}),Xc=Qs({id:Pc(`needs an id of letters, digits and dashes`),on:Uc.optional().describe(`Without it, about the work in general`),words:Nc(`needs words`)}),Zc=Qs({number:Bs().int().min(0).describe(`Round 0 is Before: the app as it was`),by:Nc(`needs to say which agent recorded it`).describe(`By the name it goes by, “Claude Code” or “Codex”: one review can pass between agents`),flows:Xs(Gc),replies:Xs(Yc).describe(`The agent's answer to each note that asks for one`),accounts:ic(ms(),Jc).describe(`What the agent says about each change new since the round before, by its id`),commit:ms().optional().describe(`What it was recorded from`),cantStart:Xs(Nc(`needs the flow's name`)).optional().describe(`Before: the flows the app as it was can't start, so they have no Before`),finished:Mc().optional()}),Qc=Qs({note:Nc(`needs the note it's on`),verdict:oc([`looks good`,`not quite`],{error:`is “looks good” or “not quite”`}),words:ms().optional()}).refine(e=>e.verdict!==`not quite`||e.words?.trim(),{error:`is not quite, so it needs words saying what's still wrong`}),$c=Qs({id:Pc(`needs an id of letters, digits and dashes`).describe(`Chosen by the sender, so sending twice sends once`),round:Bs().int().min(0),by:Nc(`needs to say who sent it`),sent:Mc({error:`needs to say when it was sent, as an ISO date`}),notes:Xs(Xc).describe(`New ones`),verdicts:Xs(Qc),looksGood:Xs(Nc(`needs the flow's name`)).describe(`Flows that look good as a whole; one that isn't quite right gets a note`),takenBack:Xs(Nc(`needs the flow's name`)).optional().describe(`Flows whose Looks good, said before, is taken back: they ask again`)}),el=Qs({send:ms(),round:Bs().int(),at:Mc()}),tl=Qs({by:ms(),at:Mc()});Qs({id:ms(),title:ms().describe(`A few words for the change, as a pull request's title`),asked:ms().optional().describe(`What was asked, in the person's words`),started:Mc(),rounds:Xs(Zc),comparisons:Xs(qc),sends:Xs($c),taken:Xs(el),accepted:tl.optional()});function nl(){return Array.from(crypto.getRandomValues(new Uint8Array(8)),e=>`abcdefghijkmnpqrstuvwxyz23456789`[e%32]).join(``)}var rl=e=>e.length>1?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:e[0]??``,il=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`;function al(e){return[...new Set(e.rounds.flatMap(e=>[...e.flows.map(e=>e.name),...e.cantStart??[]]))]}function ol(e){let t=new Map;for(let n of e.sends)for(let e of n.notes)t.set(e.id,{note:e,round:n.round,by:n.by});return t}function sl(e,t){let n=ol(e).get(t);if(!n)return[];let r=[{turn:{by:n.by,agent:!1,round:n.round,words:n.note.words},order:0}];for(let i of e.rounds.filter(e=>e.number>n.round)){let e=i.replies.find(e=>e.note===t);e?.words.trim()&&r.push({turn:{by:i.by,agent:!0,round:i.number,words:e.words},order:1})}for(let n of e.sends)for(let e of n.verdicts.filter(e=>e.note===t))r.push({turn:{by:n.by,agent:!1,round:n.round,words:e.words??``,verdict:e.verdict},order:2});return r.sort((e,t)=>e.turn.round-t.turn.round||e.order-t.order).map(({turn:e})=>e)}function cl(e,t){return ul(e.sends.filter(n=>e.taken.some(e=>e.send===n.id&&e.round===t)))}function ll(e){let t=t=>{let n=e.taken.find(e=>e.send===t.id);return!!n&&e.rounds.some(e=>e.number===n.round&&e.finished)};return ul(e.sends.filter(e=>!t(e)))}function ul(e){let t=new Set,n=new Map;for(let r of e){for(let e of r.notes)t.add(e.id);for(let e of r.verdicts)n.set(e.note,e.verdict)}for(let[e,r]of n)r===`not quite`&&t.add(e);return[...t]}function dl(e,t,n){return e.rounds.findLast(e=>e.number<=t&&e.accounts[n])?.accounts[n]}function fl(e,t){if(!ml(t))return[`Accepting needs to say who accepted.`];if(!e.rounds.some(e=>e.finished&&e.number>0))return[`There's no finished round to accept yet.`];let n=ol(e);return ll(e).map(e=>{let t=n.get(e);return`Note ${e}${t?`, “${pl(t.note.words)}”,`:``} still waits for the agent's answer, so the work can't be accepted yet.`})}var pl=e=>e.length>48?`${e.slice(0,47).trimEnd()}…`:e,ml=e=>typeof e==`string`&&e.trim()!==``;function hl(e,t,n,r){if(e<=0)return e;let[i,a]=r?_l(gl(t,n),r):gl(t,n);for(let t=0;t<i.length-1;t++)if(e<=i[t+1])return a[t]+(a[t+1]-a[t])*Math.min(1,Math.max(0,(e-i[t])/(i[t+1]-i[t])));return n.length}function gl(e,t){let n=e=>[...e.steps.map(e=>e.at),e.length],r=n(e),i=n(t);if(r.length===i.length)return[r,i];let a=[0],o=[0],s=(e,t)=>{e===void 0||t===void 0||t<o.at(-1)||(e>a.at(-1)?(a.push(e),o.push(t)):e===a.at(-1)&&t>o.at(-1)&&(a.push(e+.001),o.push(t)))},c=0;return e.steps.forEach((e,n)=>{let a=t.steps.findIndex((t,n)=>n>=c&&t.title===e.title);a<0||(s(r[n],i[a]),s(r[n+1],i[a+1]),c=a+1)}),s(r.at(-1),i.at(-1)),[a,o]}function _l([e,t],n){let r=[e[0]],i=[t[0]];for(let a=0;a<e.length-1;a++){let o=(e,t,n)=>e.filter(e=>e>t&&e<n),s=o(n.from,e[a],e[a+1]),c=o(n.to,t[a],t[a+1]);s.length===c.length&&(r.push(...s),i.push(...c)),r.push(e[a+1]),i.push(t[a+1])}return[r,i]}function vl(e,t){let n=e.steps.findLast(e=>e.at<=t+.05)??e.steps[0];if(!n)return;let r=n.actions??[],i=r.filter(e=>e<=t).length;if(i===r.length)return{step:n.title};if(i)return{step:n.title,actions:i};let a=e.steps[e.steps.indexOf(n)-1];return a?{step:a.title}:{step:n.title,actions:1}}function yl(e,t,n,r=1/0){let i=ol(e),a=e.sends.filter(e=>e.by===t&&e.round<r).filter(e=>e.looksGood.includes(n)||!!e.takenBack?.includes(n)||e.notes.some(e=>e.on?.flow===n)||e.verdicts.some(e=>i.get(e.note)?.note.on?.flow===n)).map(e=>e.round);return a.length?Math.max(...a):void 0}function bl(e,t,n){let r=e.rounds.find(e=>e.number===t),i=e.rounds[0]?.number;if(!r||i===void 0)return[];let a=e.comparisons.filter(e=>e.round===t),o=ol(e),s=r.flows.map(e=>e.name),c=al(e),l=a.flatMap(e=>e.changes),u=[];for(let r of new Set(l.map(e=>e.id))){let s=dl(e,t,r);if(s&&`notReal`in s)continue;let d=[...new Set(l.filter(e=>e.id===r).flatMap(e=>e.seen.map(e=>e.flow)))].map(r=>yl(e,n,r,t)).filter(e=>e!==void 0),f=d.length?Math.max(...d):i,p=a.find(e=>e.since===f)?.changes.find(e=>e.id===r);if(!p)continue;let m=[s&&`note`in s?o.get(s.note)?.note.on?.flow:void 0,...c].find(e=>p.seen.some(t=>t.flow===e))??p.seen[0].flow,h=p.seen.filter(e=>e.flow===m).sort((e,t)=>(e.at??0)-(t.at??0))[0];u.push({change:p,on:h,since:f})}return u.sort((e,t)=>s.indexOf(e.on.flow)-s.indexOf(t.on.flow)||(e.on.at??0)-(t.on.at??0))}function xl(e,t,n){let r=new Map;for(let i of ol(e).keys()){let a=sl(e,i).filter(e=>e.round<=t);a.some(e=>!e.agent&&e.by===n&&e.verdict!==`looks good`)&&r.set(i,a)}return r}function Sl(e){let t=e.findLast(e=>e.agent)?.round;return t!==void 0&&!e.some(e=>!e.agent&&e.verdict&&e.round>=t)}function Cl(e,t,n){return[...xl(e,t,n)].filter(([,e])=>Sl(e)).map(([e])=>e)}function wl(e,t,n,r){let i=e.sends.findLast(e=>e.by===n&&e.round<=t&&(e.looksGood.includes(r)||e.takenBack?.includes(r)));if(!i?.looksGood.includes(r))return!1;for(let a=i.round+1;a<=t;a++)if(bl(e,a,n).some(e=>e.on.flow===r))return!1;let a=ol(e),o=xl(e,t,n);return![...Cl(e,t,n),...ll(e).filter(e=>o.has(e))].some(e=>a.get(e)?.note.on?.flow===r)}function Tl(e,t){let n=e.rounds.findLast(e=>e.finished&&e.number>0);return!n||fl(e,t).length||Cl(e,n.number,t).length?!1:n.flows.every(r=>wl(e,n.number,t,r.name))}function El(e,t,n){if(e.at===void 0)return{flow:e.flow};let r=e=>Math.min(n.flow.length,Math.round(hl(e,t.flow,n.flow)*100)/100),i=e.until===void 0?void 0:r(e.until),a={flow:e.flow,at:r(e.at),...i!==void 0&&i>r(e.at)&&{until:i}};if(e.box)return{...a,box:e.box};if(e.point)return{...a,point:Al(e.point,e.at,t,n)??e.point};let o=r=>{let i=jl(t.readings,r,e.at,n.readings);return i&&Pl(i.thing,r.name)},s=e.element&&o(e.element),c=s&&e.alike?.map(o).filter(e=>e!==void 0);return s?{...a,element:s,...c?.length&&{alike:c}}:a}var Dl=/^(dialog|alertdialog|group|radiogroup|table|grid|treegrid|listbox|menu)$/,Ol=(e,t,n)=>kl(e,t,n)?.thing;function kl(e,t,n){let r=e.reduce((e,n)=>!e||Math.abs(n.at-t)<Math.abs(e.at-t)?n:e,void 0);if(!r)return;let i=n.x*r.screen.width,a=n.y*r.screen.height,o=e=>i>=e.box.x&&i<=e.box.x+e.box.width&&a>=e.box.y&&a<=e.box.y+e.box.height,s=e=>e.box.width*e.box.height,c=r.things.filter(e=>(e.role===`box`||Dl.test(e.role)&&!/^(table|grid|treegrid)$/.test(e.role))&&o(e)).sort((e,t)=>s(e)-s(t))[0],l=e=>{for(let t=e.holder;t!==void 0;t=r.things[t]?.holder)if(r.things[t]===c)return!0;return!1},u=e=>Math.hypot(Math.max(e.box.x-i,0,i-e.box.x-e.box.width),Math.max(e.box.y-a,0,a-e.box.y-e.box.height)),d=r.things.filter(e=>e.name&&e.role!==`box`&&!Dl.test(e.role)&&(!c||l(e))&&u(e)<=80).sort((e,t)=>u(e)-u(t)||s(e)-s(t))[0];return d&&{reading:r,thing:d}}function Al(e,t,n,r){let i=kl(n.readings,t,e),a=i&&Nl(i,n.readings,r.readings);if(!i||!a)return;let o=(e,t)=>Math.min(1,Math.max(0,e/t));return{x:o(e.x*i.reading.screen.width+a.thing.box.x-i.thing.box.x,a.reading.screen.width),y:o(e.y*i.reading.screen.height+a.thing.box.y-i.thing.box.y,a.reading.screen.height)}}function jl(e,t,n,r){let i=Ml(e,t,n);return i&&Nl(i,e,r)}function Ml(e,t,n){let r=t=>{let r;for(let i of e){let e=i.things.find(t);e&&(!r||Math.abs(i.at-n)<Math.abs(r.reading.at-n))&&(r={reading:i,thing:e})}return r};return(t.node===void 0?void 0:r(e=>e.node===t.node))??r(e=>e.role===t.role&&e.name===t.name)}function Nl({reading:e,thing:t},n,r){let i=n.filter(t=>t.step===e.step).indexOf(e),a=r.filter(t=>t.step===e.step)[i];if(a){for(let[n,r]of O(e,a).was)if(r===t)return{reading:a,thing:n}}}var Pl=(e,t)=>({role:e.role,name:e.name||t,...e.node!==void 0&&{node:e.node}});function Fl(e){let[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{let t=new EventSource(`/api/reviews/${e}/live`);return t.onmessage=e=>n(JSON.parse(e.data)),t.onerror=async()=>{if(t.readyState!==EventSource.CLOSED)return;let r=await fetch(`/api/reviews/${e}/live`).catch(()=>void 0);if(r?.ok)return void r.body?.cancel();let i=await r?.json().then(e=>e.problems,()=>void 0);i&&n(i)},()=>t.close()},[e]),t}function Il(){let[e,t]=(0,l.useState)();return(0,l.useEffect)(()=>{Promise.all([Xl(`/api/app`),Xl(`/api/reviews`)]).then(([{folder:e},n])=>t({app:e.split(/[\\/]/).at(-1)??e,reviews:n}))},[]),e}function Ll(){let[e,t]=(0,l.useState)();return(0,l.useEffect)(()=>void Xl(`/api/you`).then(({name:e})=>t(e)),[]),e}var Rl=new Map;function zl(e,t){return Rl.has(e)||Rl.set(e,t().catch(t=>{throw Rl.delete(e),t})),Rl.get(e)}function Bl(e,t,n){let r=`/api/reviews/${e}/rounds/${t}/files/${n}`;return zl(r,()=>Xl(r))}function Vl(e,t,n){let r=`/api/reviews/${e}/rounds/${t}/files/${n}`;return zl(r,()=>{let i=Bl(e,t,`assets/${n}`).catch(()=>({})),a=fetch(r).then(e=>e.ok?e.text():Promise.reject(Error(`${r}: ${e.status}`)));return Promise.all([a,i]).then(([n,r])=>JSON.parse(Hl(n,r,`/api/reviews/${e}/rounds/${t}/files/`)))})}function Hl(e,t,n){if(!Object.keys(t).length)return e;let r=e=>e.trim().split(/\s+/)[0];return e.replace(/"srcset":"([^"]*)"/g,(e,n)=>{let i=n.split(/,\s+/).map(r).find(e=>e in t);return i?`"srcset":"${i}"`:e}).replace(/https?:\/\/[^\s"'()\\]+/g,e=>e in t?n+t[e]:e)}var Ul=e=>`readings/${e.replace(/\.json$/,``)}`,Wl=(e,t,n)=>Bl(e,t,`${Ul(n)}.json`).catch(()=>[]),Gl=(e,t,n)=>Bl(e,t,`${Ul(n)}.glimpses.json`).catch(()=>[]),Kl=(e,t,n,r)=>`/api/reviews/${e}/rounds/${t}/files/${Ul(n)}/${r+1}.png`;async function ql(e,t){return Zl(`/api/reviews/${e}/sends`,t)}async function Jl(e,t){return Zl(`/api/reviews/${e}/accept`,{by:t})}async function Yl(e,t,n,r){try{let i=await fetch(`/api/reviews/${e}/video`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!i.ok||!i.body)return(await i.json()).problems??[`It wasn't made (${i.status}).`];let a=``;for await(let e of i.body.pipeThrough(new TextDecoderStream)){a+=e;let t=a.split(`
|
|
64
|
-
`);a=t.pop();for(let e of t){let t=JSON.parse(e);if(t.left!==void 0&&r(t.left),t.problems)return t.problems;if(t.video){let e=document.createElement(`a`);return e.href=URL.createObjectURL(await(await fetch(`data:video/mp4;base64,${t.video}`)).blob()),e.download=`${n}.mp4`,e.click(),setTimeout(()=>URL.revokeObjectURL(e.href),1e3),[]}}}return[`The video stopped before it was made. Try again.`]}catch{return[`Playthrough isn't running here any more. Start it again with playthrough open, then try again.`]}}async function Xl(e){let t=await fetch(e);if(!t.ok)throw Error(`${e}: ${t.status}`);return t.json()}async function Zl(e,t){let n=await Ql(e,t);return`problems`in n?n.problems:[]}async function Ql(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?{answer:await n.json()}:{problems:(await n.json()).problems??[`It wasn't kept (${n.status}).`]}}catch{return{problems:[`Playthrough isn't running here any more. Start it again with playthrough open, then try again.`]}}}async function $l(e,t,n,r,i){let a=await Ql(`/api/reviews/${e}/branches`,{round:t,...n,events:r,recording:i});return`problems`in a?a.problems:a.answer.length}var eu=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),K=e(((e,t)=>{t.exports=eu()}))(),tu=/Mac|iPhone|iPad/.test(navigator.userAgent);function nu({who:e,children:t,after:n}){return(0,K.jsxs)(`div`,{className:`grid gap-px`,children:[(0,K.jsxs)(`span`,{className:`flex items-baseline gap-3 text-[11.5px] text-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),n]}),(0,K.jsx)(`p`,{className:`leading-normal whitespace-pre-wrap text-fg`,children:t})]})}function ru(e){let{children:t,keys:n,pressed:r,tone:i,onClick:a}=e;return(0,K.jsxs)(`button`,{className:`inline-flex h-[30px] min-w-0 flex-[1_1_auto] items-center justify-center rounded-md font-medium whitespace-nowrap transition-colors duration-150 ease-calm ${n?`pr-[7px] before:flex-[1_0_10px] before:content-[''] after:order-1 after:flex-[1_0_10px] after:content-['']`:`px-2.5`} ${r?i===`good`?`bg-green/12 text-green`:`bg-slate/14 text-slate`:`bg-hover text-fg hover:bg-line`}`,"aria-pressed":r,disabled:e.disabled,"aria-keyshortcuts":n&&({"↵":`Enter`,"Ctrl ↵":`Control+Enter`,"⌘↵":`Meta+Enter`}[n]??n),onMouseDown:e=>e.preventDefault(),onClick:a,children:[t,n&&(0,K.jsx)(iu,{className:`order-2`,children:n})]})}function iu({children:e,className:t=``}){return(0,K.jsx)(`kbd`,{className:`min-w-4 flex-none rounded-[3px] whitespace-nowrap pointer-coarse:hidden px-[3px] text-center font-ui text-[11px] leading-4 font-normal text-faint shadow-[0_0_0_1px_var(--line)] in-aria-pressed:text-inherit in-aria-pressed:opacity-60 in-aria-pressed:shadow-[0_0_0_1px_currentColor] ${t}`,children:e})}var au=(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`mr-1 size-3 text-green in-aria-pressed:text-inherit`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M2.8 6.2l2.2 2.2 4.2-4.6`})}),ou=(0,K.jsx)(`svg`,{viewBox:`0 0 20 20`,className:`mr-1 size-2.5`,fill:`currentColor`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M7 4.8v10.4c0 .6.7 1 1.2.6l8-5.2a.7.7 0 000-1.2l-8-5.2c-.5-.4-1.2 0-1.2.6z`})});function su({on:e,off:t,onPress:n,onRelease:r,bar:i}){return(0,K.jsxs)(`button`,{className:i??`flex h-[30px] flex-none items-center gap-2 rounded-md px-2.5 text-xs font-medium text-fg shadow-[inset_0_0_0_1px_var(--line)] transition-[background-color,box-shadow,color] duration-150 ease-calm select-none enabled:hover:shadow-[inset_0_0_0_1px_var(--faint)] disabled:cursor-default disabled:text-faint aria-pressed:bg-hover`,disabled:t,"aria-pressed":e,"aria-keyshortcuts":`C`,onPointerDown:e=>!t&&e.button===0&&(e.preventDefault(),cu(n,r)),onContextMenu:e=>e.preventDefault(),onKeyDown:e=>e.key===`Enter`&&(n(),r()),children:[!i&&(0,K.jsx)(`span`,{className:`size-2.5 flex-none rounded-full shadow-[inset_0_0_0_1.5px_currentColor] ${e?`bg-current`:`bg-[linear-gradient(90deg,currentColor_50%,transparent_50%)]`}`}),(0,K.jsx)(`span`,{className:i?``:`min-w-0 flex-1 truncate text-left`,children:`Compare`}),(0,K.jsx)(iu,{className:i?``:`text-soft`,children:`C`})]})}function cu(e,t){e();let n=()=>{removeEventListener(`pointerup`,n),removeEventListener(`pointercancel`,n),t()};addEventListener(`pointerup`,n),addEventListener(`pointercancel`,n)}function lu({waiting:e,onTakeOver:t}){return(0,K.jsxs)(`button`,{className:`flex h-[30px] flex-none items-center gap-2 rounded-md px-2.5 text-xs font-medium text-fg shadow-[inset_0_0_0_1px_var(--line)] transition-[background-color,box-shadow] duration-150 ease-calm select-none hover:shadow-[inset_0_0_0_1px_var(--faint)] aria-pressed:bg-hover`,"aria-pressed":e,"aria-keyshortcuts":`T`,onMouseDown:e=>e.preventDefault(),onClick:t,children:[(0,K.jsx)(uu,{className:`h-2 w-2.5 flex-none`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e?`Taking over…`:`Take over where you were`}),(0,K.jsx)(iu,{className:`text-soft`,children:`T`})]})}function uu({className:e,label:t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 10 8`,className:e,fill:`none`,stroke:`var(--amber)`,strokeWidth:`1.5`,"aria-label":t,"aria-hidden":!t,children:(0,K.jsx)(`path`,{d:`M0 7 C 2.5 7, 2.5 1, 5 1 L 10 1`})})}function du({children:e,open:t=!1,className:n=``}){return(0,K.jsxs)(`span`,{"data-time":!0,className:`group/time -mr-[7px] inline-flex h-5 min-w-[78px] items-center justify-end gap-[3px] rounded-[10px] pr-[7px] pl-1 text-xs tabular-nums transition-colors duration-150 ease-calm ${t?`hover:bg-hover hover:text-fg`:`group-hover/row:bg-hover group-hover/row:text-fg`} ${n}`,children:[(0,K.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`currentColor`,className:`size-2.5 opacity-0 transition-opacity duration-150 ease-calm ${t?`group-hover/time:opacity-100`:`group-hover/row:opacity-100`}`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M7 4.8v10.4c0 .6.7 1 1.2.6l8-5.2a.7.7 0 000-1.2l-8-5.2c-.5-.4-1.2 0-1.2.6z`})}),e]})}var fu;for(let e of[`pointermove`,`pointerdown`])addEventListener(e,e=>fu={x:e.clientX,y:e.clientY},!0);function pu(e,t){let[n,r]=(0,l.useState)(!1);return(0,l.useLayoutEffect)(()=>{let e=()=>{let e=t.current?.getBoundingClientRect();return!!e&&!!fu&&fu.x>=e.left&&fu.x<=e.right&&fu.y>=e.top&&fu.y<=e.bottom};if(r(e()),!e())return;let n=()=>r(!1),i=setTimeout(n,1200),a=()=>e()||n();return addEventListener(`pointermove`,a),()=>{clearTimeout(i),removeEventListener(`pointermove`,a)}},[e,t]),n}var mu=.05,hu=1.5;function gu(e,t,n){let r=e.rounds.find(e=>e.number===t)?.flows.map(e=>e.name)??[],i=ol(e),a=[];for(let{change:o,on:s,since:c}of bl(e,t,n)){if(s.at===void 0||!r.includes(s.flow))continue;let n=e.rounds.findLast(e=>e.number<=t&&e.accounts[o.id]),l=n?.accounts[o.id],u=l&&`note`in l?l.note:void 0,d={change:o,on:s,since:c,line:l&&`line`in l?l.line:void 0,by:n?.by,note:u,answers:!!u&&i.get(u)?.note.on?.flow===s.flow},f=s.until===void 0&&a.find(e=>e.flow===s.flow&&e.until===void 0&&Math.abs(e.at-s.at)<mu);f?f.changes.push(d):a.push({id:o.id,flow:s.flow,at:s.at,until:s.until,changes:[d]})}return a.map(e=>{let t=e.changes.filter(e=>!e.answers);return{...e,name:_u((t.length?t:e.changes).map(({change:e})=>e)),row:t.length>0}})}function _u(e){return e.length>1?`${e[0].words} and ${e.length-1} more`:e[0].words}var vu=(e,t)=>e.flatMap(e=>e.changes.filter(e=>e.answers&&e.note===t));function yu(e,t){if(t?.at===void 0)return;let n=(e,t)=>t!==void 0&&Math.abs(e-t)<mu;return e.find(e=>e.row&&e.flow===t.flow&&n(e.at,t.at)&&(e.until===void 0?e.changes.some(({on:e})=>e.element?.node!==void 0&&e.element.node===t.element?.node||!!e.box&&JSON.stringify(e.box)===JSON.stringify(t.box)):!t.element&&!t.box&&!t.point))}var bu=e=>e.until===void 0?il(e.at):`${il(e.at)}–${il(e.until)}`;function xu(e,t,n){let r=e.filter(e=>e.flow===t.flow),i=e=>t.at>=e.at-.001;return r.filter(e=>e.until===void 0&&i(e)&&t.at<Math.min(e.at+hu,n.find(t=>t>e.at+.001)??1/0)).at(-1)??r.find(e=>e.until!==void 0&&i(e)&&t.at<=e.until)}var Su={notes:[],verdicts:[],looksGood:[],takenBack:[],withTheFlow:[],unsaved:[]};function Cu(e,t){let n=Object.entries(e).filter(([e])=>Number(e)<=t).map(([,e])=>e);return{notes:n.flatMap(e=>e.notes),verdicts:n.flatMap(e=>e.verdicts),looksGood:n.flatMap(e=>e.looksGood),takenBack:n.flatMap(e=>e.takenBack),withTheFlow:n.flatMap(e=>e.withTheFlow),unsaved:n.flatMap(e=>e.unsaved)}}var wu=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])),Tu=(e,t,n)=>({...e,[t]:n(e[t]??Su)});function Eu(e,t,n){let r=n.filter(n=>n.round===t||n.round<t&&Au(e,n.round,t).includes(n.flow));return[...new Set(r.map(e=>e.flow))]}var Du=({notes:e,verdicts:t,looksGood:n,takenBack:r})=>({notes:e,verdicts:t,looksGood:n,...r.length&&{takenBack:r}}),Ou=e=>e.notes.length+e.verdicts.length+e.looksGood.length+e.takenBack.length;function ku(e,t,n){let r=new Set([...n.filter(e=>e.on?.flow===t).map(e=>e.id),...e.withTheFlow]),i=e=>e.on?.flow===t;return{sending:{...Su,notes:e.notes.filter(i),verdicts:e.verdicts.filter(e=>r.has(e.note)),looksGood:e.looksGood,takenBack:e.takenBack},left:{...e,notes:e.notes.filter(e=>!i(e)),verdicts:e.verdicts.filter(e=>!r.has(e.note)),looksGood:[],takenBack:[],withTheFlow:[]}}}function Au(e,t,n){let r=e.rounds.find(e=>e.number===n)?.flows??[],i=e.comparisons.find(e=>e.round===n&&e.since===t);if(!i)return[];let a=i.changes.filter(t=>!(`notReal`in(dl(e,n,t.id)??{})));return r.filter(e=>!a.some(t=>t.seen.some(t=>t.flow===e.name))).map(e=>e.name)}function ju(e){return{...e,rounds:e.rounds.filter(e=>e.finished)}}function Mu(e,t){return{...e,rounds:e.rounds.filter(e=>e.number<=t),sends:e.sends.filter(e=>e.round<=t)}}function Nu(e,t,n){let r=Object.entries(n).filter(([,e])=>Ou(e));if(!r.length)return e;let i=new Date().toISOString();return{...e,sends:[...e.sends,...r.map(([e,n])=>({id:`unsent ${e}`,round:Number(e),by:t,sent:i,...Du(n)}))]}}function Pu(e){let t=e.rounds.flatMap(t=>e.sends.filter(e=>e.round===t.number).flatMap(e=>e.notes.map(e=>e.id)));return new Map(t.map((e,t)=>[e,t+1]))}function Fu(e,t,n,r={}){return Lu(e,t,n,r).filter(([,e])=>e).map(([e])=>e)}function Iu(e,t,n){return Lu(e,t,n,{}).filter(([,e])=>!e).map(([e])=>e)}function Lu(e,t,n,r){let i=Mu(Nu(e,n,r),t),a=Cu(r,t),o=Pu(i),s=new Set([n,...i.sends.map(e=>e.by)]),c=new Map([...s].map(e=>[e,Cl(i,t,e)])),l=ll(i),u=xl(i,t,n),d=[];for(let[e,{note:r,round:f}]of ol(i)){let p=sl(i,e),m=[...s].filter(t=>t!==n&&c.get(t)?.includes(e)),h=c.get(n)?.includes(e)?`needs you`:l.includes(e)?`with the agent`:m.length?`with someone else`:`settled`,g=a.notes.some(t=>t.id===e)||a.verdicts.some(t=>t.note===e),_={id:e,number:o.get(e)??0,on:r.on,written:f,turns:p,state:h,waitingFor:m,yours:u.has(e),toJudge:Sl(p),unsent:g};d.push([_,f===t||p.some(e=>e.round===t)||h!==`settled`])}return d.sort(([e],[t])=>e.number-t.number)}function Ru(e,t,n,r,i){let a=Mu(Nu(e,n,r),t),o=Fu(e,t,n,r),s=Cu(r,t),c=e.rounds.find(e=>e.number===t)?.flows??[];return new Map(c.map(({name:r})=>{let c=o.filter(e=>e.on?.flow===r),l=c.filter(e=>e.state===`needs you`).length,u=c.filter(e=>e.unsent&&e.state===`with the agent`).length,d=c.some(e=>e.yours&&!e.unsent&&e.state===`with the agent`),f=(e,t=0,n=!0)=>[r,{is:e,count:t,asks:n}];if(e.accepted)return f(`good`,0,!1);if(wl(a,t,n,r))return f(`good`);if(s.unsaved.some(e=>e.on?.flow===r))return f(`not saved`,1,!1);let p=c.filter(e=>e.state===`needs you`&&e.on?.at!==void 0).length;return u||d?p?f(`needs you`,p,!1):u?f(`to send`,u,!1):f(`with the agent`,0,!1):i.includes(r)?f(`is it good`,l):l?f(`needs you`,l):a.sends.some(e=>e.by===n&&e.looksGood.includes(r))?f(`looked good`):f(`to watch`)}))}var zu=e=>!!e&&e.is!==`good`&&e.is!==`with the agent`,Bu=(e,t)=>e.accepted?void 0:e.taken.find(n=>n.round>t.number&&cl(e,n.round).length>0)?.at;function Vu(e,t,n){let r=n.filter(e=>e.on?.flow===t&&e.state===`needs you`).map(e=>e.id);return{...e,looksGood:[...e.looksGood.filter(e=>e!==t),t],verdicts:[...e.verdicts,...r.map(e=>({note:e,verdict:`looks good`}))],withTheFlow:[...e.withTheFlow,...r]}}function Hu(e,t,n){let r=e.withTheFlow.filter(e=>n.find(t=>t.id===e)?.on?.flow===t);return{...e,looksGood:e.looksGood.filter(e=>e!==t),verdicts:e.verdicts.filter(e=>!r.includes(e.note)),withTheFlow:e.withTheFlow.filter(e=>!r.includes(e))}}function Uu(e){return e.state===`settled`?`green`:e.unsent||e.state===`needs you`?`amber`:`slate`}var Wu=e=>({amber:`bg-amber`,slate:`bg-slate`,green:`bg-green`})[Uu(e)],Gu=e=>`var(--${Uu(e)})`,Ku=1.2,qu=.3,Ju=-.8999999999999999,Yu=-.7,Xu=(e,t=0,n=1)=>Math.max(t,Math.min(n,e)),Zu=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;function Qu(e){if(e>=0)return;let t=e+Ku;return{soft:Zu(Xu(t/.22))*(1-Zu(Xu((t-.8999999999999999)/.3))),name:Xu((t-.04)/.2)*(1-Xu((t-.8599999999999999)/.22))}}function $u(e,t){let n=0;for(let r of e){if(r.name===t.flow)return n+Ku+t.at;n+=Ku+r.length}return 0}function ed(e,t){let n=0;for(let r of e){if(t<n+1.2+r.length||r===e.at(-1))return{flow:r.name,at:Xu(t-n-Ku,-1.2,r.length)};n+=Ku+r.length}return{flow:``,at:0}}var td=class{flows;now;#e=!1;#t=0;#n=0;#r=[];#i;#a;#o;#s=new Set;constructor(e,t){this.flows=e,this.now={moment:t,playing:!1,speed:1,stopped:!1}}get flow(){return this.flows.find(e=>e.name===this.now.moment.flow)??this.flows[0]}play(){if(this.now.playing||!this.flows.length)return;let e=this.flow;if(this.now.moment.at>=e.length-.06){let t=this.flows.slice(this.flows.indexOf(e)+1).find(e=>!e.fork)??this.flows[0];this.#l({moment:{flow:t.name,at:-Ku}})}this.#t=performance.now(),this.#l({playing:!0}),this.#n=requestAnimationFrame(this.#c)}pause(){this.#a=this.#o=void 0,this.now.playing&&(cancelAnimationFrame(this.#n),this.#l({playing:!1}))}toggle(){this.now.playing?this.pause():this.play()}seek(e){this.#a=this.#o=void 0,this.#l({moment:{flow:this.flow.name,at:Xu(e,-Ku,this.flow.length)}})}go(e){this.#a=this.#o=void 0;let t=this.flows.find(t=>t.name===e.flow);t&&this.#l({moment:{flow:t.name,at:Xu(e.at,-Ku,t.length)}})}watch(e,t){this.pause(),this.flows=e,this.go(t)}keep(e){this.flows=e}run(e,t){this.pause(),this.go(e),this.#a=t,this.play()}repeat(e,t){this.run(e,t),this.#o=e.at}slower(){this.#l({speed:this.now.speed===1?.5:this.now.speed===.5?.25:1})}scrub(e){this.#e=e,this.#t=performance.now()}stopAt(e){this.#r=e}subscribe=e=>(this.#s.add(e),()=>void this.#s.delete(e));destroy(){cancelAnimationFrame(this.#n),this.#s.clear()}#c=e=>{let t=Xu((e-this.#t)/1e3,0,.1);if(this.#t=Math.max(this.#t,e),this.#n=requestAnimationFrame(this.#c),this.#e)return;let n=this.flow,r=this.now.moment.at,i=Math.min(n.length,r+t*this.now.speed),a=this.#i?.flow===n.name&&this.#i.at===r?this.#i.ids:void 0,o=e=>e.at>r||!!a&&e.at===r&&!a.includes(e.id),s=this.#a===void 0&&this.#r.find(e=>e.flow===n.name&&o(e)&&e.at<=i);if(s)return cancelAnimationFrame(this.#n),this.#a=void 0,this.#i={flow:n.name,at:s.at,ids:[...s.at===r?a??[]:[],s.id]},this.#l({moment:{flow:n.name,at:s.at},playing:!1,stopped:!0}),s.reached();if(this.#a!==void 0&&i>=this.#a){if(this.#o!==void 0)return this.#l({moment:{flow:n.name,at:this.#o}});cancelAnimationFrame(this.#n);let e=this.#a;return this.#a=void 0,this.#l({moment:{flow:n.name,at:e},playing:!1,stopped:!0})}i>=n.length&&cancelAnimationFrame(this.#n),this.#l({moment:{flow:n.name,at:i},playing:i<n.length})};#l(e){this.now={...this.now,stopped:!1,...e};for(let e of this.#s)e()}},nd=()=>()=>{},rd={moment:{flow:``,at:0},playing:!1,speed:1,stopped:!1};function id(e,t=e=>e){return(0,l.useSyncExternalStore)(e?.subscribe??nd,()=>t(e?.now??rd))}var ad=`size-[18px] flex-none rounded-full text-center text-[10px] leading-[18px] font-semibold`,od=`bg-[color-mix(in_srgb,var(--c)_18%,var(--ground))] text-[color-mix(in_srgb,var(--c)_80%,var(--fg))]`,sd=`bg-(--c) text-white`,cd=1.5,ld=4,ud=`-my-0.5 -mr-1.5 inline-flex flex-none items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-soft transition-colors duration-150 ease-calm select-none enabled:hover:text-fg disabled:cursor-default disabled:text-faint aria-pressed:bg-hover aria-pressed:text-fg`,dd=`isolate before:pointer-events-none before:absolute before:inset-y-0 before:right-0 before:left-[31px] before:-z-1 before:rounded-lg before:transition-colors before:duration-150 before:ease-calm before:content-['']`,fd=`${dd} hover:before:bg-hover`,pd=`${dd} before:bg-hover pb-3`;function md(e){let{note:t,open:n,answers:r}=e,i=t.on?.at,a=id(e.playhead,({moment:e})=>i!==void 0&&e.flow===t.on?.flow&&e.at>=i-.05&&e.at<=(t.on?.until??i)+cd);return e.grown?(0,K.jsx)(`button`,{className:`-mt-1 block w-full truncate pr-2.5 pb-1.5 pl-[44px] text-left text-[12.5px] leading-[18px] text-soft transition-colors duration-150 ease-calm hover:text-fg`,onMouseDown:e=>e.preventDefault(),onClick:e.onOpen,children:t.turns[0]?.words}):n||e.whole?(0,K.jsx)(`div`,{"data-open":``,children:(0,K.jsx)(_d,{...e})}):(0,K.jsx)(`div`,{className:`relative ${fd} ${e.fresh?`before:animate-glow`:``}`,style:{"--c":Gu(t)},children:(0,K.jsxs)(`button`,{className:`group/row grid w-full grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-x-2 py-1.5 pr-2.5 pl-[18px] text-left`,onMouseDown:e=>e.preventDefault(),onClick:e.onOpen,"aria-expanded":!1,children:[(0,K.jsx)(`span`,{className:`${ad} relative z-1 mt-px ${a?sd:od}`,children:t.number}),(0,K.jsx)(`span`,{className:`truncate`,children:t.turns[0]?.words}),i===void 0?(0,K.jsx)(`span`,{className:`w-[78px]`}):(0,K.jsx)(du,{className:a?`text-[color-mix(in_srgb,var(--c)_80%,var(--fg))]`:`text-faint`,children:il(i)}),r.length>0&&(0,K.jsx)(hd,{answers:r,lines:!0,className:`col-start-2 col-end-4 mt-[3px] text-[12.5px] leading-[18px] text-soft`})]})})}function hd({answers:e,className:t,lines:n,onPoint:r,seen:i,onVisit:a}){let o=e.length>ld?e.slice(0,3):e,s=(0,K.jsx)(`i`,{className:`size-1.5 flex-none translate-y-[-1px] rotate-45 shadow-[inset_0_0_0_1.5px_var(--soft)]`,"aria-hidden":!0});return a?(0,K.jsxs)(`span`,{className:`grid gap-px ${t}`,children:[o.map(e=>{let t=i?.(e);return(0,K.jsxs)(`button`,{className:`group/row -mx-1.5 grid grid-cols-[6px_minmax(0,1fr)_auto] items-baseline gap-x-2 rounded-md px-1.5 py-px text-left text-fg transition-colors duration-150 ease-calm hover:bg-hover`,onMouseDown:e=>e.preventDefault(),onClick:()=>a(e),children:[s,(0,K.jsx)(`span`,{className:`min-w-0`,children:e.change.words}),t!==void 0&&(0,K.jsx)(du,{className:`text-faint`,children:il(t)})]},e.change.id)}),o.length<e.length&&(0,K.jsxs)(`span`,{className:`pl-[15px]`,children:[e.length-o.length,` more changes`]})]}):(0,K.jsxs)(`span`,{className:`grid gap-px ${t}`,children:[o.map(({change:e})=>(0,K.jsxs)(`span`,{className:`group/name flex min-w-0 items-baseline gap-2`,onPointerEnter:r&&(()=>r(e.id)),onPointerLeave:r&&(()=>r(void 0)),children:[(0,K.jsx)(`i`,{className:`size-1.5 flex-none translate-y-[-1px] rotate-45 shadow-[inset_0_0_0_1.5px_var(--soft)] transition-colors duration-150 ease-calm ${r?`group-hover/name:bg-soft`:``}`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:n?`truncate`:`min-w-0 text-fg`,children:e.words})]},e.id)),o.length<e.length&&(0,K.jsxs)(`span`,{className:`pl-[15px]`,children:[e.length-o.length,` more changes`]})]})}function gd(e){let t=[];for(let n of e){let e=t.at(-1);!e||!n.agent&&n.verdict!==`looks good`&&e.some(e=>e.agent)?t.push([n]):e.push(n)}return t}function _d(e){let{note:t,you:n,readOnly:r,compare:i,whereYouWere:a}=e,o=t.unsent&&t.turns.length===1,s=t.unsent&&!o?t.turns.at(-1):void 0,c=t=>n=>e.onUnfinished(n.trim()&&n!==t?n:void 0),u=e.asking||!r&&!o&&e.unfinished!==void 0,d=t.turns.findLast(e=>e.agent)?.round,f=!s&&t.state===`settled`&&d!==void 0&&t.turns.findLast(e=>e.verdict&&e.round>=d)?.verdict===`looks good`,p=e.onAsking,[m,h]=(0,l.useState)(o&&e.unfinished!==void 0),[g,_]=(0,l.useState)(!1),v=gd(s?t.turns.slice(0,-1):t.turns),y=g?v.flat():v.at(-1)??[],b=v.length-1,x=e=>e.agent||e.by!==n?e.by:`You`,S=i&&!e.whole&&!u&&!m&&!e.away&&(0,K.jsx)(su,{...i,bar:ud}),C=y.findLastIndex(e=>e.agent),w=e=>e.verdict&&(0,K.jsxs)(`span`,{className:e.verdict===`looks good`?`text-green`:`text-slate`,children:[` · `,e.verdict===`looks good`?`Looks good`:`Not quite`]}),T=(e,t)=>(0,K.jsxs)(`span`,{className:`flex gap-3 text-[11.5px] text-soft ${t?`mr-5`:``}`,children:[(0,K.jsx)(`button`,{className:`hover:text-fg`,onClick:e,children:`Edit`}),t&&(0,K.jsx)(`button`,{className:`hover:text-fg`,onClick:t,children:`Remove`})]}),E;E=o&&(m||!t.turns[0]?.words)&&!r?(0,K.jsx)(vd,{words:e.unfinished??t.turns[0]?.words??``,placeholder:`What do you think?`,question:`Your note`,onWords:c(t.turns[0]?.words??``),onSave:t=>{e.onUnfinished(void 0),e.onEdit(t),h(!1)},onCancel:()=>{e.onUnfinished(void 0),h(!1)}}):(0,K.jsxs)(K.Fragment,{children:[b>0&&(0,K.jsxs)(`button`,{className:`-my-0.5 flex items-center gap-[3px] justify-self-start text-[11.5px] text-soft hover:text-fg`,onClick:()=>_(!g),"aria-expanded":g,children:[b,` earlier `,b===1?`answer`:`answers`,(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 transition-transform duration-200 ease-calm ${g?``:`rotate-180`}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M3.5 7.5L6 5l2.5 2.5`})})]}),y.map((t,n)=>(0,K.jsxs)(`div`,{className:`grid gap-2.5`,children:[(t.words||t.verdict)&&(0,K.jsx)(nu,{who:(0,K.jsxs)(K.Fragment,{children:[x(t),w(t)]}),after:o&&!r?T(()=>h(!0),()=>e.onEdit(void 0)):void 0,children:t.words}),n===C&&e.answers.length>0&&(0,K.jsx)(hd,{answers:e.answers,className:`-mt-0.5 leading-normal`,onPoint:e.whole?void 0:e.onPoint,seen:e.seen,onVisit:e.onVisit})]},n)),t.state===`with someone else`&&!r&&(0,K.jsxs)(`p`,{className:`text-xs leading-[18px] text-slate`,children:[`Waiting for `,rl(t.waitingFor)]}),s?.verdict===`not quite`&&!u&&(0,K.jsx)(nu,{who:(0,K.jsxs)(K.Fragment,{children:[`You`,w(s)]}),after:!r&&T(()=>p(!0)),children:s.words})]});let D=(0,K.jsxs)(ru,{keys:`↵`,onClick:e.onPlayOn,children:[ou,`Play on`]}),O,k;return e.whole?[O,k]=[``,void 0]:r?[O,k]=[t.state===`settled`?`Settled`:``,void 0]:u&&!e.away?k=(0,K.jsx)(vd,{words:e.unfinished??(s?.verdict===`not quite`?s.words:``),placeholder:`What’s still not right?`,question:(0,K.jsx)(`span`,{className:`text-slate`,children:`Not quite`}),tone:`back`,onWords:c(s?.verdict===`not quite`?s.words??``:``),onSave:n=>{e.onUnfinished(void 0),e.onJudge({note:t.id,verdict:`not quite`,words:n}),p(!1)},onCancel:()=>{e.onUnfinished(void 0),p(!1)}}):(t.toJudge||s||f)&&!e.away?[O,k]=[`Does this fix it?`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(ru,{keys:s||f?void 0:`↵`,tone:`good`,pressed:s?.verdict===`looks good`||f,onClick:()=>{f||(e.onJudge(s?.verdict===`looks good`?void 0:{note:t.id,verdict:`looks good`}),s?.verdict!==`looks good`&&e.onPlayOn())},children:[au,`Looks good`]}),(0,K.jsx)(ru,{keys:s||f?void 0:`X`,tone:`back`,pressed:s?.verdict===`not quite`,onClick:()=>s?.verdict===`not quite`?e.onJudge(void 0):p(!0),children:`Not quite`})]})]:e.away?k=(0,K.jsx)(`button`,{className:`h-[30px] flex-[1_1_100%] rounded-[7px] bg-hover font-medium text-fg shadow-[inset_0_0_0_1px_var(--line)] hover:opacity-88`,onClick:e.onShow,children:`Show it`}):m||([O,k]=[`${t.on?.app?`In the app · `:``}${t.unsent?`Not sent yet`:t.state===`with the agent`?`Sent to the agent`:t.state===`settled`?`Settled`:``}`,t.on?.at===void 0?void 0:D]),(0,K.jsxs)(`div`,{className:`grid gap-2.5 px-4 ${e.whole?`py-3`:`py-2`} [&>p:first-child]:pr-5`,children:[a?.stopped&&(0,K.jsx)(`p`,{className:`leading-normal text-fg`,children:a.stopped}),(0,K.jsx)(`div`,{className:`grid gap-2.5 transition-opacity duration-250 ease-calm ${e.away&&!r?`opacity-45`:``}`,children:E}),a&&a.live!==`shown`&&!u&&!m&&!e.away&&(a.onTakeOver?(0,K.jsx)(lu,{waiting:a.live===`waiting`,onTakeOver:a.onTakeOver}):!a.stopped&&(0,K.jsxs)(`p`,{className:`text-xs leading-[18px] text-soft`,children:[`Where you took this flow over isn’t in round `,a.round,`’s recording.`]})),(O||S)&&(0,K.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-2 text-xs leading-[18px] text-soft`,children:[(0,K.jsx)(`span`,{children:O}),S]}),k&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:k})]})}function vd(e){let[t,n]=(0,l.useState)(e.words),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{r.current?.focus(),r.current?.setSelectionRange(r.current.value.length,r.current.value.length)},[]);let i=(0,l.useRef)(e.onWords);i.current=e.onWords;let a=(0,l.useRef)(t);a.current=t;let o=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>o.current||i.current?.(t),300);return()=>clearTimeout(e)},[t]),(0,l.useEffect)(()=>()=>void(o.current||i.current?.(a.current)),[]);let s=e=>(o.current=!0,e()),c=()=>t.trim()&&s(()=>e.onSave(t.trim())),u=()=>s(e.onCancel);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`textarea`,{ref:r,rows:5,value:t,placeholder:e.placeholder,className:`block min-h-14 w-full resize-none rounded-md bg-hover px-2.5 py-2 leading-normal shadow-[inset_0_0_0_1px_var(--line)] placeholder:text-faint focus-visible:outline-none ${e.tone===`back`?`focus:shadow-[inset_0_0_0_1px_var(--slate)]`:`focus:shadow-[inset_0_0_0_1px_var(--amber)]`}`,onChange:e=>n(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&c(),e.key===`Escape`&&(i.current?.(t),t.trim()?e.currentTarget.blur():u())}}),e.question&&(0,K.jsx)(`p`,{className:`mt-1.5 text-xs leading-[18px] text-soft`,children:e.question}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,K.jsx)(ru,{onClick:u,children:`Cancel`}),(0,K.jsxs)(`button`,{className:`inline-flex h-[30px] flex-[1_1_auto] items-center justify-center rounded-[7px] bg-fg pr-[7px] font-medium text-ground transition-opacity duration-150 ease-calm before:flex-[1_0_10px] after:order-1 after:flex-[1_0_10px] hover:opacity-88 disabled:bg-transparent disabled:text-faint disabled:shadow-[inset_0_0_0_1px_var(--line)]`,disabled:!t.trim(),"aria-keyshortcuts":tu?`Meta+Enter`:`Control+Enter`,onClick:c,children:[`Save`,(0,K.jsx)(`kbd`,{className:`order-2 flex-none rounded-[3px] px-1 font-ui whitespace-nowrap pointer-coarse:hidden text-[11px] leading-4 font-normal opacity-60 shadow-[0_0_0_1px_currentColor]`,children:tu?`⌘↵`:`Ctrl ↵`})]})]})]})}var yd=(e,t)=>e?.flow===t&&performance.now()-e.at<700;function bd(e,t,n,r=!1){return[...t.filter(t=>t.on?.flow===e&&(!r||t.unsent||t.state===`with the agent`)).map(e=>({note:e,at:e.on?.at??1/0})),...n.filter(t=>t.flow===e&&t.row&&!r).map(e=>({diamond:e,at:e.at}))].sort((e,t)=>e.at-t.at)}function xd(e,t){return e?.is===`good`&&!t}function Sd(e){let t=id(e.playhead,e=>e.moment.flow),n=e.round.flows.find(e=>e.name===t),r=e.diamonds.find(t=>t.id===e.chosen);if(r)return(0,K.jsx)(jd,{...e,diamond:r,yours:e.notes.filter(t=>e.grown.get(t.id)===r.id)});let i=n&&e.standing(n.name),a=n?e.notes.filter(e=>e.on?.flow===n.name&&e.on.at===void 0):[],o=!!n&&e.asked===n.name;if(!n||!o&&!a.length&&!e.writing)return null;let s=`mx-4 my-1.5 border-t border-line`,c=a.filter(e=>e.state===`needs you`&&!e.unsent).length;return(0,K.jsxs)(K.Fragment,{children:[a.map((t,n)=>(0,K.jsxs)(l.Fragment,{children:[n>0&&(0,K.jsx)(`hr`,{className:s}),e.note(t)]},t.id)),e.writing,o&&(a.length>0||!!e.writing)&&(0,K.jsx)(`hr`,{className:s}),o&&(i?(0,K.jsx)(Cd,{...e,flow:n,standing:i,laidOut:c,just:yd(e.landed,n.name)}):e.onward.kind===`go`&&(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(wd,{step:e.onward})}))]})}function Cd({flow:e,standing:t,laidOut:n,just:r,...i}){if(t.is===`to send`||t.is===`with the agent`)return(0,K.jsx)(Td,{...i,flow:e,standing:t,just:r});if(t.is===`not saved`)return(0,K.jsx)(Ed,{...i,flow:e,just:r});let a=t.is===`good`,o=(0,l.useRef)(null),s=pu(e.name,o),c=a?0:i.unseen(e.name).length,u=t.count-n;return(0,K.jsxs)(`div`,{className:Od,children:[(0,K.jsx)(Pd,{end:a?`good`:`asks`,just:r,className:kd}),(0,K.jsxs)(`p`,{className:`mb-3 text-[13px] leading-[18px] text-soft`,children:[(0,K.jsx)(Dd,{onClick:()=>i.onAgain(e)}),`Is this flow good?`,c>0?(0,K.jsxs)(`span`,{className:`block text-xs leading-4 text-faint`,children:[c,` `,c===1?`answer`:`answers`,` you haven’t seen`]}):a?i.waiting&&(0,K.jsx)(`span`,{className:`block text-xs leading-4 text-faint`,children:i.waiting}):u>0&&(0,K.jsxs)(`span`,{className:`block text-xs leading-4 text-faint`,children:[u,` `,u===1?`note`:`notes`,` not answered`]})]}),(0,K.jsxs)(`div`,{ref:o,className:`flex gap-1.5 transition-opacity duration-150 ease-calm ${s?`pointer-events-none opacity-45`:``}`,children:[(0,K.jsx)(ru,{keys:a?void 0:`↵`,tone:`good`,pressed:a,onClick:()=>i.onGood(e.name),children:c>0?`Show it`:(0,K.jsxs)(K.Fragment,{children:[au,`Looks good`]})}),(0,K.jsx)(ru,{keys:`X`,tone:`back`,onClick:()=>i.onNotQuite(e.name),children:`Not quite`})]}),a&&(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(wd,{step:i.onward})})]})}function wd({step:e}){return e.kind===`go`?(0,K.jsx)(`div`,{className:`flex gap-1.5`,children:(0,K.jsx)(ru,{keys:e.final?tu?`⌘↵`:`Ctrl ↵`:`↵`,onClick:e.take,children:(0,K.jsxs)(`span`,{className:`truncate`,children:[e.words,e.what&&(0,K.jsxs)(`span`,{className:`font-normal text-soft`,children:[` · `,e.what]})]})})}):null}function Td({flow:e,standing:t,just:n,...r}){let i=t.is===`with the agent`,{onward:a}=r;return(0,K.jsxs)(`div`,{className:Od,children:[(0,K.jsx)(Pd,{end:i?`with the agent`:`to send`,just:n,className:kd}),(0,K.jsxs)(`p`,{className:`mb-3 text-[13px] leading-[18px] text-soft`,children:[(0,K.jsx)(Dd,{onClick:()=>r.onAgain(e)}),i?`With the agent`:`${t.count} ${t.count===1?`note`:`notes`} for the agent`,i&&r.waiting&&(0,K.jsx)(`span`,{className:`block text-xs leading-4 text-faint`,children:r.waiting})]}),i?(0,K.jsx)(wd,{step:a}):(0,K.jsx)(`div`,{className:`flex gap-1.5`,children:(0,K.jsx)(ru,{keys:`↵`,onClick:()=>r.onSend(e.name),children:`Send`})})]})}function Ed({flow:e,just:t,...n}){return(0,K.jsxs)(`div`,{className:Od,children:[(0,K.jsx)(Pd,{end:`asks`,just:t,className:kd}),(0,K.jsxs)(`p`,{className:`mb-3 text-[13px] leading-[18px] text-soft`,children:[(0,K.jsx)(Dd,{onClick:()=>n.onAgain(e)}),`Your note isn’t saved`]}),(0,K.jsx)(wd,{step:n.onward})]})}function Dd({onClick:e}){return(0,K.jsxs)(`button`,{className:`float-right ml-2 inline-flex items-center gap-1 text-xs leading-[18px] text-faint transition-colors duration-150 ease-calm hover:text-fg`,onMouseDown:Ad,onClick:e,children:[(0,K.jsxs)(`svg`,{viewBox:`0 0 20 20`,className:`size-3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,K.jsx)(`path`,{d:`M4 10a6 6 0 1 0 1.8-4.3`}),(0,K.jsx)(`path`,{d:`M4 3.5v3h3`})]}),`Watch again`]})}var Od=`relative py-4 pr-4 pl-[42px]`,kd=`absolute top-4 left-4 z-1 size-[18px]`,Ad=e=>e.preventDefault();function jd(e){let{diamond:t,yours:n}=e;return(0,K.jsxs)(`div`,{"data-open":``,className:`relative ${pd}`,children:[(0,K.jsxs)(`button`,{className:`grid w-full grid-cols-[18px_minmax(0,1fr)] gap-2 py-1.5 pr-2.5 pl-[18px] text-left`,onMouseDown:Ad,onClick:n=>n.target.closest(`[data-time]`)?e.onDiamond(t):e.onClose(),"aria-expanded":!0,children:[(0,K.jsxs)(`span`,{"data-mark":!0,className:`relative z-1 mt-px grid size-[18px] place-items-center`,children:[(0,K.jsx)(`i`,{className:`size-2 rotate-45 bg-ground shadow-[inset_0_0_0_1.5px_var(--fg),0_0_0_2.5px_var(--ground)]`}),n[0]&&(0,K.jsx)(`b`,{className:`absolute top-[calc(50%-8px)] left-[calc(50%+2px)] size-1.5 rounded-full shadow-[0_0_0_1.5px_var(--ground)]`,style:{background:Gu(n[0])}})]}),(0,K.jsx)(`span`,{className:`-mr-[7px] block min-w-0 pr-[7px]`,children:(0,K.jsxs)(`span`,{className:`block leading-5 [overflow-wrap:anywhere]`,children:[(0,K.jsx)(du,{open:!0,className:`float-right ml-2 text-faint`,children:bu(t)}),(0,K.jsx)(`span`,{children:t.name})]})})]}),(0,K.jsx)(`div`,{className:`grid gap-2.5 pr-3.5 pl-[44px]`,children:(0,K.jsx)(Md,{...e})}),n.map(t=>e.note(t,!0)),e.compare&&(0,K.jsx)(`div`,{className:`mt-2.5 grid pr-3.5 pl-[44px]`,children:(0,K.jsx)(su,{...e.compare})}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-1.5 pr-3.5 pl-[44px]`,children:[(0,K.jsxs)(ru,{keys:`↵`,onClick:e.onPlayOn,children:[ou,`Play on`]}),!n.length&&(0,K.jsx)(ru,{keys:`X`,onClick:()=>e.onNoteOn(t),children:`Note on this`})]})]})}function Md({diamond:e,notes:t,onNote:n,onPoint:r}){let i=e.changes.filter(e=>!e.answers),a=e=>{let r=e.note&&t.find(t=>t.id===e.note);return r?(0,K.jsx)(nu,{who:`For your note ${r.number}`,children:(0,K.jsx)(`button`,{className:`-mx-[3px] rounded px-[3px] text-left transition-colors duration-150 ease-calm hover:bg-line`,onClick:()=>n(r),children:r.turns[0]?.words})}):e.line&&(0,K.jsx)(nu,{who:e.by,children:e.line})};if(i.length===1)return a(i[0]);let o=[];for(let e of i){let t=o.at(-1);t&&e.line&&t[0].line===e.line?t.push(e):o.push([e])}return o.map(e=>(0,K.jsxs)(`div`,{className:`grid gap-0.5`,children:[e.map(({change:e})=>(0,K.jsxs)(`span`,{className:`group/name flex items-start gap-[9px] leading-normal font-medium`,onPointerEnter:()=>r(e.id),onPointerLeave:()=>r(void 0),children:[(0,K.jsx)(`i`,{className:`mx-0.5 mt-1.5 size-[7px] flex-none rotate-45 shadow-[inset_0_0_0_1.5px_var(--soft)] transition-colors duration-150 ease-calm group-hover/name:bg-soft`,"aria-hidden":!0}),e.words]},e.id)),(0,K.jsx)(`div`,{className:`mt-[3px] ml-[19px] border-l-2 border-line pl-2.5 text-[12.5px] [&_p]:text-[12.5px]`,children:a(e[0])})]},e[0].change.id))}var Nd=e=>e.is===`good`||e.is===`with the agent`||e.is===`to send`?e.is:`asks`;function Pd({end:e,ahead:t,just:n,className:r}){return(0,K.jsxs)(`span`,{"aria-hidden":!0,className:`grid place-items-center rounded-[28%] transition-[background-color,box-shadow,color,scale] duration-250 ease-calm ${e===`good`?`bg-green text-ground shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--green)_70%,var(--fg))]`:e===`with the agent`?`bg-slate text-ground`:t?`bg-ground text-amber-ink shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--amber)_50%,var(--ground))]`:`bg-[color-mix(in_srgb,var(--amber)_22%,var(--ground))] text-amber-ink shadow-[inset_0_0_0_1.5px_var(--amber)]`} ${n?`animate-pop`:``} ${r}`,children:[(e===`good`||e===`with the agent`)&&(0,K.jsx)(Fd,{className:`size-[62%] ${n?`animate-tick`:``}`}),e===`to send`&&(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-[62%]`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M6 9.6V2.8M3.2 5.5 6 2.7l2.8 2.8`})})]})}function Fd({className:e,style:t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:e,style:t,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M2.8 6.2l2.2 2.2 4.2-4.6`})})}function Id(e){let t=`inline-flex items-center gap-2 rounded-lg px-2.5 py-1.5 whitespace-nowrap text-fg transition-colors duration-150 ease-calm enabled:hover:bg-hover disabled:cursor-default disabled:opacity-50 aria-pressed:bg-hover`,n=e.live===`shown`,r=(0,l.useRef)(null),{listed:i,onList:a}=e;(0,l.useEffect)(()=>{if(!i)return;let e=e=>!r.current?.contains(e.target)&&a(!1),t=e=>e.key===`Escape`&&a(!1);return addEventListener(`pointerdown`,e,!0),addEventListener(`keydown`,t),()=>(removeEventListener(`pointerdown`,e,!0),removeEventListener(`keydown`,t))},[i,a]);let o=e.notes.length+(e.whole?.notes??0),s=`grid w-full grid-cols-[12px_minmax(0,1fr)_auto] items-center gap-x-2.5 rounded-lg px-2.5 py-[7px] text-left transition-colors duration-150 ease-calm hover:bg-hover focus-visible:bg-hover`;return(0,K.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,K.jsx)(`div`,{role:`dialog`,"aria-label":`Notes on ${e.flow}`,"aria-hidden":!i,className:`absolute right-0 bottom-full mb-2 w-[340px] max-w-[calc(100vw-32px)] rounded-xl bg-surface p-1.5 shadow-float transition-[opacity,translate] duration-150 ease-calm ${i?`translate-y-0 opacity-100`:`pointer-events-none translate-y-1 opacity-0`}`,children:(0,K.jsxs)(`div`,{className:`max-h-[min(55vh,420px)] overflow-y-auto`,children:[e.notes.map(t=>(0,K.jsxs)(`button`,{tabIndex:i?0:-1,className:s,onPointerEnter:()=>e.onLight(t.id),onPointerLeave:()=>e.onLight(void 0),onFocus:()=>e.onLight(t.id),onBlur:()=>e.onLight(void 0),onClick:()=>e.onSaid(t.id),children:[(0,K.jsx)(`span`,{className:`size-1.5 justify-self-center rounded-full`,style:{background:t.ink}}),(0,K.jsx)(`span`,{className:`truncate text-[13px] leading-[18px] text-fg`,children:t.words}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-[11.5px] text-faint tabular-nums`,children:[t.app&&(0,K.jsx)(uu,{className:`h-2 w-2.5`,label:`In the app`}),t.at]})]},t.id)),e.whole?(0,K.jsxs)(`button`,{tabIndex:i?0:-1,className:s,onClick:e.onWhole,children:[(0,K.jsx)(Pd,{end:e.whole.end,just:!1,className:`size-3`}),(0,K.jsxs)(`span`,{className:`truncate text-[13px] leading-[18px] text-fg`,children:[`The whole flow`,e.whole.notes>0&&(0,K.jsxs)(`span`,{className:`text-soft`,children:[` · `,e.whole.notes,` `,e.whole.notes===1?`note`:`notes`]})]}),(0,K.jsx)(`span`,{className:`text-[11.5px] text-faint`,children:e.whole.words})]}):!o&&(0,K.jsx)(`p`,{className:`px-2.5 py-[7px] text-[13px] text-soft`,children:`No notes on this flow yet.`})]})}),(0,K.jsxs)(`div`,{role:`toolbar`,"aria-label":`This moment`,"data-bar":``,className:`flex gap-0.5 rounded-xl bg-surface p-1 text-[13px] select-none [&_kbd]:text-[color-mix(in_srgb,var(--faint)_55%,var(--soft))] ${n?`shadow-[0_0_0_1.5px_rgba(236,178,72,0.95),0_6px_20px_rgba(20,24,34,0.12)]`:`shadow-[0_0_0_1px_var(--edge),0_6px_20px_var(--drop)]`}`,children:[(0,K.jsxs)(`button`,{className:t,disabled:!e.onNote,"aria-pressed":e.noting,onClick:e.onNote,children:[`Note `,(0,K.jsx)(iu,{children:`N`})]}),!n&&e.compare&&(0,K.jsx)(su,{...e.compare,bar:t}),n?(0,K.jsxs)(`button`,{className:t,onClick:e.onBack,children:[`Back to the recording `,(0,K.jsx)(iu,{children:`Esc`})]}):(0,K.jsxs)(`button`,{className:t,disabled:!e.latest,"aria-pressed":e.live===`waiting`,onClick:e.onTakeOver,children:[e.live===`waiting`?`Taking over…`:`Take over`,` `,(0,K.jsx)(iu,{children:`T`})]}),(0,K.jsx)(`span`,{className:`my-1.5 w-px bg-line`}),(0,K.jsx)(`button`,{className:`${t} text-soft`,"aria-pressed":i,onClick:()=>a(!i),children:o?`${o} ${o===1?`note`:`notes`}`:`Notes`})]})]})}var Ld={x:innerWidth/2,y:innerHeight/2},Rd=(e,t)=>Object.assign(Ld,{x:e,y:t}),zd=[`right`,`left`,`over`,`under`],Bd=16,Vd=28,Hd=4,Ud=1500,Wd=120;function Gd({id:e,over:t,standing:n,still:r,resting:i,pinned:a,onAway:o,children:s}){let c=(0,l.useRef)(null),u=(0,l.useRef)(void 0),d=(0,l.useRef)(!1),f=(0,l.useRef)(o);f.current=i?void 0:o,(0,l.useEffect)(()=>{let e=e=>{if(c.current?.contains(e.target)||(Rd(e.clientX,e.clientY),!c.current)||e.target.closest?.(`[data-mark], [data-pin]`))return;if(!e.target.closest?.(`[data-frame]`))return f.current?.();let t=n=>{removeEventListener(`pointerup`,t,!0),Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY)<Hd&&f.current?.()};addEventListener(`pointerup`,t,!0)},t=({data:e})=>e?.playthrough===`down`&&c.current&&f.current?.();return addEventListener(`pointerdown`,e,!0),addEventListener(`message`,t),()=>{removeEventListener(`pointerdown`,e,!0),removeEventListener(`message`,t)}},[]),(0,l.useEffect)(()=>{let e=c.current,t=e?.firstElementChild;if(!e||!t)return;let n={id:u.current?.id,height:t.getBoundingClientRect().height},r=new ResizeObserver(()=>{let r=t.getBoundingClientRect().height,i=e.getAnimations().filter(e=>e.id===`length`),a=i.length?e.getBoundingClientRect().height:void 0;i.forEach(e=>e.cancel());let o=n.id===u.current?.id,s=n.height;if(n={id:u.current?.id,height:r},!o||Math.abs(r-s)<2||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{paddingTop:c,paddingBottom:l}=getComputedStyle(e),d=parseFloat(c)+parseFloat(l);e.style.overflow=`hidden`;let f=e.animate([{height:`${a??s+d}px`},{height:`${r+d}px`}],{id:`length`,duration:220,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`});f.onfinish=()=>e.style.overflow=``});return r.observe(t),()=>r.disconnect()},[!!s]);let p=(0,l.useRef)(void 0);return(0,l.useLayoutEffect)(()=>{if(!s){Kd(p.current),p.current=void 0,u.current=void 0;return}c.current?.parentNode&&(p.current={card:c.current,in:c.current.parentNode});let r=()=>{let r=c.current;if(!r)return;let i=r.offsetWidth,o=r.offsetHeight,s=u.current&&u.current.id===e?u.current:u.current={id:e,at:{...Ld},since:performance.now()},l=[...document.querySelectorAll(`[data-frame]:not([hidden], [data-over])`)].map(e=>{let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return[t,n,r,i].map(Math.round).join(`,`)}),f=`${innerWidth}x${innerHeight} ${l.join(` `)}`,p=s.layout===f;s.seen?.layout!==f&&(s.seen={layout:f,since:performance.now()});let m=performance.now()-s.seen.since<Wd,h=(e,t)=>{if(d.current&&s.last&&!s.put&&p&&([e,t]=[s.last.x,s.last.y]),s.last={x:e,y:t},r.style.translate=`${e.toFixed(1)}px ${t.toFixed(1)}px`,s.shown&&!s.gone)return;let n=!s.shown;s.shown=!0,s.gone=!1,r.style.visibility=``,!matchMedia(`(prefers-reduced-motion: reduce)`).matches&&r.animate(n?[{opacity:0,scale:.96},{opacity:1,scale:1}]:[{opacity:0},{opacity:1}],{duration:n?180:160,easing:`cubic-bezier(0.2, 0, 0, 1)`})},g=`[data-frame][data-watched]`,_=t&&document.querySelector(g)?.getBoundingClientRect();if(_)return h(_.left+_.width/2-i/2,n?_.top+_.height/2-o/2:_.bottom-o-44);if(s.put)return h(qd(s.put.x,Bd,innerWidth-i-Bd),qd(s.put.y,Bd,innerHeight-o-Bd));let v=e=>{let t=e?.getBoundingClientRect();return t&&(t.width||t.height)?t:void 0},y=e?document.querySelector(`${g} [data-mark-id="${CSS.escape(e)}"]`):null,b=e?document.querySelector(`${g} [data-pin="${CSS.escape(e)}"]`):null,x=y??b,S=v(y)??v(b),C=!!S,w=a?.(),T=!C&&!w&&!!x&&!s.was&&performance.now()-s.since<Ud;if(!T&&s.layout&&!p&&m&&(s.gone=!0),r.style.visibility=T||s.gone?`hidden`:``,T||s.gone&&m)return;if(!C&&!w&&s.was)return h(s.was.x,s.was.y);let E=w??s.at,D=C?S:new DOMRect(E.x,E.y,0,0),O=e?document.querySelector(`${g} [data-pin="${CSS.escape(e)}"]`)?.getBoundingClientRect():void 0,k=O?.width?O:D,A=document.querySelector(`[data-bar]`)?.getBoundingClientRect(),j=A?.height?A.top-Bd:innerHeight-Bd,M=({x:e,y:t})=>e>=Bd&&e+i<=innerWidth-Bd&&t>=Bd&&t+o<=j,N=s.fromPin&&{x:k.left+s.fromPin.x,y:k.top+s.fromPin.y};if(m&&s.last)return h(qd(s.last.x,Bd,innerWidth-i-Bd),qd(s.last.y,Bd,j-o));if(N&&p&&M(N))return C&&(s.was=N),h(N.x,N.y);let ee=qd(k.right-i,Bd,innerWidth-i-Bd),te=qd(D.top-24,Bd,j-o),ne={right:{x:D.right+Vd,y:te},left:{x:D.left-Vd-i,y:te},under:{x:ee,y:D.bottom+20},over:{x:ee,y:Math.min(D.top,k.top)-16-o}},re=e=>[...document.querySelectorAll(`[data-frame]:not([hidden], [data-over]) ${e}`)].map(e=>e.getBoundingClientRect()).filter(e=>e.width),ie=e?re(`[data-mark-id="${CSS.escape(e)}"]`):[],ae=e=>t=>{let{x:n,y:r}=ne[t];return M(ne[t])&&!e.some(e=>n<e.right&&n+i>e.left&&r<e.bottom&&r+o>e.top)},oe=[...document.querySelectorAll(`[data-frame]:not([hidden], [data-over], [data-watched])`)].map(e=>e.getBoundingClientRect()),se=s.side?[s.side,...zd]:zd,ce=se.find(ae([...ie,...oe,...re(`[data-kind="change"]`)]))??se.find(ae([...ie,...oe]))??se.find(ae(ie))??se.find(ae([]));if((C||w)&&(s.side??=ce),ce&&C&&(s.was=ne[ce]),ce&&(C||w)&&Object.assign(s,{layout:f,fromPin:{x:ne[ce].x-k.left,y:ne[ce].y-k.top}}),ce)return h(ne[ce].x,ne[ce].y);h(D.right+Vd+i<=innerWidth-Bd?D.right+Vd:Math.max(Bd,D.left-Vd-i),te)};r();let i=requestAnimationFrame(function e(){r(),i=requestAnimationFrame(e)});return()=>cancelAnimationFrame(i)}),s?(0,K.jsxs)(`aside`,{ref:c,inert:!!i,onPointerDown:e=>{let t=c.current;if(e.button!==0||!t||!u.current||e.target.closest(`input, textarea, select, [contenteditable]`))return;let n={x:e.clientX,y:e.clientY},r=t.getBoundingClientRect(),i=u.current,a=!1,o=e=>{!a&&Math.hypot(e.clientX-n.x,e.clientY-n.y)<Hd||(a||getSelection()?.removeAllRanges(),document.documentElement.style.userSelect=`none`,a=!0,i.put={x:r.left+e.clientX-n.x,y:r.top+e.clientY-n.y})},s=()=>{if(removeEventListener(`pointermove`,o),removeEventListener(`pointerup`,s),!a)return;document.documentElement.style.userSelect=``;let e=e=>e.stopPropagation();addEventListener(`click`,e,{capture:!0,once:!0}),setTimeout(()=>removeEventListener(`click`,e,{capture:!0}))};addEventListener(`pointermove`,o),addEventListener(`pointerup`,s)},onPointerEnter:()=>d.current=!0,onPointerLeave:()=>d.current=!1,className:`fixed top-0 left-0 z-30 ${n?`w-[400px]`:`w-[330px]`} rounded-xl bg-ground py-1.5 shadow-float transition-opacity duration-250 ease-calm ${r||i===`shown`?`pointer-events-none opacity-0`:``}`,children:[(0,K.jsx)(`div`,{"data-card":!0,className:`grid grid-cols-[minmax(0,1fr)] ${o?`[&>*>button:first-child]:pr-9`:``}`,children:s}),o&&(0,K.jsx)(`button`,{"aria-label":`Close`,className:`absolute top-[11px] right-2 grid size-5 place-items-center rounded-full text-faint transition-colors duration-150 ease-calm hover:bg-hover hover:text-fg`,onMouseDown:e=>e.preventDefault(),onClick:()=>f.current?.(),children:(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M3 3l6 6M9 3l-6 6`})})})]}):null}function Kd(e){if(!e||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{card:t}=e;t.inert=!0,t.setAttribute(`aria-hidden`,`true`),e.in.append(t);let n=Number(getComputedStyle(t).opacity);if(t.style.visibility===`hidden`||!n)return t.remove();t.animate([{opacity:n,scale:1},{opacity:0,scale:.97}],{duration:140,easing:`cubic-bezier(0.4, 0, 1, 1)`,fill:`forwards`}).onfinish=()=>t.remove()}var qd=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n)),Jd=new WeakMap,Yd=`cubic-bezier(0.2, 0.8, 0.2, 1)`;function Xd(e,t,n){let r=Jd.get(e);if(r&&((e,t)=>e.map(e=>`${e.key}:${e.text}`).join(`|`)===t.map(e=>`${e.key}:${e.text}`).join(`|`))(r.parts,t))return;let i=t.flatMap(e=>Zd(e).map(t=>$d(t,e.soft))).join(``);if(Jd.set(e,{parts:t,html:i}),!r||!n||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return void(e.innerHTML=i);let a={duration:240,easing:Yd,fill:`both`};if(r.parts.map(e=>e.key).join()!==t.map(e=>e.key).join()){e.innerHTML=`<span class="inline-grid overflow-hidden align-top"><span data-new class="[grid-area:1/1] justify-self-center whitespace-nowrap">${i}</span><span data-old aria-hidden="true" class="[grid-area:1/1] justify-self-center whitespace-nowrap">${r.html}</span></span>`;let t={...a,duration:260};e.querySelector(`[data-new]`).animate([{transform:`translateY(${n*100}%)`},{transform:`none`}],t);let o=e.querySelector(`[data-old]`);o.animate([{transform:`none`},{transform:`translateY(${-n*100}%)`}],t).onfinish=()=>o.remove();return}let o=[];for(let e of t){let t=Zd(e),n=Zd(r.parts.find(t=>t.key===e.key)),i=t.length-n.length;for(let t=0;t<-i;t++)o.push({was:n[t],soft:e.soft,leaving:!0,group:`trim ${e.key}`});t.forEach((t,r)=>o.push({now:t,was:n[r-i],soft:e.soft,group:r-i<0?`grow ${e.key}`:void 0}))}e.innerHTML=o.map(e=>$d(e.leaving?e.was:e.now,e.soft)).join(``);let s=[...e.children],c=-1,l;for(let e=o.length-1;e>=0;e--){let t=o[e],r=s[e],i=r.firstElementChild;if(!t.leaving&&t.was===t.now)continue;t.group&&t.group===l||c++,l=t.group;let u={...a,delay:c*28},d=r.offsetWidth;if(t.leaving){i.animate([{transform:`none`},{transform:`translateY(${-n*100}%)`}],u),r.animate([{width:`${d}px`},{width:`0px`}],u).onfinish=()=>r.remove();continue}i.animate([{transform:`translateY(${n*100}%)`},{transform:`none`}],u);let f=0;if(t.was!==void 0){let e=document.createElement(`i`);e.className=`absolute top-0 left-0 not-italic`,e.innerHTML=Qd(t.was),r.append(e),f=e.offsetWidth,e.animate([{transform:`none`},{transform:`translateY(${-n*100}%)`}],u).onfinish=()=>e.remove()}f!==d&&r.animate([{width:`${f}px`},{width:`${d}px`}],{...u,fill:`backwards`})}}var Zd=e=>e.word?[e.text]:[...e.text],Qd=e=>e===` `?` `:e.replace(/[&<>"]/g,e=>`&#${e.charCodeAt(0)};`),$d=(e,t)=>`<span class="relative inline-block overflow-hidden align-top${t?` text-faint`:``}"><i class="inline-block not-italic">${Qd(e)}</i></span>`,ef=o(),tf=e=>new Date(e).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}),nf=e=>e===0?`Before`:`Round ${e}`,rf=e=>e<=6?1:Math.max(.25,.82**(e-6));function af(e){let{rounds:t,watching:n,earlier:r}=e,i=t[0]?.number??0,a=t.at(-1)?.number??0,o=(0,l.useRef)(e);o.current=e;let s=(0,l.useRef)(null),c=(0,l.useRef)(null),u=(0,l.useRef)(null),d=(0,l.useRef)(null),[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!0),[g,_]=(0,l.useState)(),v=(0,l.useRef)({}),y=(0,l.useRef)(!1),b=r!==void 0,x=e.arrived&&!f?`arrived`:e.working&&!f?`working`:`round`,S=a>i,C=(e,t)=>t===void 0&&e===0?[{text:`Before`,key:`word`,word:!0}]:t===0?[{text:`Before`,key:`word`,word:!0},{text:` → `,key:`to`,soft:!0},{text:`Round `,key:`round`},{text:String(e),key:`number`}]:t===void 0?[{text:`Round`,key:`word`,word:!0,soft:e!==a},{text:` `,key:`gap`,soft:!0},{text:String(e),key:`number`,soft:e!==a}]:[{text:`Round`,key:`word`,word:!0},{text:` `,key:`gap`,soft:!0},{text:String(t),key:`then`},{text:` → `,key:`to`,soft:!0},{text:String(e),key:`number`}],w=x===`arrived`?[{text:nf(e.arrived.number),key:`word`,word:!0},{text:` is in`,key:`end`,soft:!0}]:x===`working`?[{text:nf(a+1),key:`word`,word:!0},{text:` coming`,key:`end`,soft:!0}]:C(n,r),T=x===`arrived`?1e6:x===`working`?1e6-1:n*1e3+(b?r+1:0),E=(0,l.useRef)(T);(0,l.useLayoutEffect)(()=>{Xd(c.current,w,T<E.current?-1:1),E.current=T});let D=(0,l.useRef)(``);(0,l.useLayoutEffect)(()=>{e.quiet||D.current===`${i}-${a}`||(D.current=`${i}-${a}`,c.current.style.minWidth=`${of(c.current,t,C)}px`)});let O=()=>{let e=u.current;if(!e)return;let t=e.clientWidth,n=0;for(let e=1;e<=a-i;e++)n+=rf(e);let r=n?t/n:0,o=t,s={};for(let e=0;e<=a-i;e++)e&&(o-=r*rf(e)),s[a-e]=m?o:t-o;v.current=s};(0,l.useLayoutEffect)(()=>{let e=s.current;if(!f||!e||!c.current)return;let t=e.parentElement,n=e.getBoundingClientRect(),r=t.querySelector(`[data-speed]`)?.getBoundingClientRect(),o=t.querySelector(`[data-views]`)?.getBoundingClientRect(),l=!!r&&Math.abs(r.top-n.top)<8;if(l!==m)return h(l);let u=c.current.offsetWidth+4,d=(l?n.right-r.left:o&&Math.abs(o.top-n.top)<8?o.right-n.left:n.width+170)-u-28,p=0;for(let e=1;e<=a-i;e++)p+=rf(e);let g=S?Xu(p*24,48,Math.max(48,d)):e.querySelector(`[data-none]`)?.offsetWidth??0;e.style.setProperty(`--lw`,`${u}px`),e.style.setProperty(`--hw`,`${u+28+g}px`),O()}),(0,l.useLayoutEffect)(()=>{s.current?.style.setProperty(`--lw`,`${(c.current?.offsetWidth??0)+4}px`),k()});let k=()=>{let e=u.current;if(!e||!S)return;Object.keys(v.current).length||O();for(let t of e.querySelectorAll(`[data-dot]`)){let e=Number(t.dataset.dot);t.style.left=`${v.current[e]??0}px`,t.style.setProperty(`--s`,(2+2*Math.min(1,rf(a-e)*1.25)).toFixed(2))}let t=[v.current[i]??0,v.current[a]??0];Object.assign(e.querySelector(`[data-rail]`).style,{left:`${Math.min(...t)}px`,width:`${Math.abs(t[1]-t[0])}px`});let n=v.current[o.current.watching]??0;e.querySelector(`[data-now]`).style.left=`${n}px`;let r=v.current[o.current.earlier??o.current.watching-1];r!==void 0&&(e.querySelector(`[data-then]`).style.left=`${r}px`,Object.assign(e.querySelector(`[data-pair]`).style,{left:`${Math.min(r,n)}px`,width:`${Math.abs(n-r)}px`}))},A=e=>{let t=e-u.current.getBoundingClientRect().left,n=a;for(let e=i;e<=a;e++)Math.abs((v.current[e]??0)-t)<Math.abs((v.current[n]??0)-t)&&(n=e);return n},j=e=>{let t=u.current;if(!t)return;let n=e===void 0?void 0:e-t.getBoundingClientRect().left;for(let e of t.querySelectorAll(`[data-dot]`))e.style.setProperty(`--m`,n===void 0?`1`:(1+1.4*Math.max(0,1-Math.abs((v.current[Number(e.dataset.dot)]??0)-n)/26)).toFixed(3))};(0,l.useLayoutEffect)(()=>{let e=d.current,t=s.current;if(!e||!t||g===void 0||!u.current)return;let n=t.getBoundingClientRect(),r=parseFloat(getComputedStyle(t).getPropertyValue(`--hw`))||n.width,i=e.offsetWidth/2,a=m?n.width-r:0,o=u.current.getBoundingClientRect().left-n.left+(v.current[g]??0);e.style.left=`${Xu(o,a+i,Math.max(a+i,a+r-i))}px`});let M=(e,t,n)=>{let r=e.pointerId;e.target.setPointerCapture?.(r);let i=e=>e.pointerId===r&&t(e.clientX),a=e=>{e.pointerId===r&&(removeEventListener(`pointermove`,i),removeEventListener(`pointerup`,a),removeEventListener(`pointercancel`,a),n())};addEventListener(`pointermove`,i),addEventListener(`pointerup`,a),addEventListener(`pointercancel`,a)},N=e=>{if(x!==`round`||!S||e.button!==0)return;let t=e.clientX,r=n,i=f,a=!1;M(e,e=>{if(!a&&Math.abs(e-t)<4)return;a||(a=!0,document.documentElement.classList.add(`**:cursor-ew-resize!`),(0,ef.flushSync)(()=>p(!0)));let n=u.current.getBoundingClientRect().left+(v.current[r]??0)+e-t;j(n);let i=A(n);i!==o.current.watching&&o.current.onRound(i),_(i)},()=>{a&&(document.documentElement.classList.remove(`**:cursor-ew-resize!`),y.current=!0,setTimeout(()=>y.current=!1),p(i),_(void 0),j())})},ee=()=>{if(!y.current){if(x===`arrived`)return e.onRound(e.arrived.number);p(!f),_(void 0)}},te=e=>{if(!S||e.button!==0)return;let t=e=>{let t=A(e);t!==o.current.watching&&o.current.onRound(t)};t(e.clientX),M(e,t,()=>{o.current.watching===a&&(p(!1),_(void 0))})},ne=(0,l.useRef)({by:0,opened:!1,fold:0});(0,l.useEffect)(()=>{let e=s.current,t=e=>{let{watching:t}=o.current;if(Math.abs(e.deltaX)<=Math.abs(e.deltaY)||!S||x!==`round`)return;e.preventDefault();let n=ne.current;if(f||((0,ef.flushSync)(()=>p(!0)),n.opened=!0,n.by=0),n.by+=e.deltaX,Math.abs(n.by)>=30){let e=Math.sign((v.current[a]??0)-(v.current[i]??0))*Math.sign(n.by);n.by=0;let r=Xu(t+e,i,a);r!==t&&o.current.onRound(r)}clearTimeout(n.fold),n.fold=window.setTimeout(()=>{n.opened&&p(!1),n.opened=!1,n.by=0},900)};return e?.addEventListener(`wheel`,t,{passive:!1}),()=>e?.removeEventListener(`wheel`,t)}),(0,l.useEffect)(()=>{if(!f)return;let e=e=>!s.current?.contains(e.target)&&p(!1),t=e=>{e.key===`Escape`&&(e.preventDefault(),p(!1),_(void 0),c.current?.focus())};return addEventListener(`pointerdown`,e),addEventListener(`keydown`,t,!0),()=>{removeEventListener(`pointerdown`,e),removeEventListener(`keydown`,t,!0)}},[f]);let re=t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault(),t.stopPropagation();let r=Xu(n+(t.key===`ArrowRight`?1:-1),i,a);r!==n&&e.onRound(r)},ie=e=>{let t=new Date(e.finished??0);return`${t.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`})}, ${t.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`})}`},ae=g===void 0?void 0:t.find(e=>e.number===g),oe=`pointer-events-none absolute bottom-[calc(100%+3px)] z-7 max-w-[380px] -translate-x-1/2 truncate rounded-[5px] bg-surface px-[7px] py-px text-[11px] leading-[14px] whitespace-nowrap text-soft shadow-tip transition-[opacity,translate] duration-150 ease-calm`,se=`translate-y-[2px] opacity-0`;return(0,K.jsxs)(`nav`,{ref:s,"data-open":f?m?`left`:`right`:void 0,"aria-label":`Rounds`,className:`group/rounds relative flex h-[calc(1.5em+10px)] items-center gap-3 rounded-lg ${e.quiet?``:`bg-hover px-0.5`}`,children:[(0,K.jsx)(`button`,{ref:c,"aria-expanded":f,"aria-label":x===`arrived`?`The agent's next round is in`:x===`working`?`The agent started at ${tf(e.working)}`:`Rounds`,"data-say":x,className:`relative z-6 touch-pan-y rounded-md px-2.5 py-[3px] text-center whitespace-nowrap tabular-nums transition-colors duration-150 ease-calm ${e.quiet?`text-fg hover:bg-hover aria-expanded:bg-surface aria-expanded:shadow-[0_0_0_1px_var(--line)]`:`text-fg hover:bg-surface hover:shadow-[0_0_0_1px_var(--line)] aria-expanded:bg-surface aria-expanded:shadow-[0_0_0_1px_var(--line)]`} ${x===`round`&&S?`cursor-ew-resize`:``} data-[say=arrived]:before:mr-1.5 data-[say=arrived]:before:mb-px data-[say=arrived]:before:inline-block data-[say=arrived]:before:size-1.5 data-[say=arrived]:before:rounded-full data-[say=arrived]:before:bg-amber data-[say=arrived]:before:align-middle data-[say=working]:before:mt-[calc(.5lh-3px)] data-[say=working]:before:mr-1.5 data-[say=working]:before:inline-block data-[say=working]:before:size-1.5 data-[say=working]:before:animate-breathe data-[say=working]:before:rounded-full data-[say=working]:before:bg-slate data-[say=working]:before:align-top`,onPointerDown:N,onClick:ee,onKeyDown:re}),(0,K.jsx)(`div`,{className:`absolute top-0 bottom-0 z-5 w-[var(--hw,100%)] rounded-lg [background:linear-gradient(var(--hover),var(--hover)),var(--ground)] ${m?`right-0 [clip-path:inset(0_0_0_calc(100%_-_var(--lw,0px))_round_8px)]`:`left-0 [clip-path:inset(0_calc(100%_-_var(--lw,0px))_0_0_round_8px)]`} invisible transition-[clip-path,visibility] duration-[280ms,0s] delay-[0s,280ms] ease-calm group-data-open/rounds:visible group-data-open/rounds:[clip-path:inset(0_0_0_0_round_8px)] group-data-open/rounds:delay-0`,children:(0,K.jsxs)(`div`,{ref:u,role:`slider`,tabIndex:f?0:-1,"aria-label":`Rounds`,"aria-valuemin":i,"aria-valuemax":a,"aria-valuenow":n,"aria-valuetext":nf(n)+(b?`, against ${nf(r)}`:``),className:`absolute top-0 bottom-0 touch-none *:absolute *:top-1/2 ${m?`right-[calc(var(--lw,0px)+12px)] left-4`:`right-4 left-[calc(var(--lw,0px)+12px)]`} ${S?`cursor-pointer`:`cursor-default`}`,onPointerDown:te,onPointerMove:e=>{S&&(j(e.clientX),_(A(e.clientX)))},onPointerLeave:()=>{j(),_(void 0)},onKeyDown:re,children:[S&&(0,K.jsx)(`div`,{"data-rail":!0,className:`-mt-px h-0.5 rounded-full bg-line`}),S&&t.map(e=>(0,K.jsx)(`i`,{"data-dot":e.number,style:{"--i":a-e.number},className:`-mt-[calc(var(--s,4)*.5px)] -ml-[calc(var(--s,4)*.5px)] size-[calc(var(--s,4)*1px)] rounded-full opacity-0 transition-[opacity,scale,background-color] duration-[150ms,120ms,150ms] ease-calm group-data-open/rounds:opacity-100 group-data-open/rounds:delay-[calc(var(--i,0)*22ms+60ms),0s,0s] ${g===e.number?`bg-fg [scale:max(var(--m,1),1.75)]`:`bg-faint [scale:var(--m,1)]`}`},e.number)),S&&(0,K.jsx)(`div`,{"data-pair":!0,className:`-mt-px h-0.5 bg-fg transition-[left,width,opacity] duration-200 ease-calm ${b?`opacity-100`:`opacity-0`}`}),S&&(0,K.jsx)(`i`,{"data-then":!0,className:`-mt-[4.5px] -ml-[4.5px] size-[9px] rounded-full bg-ground shadow-[inset_0_0_0_2px_var(--fg)] transition-[left,opacity] duration-200 ease-calm ${b?`opacity-100`:`opacity-0`}`}),S&&(0,K.jsx)(`i`,{"data-now":!0,className:`-mt-[4.5px] -ml-[4.5px] size-[9px] rounded-full bg-fg shadow-[0_0_0_2px_var(--ground)] transition-[left] duration-200 ease-calm`}),!S&&(0,K.jsx)(`span`,{"data-none":!0,className:`${m?`right-0`:`left-0`} -translate-y-1/2 text-xs whitespace-nowrap text-faint opacity-0 transition-opacity duration-150 ease-calm group-data-open/rounds:opacity-100 group-data-open/rounds:delay-100`,children:`Nothing earlier yet`})]})}),(0,K.jsx)(`span`,{ref:d,"aria-hidden":!0,className:`${oe} ${ae&&f?`opacity-100`:se}`,children:ae&&(0,K.jsx)(`b`,{className:`mr-1.5 font-medium text-fg`,children:ae.number===0?`Before`:`${nf(ae.number)} · ${ie(ae)}`})}),x!==`round`&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`${oe} ${se} left-[calc(var(--lw,0px)/2)] group-has-[[data-say]:hover]/rounds:translate-y-0 group-has-[[data-say]:hover]/rounds:opacity-100`,children:x===`arrived`?`${nf(e.arrived.number)} came in at ${tf(e.arrived.finished??``)}`:`The agent started at ${tf(e.working)}`})]})}function of(e,t,n){let r=getComputedStyle(e),i=document.createElement(`canvas`).getContext(`2d`);i.font=`${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;let a=e=>i.measureText(e).width,o=e=>e.map(e=>e.text).join(``),s=t.at(-1)?.number??0,c=a(`${nf(s+1)} coming`)+12;c=Math.max(c,a(`${nf(s+1)} is in`)+12);for(let e of t){c=Math.max(c,a(o(n(e.number))));for(let r of t)r.number<e.number&&(c=Math.max(c,a(o(n(e.number,r.number)))))}return Math.max(96,Math.ceil(c+parseFloat(r.paddingLeft)+parseFloat(r.paddingRight)+4))}var sf=14,cf=`end`,lf=64,uf=18,df=12,ff=(e,t)=>`calc(${(e*100).toFixed(4)}% - ${(t*(1-e)).toFixed(2)}px)`,pf=.03,mf=8,hf=10,gf=6,_f=8;function vf({playhead:e,dots:t,onDot:n,marks:r,onMark:i,live:a,forks:o=[],growing:s,lit:c,end:u}){let d=id(e),f=e.flows,p=e.flow.fork,m=p&&f.find(e=>e.name===p)||e.flow,h=f.indexOf(m),g=o.find(t=>t.name===e.flow.name),_=(0,l.useRef)(null),[v,y]=(0,l.useState)(),[b,x]=(0,l.useState)(!1),[S,C]=(0,l.useState)(),[w,T]=(0,l.useState)(),E=(0,l.useRef)(void 0);(0,l.useLayoutEffect)(()=>{let e=E.current&&t.filter(e=>!E.current.has(e.id));if(E.current=new Set(t.map(e=>e.id)),e?.length&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let t of e){let e=_.current?.querySelector(`[data-dot="${CSS.escape(t.id)}"]`);(e?.querySelector(`span`)??e)?.animate([{scale:.3,opacity:0},{scale:1.6,opacity:1,offset:.6},{scale:1}],{duration:360,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`})}});let D=(0,l.useRef)(null),O=(0,l.useRef)(d.playing);(0,l.useLayoutEffect)(()=>{O.current!==d.playing&&(O.current=d.playing,matchMedia(`(prefers-reduced-motion: reduce)`).matches||D.current?.animate([{opacity:0,scale:.5},{opacity:1,scale:1}],{duration:180,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`}))});let k=(e,t)=>{let n=f.indexOf(e);return n<h?0:n>h?1:Xu((t+Ku)/(e.length+Ku))},A=(e,t)=>`${(k(e,t)*100).toFixed(4)}%`,j=e=>`${(e*100).toFixed(4)}%`,M=s&&(o.find(e=>e.name===s.name)??s),N=[...o.filter(e=>e.name!==M?.name),...M?[M]:[]],ee=e=>{let n=Math.max(...t.filter(t=>t.fork===e.name).map(e=>e.at));return n>e.at&&n<e.length&&(k(m,e.length)-k(m,n))*oe<_f?n:e.length},te=e=>{let t=k(m,e.at);return{start:t,end:Math.min(1,Math.max(k(m,ee(e)),t+pf))}},ne=e=>{let t=(1-k(m,e.at))*oe,n=Xu(t,30,lf);return{length:n,back:Math.max(0,n-t)}},re=(e,t)=>{let{start:n,end:r}=te(e),i=ee(e);return i<=e.at?r:n+(Xu(t,e.at,i)-e.at)/(i-e.at)*(r-n)},ie=(e,t)=>{let n=_.current.getBoundingClientRect(),{start:r,end:i}=te(e),a=ee(e);return Xu(e.at+(Xu((t-n.left)/n.width)-r)/Math.max(1e-4,i-r)*(a-e.at),e.at,a)},ae=e=>{let t=e.fork?N.find(t=>t.name===e.fork):void 0;return t?re(t,e.at):k(m,e.at)},[oe,se]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=new ResizeObserver(([e])=>se(e.contentRect.width));return e.observe(_.current),()=>e.disconnect()},[]);let ce=new Map,le=t.filter(e=>e.until===void 0).sort((e,t)=>e.at-t.at);for(let e=0;e<le.length;){let t=e+1;for(;t<le.length&&(k(m,le[t].at)-k(m,le[t-1].at))*oe<sf;)t++;le.slice(e,t).forEach((n,r)=>ce.set(n.id,(r-(t-e-1)/2)*sf)),e=t}let ue=new Map,de=new Map,fe=N.map((e,t)=>{let{start:n,end:r}=te(e);return{fork:e,made:t,from:n*oe,to:(e===M?n*oe+ne(e).length-ne(e).back:r*oe)+hf}}).sort((e,t)=>e.from-t.from||t.to-e.to||e.made-t.made),P;for(let e of fe)P=P&&e.from-P.from<1?{from:P.from,step:P.step+gf}:{from:e.from,step:0},de.set(e.fork.name,P.step),e.from+=P.step;for(let e of[...fe].reverse()){let t=fe.filter(t=>t.from>e.from&&t.from<e.to).map(e=>ue.get(e.fork.name));ue.set(e.fork.name,Math.min(2,t.length?1+Math.max(...t):0))}let pe=e=>e?(ue.get(e.name)??0)*mf:0,[me,he]=(0,l.useState)(!1),[F,I]=(0,l.useState)(m.name);F!==m.name&&(I(m.name),b||he(!0)),(0,l.useEffect)(()=>{if(!me)return;let e=setTimeout(()=>he(!1),400);return()=>clearTimeout(e)},[me,F]);let ge=e=>{let t=_.current.getBoundingClientRect();return-Ku+Xu((e-t.left)/t.width,0,.9995)*(m.length+Ku)},L=(e,t)=>{let n=_.current.getBoundingClientRect(),r=t,i=1/0;for(let t of _.current.querySelectorAll(`[data-at]`)){let a=Number(t.dataset.at),o=Math.abs(e-(n.left+k(m,a)*n.width));o<5&&o<i&&([i,r]=[o,a])}return r},_e=(0,l.useRef)(!1),ve=t=>{if(t.button!==0)return;let n=!!t.target.closest(`[data-mark]`),r=o.find(e=>e.name===t.target.closest(`[data-fork]`)?.getAttribute(`data-fork`)),i=t=>r?e.go({flow:r.name,at:ie(r,t)}):e.go({flow:m.name,at:L(t,ge(t))}),a=t.clientX,s=t.pointerId,c=e.now.playing,l=!1,u=()=>{l=!0,C(r?.name??``),x(!0),e.scrub(!0),_.current.setPointerCapture(s)};n||(u(),r?i(a):e.go({flow:m.name,at:ge(a)}));let d=e=>{e.pointerId===s&&(!l&&Math.abs(e.clientX-a)<4||(l||u(),i(e.clientX)))},f=t=>{t.pointerId===s&&(removeEventListener(`pointermove`,d),removeEventListener(`pointerup`,f),removeEventListener(`pointercancel`,f),l&&(C(void 0),n&&(_e.current=!0,setTimeout(()=>_e.current=!1)),x(!1),e.scrub(!1),c&&e.now.moment.at>=e.flow.length-.06&&e.pause()))};addEventListener(`pointermove`,d),addEventListener(`pointerup`,f),addEventListener(`pointercancel`,f)},ye=d.moment.at,R=M??g,be=e=>`calc(${j(k(m,e.at))} + ${ne(e).length-ne(e).back-uf}px)`,xe=M?be(M):j(g?re(g,ye):k(m,ye)),Se=R?A(m,R.at):xe,Ce=S??v?.fork??(v?``:void 0),we=Ce!==void 0&&Ce===(R?R.name:``),z=me?`transition-[left,width,opacity] duration-300 ease-calm`:``,Te=`pointer-events-none absolute bottom-[calc(100%-1px)] -translate-x-1/2 rounded-[5px] bg-surface px-[7px] py-px text-[11px] leading-[14px] whitespace-nowrap shadow-tip transition-[opacity,translate] duration-150 ease-calm`,Ee=t.find(e=>e.id===w),De=r.find(e=>e.id===w),Oe=w===cf?u:void 0,ke=!g&&ye>=m.length-.06,Ae=d.playing?void 0:Ee??De??Oe,je=!b&&v!==void 0&&!Ae,Me=v?.fork?N.find(e=>e.name===v.fork):void 0,Ne=v===void 0?void 0:j(Me?re(Me,v.at):k(m,v.at));return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{className:`grid size-7 flex-none place-items-center rounded-full text-fg transition-colors duration-150 ease-calm hover:bg-hover`,"aria-label":d.playing?`Pause`:`Play`,onClick:()=>e.toggle(),children:(0,K.jsx)(`svg`,{ref:D,viewBox:`0 0 20 20`,fill:`currentColor`,className:`size-3.5`,"aria-hidden":!0,children:d.playing?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`rect`,{x:`5.5`,y:`4.5`,width:`3`,height:`11`,rx:`1`}),(0,K.jsx)(`rect`,{x:`11.5`,y:`4.5`,width:`3`,height:`11`,rx:`1`})]}):(0,K.jsx)(`path`,{d:`M7 4.8v10.4c0 .6.7 1 1.2.6l8-5.2a.7.7 0 000-1.2l-8-5.2c-.5-.4-1.2 0-1.2.6z`})})}),(0,K.jsxs)(`span`,{className:`grid text-soft tabular-nums`,children:[(0,K.jsxs)(`span`,{className:`col-start-1 row-start-1 ${a?`invisible`:``}`,children:[il(Math.max(0,ye)),(0,K.jsxs)(`small`,{className:`text-[smaller] text-faint`,children:[` / `,il(e.flow.length)]})]}),a&&(0,K.jsx)(`span`,{className:`col-start-1 row-start-1 text-fg`,children:`Live`})]}),(0,K.jsxs)(`div`,{ref:_,role:`slider`,tabIndex:0,"aria-label":`Playback position`,"aria-valuemin":0,"aria-valuemax":m.length,"aria-valuenow":Math.max(0,ye),"data-scrubbing":b?``:void 0,className:`group/line relative mr-5 h-9 min-w-30 flex-[1_1_160px] cursor-pointer touch-none select-none`,onPointerDown:ve,onMouseDown:e=>e.preventDefault(),onPointerMove:e=>{if(b)return;let t=e.target,n=N.find(e=>e.name===t.closest(`[data-fork]`)?.getAttribute(`data-fork`));y(t.closest(`[data-mark]`)?void 0:n?{at:ie(n,e.clientX),fork:n.name}:{at:ge(e.clientX)})},onPointerLeave:()=>y(void 0),children:[(0,K.jsx)(`div`,{className:`absolute inset-x-0 z-1 bg-line transition-[top,height,border-radius] duration-150 ease-calm ${Ce===``?`top-4 h-1 rounded-[2px]`:`top-[17px] h-0.5 rounded-[1px]`}`,children:(0,K.jsx)(`div`,{className:`absolute top-0 left-0 h-full rounded-[inherit] ${Ce===``?`bg-soft`:`bg-faint`} ${z}`,style:{width:Se}})}),[...N].sort((e,t)=>pe(e)-pe(t)).map(e=>{let{start:t,end:n}=te(e),r=e===R,i=e===M,a=r?i?1:re(e,ye):t,o=Ce===e.name,s=pe(e),c=o||r?`var(--amber)`:`color-mix(in srgb, var(--amber) 40%, var(--ground))`,l=`color-mix(in srgb, var(--amber) ${o?45:25}%, var(--ground))`,u=df+s,d=de.get(e.name)??0,f=`M0 ${16+s} C ${u/2} ${16+s}, ${u/2} 4, ${u} 4`;return(0,K.jsxs)(`div`,{"data-fork":e.name,className:`absolute h-2 transition-[width] duration-500 ease-calm`,style:{top:1-s,left:`calc(${j(t)} + ${d-(i?ne(e).back:0)}px)`,width:i?`${ne(e).length}px`:`calc(${j(n-t)} - ${d}px)`},children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-0 -top-1`,style:{bottom:s?0:-2}}),(0,K.jsx)(`svg`,{width:u,height:`8`,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-0 overflow-visible`,children:(0,K.jsx)(`path`,{d:f,fill:`none`,stroke:r?c:l,strokeWidth:o?4:2,className:`transition-[stroke-width] duration-150 ease-calm`})}),(0,K.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute transition-[top,height,border-radius] duration-150 ease-calm ${i?`right-[18px]`:`right-0`} ${o?`top-0.5 h-1 rounded-r-[2px]`:`top-[3px] h-0.5 rounded-r-[1px]`}`,style:{left:u,background:i?c:`linear-gradient(90deg, ${c} ${ff(Xu((a-t)/Math.max(1e-4,n-t)),u)}, ${l} 0)`}}),i&&(0,K.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-0 w-[18px] animate-breathe motion-reduce:animate-none ${o?`top-0.5 h-1 rounded-r-[2px]`:`top-[3px] h-0.5 rounded-r-[1px]`}`,style:{background:`linear-gradient(90deg, ${c}, transparent)`}})]},e.name)}),f.filter(e=>!e.fork).length>1&&f.filter(e=>!e.fork).map(e=>(0,K.jsx)(`span`,{className:`pointer-events-none absolute top-[23px] truncate text-[10.5px] leading-3 whitespace-nowrap text-faint ${e===m?``:`invisible opacity-0`} ${z||`transition-opacity duration-300`}`,style:{left:A(e,-1.2),width:`calc(${A(e,e.length)} - ${A(e,-1.2)})`},children:e.name},e.name)),u&&(0,K.jsx)(`button`,{"data-mark":!0,"aria-label":u.words,className:`group/end absolute top-[11px] left-[calc(100%+4px)] z-3 grid size-3.5 place-items-center`,onPointerEnter:()=>T(cf),onPointerLeave:()=>T(void 0),onClick:()=>!_e.current&&u.go(),children:(0,K.jsx)(Pd,{end:u.end,ahead:!ke,just:u.just,className:`size-3.5 group-hover/end:scale-115`})}),r.map(e=>{let t={onPointerEnter:()=>T(e.id),onPointerLeave:()=>T(void 0),onClick:()=>!_e.current&&i(e.id)},n=A(m,e.at),r=ye<e.at-.02?e.lit?`bg-ground shadow-[inset_0_0_0_1.5px_var(--fg),0_0_0_1.5px_var(--ground),0_0_0_3px_var(--fg)]`:`bg-ground shadow-[inset_0_0_0_1.5px_var(--fg),0_0_0_1.5px_var(--ground)]`:e.lit?`bg-fg shadow-[0_0_0_1.5px_var(--ground),0_0_0_3px_var(--fg)]`:`bg-fg shadow-[0_0_0_1.5px_var(--ground)]`;return(0,K.jsxs)(`button`,{"data-mark":!0,"data-at":e.at,"aria-label":`${e.name}, ${il(e.at)}`,className:`group/mark absolute top-[11px] z-3 -ml-[7px] grid size-3.5 place-items-center ${z}`,style:{left:n},...t,children:[(0,K.jsx)(`i`,{className:`size-[7px] rotate-45 transition-[scale,background-color] duration-150 ease-calm group-hover/mark:scale-130 ${r}`}),e.note&&(0,K.jsx)(`b`,{className:`absolute top-[calc(50%-8px)] left-[calc(50%+2px)] size-1.5 rounded-full shadow-[0_0_0_1.5px_var(--ground)]`,style:{background:e.note.ink}})]},e.id)}),t.map(e=>{let t=e.fork?!(R?.name===e.fork&&ye>=e.at-.02):ye<e.at-.02,r=e.until===void 0?0:Xu((ye-e.at)/(e.until-e.at))*100,i=e.ink,a=`color-mix(in srgb, ${i} 35%, var(--ground))`;return(0,K.jsx)(`button`,{"data-mark":!0,"data-dot":e.id,"data-at":e.at,"aria-label":`Note ${e.number} at ${il(e.at)}`,className:`group/dot absolute z-4 grid place-items-center ${e.until===void 0?`${e.fork?``:`top-[11px]`} size-3.5 -translate-x-1/2`:`top-[15px] -ml-[3px] box-content h-1.5 rounded-[3px] px-[3px] shadow-[0_0_0_2px_var(--ground)] transition-[top,height,border-radius] duration-150 ease-calm hover:top-3.5 hover:h-2 hover:rounded-[4px]`} ${z}`,style:{left:e.fork?`min(${e.fork===M?.name?be(M):j(ae(e))}, calc(100% - 4px))`:`calc(${j(ae(e))} + ${ce.get(e.id)??0}px)`,...e.fork&&e.until===void 0&&{top:-2-pe(N.find(t=>t.name===e.fork))},...e.until!==void 0&&{width:`calc(${A(m,e.until)} - ${A(m,e.at)})`,background:`linear-gradient(90deg, ${i} ${r}%, ${a} ${r}%)`}},onPointerEnter:()=>T(e.id),onPointerLeave:()=>T(void 0),onClick:()=>!_e.current&&n(e.id),children:e.until===void 0&&(0,K.jsx)(`span`,{className:`size-1.5 rounded-full shadow-[0_0_0_2px_var(--ground)] transition-[scale,background-color] duration-150 ease-calm group-hover/dot:scale-140 ${c===e.id?`scale-140`:``}`,style:{background:t?a:i}})},e.id)}),(0,K.jsx)(`div`,{className:`pointer-events-none absolute z-5 bg-fg transition-[top,bottom,width,margin,border-radius] duration-150 ease-calm ${R?we?`-top-[3px] bottom-[21px]`:`-top-[2px] bottom-[22px]`:we?`top-1.5 bottom-1.5`:`top-[9px] bottom-[9px]`} ${we?`-ml-[1.5px] w-[3px] rounded-[1.5px]`:`-ml-px w-0.5 rounded-[1px]`} ${z}`,style:{left:xe,translate:`0 ${-pe(R)}px`}}),(0,K.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute z-4 transition-opacity duration-120 ease-calm ${Me?`-top-[3px] bottom-[21px] -ml-px w-0.5 rounded-[1px] bg-amber`:`top-1.5 bottom-1.5 -ml-[1.5px] w-[3px] rounded-[1.5px] bg-fg`} ${je?Me?`opacity-60`:`opacity-30`:`opacity-0`}`,style:{left:Ne,translate:`0 ${-pe(Me)}px`}}),(0,K.jsxs)(`span`,{"aria-hidden":!0,className:`${Te} z-300 text-fg ${Ae?`translate-y-0 opacity-100`:`translate-y-[2px] opacity-0`}`,style:{marginBottom:pe(Ee?.fork?N.find(e=>e.name===Ee.fork):void 0),left:Ee?Ee.fork&&Ee.fork===M?.name?be(M):j(ae(Ee)):De?A(m,De.at):Oe?`calc(100% + 11px)`:void 0},children:[Ee&&(0,K.jsx)(`span`,{className:`block max-w-[220px] truncate`,children:Ee.words}),Oe&&(0,K.jsx)(`span`,{className:`block`,children:Oe.words}),De&&(0,K.jsxs)(`span`,{className:`block max-w-[320px] truncate`,children:[De.note&&(0,K.jsx)(`b`,{className:`mr-[5px] font-semibold text-amber-ink`,children:De.note.number}),De.name]})]}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`${Te} z-299 tabular-nums ${b?`text-fg`:`text-soft`} ${!Ae&&(b||v!==void 0)?`translate-y-0 opacity-100`:`translate-y-[2px] opacity-0`}`,style:{marginBottom:pe(b?R:Me),left:b?xe:Ne},children:il(Math.max(0,b?ye:v?.at??0))})]})]})}function yf(e){let t=id(e.playhead,e=>e.speed),n=e.watching===e.rounds[0]?.number,r=!e.shown||e.shown.fit>=.995,i=e.zoomed&&!r,a=`${Math.round(Math.min(1,i?e.shown.k:e.shown?.fit??1)*100)}%`,o=`rounded-md px-1.5 py-[3px] whitespace-nowrap text-faint transition-colors duration-150 ease-calm`,s=`transition-opacity duration-200 ease-calm group-has-[[data-open=left]]/controls:pointer-events-none group-has-[[data-open=left]]/controls:opacity-0`,c=e.watching===e.rounds.at(-1)?.number,l=`transition-opacity duration-200 ease-calm group-has-[[data-open=right]]/controls:pointer-events-none group-has-[[data-open=right]]/controls:opacity-0`;return(0,K.jsxs)(`div`,{className:`group/controls flex min-w-0 flex-wrap items-center gap-3 pt-[18px] select-none`,children:[(0,K.jsx)(vf,{playhead:e.playhead,dots:e.dots,onDot:e.onDot,marks:e.marks,onMark:e.onMark,live:e.live===`shown`,forks:e.forks,growing:e.growing,lit:e.lit,end:e.end}),(0,K.jsx)(`button`,{"data-speed":!0,className:`${o} ${s} text-center hover:bg-hover hover:text-fg ${t<1?`text-amber-ink`:``}`,"aria-label":`Speed ${xf(t)}`,onClick:()=>e.playhead.slower(),children:(0,K.jsx)(bf,{text:xf(t),order:t,by:t})}),(0,K.jsx)(`button`,{className:`${o} ${s} -ml-1.5 min-w-[46px] text-left ${r?`cursor-default opacity-55`:`hover:bg-hover hover:text-fg ${i?`text-fg`:``}`}`,"aria-label":r?`Shown at actual size`:i?`Fit the recording to the frame`:`Show the recording at actual size`,onClick:()=>!r&&e.onSize(),children:(0,K.jsx)(bf,{text:a,order:parseInt(a),by:i})}),!e.stage&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`h-4 w-px flex-none bg-line ${s}`}),(0,K.jsx)(af,{rounds:e.rounds,watching:e.watching,earlier:e.earlier,arrived:e.arrived,working:e.working,onRound:e.onRound}),(0,K.jsx)(`div`,{"data-views":!0,role:`group`,"aria-label":`Compare`,className:`flex gap-0.5 rounded-lg bg-hover p-0.5 ${l}`,children:[`one`,`side`].map(t=>{let r=t===`one`?`On its own`:`Side by side`,i=n&&t!==`one`,a=n?t===`one`:e.look===t;return(0,K.jsxs)(`button`,{"aria-pressed":a,"aria-label":r,disabled:i,className:`group/look relative inline-flex items-center rounded-md px-2 py-[3px] text-soft transition-colors duration-150 ease-calm enabled:hover:bg-hover enabled:hover:text-fg disabled:cursor-default disabled:text-faint aria-pressed:bg-surface aria-pressed:text-fg aria-pressed:shadow-[0_0_0_1px_var(--line)]`,onClick:()=>e.onLook(t),children:[(0,K.jsx)(`svg`,{viewBox:`0 0 16 12`,"aria-hidden":!0,className:`block h-[1.5em] w-4 fill-none stroke-current stroke-[1.4] group-disabled/look:opacity-55`,children:t===`one`?(0,K.jsx)(`rect`,{x:`1`,y:`1`,width:`14`,height:`10`,rx:`2`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`rect`,{x:`1`,y:`1`,width:`6`,height:`10`,rx:`1.5`}),(0,K.jsx)(`rect`,{x:`9`,y:`1`,width:`6`,height:`10`,rx:`1.5`})]})}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2 translate-y-[2px] rounded-[5px] bg-surface px-[7px] py-px text-[11px] leading-[14px] whitespace-nowrap text-fg opacity-0 shadow-tip transition-[opacity,translate] duration-150 ease-calm group-hover/look:translate-y-0 group-hover/look:opacity-100`,children:i?`Nothing earlier to compare with`:r})]},t)})}),(0,K.jsx)(`span`,{className:`h-4 w-px flex-none bg-line ${l}`}),(0,K.jsxs)(`button`,{disabled:!c,"aria-pressed":!!e.live,className:`group/take relative ${o} ${l} enabled:hover:bg-hover enabled:hover:text-fg disabled:cursor-default disabled:opacity-55 aria-pressed:text-fg ${e.live===`waiting`?`animate-pulse`:``}`,onClick:e.onTakeOver,children:[`Take over`,(0,K.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute right-0 bottom-[calc(100%+5px)] translate-y-[2px] rounded-[5px] bg-surface px-[7px] py-px text-[11px] leading-[14px] whitespace-nowrap text-fg opacity-0 shadow-tip transition-[opacity,translate] duration-150 ease-calm group-hover/take:translate-y-0 group-hover/take:opacity-100`,children:c?e.live===`shown`?`Back to the recording · Esc`:e.live===`waiting`?`Getting it ready…`:`Carry on from here in the app, by hand · T`:`Only the latest round is the app as it is now`})]})]})]})}function bf({text:e,order:t,by:n}){let r=(0,l.useRef)(null),i=(0,l.useRef)({order:t,by:n});return(0,l.useLayoutEffect)(()=>{Xd(r.current,[{text:e,key:`text`}],n===i.current.by?0:t<i.current.order?-1:1),i.current={order:t,by:n}}),(0,K.jsx)(`span`,{ref:r,"aria-hidden":!0})}var xf=e=>e===1?`1×`:e===.5?`½×`:`¼×`,Sf=1500,Cf=`cubic-bezier(0.22, 0.8, 0.24, 1)`;function wf({asked:e,shown:t,resting:n,ref:r}){let[i,a]=(0,l.useState)(),o=!!i&&`since`in i,s=()=>{let t=e();!o&&t&&(a({since:Date.now()}),Yl(t.review,t.filmed,t.name,e=>a(t=>t&&`since`in t?{...t,due:Date.now()+e*1e3}:t)).then(e=>{a(e.length?{problems:e}:{downloaded:!0}),setTimeout(()=>a(e=>e&&!(`since`in e)?void 0:e),e.length?6e3:2500)}))};(0,l.useImperativeHandle)(r,()=>({start:s}));let c=Tf(o?i.due:void 0),u=i?`downloaded`in i?`Downloaded`:`problems`in i?`Couldn’t make the video`:c?(0,K.jsxs)(K.Fragment,{children:[`Downloading in `,(0,K.jsx)(Df,{children:c},c),`…`]}):`Downloading…`:`Download video`,d=(0,l.useRef)(null),f=(0,l.useRef)(0);return(0,l.useLayoutEffect)(()=>{let e=d.current.getBoundingClientRect().width;f.current&&Math.abs(f.current-e)>.5&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches&&d.current.animate([{width:`${f.current}px`},{width:`${e}px`}],{duration:380,easing:Cf}),f.current=e}),(0,K.jsxs)(`button`,{ref:d,className:`relative inline-flex items-center gap-1.5 overflow-hidden rounded-lg px-2.5 py-1.5 whitespace-nowrap text-soft transition-[background-color,color,opacity] duration-150 ease-calm enabled:hover:bg-hover enabled:hover:text-fg disabled:cursor-default aria-busy:text-fg ${t?``:`invisible opacity-0`} ${n?`opacity-32`:``}`,disabled:!t||n,"aria-busy":o,title:i&&`problems`in i?i.problems.join(` `):`The flow as it's shown, as an MP4`,onClick:s,children:[(0,K.jsx)(Ef,{making:i}),i&&`downloaded`in i?au:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,className:`relative size-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M8 2.5v7.5M4.75 7l3.25 3.25L11.25 7M3 13h10`})}),(0,K.jsx)(`span`,{className:`relative tabular-nums`,children:u}),(0,K.jsx)(iu,{className:`relative ml-1`,children:`V`})]})}function Tf(e){let[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return n(void 0);let t=()=>n(t=>{let n=(e-Date.now())/1e3;if(!t&&n*1e3<Sf)return;let r=t?Math.min(t,Math.ceil(n)):Math.ceil(n-.5);return r<1?void 0:r});t();let r=setInterval(t,100);return()=>clearInterval(r)},[e]),t}function Ef({making:e}){let t=(0,l.useRef)(null),n=(0,l.useRef)(0);(0,l.useEffect)(()=>{let r=t.current;if(!e||`problems`in e)return void(n.current=0,r.style.transform=`scaleX(0)`);if(`downloaded`in e)return void(r.style.transform=`scaleX(1)`);let i=0,a=()=>{e.due&&(n.current=Math.max(n.current,Math.min(1,(Date.now()-e.since)/(e.due-e.since)))),r.style.transform=`scaleX(${n.current.toFixed(4)})`,i=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(i)},[e]);let r=!!e&&`since`in e,i=!!e&&`downloaded`in e;return(0,K.jsx)(`span`,{ref:t,"aria-hidden":!0,className:`absolute inset-0 origin-left bg-[color-mix(in_srgb,var(--fg)_8%,transparent)] ${r?`opacity-100`:`opacity-0`} ${i?`[transition:transform_200ms_var(--ease-calm),opacity_500ms_var(--ease-calm)_700ms]`:`transition-opacity duration-500 ease-calm`}`,style:{transform:`scaleX(0)`}})}function Df({children:e}){let t=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{matchMedia(`(prefers-reduced-motion: reduce)`).matches||t.current.animate([{opacity:0,transform:`translateY(3px)`},{opacity:1,transform:`none`}],{duration:280,easing:Cf})},[]),(0,K.jsx)(`span`,{ref:t,className:`inline-block`,children:e})}var Of=e=>({key:`playthrough:${e}:unsent`,shape:e=>Object.fromEntries(Object.entries(e??{}).map(([e,t])=>[e,{...Su,...t}])),empty:e=>Object.values(e).every(e=>!Ou(e)&&!e.unsaved.length),moved:()=>Object.fromEntries(Pf(e,``).map(({round:e,kept:t})=>[e,t]))}),kf=e=>({key:`playthrough:${e}:watched`,shape:e=>Array.isArray(e)?e:[],empty:e=>!e.length,moved:()=>Pf(e,`:watched`).flatMap(({round:e,kept:t})=>Array.isArray(t)?t.map(t=>({flow:t,round:e})):[])}),Af=e=>Lf(Of(e)),jf=e=>Lf(kf(e)),Mf=e=>If(Of(e)),Nf=e=>If(kf(e));function Pf(e,t){let n=RegExp(`^playthrough:${e.replace(/[^\w-]/g,`\\$&`)}:(\\d+)${t}$`);try{return Object.keys(localStorage).flatMap(e=>{let t=n.exec(e)?.[1];if(t===void 0)return[];let r=Ff(e);return localStorage.removeItem(e),r?[{round:Number(t),kept:r}]:[]})}catch{return[]}}function Ff(e){try{return JSON.parse(localStorage.getItem(e)??`null`)}catch{return null}}function If({key:e,shape:t,empty:n,moved:r}){return Ff(e)===null&&Rf(e,r(),n),t(Ff(e))}function Lf(e){let[t,n]=(0,l.useState)(()=>({key:e.key,value:If(e)}));return t.key!==e.key&&n({key:e.key,value:If(e)}),[t.key===e.key?t.value:If(e),t=>n(n=>{let r=t(n.value);return Rf(n.key,r,e.empty),{key:n.key,value:r}})]}function Rf(e,t,n){try{n(t)?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}catch{}}var zf={duration:420,easing:`cubic-bezier(.3,.7,.1,1)`};function Bf(e){return matchMedia(`(prefers-reduced-motion: reduce)`).matches?[]:[...e.querySelectorAll(`[data-picture]`)].flatMap(e=>{let t=e.getBoundingClientRect();return t.width?[{flow:e.dataset.picture,from:e,box:t,copy:Wf(e)}]:[]})}function Vf(e,t){let n=e[0],r=t.getBoundingClientRect();if(!n||!r.width)return 0;let i=Uf(n.from,n.box,n.copy);t.toggleAttribute(`data-flying`,!0);let a={left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,borderRadius:getComputedStyle(t).borderRadius};return i.animate([{},a],{duration:zf.duration,easing:zf.easing,fill:`forwards`}).onfinish=()=>{for(let e of[n.from,t])e.removeAttribute(`data-flying`);i.remove()},zf.duration}function Hf(e,t,n,r){let i=r.getBoundingClientRect();if(matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t.width||!i.width)return;let a=Wf(r),o=Uf(r,t,a);if(e.toggleAttribute(`data-flying`,!0),n){let e=Object.assign(document.createElement(`img`),{src:n,alt:``,className:`absolute inset-0 size-full object-contain`});o.prepend(e),a.animate([{opacity:0},{opacity:0,offset:.5},{opacity:1}],zf.duration)}let s={left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`,borderRadius:getComputedStyle(r).borderRadius};o.animate([{},s],{duration:zf.duration,easing:zf.easing,fill:`forwards`}).onfinish=()=>{for(let t of[r,e])t.removeAttribute(`data-flying`);o.remove()}}function Uf(e,t,n){let r=document.createElement(`div`);return r.className=`pointer-events-none fixed z-60 overflow-hidden bg-paper shadow-frame`,Object.assign(r.style,{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,borderRadius:getComputedStyle(e).borderRadius}),r.append(n),document.body.append(r),e.toggleAttribute(`data-flying`,!0),r}function Wf(e){let t=document.createElement(`div`);t.className=`absolute inset-0`;for(let n of e.children){let e=getComputedStyle(n);if(n.hasAttribute(`data-pointing`)||Number(e.opacity)<.01||e.visibility===`hidden`)continue;let r=n.cloneNode(!0);Object.assign(r.style,{opacity:e.opacity,zIndex:e.zIndex}),t.append(r)}return t}var Gf=e=>[...new Set([e.person,...e.steps.map(e=>e.person)].filter(e=>!!e))];function Kf(e,t,n=[]){let r=e.steps.findLastIndex(e=>e.at<=t),i=e.steps[r];if(!i)return e.person;let a=i.person??e.person,o=e.steps[r-1]?.person??e.person,s=n.find(e=>e>=i.at);return a!==o&&s!==void 0&&t<s?o:a}var q=e=>new Set(e.rounds.flatMap(e=>e.flows.flatMap(Gf))).size>1;function qf(e){let t=Gf(e);return t.length?`as ${t.join(`, then `)}`:``}function Jf({step:e,before:t,className:n}){return(0,K.jsxs)(`button`,{className:`flex h-8 min-w-0 items-center rounded-lg bg-hover px-3 text-xs leading-4 text-fg shadow-[inset_0_0_0_1px_var(--line)] transition-colors duration-150 ease-calm ${n}`,"aria-keyshortcuts":e.final?tu?`Meta+Enter`:`Control+Enter`:`Enter`,onMouseDown:e=>e.preventDefault(),onClick:e.take,children:[t,(0,K.jsx)(`span`,{className:`flex-none`,children:e.words}),e.what&&(0,K.jsx)(`span`,{className:`flex-none text-faint`,children:`·`}),e.what&&(0,K.jsx)(`b`,{className:`min-w-0 truncate font-medium`,children:e.what}),(0,K.jsx)(iu,{className:`ml-auto`,children:e.final?tu?`⌘↵`:`Ctrl ↵`:`↵`})]})}function Yf({step:e,className:t}){return(0,K.jsxs)(`p`,{className:`flex h-8 min-w-0 animate-arrive items-center gap-1.5 text-xs font-medium whitespace-nowrap text-fg ${t}`,role:`status`,children:[(0,K.jsx)(`i`,{className:`mr-0.5 size-1.5 flex-none rounded-full bg-slate ${e.busy?`animate-breathe`:`opacity-45`}`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-none`,children:e.words}),e.what&&(0,K.jsx)(`span`,{className:`flex-none font-normal text-faint`,children:`·`}),e.what&&(0,K.jsx)(`span`,{className:`min-w-0 truncate font-normal text-soft`,children:e.what})]},e.words)}var Xf=e=>{let t=`${e.count} ${e.count===1?`note`:`notes`}`;return{good:`Looks good`,"not saved":`Your note isn’t saved`,"needs you":`${e.count} waiting for your answer`,"to send":`${t} to send`,"with the agent":`With the agent`,"is it good":`Is it good?`,"looked good":`Looked good earlier, changed since`,"to watch":`Not watched yet`}[e.is]},Zf=Object.defineProperty,Qf=(e,t,n)=>t in e?Zf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>Qf(e,typeof t==`symbol`?t:t+``,n),$f=Object.defineProperty,ep=(e,t,n)=>t in e?$f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tp=(e,t,n)=>ep(e,typeof t==`symbol`?t:t+``,n),Y=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(Y||{}),np={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`,`firstChild`,`lastChild`,`nextSibling`,`previousSibling`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},rp={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},ip={},ap={},op=()=>!!globalThis.Zone;function sp(e){if(ip[e])return ip[e];let t=globalThis[e],n=t.prototype,r=e in np?np[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in rp?rp[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!op())return ip[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),ap[e]=()=>r.remove()):r.remove(),ip[e]=a}catch{return n}}var cp={};function lp(e,t,n){let r=cp[e]?.[n];if(r)return r.call(t);let i=sp(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?((cp[e]||(cp[e]={}))[n]=a,a.call(t)):t[n]}var up={};function dp(e,t,n){let r=`${e}.${String(n)}`;if(up[r])return up[r].bind(t);let i=sp(e)[n];return typeof i==`function`?(up[r]=i,i.bind(t)):t[n]}function fp(e){return lp(`Node`,e,`ownerDocument`)}function pp(e){return lp(`Node`,e,`childNodes`)}function mp(e){return lp(`Node`,e,`parentNode`)}function hp(e){return lp(`Node`,e,`parentElement`)}function gp(e){return lp(`Node`,e,`textContent`)}function _p(e){return lp(`Node`,e,`firstChild`)}function vp(e){return lp(`Node`,e,`lastChild`)}function yp(e){return lp(`Node`,e,`nextSibling`)}function bp(e){return lp(`Node`,e,`previousSibling`)}function xp(e,t){return dp(`Node`,e,`contains`)(t)}function Sp(e){return dp(`Node`,e,`getRootNode`)()}function Cp(e){return!e||!(`host`in e)?null:lp(`ShadowRoot`,e,`host`)}function wp(e){return e.styleSheets}function Tp(e){return!e||!(`shadowRoot`in e)?null:lp(`Element`,e,`shadowRoot`)}function Ep(e,t){return lp(`Element`,e,`querySelector`)(t)}function Dp(e,t){return lp(`Element`,e,`querySelectorAll`)(t)}function Op(){return[sp(`MutationObserver`).constructor,ap.MutationObserver??(()=>{})]}var kp=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(kp=()=>new Date().getTime());function Ap(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var jp={ownerDocument:fp,childNodes:pp,parentNode:mp,parentElement:hp,textContent:gp,firstChild:_p,lastChild:vp,nextSibling:yp,previousSibling:bp,contains:xp,getRootNode:Sp,host:Cp,styleSheets:wp,shadowRoot:Tp,querySelector:Ep,querySelectorAll:Dp,nowTimestamp:kp,mutationObserverCtor:Op,patch:Ap};function Mp(e){return e.nodeType===e.ELEMENT_NODE}function Np(e){let t=e&&`host`in e&&`mode`in e&&jp.host(e)||null;return!!(t&&`shadowRoot`in t&&jp.shadowRoot(t)===e)}function Pp(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function Fp(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function Ip(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function Lp(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),Fp(Array.from(t,e=>Rp(e,n)).join(``))}catch{return null}}function Rp(e,t){if(Bp(e)){let t;try{t=Lp(e.styleSheet)||Ip(e)}catch{t=e.cssText}return e.styleSheet.href?nm(t,e.styleSheet.href):t}{let n=e.cssText;return Vp(e)&&e.selectorText.includes(`:`)&&(n=zp(n)),t?nm(n,t):n}}function zp(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function Bp(e){return`styleSheet`in e}function Vp(e){return`selectorText`in e}var Hp=class{constructor(){tp(this,`idNodeMap`,new Map),tp(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Up(){return new Hp}function Wp({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:a}){let o=i||``,s=r&&Gp(r);return(t[n.toLowerCase()]||s&&t[s])&&(o=a?a(o,e):`*`.repeat(o.length)),o}function Gp(e){return e.toLowerCase()}var Kp=`__rrweb_original__`;function qp(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=Kp in i?i[Kp]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function Jp(e,t){return!e||!t||e.type!==t.type?!1:e.type===Y.Document?e.compatMode===t.compatMode:e.type===Y.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Y.Comment||e.type===Y.Text||e.type===Y.CDATA?e.textContent===t.textContent:e.type===Y.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock}function Yp(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?Gp(t):null}function Xp(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}function Zp(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var Qp=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$p=/^(?:[a-z+]+:)?\/\//i,em=/^www\..*/i,tm=/^(data:)([^,]*),(.*)/i;function nm(e,t){return(e||``).replace(Qp,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if($p.test(s)||em.test(s)||tm.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${Zp(t)+s}${c})`;let l=s.split(`#`)[0],u=s.substring(l.length),d=t.split(`#`)[0].split(`/`),f=l.split(`/`);d.pop();for(let e of f)if(e===`.`)continue;else e===`..`?d.pop():d.push(e);return`url(${c}${d.join(`/`)}${u}${c})`})}var rm=`(?:/\\*[^*]*\\*/)|[\\s;]`,im=RegExp(`${rm}|\\b(0)px?`,`g`),am=new RegExp(rm,`g`);function om(e,t=!1){return t?e.replace(am,``):e.replace(im,`$1`)}function sm(e,t,n=!1){let r=Array.from(t.childNodes),i=[],a=0;if(r.length>1&&e&&typeof e==`string`){let t=om(e,n),o=t.length/e.length;for(let s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent==`string`){let c=om(r[s].textContent,n),l=3;for(;l<c.length&&(c[l].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,l),1)!==-1);l++);for(;l<c.length;l++){let u=c.substring(0,l),d=t.split(u),f=-1;if(d.length===2)f=d[0].length;else if(d.length>2&&d[0]===``&&r[s-1].textContent!==``)f=t.indexOf(u,1);else if(d.length===1){if(u=u.substring(0,u.length-1),d=t.split(u),d.length<=1)return i.push(e),i;l=101}else l===c.length-1&&(f=t.indexOf(u));if(d.length>=2&&l>100){let e=r[s-1].textContent;if(e&&typeof e==`string`){let n=om(e).length;f=t.indexOf(u,n)}f===-1&&(f=d[0].length)}if(f!==-1){let s=Math.floor(f/o);for(;s>0&&s<e.length;){if(a+=1,a>50*r.length)return i.push(e),i;let c=om(e.substring(0,s),n);if(c.length===f){i.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length<f?s+=Math.max(1,Math.floor((f-c.length)/o)):s-=Math.max(1,Math.floor((c.length-f)*o))}break}}}}return i.push(e),i}function cm(e,t){return sm(e,t).join(`/* rr_split */`)}var lm=1,um=RegExp(`[^a-z0-9-_:]`),dm=-2;function fm(){return lm++}function pm(e){if(e instanceof HTMLFormElement)return`form`;let t=Gp(e.tagName);return um.test(t)?`div`:t}var mm,hm,gm=/^[^ \t\n\r\u000c]+/,_m=/^[, \t\n\r\u000c]+/;function vm(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(_m),!(n>=t.length);){let a=r(gm);if(a.slice(-1)===`,`)a=bm(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=bm(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var ym=new WeakMap;function bm(e,t){return!t||t.trim()===``?t:Sm(e,t)}function xm(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Sm(e,t){let n=ym.get(e);if(n||(n=e.createElement(`a`),ym.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Cm(e,t,n,r){return r&&(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&[`table`,`td`,`th`].includes(t)?bm(e,r):n===`srcset`?vm(e,r):n===`style`?nm(r,Sm(e)):t===`object`&&n===`data`?bm(e,r):r)}function wm(e,t,n){return[`video`,`audio`].includes(e)&&Gp(t)===`autoplay`}function Tm(e,t,n){try{if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function Em(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Em(jp.parentNode(e),t,n):!1;for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return n?Em(jp.parentNode(e),t,n):!1}function Dm(e,t,n,r){let i;if(Mp(e)){if(i=e,!jp.childNodes(i).length)return!1}else if(jp.parentElement(e)===null)return!1;else i=jp.parentElement(e);try{if(typeof t==`string`){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Em(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function Om(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=setTimeout(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return setTimeout(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function km(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=setTimeout(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(a),r=!0,t()})}function Am(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:o,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:h=!1,cssCaptured:g=!1}=t,_=jm(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:Y.Document,childNodes:[]}:{type:Y.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:Y.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return Nm(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:h,rootId:_});case e.TEXT_NODE:return Mm(e,{doc:n,needsMask:o,maskTextFn:l,rootId:_,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Y.CDATA,textContent:``,rootId:_};case e.COMMENT_NODE:return{type:Y.Comment,textContent:jp.textContent(e)||``,rootId:_};default:return!1}}function jm(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function Mm(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:a}=t,o=jp.parentNode(e),s=o&&o.tagName,c=``,l=s===`STYLE`||void 0,u=s===`SCRIPT`||void 0;return u?c=`SCRIPT_PLACEHOLDER`:a||(c=jp.textContent(e),l&&c&&(c=nm(c,Sm(t.doc)))),!l&&!u&&c&&n&&(c=r?r(c,jp.parentElement(e)):c.replace(/[\S]/g,`*`)),{type:Y.Text,textContent:c||``,rootId:i}}function Nm(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:o={},maskInputFn:s,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f=!1,rootId:p}=t,m=Tm(e,r,i),h=pm(e),g={},_=e.attributes.length;for(let t=0;t<_;t++){let r=e.attributes[t];wm(h,r.name,r.value)||(g[r.name]=Cm(n,h,Gp(r.name),r.value))}if(h===`link`&&a){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=Lp(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if(h===`style`&&e.sheet){let t=Lp(e.sheet);t&&(e.childNodes.length>1&&(t=cm(t,e)),g._cssText=t)}if([`input`,`textarea`,`select`].includes(h)){let t=e.value,n=e.checked;g.type!==`radio`&&g.type!==`checkbox`&&g.type!==`submit`&&g.type!==`button`&&t?g.value=Wp({element:e,type:Yp(e),tagName:h,value:t,maskInputOptions:o,maskInputFn:s}):n&&(g.checked=n)}if(h===`option`&&(e.selected&&!o.select?g.selected=!0:delete g.selected),h===`dialog`&&e.open&&(g.rr_open_mode=e.matches(`dialog:modal`)?`modal`:`non-modal`),h===`canvas`&&u){if(e.__context===`2d`)qp(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!(`__context`in e)){let t=e.toDataURL(c.type,c.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(g.rr_dataURL=t)}}if(h===`img`&&l){mm||(mm=n.createElement(`canvas`),hm=mm.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{mm.width=t.naturalWidth,mm.height=t.naturalHeight,hm.drawImage(t,0,0),g.rr_dataURL=mm.toDataURL(c.type,c.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?g.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if([`audio`,`video`].includes(h)){let t=g;t.rr_mediaState=e.paused?`paused`:`played`,t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){let{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}h===`iframe`&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(h)&&(v=!0)}catch{}return{type:Y.Element,tagName:h,attributes:g,childNodes:[],isSVG:xm(e)||void 0,needBlock:m,rootId:p,isCustom:v}}function Pm(e){return e==null?``:e.toLowerCase()}function Fm(e){return e===!0||e===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e===`all`,headMetaDescKeywords:e===`all`,headTitleMutations:e===`all`}:e||{}}function Im(e,t){return!!(t.comment&&e.type===Y.Comment||e.type===Y.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`&&e.attributes.as===`script`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&Xp(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(Pm(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Pm(e.attributes.name)===`application-name`||Pm(e.attributes.rel)===`icon`||Pm(e.attributes.rel)===`apple-touch-icon`||Pm(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&Pm(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Pm(e.attributes.property).match(/^(og|twitter|fb):/)||Pm(e.attributes.name).match(/^(og|twitter):/)||Pm(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(Pm(e.attributes.name)===`robots`||Pm(e.attributes.name)===`googlebot`||Pm(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(Pm(e.attributes.name)===`author`||Pm(e.attributes.name)===`generator`||Pm(e.attributes.name)===`framework`||Pm(e.attributes.name)===`publisher`||Pm(e.attributes.name)===`progid`||Pm(e.attributes.property).match(/^article:/)||Pm(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Pm(e.attributes.name)===`google-site-verification`||Pm(e.attributes.name)===`yandex-verification`||Pm(e.attributes.name)===`csrf-token`||Pm(e.attributes.name)===`p:domain_verify`||Pm(e.attributes.name)===`verify-v1`||Pm(e.attributes.name)===`verification`||Pm(e.attributes.name)===`shopify-checkout-api-token`))))}function Lm(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m={},inlineImages:h=!1,recordCanvas:g=!1,onSerialize:_,onIframeLoad:v,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:C=!1,cssCaptured:w=!1}=t,{needsMask:T}=t,{preserveWhiteSpace:E=!0}=t;T||=Dm(e,o,s,T===void 0);let D=Am(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,dataURLOptions:m,inlineImages:h,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:C,cssCaptured:w});if(!D)return console.warn(e,`not serialized`),null;let O;O=r.hasNode(e)?r.getId(e):Im(D,p)||!E&&D.type===Y.Text&&!D.textContent.replace(/^\s+|\s+$/gm,``).length?dm:fm();let k=Object.assign(D,{id:O});if(r.add(e,k),O===dm)return null;_&&_(e);let A=!c;if(k.type===Y.Element){A&&=!k.needBlock,delete k.needBlock;let t=jp.shadowRoot(e);t&&Pp(t)&&(k.isShadowHost=!0)}if((k.type===Y.Document||k.type===Y.Element)&&A){p.headWhitespace&&k.type===Y.Element&&k.tagName===`head`&&(E=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:o,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:E,onSerialize:_,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:x,keepIframeSrcFn:S,cssCaptured:!1};if(k.type!==Y.Element||k.tagName!==`textarea`||k.attributes.value===void 0){k.type===Y.Element&&k.attributes._cssText!==void 0&&typeof k.attributes._cssText==`string`&&(t.cssCaptured=!0);for(let n of Array.from(jp.childNodes(e))){let e=Lm(n,t);e&&k.childNodes.push(e)}}let C=null;if(Mp(e)&&(C=jp.shadowRoot(e)))for(let e of Array.from(jp.childNodes(C))){let n=Lm(e,t);n&&(Pp(C)&&(n.isShadow=!0),k.childNodes.push(n))}}let j=jp.parentNode(e);return j&&Np(j)&&Pp(j)&&(k.isShadow=!0),k.type===Y.Element&&k.tagName===`iframe`&&Om(e,()=>{let t=e.contentDocument;if(t&&v){let n=Lm(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:E,onSerialize:_,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:x,keepIframeSrcFn:S});n&&v(e,n)}},y),k.type===Y.Element&&k.tagName===`link`&&typeof k.attributes.rel==`string`&&(k.attributes.rel===`stylesheet`||k.attributes.rel===`preload`&&typeof k.attributes.href==`string`&&Xp(k.attributes.href)===`css`)&&km(e,()=>{if(b){let t=Lm(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:E,onSerialize:_,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:x,keepIframeSrcFn:S});t&&b(e,t)}},x),k}function Rm(e,t){let{mirror:n=new Hp,blockClass:r=`rr-block`,blockSelector:i=null,maskTextClass:a=`rr-mask`,maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:f,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x=()=>!1}=t;return Lm(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:Fm(p),dataURLOptions:m,inlineImages:c,recordCanvas:l,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x,newlyAddedElement:!1})}var zm=RegExp(`(max|min)-device-(width|height)`,`g`),Bm={postcssPlugin:`postcss-custom-selectors`,prepare(){return{postcssPlugin:`postcss-custom-selectors`,AtRule:function(e){e.params.match(zm)&&(e.params=e.params.replace(zm,`$1-$2`))}}}},Vm={postcssPlugin:`postcss-hover-classes`,prepare:function(){let e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(e){e.includes(`:hover`)&&(t.selector+=`,
|
|
65
|
-
`+e.replace(/:hover/g,`.\\:hover`))}))}}}};function Hm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Um(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Wm={exports:{}},Gm;function Km(){if(Gm)return Wm.exports;Gm=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Wm.exports=t(),Wm.exports.createColors=t,Wm.exports}var qm=Um(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),Jm,Ym;function Xm(){if(Ym)return Jm;Ym=1;let e=Km(),t=qm;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
|
|
66
|
-
`+t+c(`^`)}return` `+l(r)+e}).join(`
|
|
67
|
-
`)}toString(){let e=this.showSourceCode();return e&&=`
|
|
68
|
-
|
|
69
|
-
`+e+`
|
|
70
|
-
`,this.name+`: `+this.message+e}}return Jm=n,n.default=n,Jm}var Zm={},Qm;function $m(){return Qm||(Qm=1,Zm.isClean=Symbol(`isClean`),Zm.my=Symbol(`my`)),Zm}var eh,th;function nh(){if(th)return eh;th=1;let e={after:`
|
|
71
|
-
`,beforeClose:`
|
|
72
|
-
`,beforeComment:`
|
|
73
|
-
`,beforeDecl:`
|
|
74
|
-
`,beforeOpen:` `,beforeRule:`
|
|
75
|
-
`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:` `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
|
|
76
|
-
`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
|
|
77
|
-
`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
|
|
78
|
-
`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
|
|
79
|
-
`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
|
|
80
|
-
`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
|
|
81
|
-
`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return eh=n,n.default=n,eh}var rh,ih;function ah(){if(ih)return rh;ih=1;let e=nh();function t(t,n){new e(n).stringify(t)}return rh=t,t.default=t,rh}var oh,sh;function ch(){if(sh)return oh;sh=1;let{isClean:e,my:t}=$m(),n=Xm(),r=nh(),i=ah();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
|
|
82
|
-
`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return oh=o,o.default=o,oh}var lh,uh;function dh(){if(uh)return lh;uh=1;let e=ch();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return lh=t,t.default=t,lh}var fh,ph;function mh(){return ph||(ph=1,fh={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}}),fh}var hh,gh;function _h(){if(gh)return hh;gh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qm,{existsSync:n,readFileSync:r}=qm,{dirname:i,join:a}=qm;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return hh=s,s.default=s,hh}var vh,yh;function bh(){if(yh)return vh;yh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qm,{fileURLToPath:n,pathToFileURL:r}=qm,{isAbsolute:i,resolve:a}=qm,{nanoid:o}=mh(),s=qm,c=Xm(),l=_h(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===``?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(this.file=!f||/^\w+:\/\//.test(t.from)||i(t.from)?t.from:a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
|
|
83
|
-
`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`){if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`)}let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return vh=p,p.default=p,s&&s.registerInput&&s.registerInput(p),vh}var xh,Sh;function Ch(){if(Sh)return xh;Sh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qm,{dirname:n,relative:r,resolve:i,sep:a}=qm,{pathToFileURL:o}=qm,s=bh(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
|
|
84
|
-
`;this.css.includes(`\r
|
|
85
|
-
`)&&(t=`\r
|
|
86
|
-
`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&(a.sourcesContent=null)):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
|
|
87
|
-
`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps){if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return xh=u,xh}var wh,Th;function Eh(){if(Th)return wh;Th=1;let e=ch();class t extends e{constructor(e){super(e),this.type=`comment`}}return wh=t,t.default=t,wh}var Dh,Oh;function kh(){if(Oh)return Dh;Oh=1;let{isClean:e,my:t}=$m(),n=dh(),r=Eh(),i=ch(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty()),!0}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},Dh=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Dh}var Ah,jh;function Mh(){if(jh)return Ah;jh=1;let e=kh(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Ah=r,r.default=r,Ah}var Nh,Ph;function Fh(){if(Ph)return Nh;Ph=1;let e={};return Nh=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},Nh}var Ih,Lh;function Rh(){if(Lh)return Ih;Lh=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Ih=e,e.default=e,Ih}var zh,Bh;function Vh(){if(Bh)return zh;Bh=1;let e=Rh();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return zh=t,t.default=t,zh}var Hh,Uh;function Wh(){if(Uh)return Hh;Uh=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Hh=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1){if(s||a){l=y;break}C(`bracket`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1){if(s||a){l=y+1;break}C(`string`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l)}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},Hh}var Gh,Kh;function qh(){if(Kh)return Gh;Kh=1;let e=kh();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Gh=t,t.default=t,e.registerAtRule(t),Gh}var Jh,Yh;function Xh(){if(Yh)return Jh;Yh=1;let e=kh(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Jh=r,r.default=r,e.registerRoot(r),Jh}var Zh,Qh;function $h(){if(Qh)return Zh;Qh=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
|
|
88
|
-
`,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return Zh=e,e.default=e,Zh}var eg,tg;function ng(){if(tg)return eg;tg=1;let e=kh(),t=$h();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return eg=n,n.default=n,e.registerRule(n),eg}var rg,ig;function ag(){if(ig)return rg;ig=1;let e=dh(),t=Wh(),n=Eh(),r=qh(),i=Xh(),a=ng(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0){if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}if(n===`{`){s=!0;break}if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}c.push(e)}else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`){if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a}i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;){if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1]}(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],c===`space`||c===`comment`);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0){if(n===`;`){if(r){this.decl(s,o);return}break}if(n===`{`){this.rule(s);return}if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}n===`:`&&(r=!0)}else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],c===`space`||c===`comment`);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`||t===`comment`);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],t===`space`||t===`comment`);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return rg=c,rg}var og,sg;function cg(){if(sg)return og;sg=1;let e=kh(),t=ag(),n=bh();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return og=r,r.default=r,e.registerParse(r),og}var lg,ug;function dg(){if(ug)return lg;ug=1;let{isClean:e,my:t}=$m(),n=Ch(),r=ah(),i=kh(),a=Mh();Fh();let o=Vh(),s=cg(),c=Xh(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n]){if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit){if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},lg=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),lg}var fg,pg;function mg(){if(pg)return fg;pg=1;let e=Ch(),t=ah();Fh();let n=cg(),r=Vh();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o,s=t;this.result=new r(this._processor,o,this._opts),this.result.css=i;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let l=new e(s,o,this._opts,i);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return fg=i,i.default=i,fg}var hg,gg;function _g(){if(gg)return hg;gg=1;let e=mg(),t=dg(),n=Mh(),r=Xh();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n!=`object`||!n.parse&&!n.stringify)throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return hg=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),hg}var vg,yg;function bg(){if(yg)return vg;yg=1;let e=dh(),t=_h(),n=Eh(),r=qh(),i=bh(),a=Xh(),o=ng();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return vg=s,s.default=s,vg}var xg,Sg;function Cg(){if(Sg)return xg;Sg=1;let e=Xm(),t=dh(),n=dg(),r=kh(),i=_g(),a=ah(),o=bg(),s=Mh(),c=Rh(),l=Eh(),u=qh(),d=Vh(),f=bh(),p=cg(),m=$h(),h=ng(),g=Xh(),_=ch();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
89
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
90
|
-
https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),xg=v,v.default=v,xg}var wg=Hm(Cg());wg.stringify,wg.fromJSON,wg.plugin,wg.parse,wg.list,wg.document,wg.comment,wg.atRule,wg.rule,wg.decl,wg.root,wg.CssSyntaxError,wg.Declaration,wg.Container,wg.Processor,wg.Document,wg.Comment,wg.Warning,wg.AtRule,wg.Result,wg.Input,wg.Rule,wg.Root,wg.Node;var Tg={script:`noscript`,altglyph:`altGlyph`,altglyphdef:`altGlyphDef`,altglyphitem:`altGlyphItem`,animatecolor:`animateColor`,animatemotion:`animateMotion`,animatetransform:`animateTransform`,clippath:`clipPath`,feblend:`feBlend`,fecolormatrix:`feColorMatrix`,fecomponenttransfer:`feComponentTransfer`,fecomposite:`feComposite`,feconvolvematrix:`feConvolveMatrix`,fediffuselighting:`feDiffuseLighting`,fedisplacementmap:`feDisplacementMap`,fedistantlight:`feDistantLight`,fedropshadow:`feDropShadow`,feflood:`feFlood`,fefunca:`feFuncA`,fefuncb:`feFuncB`,fefuncg:`feFuncG`,fefuncr:`feFuncR`,fegaussianblur:`feGaussianBlur`,feimage:`feImage`,femerge:`feMerge`,femergenode:`feMergeNode`,femorphology:`feMorphology`,feoffset:`feOffset`,fepointlight:`fePointLight`,fespecularlighting:`feSpecularLighting`,fespotlight:`feSpotLight`,fetile:`feTile`,feturbulence:`feTurbulence`,foreignobject:`foreignObject`,glyphref:`glyphRef`,lineargradient:`linearGradient`,radialgradient:`radialGradient`};function Eg(e){let t=Tg[e.tagName]?Tg[e.tagName]:e.tagName;return t===`link`&&e.attributes._cssText&&(t=`style`),t}function Dg(e,t){let n=t?.stylesWithHoverClass.get(e);if(n)return n;let r=e;try{r=wg([Bm,Vm]).process(e).css}catch(e){console.warn(`Failed to adapt css for replay`,e)}return t?.stylesWithHoverClass.set(e,r),r}function Og(){return{stylesWithHoverClass:new Map}}var kg=`rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.`,Ag=`rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.`,jg=new WeakSet;function Mg(e){if(!e||e.tagName!==`IFRAME`||!(`sandbox`in e))return!1;let t=Array.from(e.sandbox);return t.length===1&&t[0]===`allow-same-origin`}function Ng(e){if(e.UNSAFE_allowUnprotectedRebuild)return;let t=e.doc.defaultView;if(t&&!(jg.has(e.doc)&&Mg(t.frameElement)))throw Error(kg)}function Pg(e,t,n,r){let i=[];for(let t of e.childNodes)t.type===Y.Text&&i.push(t);let a=t.split(`/* rr_split */`);for(;a.length>1&&a.length>i.length;)a.splice(-2,2,a.slice(-2).join(``));let o=``;n&&(o=Dg(a.join(``),r));let s=0,c=-1;for(let e=0;e<i.length&&e!==a.length;e++){let t=i[e],r=a[e],l=e<a.length-1?a[e+1]:null;if(n&&l){let e=s,t=l.length;t=Math.min(t,30);let n=!1;for(;t>2;t--){let r=l.substring(0,t),i=o.substring(s).indexOf(r);if(n=i!==-1,n){e+=i;break}}n||(e+=r.length),r=o.substring(s,e),s=e}else n&&(r=o.substring(s));c!==-1&&(r=r.substring(c)),l&&(c!==-1||r.endsWith(`0p`)&&l.startsWith(`x`))&&(c=l.indexOf(`}`),c!==-1&&(c+=1,r+=l.substring(0,c))),t.textContent=r}}function Fg(e,t,n,r){let{doc:i,hackCss:a,cache:o}=r;e.childNodes.length?Pg(e,n,a,o):(a&&(n=Dg(n,o)),t.appendChild(i.createTextNode(n)))}function Ig(e,t){let{doc:n,hackCss:r,cache:i}=t;switch(e.type){case Y.Document:return n.implementation.createDocument(null,``,null);case Y.DocumentType:return n.implementation.createDocumentType(e.name||`html`,e.publicId,e.systemId);case Y.Element:{let r=Eg(e),i;e.isSVG?i=n.createElementNS(`http://www.w3.org/2000/svg`,r):(e.isCustom&&n.defaultView?.customElements&&!n.defaultView.customElements.get(e.tagName)&&n.defaultView.customElements.define(e.tagName,class extends n.defaultView.HTMLElement{}),i=n.createElement(r));let a={};for(let o in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,o))continue;let s=e.attributes[o];if((r!==`option`||o!==`selected`||s!==!1)&&s!==null){if(s===!0&&(s=``),o.startsWith(`rr_`))a[o]=s;else{if(typeof s==`string`){if(r===`style`&&o===`_cssText`){Fg(e,i,s,t);continue}if(r===`textarea`&&o===`value`){i.appendChild(n.createTextNode(s)),e.childNodes=[];continue}}try{if(e.isSVG&&o===`xlink:href`)i.setAttributeNS(`http://www.w3.org/1999/xlink`,o,s.toString());else if(o===`onload`||o===`onclick`||o.substring(0,7)===`onmouse`)i.setAttribute(`_`+o,s.toString());else if(r===`meta`&&e.attributes[`http-equiv`]===`Content-Security-Policy`&&o===`content`){i.setAttribute(`csp-content`,s.toString());continue}else r===`link`&&(e.attributes.rel===`preload`&&e.attributes.as===`script`||e.attributes.rel===`modulepreload`)||r===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&Xp(e.attributes.href)===`js`||(r===`img`&&e.attributes.srcset&&e.attributes.rr_dataURL?i.setAttribute(`rrweb-original-srcset`,e.attributes.srcset):i.setAttribute(o,s.toString()))}catch{}}}}for(let t in a){let o=a[t];if(r===`canvas`&&t===`rr_dataURL`){let e=n.createElement(`img`);e.onload=()=>{let t=i.getContext(`2d`);t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),i.RRNodeType&&(i.rr_dataURL=o.toString())}else if(r===`img`&&t===`rr_dataURL`){let t=i;t.currentSrc.startsWith(`data:`)||(t.setAttribute(`rrweb-original-src`,e.attributes.src),t.src=o.toString())}if(t===`rr_width`)i.style.setProperty(`width`,o.toString());else if(t===`rr_height`)i.style.setProperty(`height`,o.toString());else if(t===`rr_mediaCurrentTime`&&typeof o==`number`)i.currentTime=o;else if(t===`rr_mediaState`)switch(o){case`played`:i.play().catch(e=>console.warn(`media playback error`,e));break;case`paused`:i.pause()}else t===`rr_mediaPlaybackRate`&&typeof o==`number`?i.playbackRate=o:t===`rr_mediaMuted`&&typeof o==`boolean`?i.muted=o:t===`rr_mediaLoop`&&typeof o==`boolean`?i.loop=o:t===`rr_mediaVolume`&&typeof o==`number`?i.volume=o:t===`rr_open_mode`&&i.setAttribute(`rr_open_mode`,o)}if(e.isShadowHost){if(!i.shadowRoot)i.attachShadow({mode:`open`});else for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild)}return(r===`input`||r===`textarea`)&&i.setAttribute(`autocomplete`,`off`),i}case Y.Text:return e.isStyle&&r?n.createTextNode(Dg(e.textContent,i)):n.createTextNode(e.textContent);case Y.CDATA:return n.createCDATASection(e.textContent);case Y.Comment:return n.createComment(e.textContent);default:return null}}function Lg(e,t){let{doc:n,mirror:r,skipChild:i=!1,hackCss:a=!0,afterAppend:o,cache:s}=t;if(r.has(e.id)){let t=r.getNode(e.id);if(Jp(r.getMeta(t),e))return r.getNode(e.id)}let c=Ig(e,{doc:n,hackCss:a,cache:s});if(!c)return null;if(e.rootId&&r.getNode(e.rootId)!==n&&r.replace(e.rootId,n),e.type===Y.Document&&(n.close(),n.open(),e.compatMode===`BackCompat`&&e.childNodes&&e.childNodes[0].type!==Y.DocumentType&&(e.childNodes[0].type===Y.Element&&`xmlns`in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns===`http://www.w3.org/1999/xhtml`?n.write(`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">`):n.write(`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">`)),c=n),r.add(c,e),(e.type===Y.Document||e.type===Y.Element)&&!i)for(let t of e.childNodes){let i=Lg(t,{doc:n,mirror:r,skipChild:!1,hackCss:a,afterAppend:o,cache:s});if(!i)console.warn(`Failed to rebuild`,t);else{if(t.isShadow&&Mp(c)&&c.shadowRoot)c.shadowRoot.appendChild(i);else if(e.type===Y.Document&&t.type==Y.Element){let e=i,t=null;e.childNodes.forEach(e=>{e.nodeName===`BODY`&&(t=e)}),t?(e.removeChild(t),c.appendChild(i),e.appendChild(t)):c.appendChild(i)}else c.appendChild(i);o&&o(i,t.id)}}return c}function Rg(e,t){function n(e){t(e)}for(let t of e.getIds())e.has(t)&&n(e.getNode(t))}function zg(e,t){let n=t.getMeta(e);if(n?.type!==Y.Element)return;let r=e;for(let e in n.attributes){if(!(Object.prototype.hasOwnProperty.call(n.attributes,e)&&e.startsWith(`rr_`)))continue;let t=n.attributes[e];e===`rr_scrollLeft`&&(r.scrollLeft=t),e===`rr_scrollTop`&&(r.scrollTop=t)}}function Bg(e,t){Ng(t);let{doc:n,onVisit:r,hackCss:i=!0,afterAppend:a,cache:o,mirror:s=new Hp}=t,c=Lg(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:o});return Rg(s,e=>{r&&r(e),zg(e,s)}),c}function Vg(e){var t;if(!e.root.isConnected)throw Error(Ag);let n=e.root.ownerDocument.createElement(`iframe`);for(let[t,r]of Object.entries(e.iframeAttributes||{}))t!==`sandbox`&&n.setAttribute(t,r);n.setAttribute(`sandbox`,`allow-same-origin`),e.root.appendChild(n);let r=n.contentDocument;if(!r||!n.contentWindow)throw(t=n.parentNode)==null||t.removeChild(n),Error(Ag);return jg.add(r),n}var Hg=Object.defineProperty,Ug=(e,t,n)=>t in e?Hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t,n)=>Ug(e,typeof t==`symbol`?t:t+``,n),Wg=Object.defineProperty,Gg=(e,t,n)=>t in e?Wg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kg=(e,t,n)=>Gg(e,typeof t==`symbol`?t:t+``,n);Date.now().toString();var qg=class{constructor(){Kg(this,`idNodeMap`,new Map),Kg(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Jg(){return new qg}function Yg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Xg(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Zg={exports:{}},Qg;function $g(){if(Qg)return Zg.exports;Qg=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Zg.exports=t(),Zg.exports.createColors=t,Zg.exports}var e_=Xg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),t_,n_;function r_(){if(n_)return t_;n_=1;let e=$g(),t=e_;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
|
|
91
|
-
`+t+c(`^`)}return` `+l(r)+e}).join(`
|
|
92
|
-
`)}toString(){let e=this.showSourceCode();return e&&=`
|
|
93
|
-
|
|
94
|
-
`+e+`
|
|
95
|
-
`,this.name+`: `+this.message+e}}return t_=n,n.default=n,t_}var i_={},a_;function o_(){return a_||(a_=1,i_.isClean=Symbol(`isClean`),i_.my=Symbol(`my`)),i_}var s_,c_;function l_(){if(c_)return s_;c_=1;let e={after:`
|
|
96
|
-
`,beforeClose:`
|
|
97
|
-
`,beforeComment:`
|
|
98
|
-
`,beforeDecl:`
|
|
99
|
-
`,beforeOpen:` `,beforeRule:`
|
|
100
|
-
`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:` `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
|
|
101
|
-
`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
|
|
102
|
-
`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
|
|
103
|
-
`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
|
|
104
|
-
`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
|
|
105
|
-
`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
|
|
106
|
-
`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return s_=n,n.default=n,s_}var u_,d_;function f_(){if(d_)return u_;d_=1;let e=l_();function t(t,n){new e(n).stringify(t)}return u_=t,t.default=t,u_}var p_,m_;function h_(){if(m_)return p_;m_=1;let{isClean:e,my:t}=o_(),n=r_(),r=l_(),i=f_();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
|
|
107
|
-
`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return p_=o,o.default=o,p_}var g_,__;function v_(){if(__)return g_;__=1;let e=h_();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return g_=t,t.default=t,g_}var y_,b_;function x_(){return b_||(b_=1,y_={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}}),y_}var S_,C_;function w_(){if(C_)return S_;C_=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=e_,{existsSync:n,readFileSync:r}=e_,{dirname:i,join:a}=e_;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return S_=s,s.default=s,S_}var T_,E_;function D_(){if(E_)return T_;E_=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=e_,{fileURLToPath:n,pathToFileURL:r}=e_,{isAbsolute:i,resolve:a}=e_,{nanoid:o}=x_(),s=e_,c=r_(),l=w_(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===``?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(this.file=!f||/^\w+:\/\//.test(t.from)||i(t.from)?t.from:a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
|
|
108
|
-
`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`){if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`)}let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return T_=p,p.default=p,s&&s.registerInput&&s.registerInput(p),T_}var O_,k_;function A_(){if(k_)return O_;k_=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=e_,{dirname:n,relative:r,resolve:i,sep:a}=e_,{pathToFileURL:o}=e_,s=D_(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
|
|
109
|
-
`;this.css.includes(`\r
|
|
110
|
-
`)&&(t=`\r
|
|
111
|
-
`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&(a.sourcesContent=null)):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
|
|
112
|
-
`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps){if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return O_=u,O_}var j_,M_;function N_(){if(M_)return j_;M_=1;let e=h_();class t extends e{constructor(e){super(e),this.type=`comment`}}return j_=t,t.default=t,j_}var P_,F_;function I_(){if(F_)return P_;F_=1;let{isClean:e,my:t}=o_(),n=v_(),r=N_(),i=h_(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty()),!0}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},P_=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},P_}var L_,R_;function z_(){if(R_)return L_;R_=1;let e=I_(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},L_=r,r.default=r,L_}var B_,V_;function H_(){if(V_)return B_;V_=1;let e={};return B_=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},B_}var U_,W_;function G_(){if(W_)return U_;W_=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return U_=e,e.default=e,U_}var K_,q_;function J_(){if(q_)return K_;q_=1;let e=G_();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return K_=t,t.default=t,K_}var Y_,X_;function Z_(){if(X_)return Y_;X_=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Y_=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1){if(s||a){l=y;break}C(`bracket`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1){if(s||a){l=y+1;break}C(`string`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l)}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},Y_}var Q_,$_;function ev(){if($_)return Q_;$_=1;let e=I_();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Q_=t,t.default=t,e.registerAtRule(t),Q_}var tv,nv;function rv(){if(nv)return tv;nv=1;let e=I_(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},tv=r,r.default=r,e.registerRoot(r),tv}var iv,av;function ov(){if(av)return iv;av=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
|
|
113
|
-
`,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return iv=e,e.default=e,iv}var sv,cv;function lv(){if(cv)return sv;cv=1;let e=I_(),t=ov();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return sv=n,n.default=n,e.registerRule(n),sv}var uv,dv;function fv(){if(dv)return uv;dv=1;let e=v_(),t=Z_(),n=N_(),r=ev(),i=rv(),a=lv(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0){if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}if(n===`{`){s=!0;break}if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}c.push(e)}else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`){if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a}i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;){if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1]}(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],c===`space`||c===`comment`);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0){if(n===`;`){if(r){this.decl(s,o);return}break}if(n===`{`){this.rule(s);return}if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}n===`:`&&(r=!0)}else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],c===`space`||c===`comment`);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`||t===`comment`);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],t===`space`||t===`comment`);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return uv=c,uv}var pv,mv;function hv(){if(mv)return pv;mv=1;let e=I_(),t=fv(),n=D_();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return pv=r,r.default=r,e.registerParse(r),pv}var gv,_v;function vv(){if(_v)return gv;_v=1;let{isClean:e,my:t}=o_(),n=A_(),r=f_(),i=I_(),a=z_();H_();let o=J_(),s=hv(),c=rv(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n]){if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit){if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},gv=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),gv}var yv,bv;function xv(){if(bv)return yv;bv=1;let e=A_(),t=f_();H_();let n=hv(),r=J_();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o,s=t;this.result=new r(this._processor,o,this._opts),this.result.css=i;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let l=new e(s,o,this._opts,i);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return yv=i,i.default=i,yv}var Sv,Cv;function wv(){if(Cv)return Sv;Cv=1;let e=xv(),t=vv(),n=z_(),r=rv();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n!=`object`||!n.parse&&!n.stringify)throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Sv=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),Sv}var Tv,Ev;function Dv(){if(Ev)return Tv;Ev=1;let e=v_(),t=w_(),n=N_(),r=ev(),i=D_(),a=rv(),o=lv();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return Tv=s,s.default=s,Tv}var Ov,kv;function Av(){if(kv)return Ov;kv=1;let e=r_(),t=v_(),n=vv(),r=I_(),i=wv(),a=f_(),o=Dv(),s=z_(),c=G_(),l=N_(),u=ev(),d=J_(),f=D_(),p=hv(),m=ov(),h=lv(),g=rv(),_=h_();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
114
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
115
|
-
https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),Ov=v,v.default=v,Ov}var jv=Yg(Av());jv.stringify,jv.fromJSON,jv.plugin,jv.parse,jv.list,jv.document,jv.comment,jv.atRule,jv.rule,jv.decl,jv.root,jv.CssSyntaxError,jv.Declaration,jv.Container,jv.Processor,jv.Document,jv.Comment,jv.Warning,jv.AtRule,jv.Result,jv.Input,jv.Rule,jv.Root,jv.Node;var Mv=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(Mv||{});function Nv(e){let t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.replace(/\/\*.*?\*\//g,``).split(n).forEach(function(e){if(e){let n=e.split(r);n.length>1&&(t[Lv(n[0].trim())]=n[1].trim())}}),t}function Pv(e){let t=[];for(let n in e){let r=e[n];if(typeof r!=`string`)continue;let i=zv(n);t.push(`${i}: ${r};`)}return t.join(` `)}var Fv=/-([a-z])/g,Iv=/^--[a-zA-Z0-9-]+$/,Lv=e=>Iv.test(e)?e:e.replace(Fv,(e,t)=>t?t.toUpperCase():``),Rv=/\B([A-Z])/g,zv=e=>e.replace(Rv,`-$1`).toLowerCase(),Bv=class e{constructor(...e){X(this,`parentElement`,null),X(this,`parentNode`,null),X(this,`ownerDocument`),X(this,`firstChild`,null),X(this,`lastChild`,null),X(this,`previousSibling`,null),X(this,`nextSibling`,null),X(this,`ELEMENT_NODE`,1),X(this,`TEXT_NODE`,3),X(this,`nodeType`),X(this,`nodeName`),X(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}},Vv=class e extends Bv{constructor(...e){super(e),X(this,`nodeType`,9),X(this,`nodeName`,`#document`),X(this,`compatMode`,`CSS1Compat`),X(this,`RRNodeType`,Mv.Document),X(this,`textContent`,null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===Mv.Element&&e.tagName===`HTML`)||null}get body(){return this.documentElement?.childNodes.find(e=>e.RRNodeType===Mv.Element&&e.tagName===`BODY`)||null}get head(){return this.documentElement?.childNodes.find(e=>e.RRNodeType===Mv.Element&&e.tagName===`HEAD`)||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){let t=e.RRNodeType;if((t===Mv.Element||t===Mv.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===t))throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===Mv.Element?`RRElement`:`RRDoctype`} on RRDocument allowed.`);let n=Xv(this,e);return n.parentElement=null,n}insertBefore(e,t){let n=e.RRNodeType;if((n===Mv.Element||n===Mv.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===n))throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===Mv.Element?`RRElement`:`RRDoctype`} on RRDocument allowed.`);let r=Zv(this,e,t);return r.parentElement=null,r}removeChild(e){return Qv(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e===`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">`?t=`-//W3C//DTD XHTML 1.0 Transitional//EN`:e===`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">`&&(t=`-//W3C//DTD HTML 4.0 Transitional//EN`),t){let e=this.createDocumentType(`html`,t,``);this.open(),this.appendChild(e)}}createDocument(t,n,r){return new e}createDocumentType(e,t,n){let r=new Hv(e,t,n);return r.ownerDocument=this,r}createElement(e){let t=new Uv(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){let t=new Kv(e);return t.ownerDocument=this,t}createComment(e){let t=new qv(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new Jv(e);return t.ownerDocument=this,t}toString(){return`RRDocument`}},Hv=class extends Bv{constructor(e,t,n){super(),X(this,`nodeType`,10),X(this,`RRNodeType`,Mv.DocumentType),X(this,`name`),X(this,`publicId`),X(this,`systemId`),X(this,`textContent`,null),this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e}toString(){return`RRDocumentType`}},Uv=class extends Bv{constructor(e){super(),X(this,`nodeType`,1),X(this,`RRNodeType`,Mv.Element),X(this,`tagName`),X(this,`attributes`,{}),X(this,`shadowRoot`,null),X(this,`scrollLeft`),X(this,`scrollTop`),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e=``;return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Yv(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||``}get className(){return this.attributes.class||``}get style(){let e=this.attributes.style?Nv(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,r,i)=>{if(t.test(n))return;let a=Lv(n);r?e[a]=r:delete e[a],i===`important`&&(e[a]+=` !important`),this.attributes.style=Pv(e)},e.removeProperty=n=>{if(t.test(n))return``;let r=Lv(n),i=e[r]||``;return delete e[r],this.attributes.style=Pv(e),i},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Xv(this,e)}insertBefore(e,t){return Zv(this,e,t)}removeChild(e){return Qv(this,e)}attachShadow(e){let t=this.ownerDocument.createElement(`SHADOWROOT`);return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e=``;for(let t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}},Wv=class extends Uv{constructor(){super(...arguments),X(this,`currentTime`),X(this,`volume`),X(this,`paused`),X(this,`muted`),X(this,`playbackRate`),X(this,`loop`)}attachShadow(e){throw Error(`RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow`)}play(){this.paused=!1}pause(){this.paused=!0}},Gv=class extends Uv{constructor(){super(...arguments),X(this,`tagName`,`DIALOG`),X(this,`nodeName`,`DIALOG`)}get isModal(){return this.getAttribute(`rr_open_mode`)===`modal`}get open(){return this.getAttribute(`open`)!==null}close(){this.removeAttribute(`open`),this.removeAttribute(`rr_open_mode`)}show(){this.setAttribute(`open`,``),this.setAttribute(`rr_open_mode`,`non-modal`)}showModal(){this.setAttribute(`open`,``),this.setAttribute(`rr_open_mode`,`modal`)}},Kv=class extends Bv{constructor(e){super(),X(this,`nodeType`,3),X(this,`nodeName`,`#text`),X(this,`RRNodeType`,Mv.Text),X(this,`data`),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},qv=class extends Bv{constructor(e){super(),X(this,`nodeType`,8),X(this,`nodeName`,`#comment`),X(this,`RRNodeType`,Mv.Comment),X(this,`data`),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},Jv=class extends Bv{constructor(e){super(),X(this,`nodeName`,`#cdata-section`),X(this,`nodeType`,4),X(this,`RRNodeType`,Mv.CDATA),X(this,`data`),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},Yv=class{constructor(e,t){if(X(this,`onChange`),X(this,`classes`,[]),X(this,`add`,(...e)=>{for(let t of e){let e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(` `))}),X(this,`remove`,(...e)=>{this.classes=this.classes.filter(t=>e.indexOf(t)===-1),this.onChange&&this.onChange(this.classes.join(` `))}),e){let t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}};function Xv(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Zv(e,t,n){if(!n)return Xv(e,t);if(n.parentNode!==e)throw Error(`Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.`);return t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Qv(e,t){if(t.parentNode!==e)throw Error(`Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.`);return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var $v=(e=>(e[e.PLACEHOLDER=0]=`PLACEHOLDER`,e[e.ELEMENT_NODE=1]=`ELEMENT_NODE`,e[e.ATTRIBUTE_NODE=2]=`ATTRIBUTE_NODE`,e[e.TEXT_NODE=3]=`TEXT_NODE`,e[e.CDATA_SECTION_NODE=4]=`CDATA_SECTION_NODE`,e[e.ENTITY_REFERENCE_NODE=5]=`ENTITY_REFERENCE_NODE`,e[e.ENTITY_NODE=6]=`ENTITY_NODE`,e[e.PROCESSING_INSTRUCTION_NODE=7]=`PROCESSING_INSTRUCTION_NODE`,e[e.COMMENT_NODE=8]=`COMMENT_NODE`,e[e.DOCUMENT_NODE=9]=`DOCUMENT_NODE`,e[e.DOCUMENT_TYPE_NODE=10]=`DOCUMENT_TYPE_NODE`,e[e.DOCUMENT_FRAGMENT_NODE=11]=`DOCUMENT_FRAGMENT_NODE`,e))($v||{}),ey={svg:`http://www.w3.org/2000/svg`,"xlink:href":`http://www.w3.org/1999/xlink`,xmlns:`http://www.w3.org/2000/xmlns/`},ty={altglyph:`altGlyph`,altglyphdef:`altGlyphDef`,altglyphitem:`altGlyphItem`,animatecolor:`animateColor`,animatemotion:`animateMotion`,animatetransform:`animateTransform`,clippath:`clipPath`,feblend:`feBlend`,fecolormatrix:`feColorMatrix`,fecomponenttransfer:`feComponentTransfer`,fecomposite:`feComposite`,feconvolvematrix:`feConvolveMatrix`,fediffuselighting:`feDiffuseLighting`,fedisplacementmap:`feDisplacementMap`,fedistantlight:`feDistantLight`,fedropshadow:`feDropShadow`,feflood:`feFlood`,fefunca:`feFuncA`,fefuncb:`feFuncB`,fefuncg:`feFuncG`,fefuncr:`feFuncR`,fegaussianblur:`feGaussianBlur`,feimage:`feImage`,femerge:`feMerge`,femergenode:`feMergeNode`,femorphology:`feMorphology`,feoffset:`feOffset`,fepointlight:`fePointLight`,fespecularlighting:`feSpecularLighting`,fespotlight:`feSpotLight`,fetile:`feTile`,feturbulence:`feTurbulence`,foreignobject:`foreignObject`,glyphref:`glyphRef`,lineargradient:`linearGradient`,radialgradient:`radialGradient`},ny=null;function ry(e,t,n,r=t.mirror||t.ownerDocument.mirror){e=iy(e,t,n,r),sy(e,t,n,r),ay(e,t,n)}function iy(e,t,n,r){var i;if(n.afterAppend&&!ny&&(ny=new WeakSet,setTimeout(()=>{ny=null},0)),!ly(e,t)){let a=cy(t,n.mirror,r);(i=e.parentNode)==null||i.replaceChild(a,e),e=a}switch(t.RRNodeType){case Mv.Document:if(!uy(e,t,n.mirror,r)){let i=r.getMeta(t);i&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,i),ny?.add(e))}break;case Mv.Element:{let i=e,a=t;switch(a.tagName){case`IFRAME`:{let i=e.contentDocument;if(!i)break;ry(i,t.contentDocument,n,r);break}}a.shadowRoot&&(i.shadowRoot||i.attachShadow({mode:`open`}),sy(i.shadowRoot,a.shadowRoot,n,r)),oy(i,a,r);break}}return e}function ay(e,t,n){var r;switch(t.RRNodeType){case Mv.Document:{let e=t.scrollData;e&&n.applyScroll(e,!0);break}case Mv.Element:{let r=e,i=t;switch(i.scrollData&&n.applyScroll(i.scrollData,!0),i.inputData&&n.applyInput(i.inputData),i.tagName){case`AUDIO`:case`VIDEO`:{let t=e,n=i;n.paused!==void 0&&(n.paused?t.pause():t.play()),n.muted!==void 0&&(t.muted=n.muted),n.volume!==void 0&&(t.volume=n.volume),n.currentTime!==void 0&&(t.currentTime=n.currentTime),n.playbackRate!==void 0&&(t.playbackRate=n.playbackRate),n.loop!==void 0&&(t.loop=n.loop);break}case`CANVAS`:{let i=t;if(i.rr_dataURL!==null){let e=document.createElement(`img`);e.onload=()=>{let t=r.getContext(`2d`);t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.rr_dataURL}i.canvasMutations.forEach(t=>n.applyCanvas(t.event,t.mutation,e));break}case`STYLE`:{let e=r.sheet;e&&t.rules.forEach(t=>n.applyStyleSheetMutation(t,e));break}case`DIALOG`:{let e=r,t=i,n=e.open,a=e.matches(`dialog:modal`),o=t.open,s=t.isModal,c=a!==s,l=n!==o;if((c||n&&l)&&e.close(),o&&(l||c))try{s?e.showModal():e.show()}catch(e){console.warn(e)}break}}break}case Mv.Text:case Mv.Comment:case Mv.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}ny?.has(e)&&(ny.delete(e),(r=n.afterAppend)==null||r.call(n,e,n.mirror.getId(e)))}function oy(e,t,n){let r=e.attributes,i=t.attributes;for(let r in i){let a=i[r];if(n.getMeta(t)?.isSVG&&ey[r])e.setAttributeNS(ey[r],r,a);else if(t.tagName===`CANVAS`&&r===`rr_dataURL`){let t=document.createElement(`img`);t.src=a,t.onload=()=>{let n=e.getContext(`2d`);n&&n.drawImage(t,0,0,t.width,t.height)}}else if(t.tagName===`IFRAME`&&r===`srcdoc`)continue;else try{e.setAttribute(r,a)}catch(e){console.warn(e)}}for(let{name:t}of Array.from(r))t in i||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function sy(e,t,n,r){let i=Array.from(e.childNodes),a=t.childNodes;if(i.length===0&&a.length===0)return;let o=0,s=i.length-1,c=0,l=a.length-1,u=i[o],d=i[s],f=a[c],p=a[l],m,h;for(;o<=s&&c<=l;)if(u===void 0)u=i[++o];else if(d===void 0)d=i[--s];else if(uy(u,f,n.mirror,r))u=i[++o],f=a[++c];else if(uy(d,p,n.mirror,r))d=i[--s],p=a[--l];else if(uy(u,p,n.mirror,r)){try{e.insertBefore(u,d.nextSibling)}catch(e){console.warn(e)}u=i[++o],p=a[--l]}else if(uy(d,f,n.mirror,r)){try{e.insertBefore(d,u)}catch(e){console.warn(e)}d=i[--s],f=a[++c]}else{if(!m){m={};for(let e=o;e<=s;e++){let t=i[e];t&&n.mirror.hasNode(t)&&(m[n.mirror.getId(t)]=e)}}h=m[r.getId(f)];let t=i[h];if(h!==void 0&&t&&uy(t,f,n.mirror,r)){try{e.insertBefore(t,u)}catch(e){console.warn(e)}i[h]=void 0}else{let t=cy(f,n.mirror,r);e.nodeName===`#document`&&u&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&u.nodeType===u.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&u.nodeType===u.ELEMENT_NODE)&&(e.removeChild(u),n.mirror.removeNodeFromMap(u),u=i[++o]);try{e.insertBefore(t,u||null)}catch(e){console.warn(e)}}f=a[++c]}if(o>s){let t=a[l+1],i=null;for(t&&(i=n.mirror.getNode(r.getId(t)));c<=l;++c){let t=cy(a[c],n.mirror,r);try{e.insertBefore(t,i)}catch(e){console.warn(e)}}}else if(c>l)for(;o<=s;o++){let t=i[o];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,_=t.firstChild;for(;g!==null&&_!==null;)ry(g,_,n,r),g=g.nextSibling,_=_.nextSibling}function cy(e,t,n){let r=n.getId(e),i=n.getMeta(e),a=null;if(r>-1&&(a=t.getNode(r)),a!==null&&ly(a,e))return a;switch(e.RRNodeType){case Mv.Document:a=new Document;break;case Mv.DocumentType:a=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case Mv.Element:{let t=e.tagName.toLowerCase();t=ty[t]||t,a=i&&`isSVG`in i&&i?.isSVG?document.createElementNS(ey.svg,t):document.createElement(e.tagName);break}case Mv.Text:a=document.createTextNode(e.data);break;case Mv.Comment:a=document.createComment(e.data);break;case Mv.CDATA:a=document.createCDATASection(e.data)}i&&t.add(a,{...i});try{ny?.add(a)}catch{}return a}function ly(e,t){return e.nodeType===t.nodeType?e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName:!1}function uy(e,t,n,r){let i=n.getId(e),a=r.getId(t);return i===-1||i!==a?!1:ly(e,t)}var dy=class e extends Vv{constructor(e){super(),X(this,`UNSERIALIZED_STARTING_ID`,-2),X(this,`_unserializedId`,this.UNSERIALIZED_STARTING_ID),X(this,`mirror`,Ty()),X(this,`scrollData`,null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new e}createDocumentType(e,t,n){let r=new fy(e,t,n);return r.ownerDocument=this,r}createElement(e){let t=e.toUpperCase(),n;switch(t){case`AUDIO`:case`VIDEO`:n=new my(t);break;case`IFRAME`:n=new vy(t,this.mirror);break;case`CANVAS`:n=new gy(t);break;case`STYLE`:n=new _y(t);break;case`DIALOG`:n=new hy(t);break;default:n=new py(t)}return n.ownerDocument=this,n}createComment(e){let t=new by(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new xy(e);return t.ownerDocument=this,t}createTextNode(e){let t=new yy(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},fy=Hv,py=class extends Uv{constructor(){super(...arguments),X(this,`inputData`,null),X(this,`scrollData`,null)}},my=class extends Wv{},hy=class extends Gv{},gy=class extends py{constructor(){super(...arguments),X(this,`rr_dataURL`,null),X(this,`canvasMutations`,[])}getContext(){return null}},_y=class extends py{constructor(){super(...arguments),X(this,`rules`,[])}},vy=class extends py{constructor(e,t){super(e),X(this,`contentDocument`,new dy),this.contentDocument.mirror=t}},yy=Kv,by=qv,xy=Jv;function Sy(e){return e instanceof HTMLFormElement?`FORM`:e.tagName.toUpperCase()}function Cy(e,t,n,r){let i;switch(e.nodeType){case $v.DOCUMENT_NODE:r&&r.nodeName===`IFRAME`?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case $v.DOCUMENT_TYPE_NODE:{let n=e;i=t.createDocumentType(n.name,n.publicId,n.systemId);break}case $v.ELEMENT_NODE:{let n=e,r=Sy(n);i=t.createElement(r);let a=i;for(let{name:e,value:t}of Array.from(n.attributes))a.attributes[e]=t;n.scrollLeft&&(a.scrollLeft=n.scrollLeft),n.scrollTop&&(a.scrollTop=n.scrollTop);break}case $v.TEXT_NODE:i=t.createTextNode(e.textContent||``);break;case $v.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case $v.COMMENT_NODE:i=t.createComment(e.textContent||``);break;case $v.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:`open`});break;default:return null}let a=n.getMeta(e);return t instanceof dy&&(a||(a=Dy(i,t.unserializedId),n.add(e,a)),t.mirror.add(i,{...a})),i}function wy(e,t=Jg(),n=new dy){function r(e,i){let a=Cy(e,n,t,i);if(a!==null){if(i?.nodeName!==`IFRAME`&&e.nodeType!==$v.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(a),a.parentNode=i,a.parentElement=i),e.nodeName===`IFRAME`){let t=e.contentDocument;t&&r(t,a)}else(e.nodeType===$v.DOCUMENT_NODE||e.nodeType===$v.ELEMENT_NODE||e.nodeType===$v.DOCUMENT_FRAGMENT_NODE)&&(e.nodeType===$v.ELEMENT_NODE&&e.shadowRoot&&r(e.shadowRoot,a),e.childNodes.forEach(e=>r(e,a)))}}return r(e,null),n}function Ty(){return new Ey}var Ey=class{constructor(){X(this,`idNodeMap`,new Map),X(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Dy(e,t){switch(e.RRNodeType){case Mv.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case Mv.DocumentType:{let n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case Mv.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case Mv.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||``};case Mv.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||``};case Mv.CDATA:return{id:t,type:e.RRNodeType,textContent:``}}}var Oy={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`,`firstChild`,`lastChild`,`nextSibling`,`previousSibling`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},ky={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},Ay={},jy={},My=()=>!!globalThis.Zone;function Ny(e){if(Ay[e])return Ay[e];let t=globalThis[e],n=t.prototype,r=e in Oy?Oy[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in ky?ky[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!My())return Ay[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),jy[e]=()=>r.remove()):r.remove(),Ay[e]=a}catch{return n}}var Py={};function Fy(e,t,n){let r=Py[e]?.[n];if(r)return r.call(t);let i=Ny(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?((Py[e]||(Py[e]={}))[n]=a,a.call(t)):t[n]}var Iy={};function Ly(e,t,n){let r=`${e}.${String(n)}`;if(Iy[r])return Iy[r].bind(t);let i=Ny(e)[n];return typeof i==`function`?(Iy[r]=i,i.bind(t)):t[n]}function Ry(e){return Fy(`Node`,e,`ownerDocument`)}function zy(e){return Fy(`Node`,e,`childNodes`)}function By(e){return Fy(`Node`,e,`parentNode`)}function Vy(e){return Fy(`Node`,e,`parentElement`)}function Hy(e){return Fy(`Node`,e,`textContent`)}function Uy(e){return Fy(`Node`,e,`firstChild`)}function Wy(e){return Fy(`Node`,e,`lastChild`)}function Gy(e){return Fy(`Node`,e,`nextSibling`)}function Ky(e){return Fy(`Node`,e,`previousSibling`)}function qy(e,t){return Ly(`Node`,e,`contains`)(t)}function Jy(e){return Ly(`Node`,e,`getRootNode`)()}function Yy(e){return!e||!(`host`in e)?null:Fy(`ShadowRoot`,e,`host`)}function Xy(e){return e.styleSheets}function Zy(e){return!e||!(`shadowRoot`in e)?null:Fy(`Element`,e,`shadowRoot`)}function Qy(e,t){return Fy(`Element`,e,`querySelector`)(t)}function $y(e,t){return Fy(`Element`,e,`querySelectorAll`)(t)}function eb(){return[Ny(`MutationObserver`).constructor,jy.MutationObserver??(()=>{})]}var tb=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(tb=()=>new Date().getTime());function nb(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Z={ownerDocument:Ry,childNodes:zy,parentNode:By,parentElement:Vy,textContent:Hy,firstChild:Uy,lastChild:Wy,nextSibling:Gy,previousSibling:Ky,contains:qy,getRootNode:Jy,host:Yy,styleSheets:Xy,shadowRoot:Zy,querySelector:Qy,querySelectorAll:$y,nowTimestamp:tb,mutationObserverCtor:eb,patch:nb};function rb(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var ib=`Please stop import mirror directly. Instead of that,\r
|
|
116
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
117
|
-
or you can use record.mirror to access the mirror instance during recording.`,ab={map:{},getId(){return console.error(ib),-1},getNode(){return console.error(ib),null},removeNodeFromMap(){console.error(ib)},has(){return console.error(ib),!1},reset(){console.error(ib)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(ab=new Proxy(ab,{get(e,t,n){return t===`map`&&console.error(ib),Reflect.get(e,t,n)}}));function ob(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function sb(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>sb(e,t,a||{},!0)}function cb(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&Z.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&Z.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function lb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ub(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function db(e){return e?e.nodeType===e.ELEMENT_NODE?e:Z.parentElement(e):null}function fb(e,t,n,r){if(!e)return!1;let i=db(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(Em(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function pb(e,t){return t.getId(e)!==-1}function mb(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===dm}function hb(e,t){if(Np(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=Z.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:!r||hb(r,t)}function gb(e){return!!e.changedTouches}function _b(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function vb(e){let t={},n=(e,n)=>{let r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(let i of e){let{nextId:e,parentId:a}=i;if(e&&e in t){let a=t[e];if(a.parent){let e=a.parent.children.indexOf(a);a.parent.children.splice(e,0,n(i,a.parent))}else{let e=r.indexOf(a);r.splice(e,0,n(i,null))}}else if(a in t){let e=t[a];e.children.push(n(i,e))}else r.push(n(i,null))}return r}function yb(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)yb(e.children[n],t)}function bb(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function xb(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function Sb(e,t){let n=e.ownerDocument?.defaultView?.frameElement;if(!n||n===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let r=n.getBoundingClientRect(),i=Sb(n,t),a=r.height/n.clientHeight;return{x:r.x*i.relativeScale+i.x,y:r.y*i.relativeScale+i.y,relativeScale:a,absoluteScale:i.absoluteScale*a}}function Cb(e){return e?e instanceof Bv&&`shadowRoot`in e?!!e.shadowRoot:!!Z.shadowRoot(e):!1}function wb(e,t){let n=e?.[t[0]];return n?t.length===1?n:wb(n.cssRules,t.slice(1)):null}function Tb(e){let t=[...e];return{positions:t,index:t.pop()}}function Eb(e){let t=new Set,n=[];for(let r=e.length;r--;){let i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}var Db=class{constructor(){J(this,`id`,1),J(this,`styleIDMap`,new WeakMap),J(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ob(e){let t=null;return`getRootNode`in e&&Z.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Z.host(Z.getRootNode(e))&&(t=Z.host(Z.getRootNode(e))),t}function kb(e){let t=e,n;for(;n=Ob(t);)t=n;return t}function Ab(e){let t=Z.ownerDocument(e);if(!t)return!1;let n=kb(e);return Z.contains(t,n)}function jb(e){let t=Z.ownerDocument(e);return t?Z.contains(t,e)||Ab(e):!1}var Q=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e[e.Asset=7]=`Asset`,e))(Q||{}),$=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))($||{}),Mb=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(Mb||{}),Nb=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(Nb||{}),Pb=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(Pb||{}),Fb=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(Fb||{}),Ib=(e=>(e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`,e.Destroy=`destroy`,e))(Ib||{}),Lb=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(Lb||{}),Rb=(e,t)=>`${e}@${t}`,zb=class{constructor(){J(this,`frozen`,!1),J(this,`locked`,!1),J(this,`texts`,[]),J(this,`attributes`,[]),J(this,`attributeMap`,new WeakMap),J(this,`removes`,[]),J(this,`mapRemoves`,[]),J(this,`movedMap`,{}),J(this,`addedSet`,new Set),J(this,`movedSet`,new Set),J(this,`droppedSet`,new Set),J(this,`removesSubTreeCache`,new Set),J(this,`mutationCb`),J(this,`blockClass`),J(this,`blockSelector`),J(this,`maskTextClass`),J(this,`maskTextSelector`),J(this,`inlineStylesheet`),J(this,`maskInputOptions`),J(this,`maskTextFn`),J(this,`maskInputFn`),J(this,`keepIframeSrcFn`),J(this,`recordCanvas`),J(this,`inlineImages`),J(this,`slimDOMOptions`),J(this,`dataURLOptions`),J(this,`doc`),J(this,`mirror`),J(this,`iframeManager`),J(this,`stylesheetManager`),J(this,`shadowDomManager`),J(this,`canvasManager`),J(this,`processedNodeManager`),J(this,`unattachedDoc`),J(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),J(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet){let t=Z.parentNode(e);(!this.removesSubTreeCache.has(t)||this.movedSet.has(t))&&this.addedSet.add(e)}let n=null,r=null,i=-1,a=null,o=!1,s=new Set,c=this.addedSet.values(),l=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(Z.previousSibling(n)))a=n,n=Z.previousSibling(n);else{for(this.addedSet.has(l.value)||(l=c.next()),n=l.value;r=Z.parentNode(n),this.addedSet.has(r);)n=r;if(s.has(r))r=null;else if(r){if(jb(r)?(o=Hb(this.droppedSet,r)||this.removesSubTreeCache.has(r),o&&Hb(this.movedSet,n)&&(o=!1)):o=!0,this.addedSet.has(Z.lastChild(r)))n=Z.lastChild(r),a=null;else for(;a=Z.nextSibling(n),this.addedSet.has(a);)n=a;if(i=Np(r)?this.mirror.getId(Ob(n)):this.mirror.getId(r),i===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=Z.host(r);i=this.mirror.getId(e)}}}if(this.addedSet.delete(n),!r||i===-1){s.add(n);continue}if(o){this.droppedSet.add(n);continue}let u=!1;if(n.nodeType===Node.TEXT_NODE){let e=r.tagName;if(e===`TEXTAREA`)continue;e===`STYLE`&&t.has(i)&&(u=!0)}let d=a?this.mirror.getId(a):null;for(;d===dm;)a&&=Z.nextSibling(a),d=a&&this.mirror.getId(a);if(d===-1){console.warn(`Couldn't record new node. Couldn't find mirror id for nextSibling:`,a),n=null;continue}let f=Lm(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{bb(e,this.mirror)&&this.iframeManager.addIframe(e),xb(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Cb(n)&&this.shadowDomManager.addShadowRoot(Z.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:u});f&&(e.push({parentId:i,nextId:d,node:f}),t.add(f.id))}let u={texts:this.texts.map(e=>{let t=e.node,n=Z.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(u.texts.length||u.attributes.length||u.removes.length||u.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),J(this,`genTextAreaValueMutation`,e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let n=Array.from(Z.childNodes(e),e=>Z.textContent(e)||``).join(``);t.attributes.value=Wp({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Yp(e),value:n,maskInputFn:this.maskInputFn})}),J(this,`processMutation`,e=>{if(!mb(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=Z.textContent(e.target);!fb(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Dm(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,db(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=Gp(t.tagName),r=e.attributeName,i=e.target.getAttribute(r);if(r===`value`){let e=Yp(t);i=Wp({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(fb(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let a=this.attributeMap.get(e.target);if(n===`iframe`&&r===`src`&&!this.keepIframeSrcFn(i)){if(!t.contentDocument)r=`rr_src`;else return}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),r===`type`&&n===`input`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!wm(n,r)){if(a.attributes[r]=Cm(this.doc,n,Gp(r),i),r===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?i===``?a.styleDiff[e]=r:a.styleDiff[e]=[r,i]:a._unchangedStyles[e]=[r,i]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(a.styleDiff[e]=!1)}else r===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?a.attributes.rr_open_mode=`modal`:a.attributes.rr_open_mode=`non-modal`)}break}case`childList`:if(fb(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName===`TEXTAREA`){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=Np(e.target)?this.mirror.getId(Z.host(e.target)):this.mirror.getId(e.target);fb(e.target,this.blockClass,this.blockSelector,!1)||mb(t,this.mirror,this.slimDOMOptions)||!pb(t,this.mirror)||(this.addedSet.has(t)?(Bb(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||hb(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Rb(n,r)]?Bb(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:Np(e.target)&&Pp(e.target)?!0:void 0}),Vb(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),J(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(mb(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[Rb(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);fb(e,this.blockClass,this.blockSelector,!1)||(Z.childNodes(e).forEach(e=>this.genAdds(e)),Cb(e)&&Z.childNodes(Z.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`doc`,`mirror`,`iframeManager`,`stylesheetManager`,`shadowDomManager`,`canvasManager`,`processedNodeManager`].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Bb(e,t){e.delete(t),Z.childNodes(t).forEach(t=>Bb(e,t))}function Vb(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),Z.childNodes(e).forEach(e=>n.push(e)))}}function Hb(e,t){return e.size!==0&&Ub(e,t)}function Ub(e,t){if(e.has(t))return!0;let n=Z.parentNode(t);return n?Ub(e,n):!1}var Wb;function Gb(e){Wb=e}function Kb(){Wb=void 0}var qb=e=>Wb?(...t)=>{try{return e(...t)}catch(e){if(Wb&&Wb(e)===!0)return;throw e}}:e,Jb=[];function Yb(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Xb(e,t){let n=new zb;Jb.push(n),n.init(e);let[r,i]=eb(),a=new r(qb(n.processMutations.bind(n)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,i]}function Zb({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=ob(qb(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=qb(ob(qb(e=>{let t=Yb(e),{clientX:n,clientY:i}=gb(e)?e.changedTouches[0]:e;s||=tb(),o.push({x:n,y:i,id:r.getId(t),timeOffset:tb()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),i,{trailing:!1})),u=[rb(`mousemove`,l,n),rb(`touchmove`,l,n),rb(`drag`,l,n)];return qb(()=>{u.forEach(e=>e())})}function Qb({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=Yb(a);if(fb(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=Nb.Mouse;break;case`touch`:s=Nb.Touch;break;case`pen`:s=Nb.Pen}s===Nb.Touch?Mb[t]===Mb.MouseDown?l=`TouchStart`:Mb[t]===Mb.MouseUp&&(l=`TouchEnd`):Nb.Pen}else gb(a)&&(s=Nb.Touch);s===null?Mb[t]===Mb.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===Nb.Touch||l.startsWith(`Mouse`)&&s===Nb.Mouse)&&(s=null));let u=gb(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;qb(e)({type:Mb[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(Mb).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=Gp(e),r=l(e);if(window.PointerEvent)switch(Mb[e]){case Mb.MouseDown:case Mb.MouseUp:n=n.replace(`mouse`,`pointer`);break;case Mb.TouchStart:case Mb.TouchEnd:return}s.push(rb(n,r,t))}),qb(()=>{s.forEach(e=>e())})}function $b({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return rb(`scroll`,qb(ob(qb(a=>{let o=Yb(a);if(!o||fb(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=cb(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function ex({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return rb(`resize`,qb(ob(qb(()=>{let t=lb(),i=ub();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var tx=[`INPUT`,`TEXTAREA`,`SELECT`],nx=new WeakMap;function rx({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Yb(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=Z.parentElement(n)),!n||!d||tx.indexOf(d)<0||fb(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=Yp(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=Wp({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=nx.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){nx.set(t,r);let i=n.getId(t);qb(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>rb(e,qb(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>sb(e[0],e[1],{set(){qb(d)({target:this,isTrusted:!1})}},!1,m))),qb(()=>{p.forEach(e=>e())})}function ix(e){let t=[];function n(e,t){if(hx(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||hx(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||hx(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||hx(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);return t.unshift(r),n(e.parentRule,t)}if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function ax(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function ox({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:qb((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=ax(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:qb((r,i,a)=>{let[o]=a,{id:s,styleId:c}=ax(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:qb((r,i,a)=>{let[o]=a,{id:s,styleId:c}=ax(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:qb((r,i,a)=>{let[o]=a,{id:s,styleId:c}=ax(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};gx(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(gx(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),gx(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),gx(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:qb((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=ax(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...ix(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:qb((r,i,a)=>{let[o]=a,{id:s,styleId:c}=ax(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...ix(i),o]}]}),r.apply(i,a)})})}),qb(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function sx({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(Z.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),qb(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function cx({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:qb((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=ax(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:ix(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:qb((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=ax(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:ix(a.parentRule)}),i.apply(a,s)})}),qb(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function lx({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=qb(a=>ob(qb(i=>{let o=Yb(i);if(!o||fb(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[rb(`play`,o(Fb.Play),a),rb(`pause`,o(Fb.Pause),a),rb(`seeked`,o(Fb.Seeked),a),rb(`volumechange`,o(Fb.VolumeChange),a),rb(`ratechange`,o(Fb.RateChange),a)];return qb(()=>{s.forEach(e=>e())})}function ux({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=nb(t.fonts,`add`,function(t){return function(n){return setTimeout(qb(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),qb(()=>{r.forEach(e=>e())})}function dx(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=qb(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);fb(a,r,i,!0)||fb(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),rb(`selectionchange`,s)}function fx({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:nb(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function px(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function mx(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};px(e,t);let r,i=()=>{};e.recordDOM&&([r,i]=Xb(e,e.doc));let a=Zb(e),o=Qb(e),s=$b(e),c=ex(e,{win:n}),l=rx(e),u=lx(e),d=()=>{},f=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(d=ox(e,{win:n}),f=sx(e,e.doc),p=cx(e,{win:n}),e.collectFonts&&(m=ux(e)));let h=dx(e),g=fx(e),_=[];for(let t of e.plugins)_.push(t.observer(t.callback,n,t.options));return qb(()=>{Jb.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g(),_.forEach(e=>e())})}function hx(e){return window[e]!==void 0}function gx(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var _x=class{constructor(e){J(this,`iframeIdToRemoteIdMap`,new WeakMap),J(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},vx=class{constructor(e){J(this,`iframes`,new WeakMap),J(this,`crossOriginIframeMap`,new WeakMap),J(this,`crossOriginIframeMirror`,new _x(fm)),J(this,`crossOriginIframeStyleMirror`),J(this,`crossOriginIframeRootIdMap`,new WeakMap),J(this,`mirror`),J(this,`mutationCb`),J(this,`wrappedEmit`),J(this,`loadListener`),J(this,`stylesheetManager`),J(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _x(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Q.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Q.IncrementalSnapshot,data:{source:$.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return t;case Q.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case Q.IncrementalSnapshot:switch(t.data.source){case $.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case $.Drag:case $.TouchMove:case $.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case $.ViewportResize:return!1;case $.MediaInteraction:case $.MouseInteraction:case $.Scroll:case $.CanvasMutation:case $.Input:return this.replaceIds(t.data,e,[`id`]),t;case $.StyleSheetRule:case $.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case $.Font:return t;case $.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case $.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)(Array.isArray(t[i])||typeof t[i]==`number`)&&(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==Lb.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},yx=class{constructor(e){J(this,`shadowDoms`,new WeakSet),J(this,`mutationCb`),J(this,`scrollCb`),J(this,`bypassOptions`),J(this,`mirror`),J(this,`restoreHandlers`,[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Pp(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[n]=Xb({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push($b({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Z.host(e))),this.restoreHandlers.push(sx({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(nb(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=Z.shadowRoot(this);return a&&jb(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},bx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,xx=typeof Uint8Array>`u`?[]:new Uint8Array(256),Sx=0;Sx<bx.length;Sx++)xx[bx.charCodeAt(Sx)]=Sx;var Cx=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=bx[t[n]>>2],i+=bx[(t[n]&3)<<4|t[n+1]>>4],i+=bx[(t[n+1]&15)<<2|t[n+2]>>6],i+=bx[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},wx=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=xx[e.charCodeAt(r)],o=xx[e.charCodeAt(r+1)],s=xx[e.charCodeAt(r+2)],c=xx[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Tx=new Map;function Ex(e,t){let n=Tx.get(e);return n||(n=new Map,Tx.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Dx=(e,t,n)=>{if(!e||!(Ax(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=Ex(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function Ox(e,t,n){if(e instanceof Array)return e.map(e=>Ox(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:Cx(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ox(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ox(e.data,t,n),e.width,e.height]}:Ax(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:Dx(e,t,n)}:e}var kx=(e,t,n)=>e.map(e=>Ox(e,t,n)),Ax=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function jx(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=nb(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return fb(this.canvas,n,r,!0)||setTimeout(()=>{let n=kx(a,t,this);e(this.canvas,{type:Pb[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=sb(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Pb[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}function Mx(e){return e===`experimental-webgl`?`webgl`:e}function Nx(e,t,n,r){let i=[];try{let a=nb(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!fb(this,t,n,!0)){let e=Mx(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e)){if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function Px(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=nb(e,c,function(e){return function(...o){let s=e.apply(this,o);if(Dx(s,a,this),`tagName`in this.canvas&&!fb(this.canvas,r,i,!0)){let e=kx(o,a,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}});o.push(s)}catch{let r=sb(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function Fx(e,t,n,r){let i=[];return t.WebGLRenderingContext!==void 0&&i.push(...Px(t.WebGLRenderingContext.prototype,Pb.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...Px(t.WebGL2RenderingContext.prototype,Pb.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}var Ix=`(function() {
|
|
118
|
-
"use strict";
|
|
119
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
120
|
-
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
121
|
-
for (var i = 0; i < chars.length; i++) {
|
|
122
|
-
lookup[chars.charCodeAt(i)] = i;
|
|
123
|
-
}
|
|
124
|
-
var encode = function(arraybuffer) {
|
|
125
|
-
var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
|
|
126
|
-
for (i2 = 0; i2 < len; i2 += 3) {
|
|
127
|
-
base64 += chars[bytes[i2] >> 2];
|
|
128
|
-
base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
129
|
-
base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
130
|
-
base64 += chars[bytes[i2 + 2] & 63];
|
|
131
|
-
}
|
|
132
|
-
if (len % 3 === 2) {
|
|
133
|
-
base64 = base64.substring(0, base64.length - 1) + "=";
|
|
134
|
-
} else if (len % 3 === 1) {
|
|
135
|
-
base64 = base64.substring(0, base64.length - 2) + "==";
|
|
136
|
-
}
|
|
137
|
-
return base64;
|
|
138
|
-
};
|
|
139
|
-
const lastBlobMap = /* @__PURE__ */ new Map();
|
|
140
|
-
const transparentBlobMap = /* @__PURE__ */ new Map();
|
|
141
|
-
async function getTransparentBlobFor(width, height, dataURLOptions) {
|
|
142
|
-
const id = \`\${width}-\${height}\`;
|
|
143
|
-
if ("OffscreenCanvas" in globalThis) {
|
|
144
|
-
if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
|
|
145
|
-
const offscreen = new OffscreenCanvas(width, height);
|
|
146
|
-
offscreen.getContext("2d");
|
|
147
|
-
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
148
|
-
const arrayBuffer = await blob.arrayBuffer();
|
|
149
|
-
const base64 = encode(arrayBuffer);
|
|
150
|
-
transparentBlobMap.set(id, base64);
|
|
151
|
-
return base64;
|
|
152
|
-
} else {
|
|
153
|
-
return "";
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
const worker = self;
|
|
157
|
-
worker.onmessage = async function(e) {
|
|
158
|
-
if ("OffscreenCanvas" in globalThis) {
|
|
159
|
-
const { id, bitmap, width, height, dataURLOptions } = e.data;
|
|
160
|
-
const transparentBase64 = getTransparentBlobFor(
|
|
161
|
-
width,
|
|
162
|
-
height,
|
|
163
|
-
dataURLOptions
|
|
164
|
-
);
|
|
165
|
-
const offscreen = new OffscreenCanvas(width, height);
|
|
166
|
-
const ctx = offscreen.getContext("2d");
|
|
167
|
-
ctx.drawImage(bitmap, 0, 0);
|
|
168
|
-
bitmap.close();
|
|
169
|
-
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
170
|
-
const type = blob.type;
|
|
171
|
-
const arrayBuffer = await blob.arrayBuffer();
|
|
172
|
-
const base64 = encode(arrayBuffer);
|
|
173
|
-
if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
|
|
174
|
-
lastBlobMap.set(id, base64);
|
|
175
|
-
return worker.postMessage({ id });
|
|
176
|
-
}
|
|
177
|
-
if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
|
|
178
|
-
worker.postMessage({
|
|
179
|
-
id,
|
|
180
|
-
type,
|
|
181
|
-
base64,
|
|
182
|
-
width,
|
|
183
|
-
height
|
|
184
|
-
});
|
|
185
|
-
lastBlobMap.set(id, base64);
|
|
186
|
-
} else {
|
|
187
|
-
return worker.postMessage({ id: e.data.id });
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
})();
|
|
191
|
-
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
192
|
-
`,Lx=typeof self<`u`&&self.Blob&&new Blob([Ix],{type:`text/javascript;charset=utf-8`});function Rx(e){let t;try{if(t=Lx&&(self.URL||self.webkitURL).createObjectURL(Lx),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Ix),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var zx=class{constructor(e){J(this,`pendingCanvasMutations`,new Map),J(this,`rafStamps`,{latestId:0,invokeId:null}),J(this,`mirror`),J(this,`mutationCb`),J(this,`resetObservers`),J(this,`frozen`,!1),J(this,`locked`,!1),J(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:n,blockClass:r,blockSelector:i,recordCanvas:a,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t===`all`&&this.initCanvasMutationObserver(n,r,i),a&&typeof t==`number`&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,i){let a=Nx(t,n,r,!0),o=new Map,s=new Rx;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:Pb[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{fb(t,n,r,!0)||e.push(t)}),e},f=e=>{l&&e-l<c||(l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])})),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=Nx(e,t,n,!1),i=jx(this.processMutation.bind(this),e,t,n),a=Fx(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},Bx=class{constructor(e){J(this,`trackedLinkElements`,new WeakSet),J(this,`mutationCb`),J(this,`adoptedStyleSheetCb`),J(this,`styleMirror`,new Db),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:Rp(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Vx=class{constructor(){J(this,`nodeMap`,new WeakMap),J(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},Hx,Ux,Wx,Gx=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var Kx=Up();function qx(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,hooks:g,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:x=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:w=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:T=!1,collectFonts:E=!1,inlineImages:D=!1,plugins:O,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:j}=e;Gb(j);let M=!C||window.parent===window,N=!1;if(!M)try{window.parent.document&&(N=!1)}catch{N=!0}if(M&&!t)throw Error(`emit function is required`);if(!M&&!N)return()=>{};b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),Kx.reset();let ee=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f===void 0?{password:!0}:f,te=Fm(p);_b();let ne,re=0,ie=e=>{for(let t of O||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!N&&(e=_(e)),e};Hx=(e,i)=>{let a=e;if(a.timestamp=tb(),Jb[0]?.isFrozen()&&a.type!==Q.FullSnapshot&&(a.type!==Q.IncrementalSnapshot||a.data.source!==$.Mutation)&&Jb.forEach(e=>e.unfreeze()),M)t?.(ie(a),i);else if(N){let e={type:`rrweb`,event:ie(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===Q.FullSnapshot)ne=a,re=0;else if(a.type===Q.IncrementalSnapshot){if(a.data.source===$.Mutation&&a.data.isAttachIframe)return;re++;let e=r&&re>=r,t=n&&a.timestamp-ne.timestamp>n;(e||t)&&Ux(!0)}};let ae=e=>{Hx({type:Q.IncrementalSnapshot,data:{source:$.Mutation,...e}})},oe=e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.Scroll,...e}}),se=e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.CanvasMutation,...e}}),ce=new Bx({mutationCb:ae,adoptedStyleSheetCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.AdoptedStyleSheet,...e}})}),le=new vx({mirror:Kx,mutationCb:ae,stylesheetManager:ce,recordCrossOriginIframes:C,wrappedEmit:Hx});for(let e of O||[])e.getMirror&&e.getMirror({nodeMirror:Kx,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror});let ue=new Vx;Wx=new zx({recordCanvas:S,mutationCb:se,win:window,blockClass:i,blockSelector:a,mirror:Kx,sampling:v.canvas,dataURLOptions:y});let de=new yx({mutationCb:ae,scrollCb:oe,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:ee,dataURLOptions:y,maskTextFn:h,maskInputFn:m,recordCanvas:S,inlineImages:D,sampling:v,slimDOMOptions:te,iframeManager:le,stylesheetManager:ce,canvasManager:Wx,keepIframeSrcFn:k,processedNodeManager:ue},mirror:Kx});Ux=(e=!1)=>{if(!x)return;Hx({type:Q.Meta,data:{href:window.location.href,width:ub(),height:lb()}},e),ce.reset(),de.init(),Jb.forEach(e=>e.lock());let t=Rm(document,{mirror:Kx,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:ee,maskTextFn:h,maskInputFn:m,slimDOM:te,dataURLOptions:y,recordCanvas:S,inlineImages:D,onSerialize:e=>{bb(e,Kx)&&le.addIframe(e),xb(e,Kx)&&ce.trackLinkElement(e),Cb(e)&&de.addShadowRoot(Z.shadowRoot(e),document)},onIframeLoad:(e,t)=>{le.attachIframe(e,t),de.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{ce.attachLinkElement(e,t)},keepIframeSrcFn:k});if(!t)return console.warn(`Failed to snapshot the document`);Hx({type:Q.FullSnapshot,data:{node:t,initialOffset:cb(window)}},e),Jb.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,Kx.getId(document))};try{let e=[],t=e=>qb(mx)({mutationCb:ae,mousemoveCb:(e,t)=>Hx({type:Q.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.MouseInteraction,...e}}),scrollCb:oe,viewportResizeCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.ViewportResize,...e}}),inputCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.Input,...e}}),mediaInteractionCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.MediaInteraction,...e}}),styleSheetRuleCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.StyleSheetRule,...e}}),styleDeclarationCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.StyleDeclaration,...e}}),canvasMutationCb:se,fontCb:e=>Hx({type:Q.IncrementalSnapshot,data:{source:$.Font,...e}}),selectionCb:e=>{Hx({type:Q.IncrementalSnapshot,data:{source:$.Selection,...e}})},customElementCb:e=>{Hx({type:Q.IncrementalSnapshot,data:{source:$.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:ee,inlineStylesheet:u,sampling:v,recordDOM:x,recordCanvas:S,inlineImages:D,userTriggeredOnInput:T,collectFonts:E,doc:e,maskInputFn:m,maskTextFn:h,keepIframeSrcFn:k,blockSelector:a,slimDOMOptions:te,dataURLOptions:y,mirror:Kx,iframeManager:le,stylesheetManager:ce,shadowDomManager:de,processedNodeManager:ue,canvasManager:Wx,ignoreCSSAttributes:A,plugins:(O?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>Hx({type:Q.Plugin,data:{plugin:e.name,payload:t}})}))||[]},g);le.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{Ux(),e.push(t(document)),Gx=!0};return[`interactive`,`complete`].includes(document.readyState)?n():(e.push(rb(`DOMContentLoaded`,()=>{Hx({type:Q.DomContentLoaded,data:{}}),w===`DOMContentLoaded`&&n()})),e.push(rb(`load`,()=>{Hx({type:Q.Load,data:{}}),w===`load`&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes(`cross-origin`)||console.warn(e)}}),ue.destroy(),Gx=!1,Kb()}}catch(e){console.warn(e)}}qx.addCustomEvent=(e,t)=>{if(!Gx)throw Error(`please add custom event after start recording`);Hx({type:Q.Custom,data:{tag:e,payload:t}})},qx.freezePage=()=>{Jb.forEach(e=>e.freeze())},qx.takeFullSnapshot=e=>{if(!Gx)throw Error(`please take full snapshot after start recording`);Ux(e)},qx.mirror=Kx;function Jx(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}function Yx(e=window,t=document){if(`scrollBehavior`in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let n=e.HTMLElement||e.Element,r={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(e){return RegExp(`MSIE |Trident/|Edge/`).test(e)}let o=+!!a(e.navigator.userAgent);function s(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){return .5*(1-Math.cos(Math.PI*e))}function l(e){if(typeof e!=`object`||!e||e.behavior===void 0||e.behavior===`auto`||e.behavior===`instant`)return!0;if(typeof e==`object`&&e.behavior===`smooth`)return!1;throw TypeError(`behavior member of ScrollOptions `+e.behavior+` is not a valid value for enumeration ScrollBehavior.`)}function u(e,t){if(t===`Y`)return e.clientHeight+o<e.scrollHeight;if(t===`X`)return e.clientWidth+o<e.scrollWidth}function d(t,n){let r=e.getComputedStyle(t,null)[`overflow`+n];return r===`auto`||r===`scroll`}function f(e){let t=u(e,`Y`)&&d(e,`Y`),n=u(e,`X`)&&d(e,`X`);return t||n}function p(e){for(;e!==t.body&&f(e)===!1;)e=e.parentNode||e.host;return e}function m(t){let n=i(),r,a,o,s=(n-t.startTime)/468;s=s>1?1:s,r=c(s),a=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,a,o),(a!==t.x||o!==t.y)&&e.requestAnimationFrame(m.bind(e,t))}function h(n,a,o){let c,l,u,d,f=i();n===t.body?(c=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=r.scroll):(c=n,l=n.scrollLeft,u=n.scrollTop,d=s),m({scrollable:c,method:d,startTime:f,startX:l,startY:u,x:a,y:o})}e.scroll=e.scrollTo=function(){arguments[0]!==void 0&&(l(arguments[0])===!0?r.scroll.call(e,arguments[0].left===void 0?typeof arguments[0]==`object`?e.scrollX||e.pageXOffset:arguments[0]:arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?e.scrollY||e.pageYOffset:arguments[1]:arguments[0].top):h.call(e,t.body,arguments[0].left===void 0?e.scrollX||e.pageXOffset:~~arguments[0].left,arguments[0].top===void 0?e.scrollY||e.pageYOffset:~~arguments[0].top))},e.scrollBy=function(){arguments[0]!==void 0&&(l(arguments[0])?r.scrollBy.call(e,arguments[0].left===void 0?typeof arguments[0]==`object`?0:arguments[0]:arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?0:arguments[1]:arguments[0].top):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(l(arguments[0])===!0){if(typeof arguments[0]==`number`&&arguments[1]===void 0)throw SyntaxError(`Value could not be converted`);r.elementScroll.call(this,arguments[0].left===void 0?typeof arguments[0]==`object`?this.scrollLeft:~~arguments[0]:~~arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?this.scrollTop:~~arguments[1]:~~arguments[0].top);return}let e=arguments[0].left,t=arguments[0].top;h.call(this,this,e===void 0?this.scrollLeft:~~e,t===void 0?this.scrollTop:~~t)},n.prototype.scrollBy=function(){arguments[0]!==void 0&&(l(arguments[0])===!0?r.elementScroll.call(this,arguments[0].left===void 0?~~arguments[0]+this.scrollLeft:~~arguments[0].left+this.scrollLeft,arguments[0].top===void 0?~~arguments[1]+this.scrollTop:~~arguments[0].top+this.scrollTop):this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}))},n.prototype.scrollIntoView=function(){if(l(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0||arguments[0]);return}let n=p(this),i=n.getBoundingClientRect(),a=this.getBoundingClientRect();n===t.body?e.scrollBy({left:a.left,top:a.top,behavior:`smooth`}):(h.call(this,n,n.scrollLeft+a.left-i.left,n.scrollTop+a.top-i.top),e.getComputedStyle(n).position!==`fixed`&&e.scrollBy({left:i.left,top:i.top,behavior:`smooth`}))}}var Xx=class{constructor(e=[],t){J(this,`timeOffset`,0),J(this,`speed`),J(this,`actions`),J(this,`raf`,null),J(this,`lastTimestamp`),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let e=this.actions[0];if(this.timeOffset>=e.delay)this.actions.shift(),e.doAction();else break}this.raf=this.actions.length>0?requestAnimationFrame(this.rafCheck.bind(this)):!0}clear(){this.raf&&=(this.raf!==!0&&cancelAnimationFrame(this.raf),null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){let r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else if(this.actions[r].delay>e.delay)n=r-1;else return r+1}return t}};function Zx(e,t){if(e.type===Q.IncrementalSnapshot&&e.data.source===$.MouseMove&&e.data.positions&&e.data.positions.length){let n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}function Qx(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(t===void 0||t-->0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}var $x;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})($x||={});var eS={type:`xstate.init`};function tS(e){return e===void 0?[]:[].concat(e)}function nS(e){return{type:`xstate.assign`,assignment:e}}function rS(e,t){return typeof(e=typeof e==`string`&&t&&t[e]?t[e]:e)==`string`?{type:e}:typeof e==`function`?{type:e.name,exec:e}:e}function iS(e){return function(t){return e===t}}function aS(e){return typeof e==`string`?{type:e}:e}function oS(e,t){return{value:e,context:t,actions:[],changed:!1,matches:iS(e)}}function sS(e,t,n){var r=t,i=!1;return[e.filter(function(e){if(e.type===`xstate.assign`){i=!0;var t=Object.assign({},r);return typeof e.assignment==`function`?t=e.assignment(r,n):Object.keys(e.assignment).forEach(function(i){t[i]=typeof e.assignment[i]==`function`?e.assignment[i](r,n):e.assignment[i]}),r=t,!1}return!0}),r,i]}function cS(e,t){t===void 0&&(t={});var n=Qx(sS(tS(e.states[e.initial].entry).map(function(e){return rS(e,t.actions)}),e.context,eS),2),r=n[0],i=n[1],a={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:iS(e.initial)},transition:function(t,n){var r,i,o=typeof t==`string`?{value:t,context:e.context}:t,s=o.value,c=o.context,l=aS(n),u=e.states[s];if(u.on){var d=tS(u.on[l.type]);try{for(var f=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}(d),p=f.next();!p.done;p=f.next()){var m=p.value;if(m===void 0)return oS(s,c);var h=typeof m==`string`?{target:m}:m,g=h.target,_=h.actions,v=_===void 0?[]:_,y=h.cond,b=y===void 0?function(){return!0}:y,x=g===void 0,S=g??s,C=e.states[S];if(b(c,l)){var w=Qx(sS((x?tS(v):[].concat(u.exit,v,C.entry).filter(function(e){return e})).map(function(e){return rS(e,a._options.actions)}),c,l),3),T=w[0],E=w[1],D=w[2],O=g??s;return{value:O,context:E,actions:T,changed:g!==s||T.length>0||D,matches:iS(O)}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}return oS(s,c)}};return a}var lS=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function uS(e){var t=e.initialState,n=$x.NotStarted,r=new Set,i={_machine:e,send:function(i){n===$x.Running&&(t=e.transition(t,i),lS(t,aS(i)),r.forEach(function(e){return e(t)}))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var a=typeof r==`object`?r:{context:e.config.context,value:r};t={value:a.value,actions:[],context:a.context,matches:iS(a.value)}}return n=$x.Running,lS(t,eS),i},stop:function(){return n=$x.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}function dS(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type===Q.Meta&&r.timestamp<=t)return e.slice(n)}return e}function fS(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){return uS(cS({id:`player`,context:e,initial:`paused`,states:{playing:{on:{PAUSE:{target:`paused`,actions:[`pause`]},CAST_EVENT:{target:`playing`,actions:`castEvent`},END:{target:`paused`,actions:[`resetLastPlayedEvent`,`pause`]},ADD_EVENT:{target:`playing`,actions:[`addEvent`]}}},paused:{on:{PLAY:{target:`playing`,actions:[`recordTimeOffset`,`play`]},CAST_EVENT:{target:`paused`,actions:`castEvent`},TO_LIVE:{target:`live`,actions:[`startLive`]},ADD_EVENT:{target:`paused`,actions:[`addEvent`]}}},live:{on:{ADD_EVENT:{target:`live`,actions:[`addEvent`]},CAST_EVENT:{target:`live`,actions:[`castEvent`]}}}}},{actions:{castEvent:nS({lastPlayedEvent:(e,t)=>t.type===`CAST_EVENT`?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:nS((e,t)=>{let n=e.timeOffset;return`payload`in t&&`timeOffset`in t.payload&&(n=t.payload.timeOffset),{...e,timeOffset:n,baselineTime:e.events[0].timestamp+n}}),play(e){let{timer:i,events:a,baselineTime:o,lastPlayedEvent:s}=e;i.clear();for(let e of a)Zx(e,o);let c=dS(a,o),l=s?.timestamp;s?.type===Q.IncrementalSnapshot&&s.data.source===$.MouseMove&&(l=s.timestamp+s.data.positions[0]?.timeOffset),o<(l||0)&&r.emit(Ib.PlayBack);let u=[];for(let e of c)if(!(l&&l<o&&(e.timestamp<=l||e===s))){if(e.timestamp<o)u.push(e);else{let n=t(e,!1);i.addAction({doAction:()=>{n()},delay:e.delay})}}n(u),r.emit(Ib.Flush),i.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:nS(e=>({...e,lastPlayedEvent:null})),startLive:nS({baselineTime:(e,t)=>(e.timer.start(),t.type===`TO_LIVE`&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:nS((e,n)=>{let{baselineTime:r,timer:i,events:a}=e;if(n.type===`ADD_EVENT`){let{event:e}=n.payload;Zx(e,r);let o=a.length-1;if(!a[o]||a[o].timestamp<=e.timestamp)a.push(e);else{let t=-1,n=0;for(;n<=o;){let t=Math.floor((n+o)/2);a[t].timestamp<=e.timestamp?n=t+1:o=t-1}t===-1&&(t=n),a.splice(t,0,e)}let s=e.timestamp<r,c=t(e,s);s?c():i.isActive()&&i.addAction({doAction:()=>{c()},delay:e.delay})}return{...e,events:a}})}}))}function pS(e){return uS(cS({id:`speed`,context:e,initial:`normal`,states:{normal:{on:{FAST_FORWARD:{target:`skipping`,actions:[`recordSpeed`,`setSpeed`]},SET_SPEED:{target:`normal`,actions:[`setSpeed`]}}},skipping:{on:{BACK_TO_NORMAL:{target:`normal`,actions:[`restoreSpeed`]},SET_SPEED:{target:`normal`,actions:[`setSpeed`]}}}}},{actions:{setSpeed:(e,t)=>{`payload`in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:nS({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}}))}var mS=e=>[`.${e} { background: currentColor }`,`noscript { display: none !important; }`],hS=new Map;function gS(e,t){let n=hS.get(e);return n||(n=new Map,hS.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function _S(e,t,n){return async r=>{if(r&&typeof r==`object`&&`rr_type`in r){if(n&&(n.isUnchanged=!1),r.rr_type===`ImageBitmap`&&`args`in r){let i=await _S(e,t,n)(r.args);return await createImageBitmap.apply(null,i)}if(`index`in r){if(n||t===null)return r;let{rr_type:e,index:i}=r;return gS(t,e)[i]}if(`args`in r){let{rr_type:i,args:a}=r,o=window[i];return new o(...await Promise.all(a.map(_S(e,t,n))))}if(`base64`in r)return wx(r.base64);if(`src`in r){let t=e.get(r.src);if(t)return t;{let t=new Image;return t.src=r.src,e.set(r.src,t),t}}if(`data`in r&&r.rr_type===`Blob`){let i=await Promise.all(r.data.map(_S(e,t,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(_S(e,t,n)));return r}}function vS(e,t){try{return t===Pb.WebGL?e.getContext(`webgl`)||e.getContext(`experimental-webgl`):e.getContext(`webgl2`)}catch{return null}}var yS=[`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`];function bS(e,t){if(!t?.constructor)return;let{name:n}=t.constructor;if(!yS.includes(n))return;let r=gS(e,n);r.includes(t)||r.push(t)}async function xS({mutation:e,target:t,type:n,imageMap:r,errorHandler:i}){try{let i=vS(t,n);if(!i)return;if(e.setter){i[e.property]=e.args[0];return}let a=i[e.property],o=await Promise.all(e.args.map(_S(r,i)));bS(i,a.apply(i,o))}catch(t){i(e,t)}}async function SS({event:e,mutations:t,target:n,imageMap:r,errorHandler:i}){let a=n.getContext(`2d`);if(!a){i(t[0],Error(`Canvas context is null`));return}let o=t.map(async e=>Promise.all(e.args.map(_S(r,a))));(await Promise.all(o)).forEach((n,o)=>{let s=t[o];try{if(s.setter){a[s.property]=s.args[0];return}let t=a[s.property];s.property===`drawImage`&&typeof s.args[0]==`string`?(r.get(e),t.apply(a,s.args)):t.apply(a,n)}catch(e){i(s,e)}})}async function CS({event:e,mutation:t,target:n,imageMap:r,canvasEventMap:i,errorHandler:a}){try{let o=i.get(e)||t,s=`commands`in o?o.commands:[o];if([Pb.WebGL,Pb.WebGL2].includes(t.type)){for(let e=0;e<s.length;e++){let i=s[e];await xS({mutation:i,type:t.type,target:n,imageMap:r,errorHandler:a})}return}await SS({event:e,mutations:s,target:n,imageMap:r,errorHandler:a})}catch(e){a(t,e)}}var wS=class{constructor(e){J(this,`mediaMap`,new Map),J(this,`warn`),J(this,`service`),J(this,`speedService`),J(this,`emitter`),J(this,`getCurrentTime`),J(this,`metadataCallbackMap`,new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(Ib.Start,this.start.bind(this)),this.emitter.on(Ib.SkipStart,this.start.bind(this)),this.emitter.on(Ib.Pause,this.pause.bind(this)),this.emitter.on(Ib.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,n)=>{this.syncTargetWithState(n),e.pause&&n.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:n}){if(n.isPlaying){let r=(e-n.lastInteractionTimeOffset)/1e3*n.playbackRate,i=`duration`in t&&t.duration;if(Number.isNaN(i)){this.waitForMetadata(t);return}let a=n.currentTimeAtLastInteraction+r;t.loop&&i!==!1&&(a%=i),t.currentTime=a}else t.pause(),t.currentTime=n.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!(`addEventListener`in e))return;let t=()=>{this.metadataCallbackMap.delete(e);let t=this.mediaMap.get(e);t&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t})};this.metadataCallbackMap.set(e,t),e.addEventListener(`loadedmetadata`,t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:n}){let r=this.mediaMap.get(e),{type:i,playbackRate:a,currentTime:o,muted:s,volume:c,loop:l}=n;return{isPlaying:i===Fb.Play||i!==Fb.Pause&&(r?.isPlaying||e.getAttribute(`autoplay`)!==null),currentTimeAtLastInteraction:o??r?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:a??r?.playbackRate??1,volume:c??r?.volume??1,muted:s??r?.muted??e.getAttribute(`muted`)===null,loop:l??r?.loop??e.getAttribute(`loop`)===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:n,loop:r,volume:i,isPlaying:a}=t,o=this.service.state.matches(`paused`),s=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==i&&(e.volume=i),e.muted=n,e.loop=r,e.playbackRate!==s&&(e.playbackRate=s),a&&!o?e.play():e.pause()}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}}addMediaElements(e,t,n){if(![`AUDIO`,`VIDEO`].includes(e.nodeName))return;let r=e,i=n.getMeta(r);if(!i||!(`attributes`in i))return;let a=this.service.state.matches(`paused`),o=i.attributes,s=!1;s=o.rr_mediaState?o.rr_mediaState===`played`:r.getAttribute(`autoplay`)!==null,s&&a&&r.pause();let c=1;typeof o.rr_mediaPlaybackRate==`number`&&(c=o.rr_mediaPlaybackRate);let l=!1;l=typeof o.rr_mediaMuted==`boolean`?o.rr_mediaMuted:r.getAttribute(`muted`)!==null;let u=!1;u=typeof o.rr_mediaLoop==`boolean`?o.rr_mediaLoop:r.getAttribute(`loop`)!==null;let d=1;typeof o.rr_mediaVolume==`number`&&(d=o.rr_mediaVolume);let f=0;typeof o.rr_mediaCurrentTime==`number`&&(f=o.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:s,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:l,loop:u}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:n}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:n})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return[`AUDIO`,`VIDEO`].includes(e.nodeName)}reset(){this.mediaMap.clear()}};function TS(e,t){if(e.nodeName!==`DIALOG`||e instanceof Bv)return;let n=e,r=n.open,i=r&&n.matches(`dialog:modal`),a=n.getAttribute(`rr_open_mode`),o=typeof t?.attributes.open==`string`||typeof n.getAttribute(`open`)==`string`,s=a===`modal`;(!r||i&&a===`non-modal`||!i&&s)&&(n.isConnected?(r&&n.close(),o&&(s?n.showModal():n.show())):console.warn(`dialog is not attached to the dom`,n))}function ES(e,t){if(e.nodeName!==`DIALOG`||e instanceof Bv)return;let n=e;n.isConnected?t.attributes.open===null&&(n.removeAttribute(`open`),n.removeAttribute(`rr_open_mode`)):console.warn(`dialog is not attached to the dom`,n)}var DS=5e3,OS=Jx,kS=`[replayer]`,AS={duration:500,lineCap:`round`,lineWidth:3,strokeStyle:`red`};function jS(e){return e.type==Q.IncrementalSnapshot&&(e.data.source==$.TouchMove||e.data.source==$.MouseInteraction&&e.data.type==Mb.TouchStart)}var MS=class{constructor(e,t){if(J(this,`wrapper`),J(this,`iframe`),J(this,`UNSAFE_replayCanvas`,!1),J(this,`service`),J(this,`speedService`),J(this,`config`),J(this,`usingVirtualDom`,!1),J(this,`virtualDom`,new dy),J(this,`mouse`),J(this,`mouseTail`,null),J(this,`tailPositions`,[]),J(this,`emitter`,OS()),J(this,`nextUserInteractionEvent`),J(this,`legacy_missingNodeRetryMap`,{}),J(this,`cache`,Og()),J(this,`imageMap`,new Map),J(this,`canvasEventMap`,new Map),J(this,`mirror`,Up()),J(this,`styleMirror`,new Db),J(this,`mediaManager`),J(this,`firstFullSnapshot`,null),J(this,`newDocumentQueue`,[]),J(this,`mousePos`,null),J(this,`touchActive`,null),J(this,`lastMouseDownEvent`,null),J(this,`lastHoveredRootNode`),J(this,`lastSelectionData`,null),J(this,`constructedStyleMutations`,[]),J(this,`adoptedStyleSheets`,[]),J(this,`handleResize`,e=>{this.iframe.style.display=`inherit`;for(let t of[this.mouseTail,this.iframe])t&&(t.setAttribute(`width`,String(e.width)),t.setAttribute(`height`,String(e.height)))}),J(this,`applyEventsSynchronously`,e=>{for(let t of e){switch(t.type){case Q.DomContentLoaded:case Q.Load:continue;case Q.FullSnapshot:case Q.Meta:case Q.Plugin:case Q.IncrementalSnapshot:}this.getCastFn(t,!0)()}}),J(this,`getCastFn`,(e,t=!1)=>{let n;switch(e.type){case Q.DomContentLoaded:case Q.Load:break;case Q.Custom:n=()=>{this.emitter.emit(Ib.CustomEvent,e)};break;case Q.Meta:n=()=>this.emitter.emit(Ib.Resize,{width:e.data.width,height:e.data.height});break;case Q.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(e,t),(n=this.iframe.contentWindow)==null||n.scrollTo(e.data.initialOffset)};break;case Q.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&(e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){let t=this.nextUserInteractionEvent.delay-e.delay,n={speed:Math.min(Math.round(t/DS),this.config.maxSpeed)};this.speedService.send({type:`FAST_FORWARD`,payload:n}),this.emitter.emit(Ib.SkipStart,n)}}}}return()=>{n&&n();for(let n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:`CAST_EVENT`,payload:{event:e}});let r=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[r]){let t=()=>{r<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send(`END`),this.emitter.emit(Ib.Finish))},n=50;e.type===Q.IncrementalSnapshot&&e.data.source===$.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(Ib.EventCast,e)}}),!t?.liveMode&&e.length<2)throw Error(`Replayer need at least 2 events.`);let n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:1e4,showWarning:!0,showDebug:!1,blockClass:`rr-block`,liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:AS,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Ib.Resize,this.handleResize),this.setupDom();for(let e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(Ib.Flush,()=>{if(this.usingVirtualDom){let e={mirror:this.mirror,applyCanvas:(e,t,n)=>{CS({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===$.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===$.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(let n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{ry(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){this.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let t in this.legacy_missingNodeRetryMap)try{let n=this.legacy_missingNodeRetryMap[t],r=cy(n.node,this.mirror,this.virtualDom.mirror);ry(r,n.node,e,this.virtualDom.mirror),n.node=r}catch(e){this.warn(e)}this.constructedStyleMutations.forEach(e=>{this.applyStyleSheetMutation(e)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(e=>{this.applyAdoptedStyleSheet(e)}),this.adoptedStyleSheets=[]}if(this.mousePos&&=(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),null),this.touchActive===!0?this.mouse.classList.add(`touch-active`):this.touchActive===!1&&this.mouse.classList.remove(`touch-active`),this.touchActive=null,this.lastMouseDownEvent){let[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&=(this.applySelection(this.lastSelectionData),null)}),this.emitter.on(Ib.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let r=new Xx([],{speed:this.config.speed});this.service=fS({events:e.map(e=>t&&t.unpackFn?t.unpackFn(e):e).sort((e,t)=>e.timestamp-t.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(e=>{this.emitter.emit(Ib.StateChange,{player:e})}),this.speedService=pS({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(e=>{this.emitter.emit(Ib.StateChange,{speed:e})}),this.mediaManager=new wS({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let i=this.service.state.context.events.find(e=>e.type===Q.Meta),a=this.service.state.context.events.find(e=>e.type===Q.FullSnapshot);if(i){let{width:e,height:t}=i.data;setTimeout(()=>{this.emitter.emit(Ib.Resize,{width:e,height:t})},0)}a&&setTimeout(()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(e=this.iframe.contentWindow)==null||e.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(jS)&&this.mouse.classList.add(`touch-device`)}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),e.speed!==void 0&&this.speedService.send({type:`SET_SPEED`,payload:{speed:e.speed}}),e.mouseTail!==void 0&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display=`none`):(this.mouseTail||(this.mouseTail=document.createElement(`canvas`),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add(`replayer-mouse-tail`),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display=`inherit`))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t;this.service.state.matches(`paused`)||this.service.send({type:`PAUSE`}),this.service.send({type:`PLAY`,payload:{timeOffset:e}}),(t=this.iframe.contentDocument?.getElementsByTagName(`html`)[0])==null||t.classList.remove(`rrweb-paused`),this.emitter.emit(Ib.Start)}pause(e){var t;e===void 0&&this.service.state.matches(`playing`)&&this.service.send({type:`PAUSE`}),typeof e==`number`&&(this.play(e),this.service.send({type:`PAUSE`})),(t=this.iframe.contentDocument?.getElementsByTagName(`html`)[0])==null||t.classList.add(`rrweb-paused`),this.emitter.emit(Ib.Pause)}resume(e=0){this.warn(`The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface.`),this.play(e),this.emitter.emit(Ib.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Ib.Destroy)}startLive(e){this.service.send({type:`TO_LIVE`,payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;jS(t)&&this.mouse.classList.add(`touch-device`),Promise.resolve().then(()=>this.service.send({type:`ADD_EVENT`,payload:{event:t}}))}enableInteract(){this.iframe.setAttribute(`scrolling`,`auto`),this.iframe.style.pointerEvents=`auto`}disableInteract(){this.iframe.setAttribute(`scrolling`,`no`),this.iframe.style.pointerEvents=`none`}resetCache(){this.cache=Og()}setupDom(){this.wrapper=document.createElement(`div`),this.wrapper.classList.add(`replayer-wrapper`),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement(`div`),this.mouse.classList.add(`replayer-mouse`),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement(`canvas`),this.mouseTail.classList.add(`replayer-mouse-tail`),this.mouseTail.style.display=`inherit`,this.wrapper.appendChild(this.mouseTail)),this.config.UNSAFE_replayCanvas?(this.iframe=document.createElement(`iframe`),this.iframe.setAttribute(`sandbox`,`allow-same-origin allow-scripts`),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=Vg({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display=`none`,this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Yx(this.iframe.contentWindow,this.iframe.contentDocument),_b(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn(`Looks like your replayer has been destroyed.`);Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn(`Found unresolved missing node map`,this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let n=[],r=new Set,i=(t,i)=>{if(t.nodeName===`DIALOG`&&r.add(t),this.collectIframeAndAttachDocument(n,t),this.mediaManager.isSupportedMediaElement(t)){let{events:n}=this.service.state.context;this.mediaManager.addMediaElements(t,e.timestamp-n[0].timestamp,this.mirror)}for(let e of this.config.plugins||[])e.onBuild&&e.onBuild(t,{id:i,replayer:this})};this.usingVirtualDom&&=(this.virtualDom.destroyTree(),!1),this.mirror.reset(),Bg(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),i(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter(t=>t!==e);let{documentElement:a,head:o}=this.iframe.contentDocument;this.insertStyleRules(a,o),r.forEach(e=>TS(e)),this.service.state.matches(`playing`)||this.iframe.contentDocument.getElementsByTagName(`html`)[0].classList.add(`rrweb-paused`),this.emitter.emit(Ib.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;let r=mS(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push(`html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }`),r.length){if(this.usingVirtualDom){let n=this.virtualDom.createElement(`style`);this.virtualDom.mirror.add(n,Dy(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:$.StyleSheetRule,adds:r.map((e,t)=>({rule:e,index:t}))})}else{let i=document.createElement(`style`);e.insertBefore(i,t);for(let e=0;e<r.length;e++)(n=i.sheet)==null||n.insertRule(r[e],e)}}}attachDocumentToIframe(e,t){let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],i=new Set,a=(e,a)=>{e.nodeName===`DIALOG`&&i.add(e),this.collectIframeAndAttachDocument(r,e);let o=n.getMeta(e);if(o?.type===Lb.Element&&o?.tagName.toUpperCase()===`HTML`){let{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(let t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:a,replayer:this})};Lg(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(t.contentDocument,e.node.id);for(let{mutationInQueue:e,builtNode:t}of r)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter(t=>t!==e);i.forEach(e=>TS(e))}collectIframeAndAttachDocument(e,t){if(bb(t,this.mirror)){let n=this.newDocumentQueue.find(e=>e.parentId===this.mirror.getId(t));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){let e=this.iframe.contentDocument?.head;if(e){let t=new Set,n,r=this.service.state,i=()=>{r=this.service.state};this.emitter.on(Ib.Start,i),this.emitter.on(Ib.Pause,i);let a=()=>{this.emitter.off(Ib.Start,i),this.emitter.off(Ib.Pause,i)};e.querySelectorAll(`link[rel="stylesheet"]`).forEach(e=>{e.sheet||(t.add(e),e.addEventListener(`load`,()=>{t.delete(e),t.size===0&&n!==-1&&(r.matches(`playing`)&&this.play(this.getCurrentTime()),this.emitter.emit(Ib.LoadStylesheetEnd),n&&clearTimeout(n),a())}))}),t.size>0&&(this.service.send({type:`PAUSE`}),this.emitter.emit(Ib.LoadStylesheetStart),n=setTimeout(()=>{r.matches(`playing`)&&this.play(this.getCurrentTime()),n=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===Q.IncrementalSnapshot&&t.data.source===$.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),(`commands`in t.data?t.data.commands:[t.data]).forEach(e=>{this.preloadImages(e,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property===`drawImage`&&typeof e.args[0]==`string`&&!this.imageMap.has(t)){let e=document.createElement(`canvas`),t=e.getContext(`2d`),n=t?.createImageData(e.width,e.height);t?.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let n={isUnchanged:!0};if(`commands`in e){let r=await Promise.all(e.commands.map(async e=>{let t=await Promise.all(e.args.map(_S(this.imageMap,null,n)));return{...e,args:t}}));n.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:r})}else{let r=await Promise.all(e.args.map(_S(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:r})}}}applyIncremental(e,t){var n,r;let{data:i}=e;switch(i.source){case $.Mutation:try{this.applyMutation(i,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,i)}break;case $.Drag:case $.TouchMove:case $.MouseMove:if(t){let e=i.positions[i.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:i}}else i.positions.forEach(n=>{let r={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,i)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(r)}),this.timer.addAction({doAction(){},delay:e.delay-i.positions[0]?.timeOffset});break;case $.MouseInteraction:{if(i.id===-1)break;let e=new Event(Gp(Mb[i.type])),n=this.mirror.getNode(i.id);if(!n)return this.debugNodeNotFound(i,i.id);this.emitter.emit(Ib.MouseInteraction,{type:i.type,target:n});let{triggerFocus:r}=this.config;switch(i.type){case Mb.Blur:`blur`in n&&n.blur();break;case Mb.Focus:r&&n.focus&&n.focus({preventScroll:!0});break;case Mb.Click:case Mb.TouchStart:case Mb.TouchEnd:case Mb.MouseDown:case Mb.MouseUp:t?(i.type===Mb.TouchStart?this.touchActive=!0:i.type===Mb.TouchEnd&&(this.touchActive=!1),i.type===Mb.MouseDown?this.lastMouseDownEvent=[n,e]:i.type===Mb.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:i.x||0,y:i.y||0,id:i.id,debugData:i}):(i.type===Mb.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x||0,i.y||0,i.id,t,i),i.type===Mb.Click?(this.mouse.classList.remove(`active`),this.mouse.offsetWidth,this.mouse.classList.add(`active`)):i.type===Mb.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add(`touch-active`)):i.type===Mb.TouchEnd?this.mouse.classList.remove(`touch-active`):n.dispatchEvent(e));break;case Mb.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove(`touch-active`);break;default:n.dispatchEvent(e)}break}case $.Scroll:if(i.id===-1)break;if(this.usingVirtualDom){let e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.scrollData=i;break}this.applyScroll(i,t);break;case $.ViewportResize:this.emitter.emit(Ib.Resize,{width:i.width,height:i.height});break;case $.Input:if(i.id===-1)break;if(this.usingVirtualDom){let e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.inputData=i;break}this.applyInput(i);break;case $.MediaInteraction:{let t=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);let n=t,{events:r}=this.service.state.context;this.mediaManager.mediaMutation({target:n,timeOffset:e.timestamp-r[0].timestamp,mutation:i});break}case $.StyleSheetRule:case $.StyleDeclaration:this.usingVirtualDom?i.styleId?this.constructedStyleMutations.push(i):i.id&&((n=this.virtualDom.mirror.getNode(i.id))==null||n.rules.push(i)):this.applyStyleSheetMutation(i);break;case $.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let t=this.virtualDom.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);t.canvasMutations.push({event:e,mutation:i})}else{let t=this.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);CS({event:e,mutation:i,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case $.Font:try{let e=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(r=this.iframe.contentDocument)==null||r.fonts.add(e)}catch(e){this.warn(e)}break;case $.Selection:if(t){this.lastSelectionData=i;break}this.applySelection(i);break;case $.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(i):this.applyAdoptedStyleSheet(i)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,wy(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let e in this.legacy_missingNodeRetryMap)try{let t=this.legacy_missingNodeRetryMap[e],n=Cy(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(t=>n.getNode(t.id)?!0:(this.warnNodeNotFound(e,t.id),!1)),e.removes.forEach(t=>{let r=n.getNode(t.id);if(!r)return;let i=n.getNode(t.parentId);if(!i)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Cb(i)&&(i=i.shadowRoot),n.removeNodeFromMap(r),i)try{i.removeChild(r),this.usingVirtualDom&&r.nodeName===`#text`&&i.nodeName===`STYLE`&&i.rules?.length>0&&(i.rules=[])}catch(t){if(t instanceof DOMException)this.warn(`parent could not remove child in mutation`,i,r,e);else throw t}});let r={...this.legacy_missingNodeRetryMap},i=[],a=e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),e.nextId!==null&&e.nextId!==void 0&&e.nextId!==-1&&!t},o=e=>{if(!this.iframe.contentDocument)return this.warn(`Looks like your replayer has been destroyed.`);let t=n.getNode(e.parentId);if(!t)return e.node.type===Lb.Document?this.newDocumentQueue.push(e):i.push(e);e.node.isShadow&&(Cb(t)||t.attachShadow({mode:`open`}),t=t.shadowRoot);let o=null,s=null;if(e.previousId&&(o=n.getNode(e.previousId)),e.nextId&&(s=n.getNode(e.nextId)),a(e))return i.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;let c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(bb(t,n)){this.attachDocumentToIframe(e,t);return}let l=(e,t)=>{if(!this.usingVirtualDom){TS(e);for(let n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}},u=Lg(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:l});if(e.previousId===-1||e.nextId===-1){r[e.node.id]={node:u,mutation:e};return}let d=n.getMeta(t);if(d&&d.type===Lb.Element&&e.node.type===Lb.Text){let e=Array.isArray(t.childNodes)?t.childNodes:Array.from(t.childNodes);if(d.tagName===`textarea`)for(let n of e)n.nodeType===t.TEXT_NODE&&t.removeChild(n);else if(d.tagName===`style`&&e.length===1)for(let r of e)r.nodeType===t.TEXT_NODE&&!n.hasNode(r)&&(u.textContent=r.textContent,t.removeChild(r))}else if(d?.type===Lb.Document){let n=t;e.node.type===Lb.DocumentType&&n.childNodes[0]?.nodeType===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),u.nodeName===`HTML`&&n.documentElement&&n.removeChild(n.documentElement)}if(o&&o.nextSibling&&o.nextSibling.parentNode?t.insertBefore(u,o.nextSibling):s&&s.parentNode?t.contains(s)?t.insertBefore(u,s):t.insertBefore(u,null):t.appendChild(u),l(u,e.node.id),this.usingVirtualDom&&u.nodeName===`#text`&&t.nodeName===`STYLE`&&t.rules?.length>0&&(t.rules=[]),bb(u,this.mirror)){let e=this.mirror.getId(u),t=this.newDocumentQueue.find(t=>t.parentId===e);t&&(this.attachDocumentToIframe(t,u),this.newDocumentQueue=this.newDocumentQueue.filter(e=>e!==t))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(r,t,u,e)};e.adds.forEach(e=>{o(e)});let s=Date.now();for(;i.length;){let e=vb(i);if(i.length=0,Date.now()-s>500){this.warn(`Timeout in the loop, please check the resolve tree data:`,e);break}for(let t of e)n.getNode(t.value.parentId)?yb(t,e=>{o(e)}):this.debug(`Drop resolve tree since there is no parent for the root node.`,t)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),Eb(e.texts).forEach(t=>{let r=n.getNode(t.id);if(!r)return e.removes.find(e=>e.id===t.id)?void 0:this.warnNodeNotFound(e,t.id);let i=r.parentElement;if(r.textContent=t.value&&i&&i.tagName===`STYLE`?Dg(t.value,this.cache):t.value,this.usingVirtualDom){let e=r.parentNode;e?.rules?.length>0&&(e.rules=[])}}),e.attributes.forEach(t=>{let r=n.getNode(t.id);if(!r)return e.removes.find(e=>e.id===t.id)?void 0:this.warnNodeNotFound(e,t.id);for(let e in t.attributes)if(typeof e==`string`){let i=t.attributes[e];if(i===null)r.removeAttribute(e),e===`open`&&ES(r,t);else if(typeof i==`string`)try{if(e===`_cssText`&&(r.nodeName===`LINK`||r.nodeName===`STYLE`))try{let e=n.getMeta(r),i=Lg({...e,attributes:{...e.attributes,...t.attributes}},{doc:r.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(e.attributes,t.attributes);let a=r.nextSibling,o=r.parentNode;if(i&&o){o.removeChild(r),o.insertBefore(i,a),n.replace(t.id,i);break}}catch{}if(e===`value`&&r.nodeName===`TEXTAREA`){let e=r;e.childNodes.forEach(t=>e.removeChild(t));let t=r.ownerDocument?.createTextNode(i);t&&e.appendChild(t)}else r.setAttribute(e,i);e===`rr_open_mode`&&r.nodeName===`DIALOG`&&TS(r,t)}catch(e){this.warn(`An error occurred may due to the checkout feature.`,e)}else if(e===`style`){let e=i,t=r;for(let n in e)if(e[n]===!1)t.style.removeProperty(n);else if(e[n]instanceof Array){let r=e[n];t.style.setProperty(n,r[0],r[1])}else{let r=e[n];t.style.setProperty(n,r)}}}})}applyScroll(e,t){var n,r;let i=this.mirror.getNode(e.id);if(!i)return this.debugNodeNotFound(e,e.id);let a=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)(n=this.iframe.contentWindow)==null||n.scrollTo({top:e.y,left:e.x,behavior:t?`auto`:`smooth`});else if(a?.type===Lb.Document)(r=i.defaultView)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?`auto`:`smooth`});else try{i.scrollTo({top:e.y,left:e.x,behavior:t?`auto`:`smooth`})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,n=e.ranges.map(({start:e,startOffset:n,end:r,endOffset:i})=>{let a=this.mirror.getNode(e),o=this.mirror.getNode(r);if(!a||!o)return;let s=new Range;s.setStart(a,n),s.setEnd(o,i);let c=a.ownerDocument?.getSelection();return c&&t.add(c),{range:s,selection:c}});t.forEach(e=>e.removeAllRanges()),n.forEach(e=>e&&e.selection?.addRange(e.range))}catch{}}applyStyleSheetMutation(e){let t=null;e.styleId?t=this.styleMirror.getStyle(e.styleId):e.id&&(t=this.mirror.getNode(e.id)?.sheet||null),t&&(e.source===$.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===$.StyleDeclaration&&this.applyStyleDeclaration(e,t))}applyStyleSheetRule(e,t){var n,r,i,a;if((n=e.adds)==null||n.forEach(({rule:e,index:n})=>{try{if(Array.isArray(n)){let{positions:r,index:i}=Tb(n);wb(t.cssRules,r)?.insertRule(e,i)}else{let r=n===void 0?void 0:Math.min(n,t.cssRules.length);t?.insertRule(e,r)}}catch{}}),(r=e.removes)==null||r.forEach(({index:e})=>{try{if(Array.isArray(e)){let{positions:n,index:r}=Tb(e);wb(t.cssRules,n)?.deleteRule(r||0)}else t?.deleteRule(e)}catch{}}),typeof e.replace==`string`)try{(i=t.replace)==null||i.call(t,e.replace)}catch{}if(typeof e.replaceSync==`string`)try{(a=t.replaceSync)==null||a.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){if(e.set){let n=wb(t.rules,e.index);n?.style&&n.style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){let n=wb(t.rules,e.index);n?.style&&n.style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;let n=this.mirror.getNode(e.id);if(!n)return;(t=e.styles)==null||t.forEach(e=>{let t=null,r=null;if(Cb(n)?r=n.ownerDocument?.defaultView||null:n.nodeName===`#document`&&(r=n.defaultView),r)try{t=new r.CSSStyleSheet,this.styleMirror.add(t,e.styleId),this.applyStyleSheetRule({source:$.StyleSheetRule,adds:e.rules},t)}catch{}});let r=0,i=(e,t)=>{let n=t.map(e=>this.styleMirror.getStyle(e)).filter(e=>e!==null);Cb(e)?e.shadowRoot.adoptedStyleSheets=n:e.nodeName===`#document`&&(e.adoptedStyleSheets=n),n.length!==t.length&&r<10&&(setTimeout(()=>i(e,t),0+100*r),r++)};i(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,r){let{previousId:i,nextId:a}=r,o=i&&e[i],s=a&&e[a];if(o){let{node:r,mutation:i}=o;t.insertBefore(r,n),delete e[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(e,t,r,i)}if(s){let{node:r,mutation:i}=s;t.insertBefore(r,n.nextSibling),delete e[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(e,t,r,i)}}moveAndHover(e,t,n,r,i){let a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(i,n);let o=Sb(a,this.iframe),s=e*o.absoluteScale+o.x,c=t*o.absoluteScale+o.y;this.mouse.style.left=`${s}px`,this.mouse.style.top=`${c}px`,r||this.drawMouseTail({x:s,y:c}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:n,strokeStyle:r,duration:i}=this.config.mouseTail===!0?AS:Object.assign({},AS,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;let e=this.mouseTail.getContext(`2d`);e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=r,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(t=>e.lineTo(t.x,t.y)),e.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(t=>t!==e),a()},i/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(`.\\:hover`).forEach(e=>{e.classList.remove(`:hover`)}),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(`:hover`),n=n.parentElement}isUserInteraction(e){return e.type===Q.IncrementalSnapshot&&e.data.source>$.Mutation&&e.data.source<=$.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches(`normal`)&&(this.speedService.send({type:`BACK_TO_NORMAL`}),this.emitter.emit(Ib.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn(`Has error on canvas update`,t,`canvas mutation:`,e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(kS,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(kS,...e)}},{addCustomEvent:NS}=qx,{freezePage:PS}=qx,{takeFullSnapshot:FS}=qx;function IS(e){let t=e[0]?.timestamp??0,n=e=>(e-t)/1e3,r={shapes:[],loads:[],pointer:[],away:[],clicks:[],changes:[],acted:[],dialogs:[]},i=``;for(let t of e){if(t.type===Q.Custom){let{tag:e,payload:a}=t.data;e===`dialog`&&r.dialogs.push({from:n(t.timestamp),until:1/0,host:i,...a});let o=r.dialogs.at(-1);e===`dialog answered`&&o?.until===1/0&&Object.assign(o,{until:n(t.timestamp),yes:a.yes,...a.value!==void 0&&{value:a.value}})}if(t.type===Q.Meta){r.loads.push(n(t.timestamp)),i=URL.parse(t.data.href)?.host??i;let{width:e,height:a}=t.data,o=r.shapes.at(-1);o&&o.width===e&&o.height===a||r.shapes.push({from:o?n(t.timestamp):0,width:e,height:a,touch:!1})}if(t.type!==Q.IncrementalSnapshot)continue;let e=t.data;if(e.source===$.MouseMove)for(let i of e.positions)r.pointer.push([n(t.timestamp+i.timeOffset),i.x,i.y]);else if(e.source===$.MouseInteraction&&e.x!==void 0&&e.y!==void 0){r.pointer.push([n(t.timestamp),e.x,e.y]),e.type===Mb.Click&&r.clicks.push(n(t.timestamp));let i=r.shapes.at(-1);e.type===Mb.TouchStart&&i&&(i.touch=!0),e.type===Mb.Click&&r.acted.push([n(t.timestamp),e.id])}else e.source===$.Input&&r.acted.push([n(t.timestamp),e.id]);([$.Mutation,$.Scroll,$.Input].includes(e.source)||e.source===$.MouseInteraction&&e.type===Mb.Click)&&r.changes.push(n(t.timestamp)+.01)}return r.shapes.length||r.shapes.push({from:0,width:1280,height:800,touch:!1}),r.pointer.sort((e,t)=>e[0]-t[0]),r.away=US(r),r}var LS=(e,t)=>e.findLast(e=>e.from<=t)??e[0];function RS(e,t){let n=e[0]?.timestamp??0,r=new Set,i=(e,n)=>{let a=n||e.id===t;a?r.add(e.id):r.delete(e.id);for(let t of e.childNodes??[])i(t,a)},a=[];for(let t of e){if(t.type===Q.FullSnapshot&&i(t.data.node,!1),t.type!==Q.IncrementalSnapshot||t.data.source!==$.Mutation)continue;let{adds:e,removes:o,texts:s,attributes:c}=t.data;for(let t of e)i(t.node,r.has(t.parentId));[...e.map(e=>e.parentId),...o.map(e=>e.parentId),...s.map(e=>e.id),...c.map(e=>e.id)].some(e=>r.has(e))&&a.push((t.timestamp-n)/1e3)}return a}var zS=2,BS=24,VS=.4,HS=1500;function US({pointer:e,shapes:t}){let n=n=>{let[r,i,a]=e[n],{width:o,height:s}=LS(t,r);return Math.min(i,a,o-1-i,s-1-a)},r=t=>{let[n,r]=[e[t],e[t+1]];return Math.hypot(r[1]-n[1],r[2]-n[2])/Math.max(.016,r[0]-n[0])>HS},i=e=>n(e)<=BS,a=[];for(let t=0;t<e.length;t++){let o=n(t)<=zS,s=t+1<e.length&&e[t+1][0]-e[t][0]>VS&&i(t+1);if(!o&&!s)continue;let c=t;for(;c>0&&(r(c-1)||i(c-1));)c--;let l=s?t+1:t;for(;l+1<e.length&&(r(l)||i(l+1));)l++;let u=[e[c][0],e[l][0]],d=a.at(-1);d&&u[0]<=d[1]?d[1]=Math.max(d[1],u[1]):a.push(u),t=Math.max(t,l)}return a}var WS=class{host=document.createElement(`div`);shapes;loads;pointer;away;clicks;dialogs;#e;#t;#n;#r=-1;#i=-1/0;#a=new WeakSet;#o=new WeakMap;constructor(e,t){let n=e[0]?.timestamp??0;for(let t of e){if(t.type!==Q.IncrementalSnapshot||t.data.source!==$.Mutation)continue;let e=t.data.removes;Object.defineProperty(t.data,"removes",{get:()=>e,set(){},enumerable:!0,configurable:!0})}({shapes:this.shapes,loads:this.loads,pointer:this.pointer,away:this.away,clicks:this.clicks,dialogs:this.dialogs}=IS(e)),this.#n=Math.max(0,(e.find(e=>e.type===Q.FullSnapshot)?.timestamp??n)-n+1),this.host.className=`absolute top-0 left-0 origin-top-left [&_.replayer-mouse]:hidden [&_iframe]:pointer-events-none [&_iframe]:block [&_iframe]:border-0`,this.#t=this.shapes[0],Object.assign(this.host.style,{width:`${this.#t.width}px`,height:`${this.#t.height}px`}),t.append(this.host),this.#e=new MS(e,{root:this.host,mouseTail:!1,triggerFocus:!1,pauseAnimation:!1,showWarning:!1}),this.#s(),this.#e.pause(this.#n)}show(e,t,n){let r=Math.max(Math.round(Math.max(0,e)*1e3),this.#n),i=r!==this.#r;if(i){let e=this.#r<0||r<this.#r||r-this.#r>300;e&&(this.#o=new WeakMap),this.#e.pause(r),this.#r=r,e&&this.#c();let t=this.shapeAt(r/1e3);t!==this.#t&&(this.#t=t,Object.assign(this.host.style,{width:`${t.width}px`,height:`${t.height}px`}))}let a=r-this.#i<150;for(let e of this.#u()){try{a?GS(e):this.#l(e)||(t?(e.playbackRate!==n&&(e.playbackRate=n),e.playState===`paused`&&e.play()):i||!this.#a.has(e)||Number(e.currentTime)<20?GS(e):e.playState===`running`&&e.pause())}catch{}this.#a.add(e)}}rest(){this.#c();for(let e of this.#u())GS(e)}shapeAt(e){return LS(this.shapes,e)}pointerAt(e,t=0){let n=this.pointer;if(!n.length||e<0||this.away.some(([t,n])=>e>=t&&e<=n))return;let r=0,i=n.length-1;for(;r<i;){let t=r+i+1>>1;n[t][0]<=e?r=t:i=t-1}let[a,o]=[n[r],n[r+1]];if(a[0]<t)return o&&[o[1],o[2]];if(!o||e<=a[0]||o[0]-a[0]>.25)return[a[1],a[2]];let s=(e-a[0])/(o[0]-a[0]);return[a[1]+(o[1]-a[1])*s,a[2]+(o[2]-a[2])*s]}boxOf(e){let t=this.#e.getMirror().getNode(e)?.getBoundingClientRect?.();return t&&(t.width||t.height)?{left:t.left,top:t.top,width:t.width,height:t.height}:void 0}outwards(e,t){let n=this.#e.iframe.contentDocument,r=this.#e.getMirror(),i=[...n?.querySelectorAll(`[inert]`)??[]];for(let e of i)e.removeAttribute(`inert`);let a=[];for(let i=n?.elementFromPoint(e,t)??null;i&&i!==n?.body;i=i.parentElement)a.push(r.getId(i));for(let e of i)e.setAttribute(`inert`,``);return a}destroy(){this.#e.destroy(),this.host.remove()}#s(){let e=this.#e.iframe.contentWindow?.HTMLDialogElement.prototype;if(!e)return;let t=e.showModal;e.showModal=function(){this.inert=!0,t.call(this)}}#c(){this.#i=this.#r;let e=performance.now()+400,t=()=>{if(!(this.#r-this.#i>=150)){for(let e of this.#u())e.playState!==`finished`&&GS(e);performance.now()<e&&requestAnimationFrame(t)}};requestAnimationFrame(t)}#l(e){if(this.#a.has(e)||!(`animationName`in e))return!1;let t=e.effect,n=t?.target;if(!n||t.getTiming().iterations===1/0)return!1;let r=String(e.animationName),i=this.#o.get(n)??new Map;this.#o.set(n,i);let a=i.get(r);if(a===void 0)return i.set(r,this.#r),!1;let o=Number(t.getComputedTiming().endTime);return this.#r-a>=o?GS(e):e.currentTime=this.#r-a,!0}#u(){try{return this.#e.iframe.contentDocument?.getAnimations()??[]}catch{return[]}}};function GS(e){try{e.finish()}catch{}}function KS({shot:e}){let{src:t,frame:n}=e,[r,i]=(0,l.useState)();if(r===t)return null;let a=()=>i(t);return n?(0,K.jsx)(`img`,{src:t,alt:``,draggable:!1,onError:a,className:`pointer-events-none absolute max-w-none`,style:{width:`${100/n.width}%`,height:`${100/n.height}%`,left:`${-n.x/n.width*100}%`,top:`${-n.y/n.height*100}%`}}):(0,K.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`pointer-events-none absolute inset-0 size-full object-contain`,onError:a})}function qS(e,t,n){let r=Kl(e.id,t.number,n.recording,Math.max(0,n.steps.length-2)),[i,a]=(0,l.useState)();return(0,l.useEffect)(()=>{let i=!0,o=n.steps.at(-1);return n.steps.length>1&&o&&Vl(e.id,t.number,n.recording).then(e=>{let{shapes:t,clicks:n,pointer:s}=IS(e),c=n.find(e=>e>=o.at),{width:l,height:u}=LS(t,c??o.at),d=c===void 0?void 0:s.findLast(([e])=>e<=c+.01)?.slice(1);i&&d&&Math.abs(l/u-1.6)<.05&&a({src:r,frame:{x:Xu(d[0]/l-.2,0,.6),y:Xu(d[1]/u-.2,0,.6),width:.4,height:.4}})}),()=>void(i=!1)},[e.id,t.number,n,r]),i?.src===r?i:{src:r}}var JS=()=>matchMedia(`(max-width: 820px)`).matches;function YS(e,t){let[n,r]=(0,l.useState)(()=>new Map),i=t.flatMap(e=>e.flows.map(t=>({round:e.number,flow:t}))),a=i.map(({round:e,flow:t})=>`${e}/${t.name}/${t.recording}`).join(`
|
|
193
|
-
`);return(0,l.useEffect)(()=>{let t=!0;for(let{round:n,flow:a}of i)Promise.all([Wl(e.id,n,a.recording),Gl(e.id,n,a.recording)]).then(([e,i])=>{let o=[...e,...i].sort((e,t)=>e.at-t.at);t&&r(t=>t.has(`${n}/${a.recording}`)?t:new Map(t).set(`${n}/${a.recording}`,{readings:e,seen:o}))});return()=>void(t=!1)},[e.id,a]),((e,t,r)=>{let a=i.find(n=>n.round===e&&n.flow.name===t)?.flow,o=a&&n.get(`${e}/${a.recording}`);return r?o?.seen:o?.readings})}var XS=new WeakMap;function ZS(e,t,n){let r=XS.get(e);if(!r){r=new Map;for(let t of e)for(let e of t.things)e.node!==void 0&&(r.get(e.node)??r.set(e.node,[]).get(e.node)).push({at:t.at,thing:e});XS.set(e,r)}return r.get(t)?.reduce((e,t)=>Math.abs(t.at-n)<Math.abs(e.at-n)?t:e).thing}var QS=e=>e.role===`text`||e.role===`box`;function $S(e,t,n){let r,i=e=>Dl.test(e.role)||t.some(t=>t.things.includes(e)&&ee(t,e));for(let a of e){let e=ZS(t,a,n);if(e?.name){if(!QS(e))return r&&i(e)?r:e;r??=e}}return r}function eC(e,t,n,r,i,a){let o=(e,t)=>Math.abs(e.left-t.left)<=2&&Math.abs(e.top-t.top)<=2&&Math.abs(e.width-t.width)<=2&&Math.abs(e.height-t.height)<=2,s=[],c=i(r.node);for(let l of e.slice(e.indexOf(r.node)+1)){let e=ZS(t,l,n),r=e?.name?i(l):void 0;if(!(!e||!r||c&&o(r,c))){if(r.width*r.height>.9*a.width*a.height)break;s.push(e),c=r}}return s}function tC(e,t,n){if(!e)return`New note`;if(e.at===void 0)return`The whole flow`;let r=t(n,e.flow,!0);if(e.element)return nC(e.element,r,e.at);let i=e.point&&r&&Ol(r,e.at,e.point);return i?`Near ${h(i)}`:`This moment`}var nC=(e,t,n)=>h(e.node!==void 0&&t&&ZS(t,e.node,n)||{...e,words:e.name});function rC(e,t,n,r,i,a){return i.number===r?n:i.replies.find(e=>e.note===t)?.on??sC(e,n,r,i,a)}var iC=1;function aC(e,t,n=[]){let r=e.replies.find(e=>e.note===t),i=r?.watch?e.flows.find(e=>e.name===r.on?.flow):void 0,a=i?.steps.findIndex(e=>e.title===r.watch)??-1;if(!i||a<0)return;let o=i.steps[a],s=i.steps[a+1]?.at??i.length,c=Math.min(r.on?.at??s,s),l=o.actions?.filter(e=>e<=c)??[],u=l.find((e,t)=>n.some(n=>n>e&&n<=(l[t+1]??c)))??l.at(-1)??o.at;return{flow:i.name,at:Math.max(0,Math.round((u-iC)*100)/100),until:s}}var oC=new Map;function sC(e,t,n,r,i){let a=e.rounds.find(e=>e.number===n)?.flows.find(e=>e.name===t.flow),o=r.flows.find(e=>e.name===t.flow),s=i(n,t.flow),c=i(r.number,t.flow);if(!a||!o||!s||!c)return;let l=JSON.stringify([e.id,n,r.number,t]);return oC.has(l)||oC.set(l,El(t,{flow:a,readings:s},{flow:o,readings:c})),oC.get(l)}function cC(e,t){let n=Math.min(e.width/t.width,e.height/t.height);return{k:n,x:-(e.width-t.width*n)/2/n,y:0,fit:n}}function lC(e,t,n,r=1){let i=Math.min(e.width/t.width,e.height/t.height);r=Math.max(i,r);let a=(e,t,n,r)=>t>=n?r?-(t-n)/2:0:Xu(e-t/2,0,n-t);return{k:r,x:a(n[0],e.width/r,t.width,!0),y:a(n[1],e.height/r,t.height,!1),fit:i}}var uC=(e,t)=>[e.x+t.width/2/e.k,e.y+t.height/2/e.k];function dC(e,t,n){let r=[0,0],i=0;for(let a=-.3;a<=.9;a+=.1){let o=e.pointerAt(Xu(t+a,0,n));o&&(r=[r[0]+o[0],r[1]+o[1]],i++)}return i?[r[0]/i,r[1]/i]:[e.shapeAt(t).width/2,0]}function fC(e,t,n,r){let i=t.width/r,a=t.height/r;return[Xu(e[0],i/2,Math.max(i/2,n.width-i/2)),Xu(e[1],a/2,Math.max(a/2,n.height-a/2))]}function pC(e,t,n,r){let i=Zu(Xu(n)),a=e.k*(t.k/e.k)**+i,[o,s]=uC(e,r),[c,l]=uC(t,r),u=[o+(c-o)*i,s+(l-s)*i];return{k:a,x:u[0]-r.width/2/a,y:u[1]-r.height/2/a,fit:t.fit}}var mC=(e,t)=>e.left<=t.left+1&&e.top<=t.top+1&&e.right>=t.right-1&&e.bottom>=t.bottom-1,hC=26,gC=1.5;function _C(e){let t=(0,l.useRef)(e);t.current=e;let n=(0,l.useRef)(null),r=(0,l.useRef)(new Map),i=(0,l.useRef)(new Map),a=(0,l.useRef)(null),o=(0,l.useRef)(new Map),s=(0,l.useRef)(new Map),c=(0,l.useRef)(void 0),u=(0,l.useRef)(new Map),d=(0,l.useRef)(void 0),f=(0,l.useRef)(void 0),p=(0,l.useRef)(!1),[m,h]=(0,l.useState)([]),[g,_]=(0,l.useState)(),[v,y]=(0,l.useState)(),b=(0,l.useRef)(void 0),x=(0,l.useRef)(void 0),S=(0,l.useRef)(new Map),C=(0,l.useRef)(``),w=(0,l.useRef)(new Map),T=(0,l.useRef)(void 0),E=id(e.playhead,e=>e.playing),{review:D,round:O,earlier:k,zoomed:A}=e,j=k?void 0:e.then,M=k?[k,O]:j?[j,O]:[O];M.some(e=>!m.includes(e.number))&&h([...new Set([...m,...M.map(e=>e.number)])].sort((e,t)=>e-t));let N=(e,t)=>`${e.number}/${t.name}/${t.recording}`,ee=(e,t)=>{let n=o.current.get(N(e,t));return n instanceof WS?n.shapes:s.current.get(N(e,t))??[LC]},te=(e,t,n=0)=>LS(ee(e,t),n),ne=(e,n)=>{let i=o.current.get(N(e,n));if(i)return i instanceof WS?i:void 0;o.current.set(N(e,n),`loading`),Vl(t.current.review.id,e.number,n.recording).then(t=>{o.current.set(N(e,n),new WS(t,BC(r.current.get(e.number)).stack)),ae()},()=>o.current.delete(N(e,n)))},re=(e,t,n)=>{let r=te(e,t,n),i=ee(e,t),a=i.findLast(e=>e.from>0&&e.from<=n);if(a&&n-a.from<.3){let e=LS(i,a.from-.001),t=Zu(Xu((n-a.from)/qu));return{width:e.width+(r.width-e.width)*t,height:e.height+(r.height-e.height)*t}}let o=e.flows[e.flows.indexOf(t)-1],s=Zu(Xu((n+Ku)/qu));if(!o||s>=1)return r;let c=te(e,o);return{width:c.width+(r.width-c.width)*s,height:c.height+(r.height-c.height)*s}},ie=(e,n,r)=>{let{round:i,earlier:a,zoomed:o}=t.current,s=Math.max(160,Math.round(innerHeight*.58));if(!n||a&&o)return s;let c=(a?[a,i]:[i]).map(e=>{let t=e.flows.find(e=>e.name===n.name);return e===i||!t?re(i,n,r):te(e,t)}),l=e=>hC+Math.max(...c.map(t=>TC(e,t).height));return a?e>700?l({width:(e-20)/2,height:s-hC}):2*l({width:e,height:(s-12)/2-hC})+12:l({width:e,height:s-hC})},ae=()=>{let{playhead:e,round:o,earlier:s,zoomed:l,peeking:f}=t.current,m=de.current,h=Xu((performance.now()-m.since)/240),g=m.from+(m.to-m.from)*Zu(h);m.now=g,h<1&&requestAnimationFrame(ae);let _=s?void 0:t.current.then,v=n.current;if(!v)return;let{moment:y,playing:b,speed:x,stopped:S}=e.now,C=o.flows.find(e=>e.name===y.flow),w=v.clientWidth,T=JS()?ie(w,C,y.at):v.clientHeight;v.style.height=JS()?`${T}px`:``;let E=C?re(o,C,y.at):LC,D=e=>{let t=TC({width:e.width,height:e.height-hC},E);return t.width*t.height},O=!s||D({width:(w-20)/2,height:T})>=D({width:w,height:(T-12)/2}),k=O?(w-20)/2:w,A=O?T:(T-12)/2,j=new Map(s?[[s.number,{left:0,top:0,width:k,height:A}],[o.number,{left:O?k+20:0,top:O?0:A+12,width:k,height:A}]]:[[o.number,{left:0,top:0,width:w,height:T}]]);_&&j.set(_.number,j.get(o.number));for(let[e,t]of r.current){t.hidden=!j.has(e);let n=e===_?.number,r=n&&!t.hasAttribute(`data-over`);t.toggleAttribute(`data-over`,n),t.style.transition=r?`none`:``,t.style.opacity=n&&!f?`0`:``,r&&t.offsetWidth,t.style.transition=``}let M=j.get(o.number),N=Math.max(...o.flows.map(e=>TC({width:M.width,height:M.height-hC},te(o,e)).width));if(a.current&&(a.current.style.left=`${Math.round(M.left+(M.width-N)/2)}px`),!C)return;let ee=d.current&&performance.now()-d.current.started<320?d.current:void 0,se;for(let e of s?[o,s]:_?[o,_]:[o]){let n=r.current.get(e.number),a=j.get(e.number);if(!n)continue;let d=e===o?C:e.flows.find(e=>e.name===C.name),f=d&&d!==C&&{from:ne(o,C)?.clicks??[],to:ne(e,d)?.clicks??[]},m=!d||d===C?y.at:hl(y.at,C,d,f||void 0),h=d?re(e,d,m):re(o,C,y.at),_={width:a.width,height:a.height-hC},v=l&&s?{width:Math.floor(Math.min(_.width,h.width)),height:Math.floor(Math.min(_.height,h.height))}:TC(_,h),w=Math.round(a.left+(a.width-v.width)/2);Object.assign(n.style,{left:`${w}px`,top:`${a.top+hC}px`,width:`${v.width}px`,height:`${v.height}px`});let T=i.current.get(e.number);T&&Object.assign(T.style,{left:`${w}px`,top:`${a.top}px`,width:`${v.width}px`});let E=BC(n),D=d&&ne(e,d);for(let e of E.stack.children)e.hidden=e!==D?.host;if(n.toggleAttribute(`data-absent`,!d),!d){E.name.textContent=`Not in ${nf(e.number)}`,E.line.hidden=!0,E.card.style.opacity=`1`,E.card.style.setProperty(`--n`,`1`),E.app.style.filter=``,E.cursor.style.opacity=E.ring.style.opacity=`0`,E.dialog.hidden=!0;continue}let O=te(e,d,m),k=D?Qu(m):{soft:1,name:1},A=e===o&&g>.002?{soft:Math.max(k?.soft??0,g),name:k?.name??0}:k,M;if(!l||cC(v,O).fit>=.995)M=cC(v,O);else if(se){let[t,n]=uC(se.view,se.box),[r,i]=[se.chosen,D&&le(e.number,D,O)?.centre];M=lC(v,O,r&&i?[t+i[0]-r[0],n+i[1]-r[1]]:[t,n],se.view.k)}else{let e=c.current?.flow===C.name?c.current:void 0,t=e||!D?void 0:ce(D,O,v);M=lC(v,O,e?.centre??t?.centre??(D?dC(D,m,d.length):[O.width/2,0]),e?.k??t?.k??1)}e===o&&(se={view:M,box:v,chosen:D&&le(o.number,D,O)?.centre},ue({fit:M.fit,k:M.k}));let N=ee?.from.get(e.number);ee&&N&&N.width===v.width&&N.height===v.height&&(M=pC(N,M,(performance.now()-ee.started)/320,v)),u.current.set(e.number,{...M,...v,page:O});let ie=`translate(${(-M.x*M.k).toFixed(2)}px,${(-M.y*M.k).toFixed(2)}px)`;D&&(D.host.style.transform=`${ie} scale(${M.k.toFixed(5)})`,D.show(m<0?t.current.read(e.number,d.name)?.[0]?.at??m:m,b,x),S&&p.current&&D.rest()),Object.assign(E.marks.style,{transform:ie,width:`${O.width*M.k}px`,height:`${O.height*M.k}px`});let ae=n.querySelector(`[data-live] iframe`);ae&&Object.assign(ae.style,IC(M,O)),oe(E.marks,D,O,M,v,m,b,e===o),E.name.textContent=d.fork??d.name;let de=q(t.current.review)&&!d.fork?qf(d):``;E.as.textContent!==de&&(E.as.textContent=de),E.as.hidden=!de;let fe=e===o?d.line??``:``,[P,pe]=E.line.children;E.line.hidden=!fe,pe.textContent!==fe&&([P.textContent,pe.textContent]=[e.by,fe]),E.card.style.opacity=A?`1`:`0`,E.card.style.setProperty(`--k`,(A?.soft??0).toFixed(3)),E.card.style.setProperty(`--n`,(A?.name??0).toFixed(3)),E.app.style.filter=A&&A.soft>.002?`blur(${(A.soft*6).toFixed(2)}px)`:``;let me=D?.shapeAt(m),he=D?.pointerAt(m,me?.touch?me.from:0),F=he&&[(he[0]-M.x)*M.k,(he[1]-M.y)*M.k];E.cursor.toggleAttribute(`data-touch`,!!me?.touch);let I=e===o&&we.current;I||(E.cursor.style.opacity=F?String(1-(A?.soft??0)):`0`),F&&!I&&(E.cursor.style.transform=`translate(${F[0]-3}px,${F[1]-2}px)`);let ge=E.cursor.querySelector(`[data-tag]`);if(!I&&!Ee.current){let e=Kf(d,m,D?.loads)??``,t=ge.querySelector(`[data-words]`);t.textContent!==e&&DC(ge,t,e,!1,b&&!!t.textContent&&!!e&&!ge.hidden),ge.hidden=!e}let L=D&&F&&!A?D.clicks.find(e=>m>=e&&m<e+.5):void 0;if(L!==void 0&&F){let e=(m-L)/.5;Object.assign(E.ring.style,{opacity:String(1-e),transform:`translate(${F[0]}px,${F[1]}px) scale(${.4+e*1.1})`})}else E.ring.style.opacity=`0`;let _e=D&&(A?.soft??0)<.5?D.dialogs.find(e=>m>=e.from&&m<e.until):void 0;if(E.dialog.hidden=!_e,_e){let e=Math.min(RC,O.width-16);Object.assign(E.dialog.style,{width:`${e}px`,transform:`translate(${(((O.width-e)/2-M.x)*M.k).toFixed(2)}px,${((8-M.y)*M.k).toFixed(2)}px) scale(${M.k.toFixed(5)})`});let[t,n,r,i,a]=[`where`,`says`,`typed`,`no`,`yes`].map(e=>E.dialog.querySelector(`[data-${e}]`));E.dialog.dataset.from!==String(_e.from)&&(E.dialog.dataset.from=String(_e.from),t.textContent=`${_e.host||`This page`} says`,n.textContent=_e.message,r.textContent=_e.value??``,r.hidden=_e.type!==`prompt`,i.hidden=_e.type===`alert`);let o=_e.yes!==void 0&&m>_e.until-.25;a.toggleAttribute(`data-pressed`,o&&(_e.yes||_e.type===`alert`)),i.toggleAttribute(`data-pressed`,o&&!_e.yes&&_e.type!==`alert`)}}p.current=b,ee&&!b&&requestAnimationFrame(ae)},oe=(e,n,r,i,a,o,s,c)=>{let l=[],u=new Map;for(let t of e.querySelectorAll(`[data-mark-id]`)){let{node:e,from:i,until:a,paused:d,markId:f}=t.dataset,p=t.dataset.box?.split(` `).map(Number),m=e===void 0?p&&{left:p[0]*r.width,top:p[1]*r.height,width:p[2]*r.width,height:p[3]*r.height}:n?.boxOf(Number(e)),h=Math.max(0,m?.left??0),g=Math.max(0,m?.top??0),_=Math.min(r.width,(m?.left??0)+(m?.width??0)),v=Math.min(r.height,(m?.top??0)+(m?.height??0)),y=e===void 0&&!p||_-h>=1&&v-g>=1,b=i===void 0||o>=Number(i)-.05&&o<=Number(a??i)+gC;t.hidden=!y||!b||d!==void 0&&s,t.toggleAttribute(`data-playing`,s),c&&e!==void 0&&t.dataset.kind===`note`&&(m?S.current.set(f,o):(!s||Math.abs(o-(S.current.get(f)??-1/0))>.3)&&l.push(f)),m&&!t.hidden&&u.set(t,{left:h,top:g,right:_,bottom:v})}c&&w.current.clear();for(let[e,t]of u){if(e.dataset.answers===void 0)continue;let n=[...u].find(([t])=>t.dataset.kind===`note`&&t.dataset.markId===e.dataset.answers)?.[1],r=w.current.get(e.dataset.markId),i=c?!!n&&(mC(t,n)||mC(n,t)):!!r;c&&i&&w.current.set(e.dataset.markId,{left:t.left-n.left,top:t.top-n.top,right:t.right-n.right,bottom:t.bottom-n.bottom}),!c&&r&&(n?u.set(e,{left:n.left+r.left,top:n.top+r.top,right:n.right+r.right,bottom:n.bottom+r.bottom}):e.hidden=!0),e.toggleAttribute(`data-one`,i&&e.dataset.pointed===void 0)}for(let[e,{left:t,top:n,right:o,bottom:s}]of u){Object.assign(e.style,{left:wC(t/r.width),top:wC(n/r.height),width:wC((o-t)/r.width),height:wC((s-n)/r.height)});let c=e.querySelector(`[data-pin]`);c&&se(c,{left:t,top:n,right:o,bottom:s},i,a)}if(!c)return;let d=l.sort().join(` `);d!==C.current&&(C.current=d,t.current.onGone(l))},se=(e,t,n,r)=>{let i=Math.min(14,r.width-(t.right-n.x)*n.k-11),a=(t.top-n.y)*n.k-14>=11,o=Math.min(14,r.height-(t.bottom-n.y)*n.k-11);Object.assign(e.style,{left:`calc(100% + ${i-9}px)`,top:a?`-23px`:`calc(100% + ${o-9}px)`})},ce=(e,n,r)=>{let i=le(t.current.round.number,e,n);if(!i)return;let a=T.current?.id===i.id?T.current:T.current={id:i.id};return a.k??=Math.min(1,r.width/(i.width+48),r.height/(i.height+48)),{centre:i.centre,k:a.k}},le=(e,n,r)=>{let i=(t.current.marks.get(e)??[]).filter(e=>e.chosen&&e.kind!==`writing`),a=i.flatMap(({on:e})=>`node`in e?n.boxOf(e.node)??[]:`box`in e?[{left:e.box.x*r.width,top:e.box.y*r.height,width:e.box.width*r.width,height:e.box.height*r.height}]:[]);if(!a.length)return;let o=Math.min(...a.map(e=>e.left)),s=Math.min(...a.map(e=>e.top)),c=Math.max(...a.map(e=>e.left+e.width))-o,l=Math.max(...a.map(e=>e.top+e.height))-s;return{id:i[0].id,width:c,height:l,centre:[o+c/2,s+l/2]}},ue=e=>{(f.current?.fit!==e.fit||f.current.k!==e.k)&&(f.current=e,t.current.onShown(e))};(0,l.useLayoutEffect)(ae),(0,l.useEffect)(()=>e.playhead.subscribe(ae),[e.playhead]);let de=(0,l.useRef)({from:0,to:0,since:0,now:0});(0,l.useEffect)(()=>{let t=+!!e.ending;de.current.to!==t&&(de.current={from:de.current.now,to:t,since:performance.now(),now:de.current.now},ae())},[e.ending]),(0,l.useEffect)(()=>{let e=new ResizeObserver(()=>ae());return n.current&&e.observe(n.current),()=>e.disconnect()},[]),(0,l.useEffect)(()=>()=>o.current.forEach(e=>e instanceof WS&&e.destroy()),[]),(0,l.useEffect)(()=>{for(let e of M)for(let t of e.flows)s.current.has(N(e,t))||(s.current.set(N(e,t),[LC]),Vl(D.id,e.number,t.recording).then(n=>{s.current.set(N(e,t),IS(n).shapes),ae()}))});let fe=(0,l.useRef)(A);fe.current!==A&&(fe.current=A,c.current=void 0,d.current=matchMedia(`(prefers-reduced-motion: reduce)`).matches?void 0:{started:performance.now(),from:new Map(u.current)});let P=(e.marks.get(O.number)??[]).find(e=>e.chosen&&e.kind!==`writing`)?.id,pe=(0,l.useRef)(P);pe.current!==P&&(pe.current=P,c.current=void 0,A&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(d.current={started:performance.now(),from:new Map(u.current)}));let me=!!k,he=(0,l.useRef)(me),F=(0,l.useRef)(void 0);he.current!==me&&!F.current&&(F.current=new Map([...r.current].filter(([,e])=>!e.hidden).map(([e,t])=>[e,t.getBoundingClientRect()]))),(0,l.useLayoutEffect)(()=>{if(he.current===me)return;he.current=me;let e=F.current??new Map;F.current=void 0;let t=matchMedia(`(prefers-reduced-motion: reduce)`).matches;for(let r of n.current?.querySelectorAll(`:scope > :not([hidden], [data-over])`)??[]){let n=r.dataset.frame===void 0?void 0:Number(r.dataset.frame),i=n===void 0?void 0:e.get(n)??e.get(O.number),a=r.getBoundingClientRect();if(i&&a.width&&a.height&&!t){let e=`translate(${i.left-a.left}px,${i.top-a.top}px) scale(${i.width/a.width},${i.height/a.height})`;r.animate([{transformOrigin:`0 0`,transform:e},{transformOrigin:`0 0`,transform:`none`}],{duration:320,easing:`cubic-bezier(0.22, 0.8, 0.24, 1)`})}else getComputedStyle(r).opacity!==`0`&&r.animate([{opacity:0},{opacity:1}],{duration:250,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`})}},[me]);let I=e=>{let n=e instanceof Element?e.closest(`[data-frame]`):null,r=n&&!n.hasAttribute(`data-absent`)?Number(n.dataset.frame):void 0,i=r===void 0?void 0:u.current.get(r);return t.current.zoomed&&i&&i.k>i.fit+.001?r:void 0},ge=(e,n)=>{let r=u.current.get(e);if(!r)return;let i=c.current?.centre??uC(r,r);d.current=void 0,c.current={centre:fC(n(i,r.k),r,r.page,r.k),k:r.k,flow:t.current.playhead.now.moment.flow},t.current.playhead.now.playing||ae()},L=(0,l.useRef)(0);(0,l.useEffect)(()=>{let e=n.current,t=e=>{if(e.altKey&&xe(e.target))return e.preventDefault(),L.current+=e.deltaY,Math.abs(L.current)<40&&Math.abs(e.deltaY)<40?void 0:(be(e,-Math.sign(L.current)),L.current=0,y(R(e)?.node));let t=I(e.target);t!==void 0&&(e.preventDefault(),ge(t,(t,n)=>[t[0]+e.deltaX/n,t[1]+e.deltaY/n]))},r=e=>void(e.key===`Alt`&&b.current&&e.preventDefault());return e?.addEventListener(`wheel`,t,{passive:!1}),addEventListener(`keyup`,r),()=>{e?.removeEventListener(`wheel`,t),removeEventListener(`keyup`,r)}},[]);let _e=(e,t)=>{let n=r.current.get(t),i=u.current.get(t);if(!n||!i)return;let a=n.getBoundingClientRect();return[Xu((e.clientX-a.left)/i.k+i.x,0,i.page.width),Xu((e.clientY-a.top)/i.k+i.y,0,i.page.height)]},ve=(e,t)=>{let n=_e(e,t),r=u.current.get(t)?.page;return n&&r&&{x:n[0]/r.width,y:n[1]/r.height}},ye=e=>{let{round:n,playhead:r,read:i}=t.current,{moment:a}=r.now,s=n.flows.find(e=>e.name===a.flow),c=s&&o.current.get(N(n,s)),l=s&&i(n.number,s.name,!0),u=_e(e,n.number);if(!(!(c instanceof WS)||!l||!u||a.at<0))return{replay:c,things:l,at:a.at,outwards:c.outwards(u[0],u[1]),here:`${n.number}/${a.flow}/${a.at}`}},R=e=>{let t=ye(e);if(!t)return;let n=b.current;return n&&n.here===t.here&&t.outwards.includes(n.pick.node)?n.pick:(b.current=void 0,$S(t.outwards,t.things,t.at))},be=(e,t)=>{let n=ye(e),r=n&&$S(n.outwards,n.things,n.at);if(!n||!r)return;let i=eC(n.outwards,n.things,n.at,r,e=>n.replay.boxOf(e),n.replay.shapeAt(n.at)),a=b.current,o=Xu((a&&a.here===n.here?i.indexOf(a.pick)+1:0)+t,0,i.length);b.current=o?{here:n.here,pick:i[o-1]}:void 0},xe=e=>{let n=e instanceof Element?e.closest(`[data-frame]`):null,{playhead:r,onPlace:i,writing:a,round:o,live:s}=t.current;return!!n&&Number(n.dataset.frame)===o.number&&!n.hasAttribute(`data-absent`)&&!r.now.playing&&!!i&&!a&&!s?.shown&&!e.closest(`[data-pin]`)},Se=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{let e=e=>{Se.current={x:e.clientX,y:e.clientY};let n=we.current&&r.current.get(t.current.round.number)?.getBoundingClientRect();if(!n)return;let i={x:e.clientX-n.left,y:e.clientY-n.top};Oe(i,i.x>=0&&i.y>=0&&i.x<=n.width&&i.y<=n.height,!1)};return addEventListener(`pointermove`,e,!0),addEventListener(`pointerdown`,e,!0),()=>{removeEventListener(`pointermove`,e,!0),removeEventListener(`pointerdown`,e,!0)}},[]);let Ce=!!e.live?.shown&&!!e.live.settled&&!!e.live.address,we=(0,l.useRef)(!1),z=(0,l.useRef)(void 0);(0,l.useLayoutEffect)(()=>{let t=r.current.get(O.number),n=t?.querySelector(`[data-live]`),i=t?.querySelector(`[data-sheen]`),a=t?.querySelector(`[data-portal]`),o=t?.querySelector(`[data-edge]`),s=t?.querySelector(`[data-cursor]`),c=s?.querySelector(`[data-tag]`),l=c?.querySelector(`[data-words]`);if(!t||!n||!i||!a||!o||!s||!c||!l||Ce===we.current)return;ke.current.forEach(clearTimeout),ke.current=[];let d={opacity:getComputedStyle(o).opacity,boxShadow:getComputedStyle(o).boxShadow},f=Ee.current;for(let e of[n,i,a,o,s,c,l])e.getAnimations().forEach(e=>e.cancel());let p=t.getBoundingClientRect(),m=u.current.get(O.number),h=Kf(e.playhead.flow,e.playhead.now.moment.at),g=e=>`translate(${(e.x-3).toFixed(1)}px,${(e.y-2).toFixed(1)}px)`,_=e=>{let t=e.getBoundingClientRect();return{x:t.left-p.left+3,y:t.top-p.top+2}},v=Se.current&&{x:Se.current.x-p.left,y:Se.current.y-p.top},y=v&&v.x>=0&&v.y>=0&&v.x<=p.width&&v.y<=p.height?v:void 0,b=e.live?.at&&m?{x:(e.live.at.x-m.x)*m.k,y:(e.live.at.y-m.y)*m.k}:void 0,x=Ce&&s.style.opacity!==`0`?_(s):void 0,S=(Ce?y??x:z.current??b??y)??{x:p.width/2,y:p.height/2},C=Math.max(...[[0,0],[p.width,0],[0,p.height],[p.width,p.height]].map(([e,t])=>Math.hypot(e-S.x,t-S.y))),w=e=>`circle(${e.toFixed(1)}px at ${S.x.toFixed(1)}px ${S.y.toFixed(1)}px)`;Object.assign(a.style,{left:`${S.x-C}px`,top:`${S.y-C}px`,width:`${C*2}px`,height:`${C*2}px`}),i.style.setProperty(`--x`,`${S.x}px`),i.style.setProperty(`--y`,`${S.y}px`);let T=matchMedia(`(prefers-reduced-motion: reduce)`).matches;we.current=Ce;let E=e=>{t.style.cursor=e?`default`:``,s.toggleAttribute(`data-yours`,e),n.querySelector(`iframe`)?.contentWindow?.postMessage({playthrough:`yours`,yours:e},`*`)};if(Ce){if(Object.assign(n.style,{opacity:`1`,pointerEvents:`auto`}),n.querySelector(`iframe`)?.focus(),o.style.opacity=`1`,z.current=S,Object.assign(s.style,{transform:g(S),opacity:`1`,zIndex:`11`}),c.hidden=!1,T)return void(E(!0),DC(c,l,h?`You, as ${h}`:`You`,!0,!1));f?l.textContent!==`Taking over…`&&DC(c,l,`Taking over…`,!1):DC(c,l,h??`You are in control`,!h,!1);let e=x&&y&&Math.hypot(y.x-x.x,y.y-x.y)>4?AC:0;e?s.animate([{translate:`${x.x-S.x}px ${x.y-S.y}px`},{translate:`0px 0px`}],{duration:e,easing:PC}):x||s.animate([{opacity:0},{opacity:1}],{duration:200}),Ae(()=>E(!0),e);let t=e+(h||f?240:0);(h||f)&&Ae(()=>DC(c,l,`You are in control`),t),Ae(()=>DC(c,l,h?`You, as ${h}`:`You`),t+1700);let r={delay:e,easing:PC,fill:`backwards`};n.animate([{clipPath:w(0)},{clipPath:w(C)}],{...r,duration:MC}),i.animate([{opacity:1},{opacity:0}],{...r,duration:MC+240}),a.animate([{transform:`scale(0)`,opacity:0},{opacity:1,offset:.1},{opacity:.85,offset:.7},{transform:`scale(1)`,opacity:0}],{...r,duration:MC}),o.animate([d,{...d,offset:.5},{opacity:1,boxShadow:`inset 0 0 0 2px rgba(236,178,72,0.95), inset 0 0 40px rgba(255,214,150,0.45)`,offset:.75},{opacity:1}],{...r,duration:MC+500});return}o.style.opacity=`0`,E(!1),EC(s,!1);let D=s.style.opacity!==`0`&&!!z.current;z.current=void 0,n.style.pointerEvents=`none`;let k={clientX:p.left+S.x,clientY:p.top+S.y};D&&document.elementFromPoint(k.clientX,k.clientY)?.dispatchEvent(new PointerEvent(`pointermove`,{...k,bubbles:!0})),ae();let A=()=>void(n.style.opacity=`0`),j=()=>void(s.style.zIndex=``);if(T)return void(A(),j());let M=s.style.transform;s.animate([{transform:g(S),opacity:1},{transform:g(S),opacity:1,offset:.3},{transform:M,opacity:Number(s.style.opacity||1)}],{duration:NC+AC,easing:PC}).finished.then(j,()=>{}),h&&(l.textContent=`You`,c.dataset.mine=``,DC(c,l,h,!1));let N={duration:NC,easing:`cubic-bezier(0.55, 0, 0.7, 0.2)`};o.animate([{opacity:1},{opacity:0}],{duration:220,easing:`ease-in`}),a.animate([{transform:`scale(1)`,opacity:0},{opacity:.9,offset:.65},{transform:`scale(0)`,opacity:0}],N),i.animate([{opacity:0},{opacity:.8}],N),n.animate([{clipPath:w(C)},{clipPath:w(0)}],N).finished.then(A,()=>{})},[Ce]);let Te=!!e.live?.shown&&!Ce,Ee=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{let t=r.current.get(O.number)?.querySelector(`[data-edge]`),n=r.current.get(O.number)?.querySelector(`[data-cursor] [data-tag]`),i=n?.querySelector(`[data-words]`);if(!t||!n||!i||Te===Ee.current)return;Ee.current=Te;let a=Kf(e.playhead.flow,e.playhead.now.moment.at);if(Te){if(n.hidden=!1,DC(n,i,`Taking over…`,!1),matchMedia(`(prefers-reduced-motion: reduce)`).matches)return void(t.style.opacity=`1`);t.animate([{opacity:.25},{opacity:1,boxShadow:jC}],{duration:1e3,easing:`ease-in-out`,direction:`alternate`,iterations:1/0})}else Ce||(t.getAnimations().forEach(e=>e.cancel()),t.style.opacity=`0`,DC(n,i,a??``,!1),n.hidden=!a)},[Te]);let De=Te?e.live?.due:void 0;(0,l.useLayoutEffect)(()=>{let e=r.current.get(O.number)?.querySelector(`[data-cursor] [data-tag]`),t=e?.querySelector(`[data-words]`);if(!De||!e||!t||De-Date.now()<FC)return;let n=matchMedia(`(prefers-reduced-motion: reduce)`).matches,i=0,a=()=>{let r=(De-Date.now())/1e3,a=i?Math.min(i,Math.ceil(r)):Math.ceil(r-.5);if(a===i)return;if(a<1)return void(clearInterval(o),DC(e,t,`Taking over…`,!1));let s=!i&&e.getBoundingClientRect().width,c=document.createElement(`span`);c.className=`inline-block`,c.textContent=String(i=a),t.replaceChildren(`Taking over in `,c,`…`),!n&&(s&&e.animate([{width:`${s}px`},{width:`${e.getBoundingClientRect().width}px`}],{duration:380,easing:PC}),c.animate([{opacity:0,transform:`translateY(3px)`},{opacity:1,transform:`none`}],{duration:280,easing:PC}))},o=setInterval(a,100);return a(),()=>clearInterval(o)},[De]),(0,l.useEffect)(()=>{let e=()=>setTimeout(()=>{let e=document.activeElement;e instanceof HTMLIFrameElement&&e.closest(`[data-live]`)&&!we.current&&e.blur()});return addEventListener(`blur`,e),()=>removeEventListener(`blur`,e)},[]);let Oe=(e,n,i)=>{let a=r.current.get(t.current.round.number)?.querySelector(`[data-cursor]`);a&&(z.current=e,Object.assign(a.style,{transform:`translate(${(e.x-3).toFixed(1)}px,${(e.y-2).toFixed(1)}px)`,opacity:n?`1`:`0`}),EC(a,i))},ke=(0,l.useRef)([]),Ae=(e,t)=>void ke.current.push(window.setTimeout(e,t));(0,l.useEffect)(()=>{let e=({data:e})=>{if(e?.playthrough!==`pointer`||!we.current)return;let n=u.current.get(t.current.round.number);n&&Oe({x:(e.x-n.x)*n.k,y:(e.y-n.y)*n.k},e.inside,!!e.text)};return addEventListener(`message`,e),()=>removeEventListener(`message`,e)},[]);let je=(e,t)=>{x.current=e;let n=t===O.number&&xe(e.target)&&!Me.current,r=n?R(e):void 0;y(r?.node),_(n&&!r?ve(e,t):void 0)},Me=(0,l.useRef)(!1),Ne=(e,t)=>{if(Me.current=!1,e.button!==0||e.target.closest(`[data-pin]`)||I(e.target)===void 0)return;let n={x:e.clientX,y:e.clientY},r=u.current.get(t),i=c.current?.centre??uC(r,r),a=e.currentTarget,o=e.pointerId,s=e=>{e.pointerId!==o||!Me.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)<4||(Me.current||a.setPointerCapture(o),Me.current=!0,ge(t,()=>[i[0]-(e.clientX-n.x)/r.k,i[1]-(e.clientY-n.y)/r.k]))},l=e=>{e.pointerId===o&&(removeEventListener(`pointermove`,s),removeEventListener(`pointerup`,l),removeEventListener(`pointercancel`,l))};addEventListener(`pointermove`,s),addEventListener(`pointerup`,l),addEventListener(`pointercancel`,l)},Pe=(t,n)=>{if(Me.current||n!==O.number||e.live?.shown)return;if(e.playhead.now.playing)return e.playhead.pause();if(!e.onPlace)return void(!e.writing&&e.playhead.play());let r=R(t);if(b.current=void 0,y(void 0),r)return e.onPlace?.({element:Pl(r,r.name)});let i=ve(t,n);i&&e.onPlace?.({point:i})},Fe=!E&&!!e.onPlace&&!e.writing&&!e.live?.shown,Ie=(0,l.useRef)(null),Le=(0,l.useRef)(0);(0,l.useEffect)(()=>{let e=()=>void(Le.current=performance.now());return addEventListener(`pointerdown`,e,!0),addEventListener(`keydown`,e,!0),()=>{removeEventListener(`pointerdown`,e,!0),removeEventListener(`keydown`,e,!0)}},[]);let Re=(0,l.useRef)(E);(0,l.useEffect)(()=>{if(Re.current===E)return;Re.current=E;let e=Ie.current,t=r.current.get(O.number)?.getBoundingClientRect(),i=n.current?.getBoundingClientRect();if(!e||!t||!i||performance.now()-Le.current>300)return;e.querySelector(`[data-play]`).style.display=E?``:`none`,e.querySelector(`[data-pause]`).style.display=E?`none`:``,Object.assign(e.style,{left:`${t.left-i.left+t.width/2}px`,top:`${t.top-i.top+t.height/2}px`});let a=matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.getAnimations().forEach(e=>e.cancel()),e.animate([{opacity:.95,transform:`translate(-50%,-50%) scale(${a?1:.85})`},{opacity:.95,transform:`translate(-50%,-50%) scale(1)`,offset:.3},{opacity:0,transform:`translate(-50%,-50%) scale(${a?1:1.25})`}],{duration:480,easing:`ease-out`})},[E]);let ze=e.onAllFlows&&(0,K.jsxs)(`button`,{className:`-my-0.5 mr-1 -ml-1 inline-flex flex-none items-baseline gap-0.5 rounded-md py-0.5 pr-2 pl-0.5 text-xs leading-4 text-soft transition-colors duration-150 ease-calm hover:bg-hover hover:text-fg`,onClick:e.onAllFlows,children:[(0,K.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-3.5 self-center`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M7.5 3L4.5 6l3 3`})}),`All flows`]}),Be=t=>(0,K.jsxs)(`button`,{className:`z-20 inline-flex items-center gap-1.5 rounded-md py-0.5 pr-1 pl-2 text-xs leading-4 text-soft transition-colors duration-150 ease-calm hover:bg-hover hover:text-fg ${t}`,onClick:e.onBareOff,children:[`Marks hidden`,(0,K.jsx)(`kbd`,{className:`rounded-[3px] px-1 font-ui text-[11px] text-soft shadow-[0_0_0_1px_var(--line)]`,children:`H`})]});return(0,K.jsxs)(`div`,{ref:n,className:`group/stage relative min-h-0 select-none`,"data-bare":e.bare?``:void 0,children:[(0,K.jsxs)(`div`,{ref:Ie,"aria-hidden":!0,className:`pointer-events-none absolute z-20 grid size-16 place-items-center rounded-full bg-[rgba(30,34,44,0.62)] text-white opacity-0`,children:[(0,K.jsx)(`svg`,{"data-play":!0,viewBox:`0 0 24 24`,className:`ml-1 size-7`,fill:`currentColor`,children:(0,K.jsx)(`path`,{d:`M7 4.5l13 7.5-13 7.5z`})}),(0,K.jsxs)(`svg`,{"data-pause":!0,viewBox:`0 0 24 24`,className:`size-7`,fill:`currentColor`,children:[(0,K.jsx)(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`}),(0,K.jsx)(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`})]})]}),m.map(t=>(0,K.jsxs)(`div`,{ref:e=>void(e?r.current.set(t,e):r.current.delete(t)),"data-frame":t,"data-watched":t===O.number||void 0,className:`absolute touch-none overflow-hidden rounded-lg bg-paper shadow-frame transition-opacity duration-160 ease-calm data-flying:invisible data-over:pointer-events-none data-over:z-10 ${t===O.number&&Fe?v===void 0?`cursor-none`:`cursor-pointer`:``}`,onPointerDown:e=>Ne(e,t),onPointerMove:e=>je(e,t),onPointerLeave:()=>{_(void 0),y(void 0)},onClick:e=>Pe(e,t),children:[t===O.number&&e.live?.address&&(0,K.jsxs)(`div`,{"data-live":!0,className:`pointer-events-none absolute inset-0 z-10 overflow-hidden opacity-0`,children:[(0,K.jsx)(`div`,{"data-sheen":!0,className:`pointer-events-none absolute inset-0 z-1 opacity-0 [background:radial-gradient(circle_at_var(--x)_var(--y),rgba(255,232,190,0.15),rgba(255,214,150,0.5))]`}),(0,K.jsx)(`iframe`,{src:e.live.address,title:`The app, taken over`,className:`absolute top-0 left-0 origin-top-left border-0 bg-paper`,style:u.current.get(t)&&IC(u.current.get(t),u.current.get(t).page)},e.live.address)]}),t===O.number&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{"data-portal":!0,className:`pointer-events-none absolute top-0 left-0 z-10 rounded-full opacity-0 [border:2.5px_solid_rgba(236,178,72,0.95)] [box-shadow:0_0_40px_14px_rgba(226,170,70,0.38),inset_0_0_36px_10px_rgba(255,214,150,0.4)]`}),(0,K.jsx)(`div`,{"data-edge":!0,className:`pointer-events-none absolute inset-0 z-10 rounded-lg opacity-0 [box-shadow:inset_0_0_0_1.5px_rgba(217,162,58,0.75),inset_0_0_22px_rgba(217,162,58,0.16)]`})]}),(0,K.jsxs)(`div`,{"data-app":!0,className:`absolute inset-0 overflow-hidden`,children:[(0,K.jsx)(`div`,{"data-stack":!0,className:`absolute inset-0`}),(0,K.jsxs)(`div`,{"data-marks":!0,inert:!!e.live?.shown,className:`absolute top-0 left-0 z-3 ${vC} group-data-bare/stage:[&_*]:pointer-events-none`,children:[(e.marks.get(t)??[]).map((t,n)=>(0,K.jsx)(yC,{mark:t,onMark:e.onMark},`${t.id}:${n}`)),t===O.number&&Fe&&v!==void 0&&(0,K.jsx)(`div`,{"data-mark-id":`hover`,"data-node":v,hidden:!0,className:`pointer-events-none absolute rounded-[4px] outline-1 outline-offset-4 outline-[rgba(217,162,58,0.55)] outline-solid`}),t===O.number&&(0,K.jsx)(bC,{placing:e.placing,aim:Fe?g:void 0})]})]}),(0,K.jsx)(`div`,{"data-ring":!0,className:`pointer-events-none absolute top-0 left-0 z-7 -mt-[17px] -ml-[17px] size-[34px] rounded-full border-[1.5px] border-[rgba(40,44,54,0.5)] bg-[rgba(40,44,54,0.06)] opacity-0 ${vC}`}),(0,K.jsxs)(`div`,{"data-dialog":!0,hidden:!0,className:`pointer-events-none absolute top-0 left-0 z-7 origin-top-left rounded-xl bg-white px-6 pt-5 pb-4 font-[system-ui,sans-serif] text-[13px] leading-[18px] text-[#1f1f1f] shadow-[0_1px_3px_rgba(0,0,0,.2),0_6px_24px_rgba(0,0,0,.24)] ${vC}`,children:[(0,K.jsx)(`p`,{"data-where":!0,className:`mb-2.5 text-[15px] leading-5 font-medium`}),(0,K.jsx)(`p`,{"data-says":!0,className:`mb-4 break-words whitespace-pre-wrap`}),(0,K.jsx)(`p`,{"data-typed":!0,className:`mb-4 h-8 truncate rounded-md border border-[#747775] px-2.5 leading-[30px]`}),(0,K.jsxs)(`p`,{className:`flex justify-end gap-2 text-[13px] leading-8 font-medium`,children:[(0,K.jsx)(`span`,{"data-no":!0,className:`rounded-full border border-[#747775] px-4 text-[#0b57d0] data-pressed:bg-[#e8eef8]`,children:`Cancel`}),(0,K.jsx)(`span`,{"data-yes":!0,className:`rounded-full bg-[#0b57d0] px-4 text-white data-pressed:bg-[#0842a0]`,children:`OK`})]})]}),(0,K.jsxs)(`div`,{"data-cursor":!0,className:`pointer-events-none absolute top-0 left-0 z-8 size-5 opacity-0 transition-[filter] duration-180 ease-calm will-change-transform [&:not([data-touch])>[data-finger]]:hidden [&[data-touch]>svg]:invisible [&[data-touch]:not([data-yours])>[data-tag]]:top-[19px] [&[data-touch]:not([data-yours])>[data-tag]]:left-[16px] [&[data-yours]>[data-finger]]:invisible [&[data-yours]>svg]:invisible [filter:drop-shadow(0_1px_1px_rgba(0,0,0,.3))] group-data-bare/stage:[filter:drop-shadow(0_1px_1px_rgba(0,0,0,.3))_opacity(0)]`,children:[(0,K.jsx)(`svg`,{"data-arrow":!0,viewBox:`0 0 20 20`,width:`20`,height:`20`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M3 2l13 7.5-5.6 1.3L7.6 16z`,fill:`#FFFFFF`,stroke:`#1E2330`,strokeWidth:`1.3`,strokeLinejoin:`round`})}),(0,K.jsxs)(`svg`,{"data-beam":!0,viewBox:`0 0 20 20`,style:{display:`none`},width:`20`,height:`20`,className:`absolute -top-2 -left-[7px]`,"aria-hidden":!0,children:[(0,K.jsx)(`path`,{d:`M7 3.5h6M10 3.5v13M7 16.5h6`,fill:`none`,stroke:`#FFFFFF`,strokeWidth:`3.2`,strokeLinecap:`round`}),(0,K.jsx)(`path`,{d:`M7 3.5h6M10 3.5v13M7 16.5h6`,fill:`none`,stroke:`#1E2330`,strokeWidth:`1.4`,strokeLinecap:`round`})]}),(0,K.jsx)(`span`,{"data-finger":!0,className:`absolute -top-3 -left-[11px] size-7 rounded-full border-[1.5px] border-[rgba(30,35,48,0.6)] bg-[rgba(255,255,255,0.5)]`}),(0,K.jsx)(`span`,{"data-tag":!0,hidden:!0,className:`${kC} transition-[background-color,color] duration-300 ease-calm data-mine:bg-[#EDB654] data-mine:text-[#3B2A07]`,children:(0,K.jsx)(`span`,{"data-words":!0})})]}),(0,K.jsx)(`div`,{"data-card":!0,className:`pointer-events-none absolute inset-0 z-9 grid place-items-center rounded-lg bg-[rgba(247,247,245,calc(var(--k,0)*.45))] p-4 text-center font-recorded text-[20px] leading-[1.2] font-medium tracking-[-0.01em] text-[#222222] opacity-0 in-data-absent:bg-surface in-data-absent:font-ui in-data-absent:text-[13px] in-data-absent:leading-normal in-data-absent:font-normal in-data-absent:tracking-normal in-data-absent:text-faint`,children:(0,K.jsxs)(`span`,{className:`grid max-w-[min(30rem,100%)] justify-items-center gap-4 opacity-[var(--n,0)] ${OC} in-data-absent:before:hidden`,children:[(0,K.jsxs)(`span`,{className:`grid justify-items-center gap-1.5`,children:[(0,K.jsx)(`span`,{"data-name":!0}),(0,K.jsx)(`span`,{"data-as":!0,hidden:!0,className:`font-ui text-[14px] leading-[1.4] font-normal tracking-normal text-[#6c707a]`})]}),(0,K.jsxs)(`span`,{"data-line":!0,hidden:!0,className:`grid gap-1 font-ui text-[15px] leading-[1.45] font-normal tracking-normal text-[#3b3e46]`,children:[(0,K.jsx)(`span`,{className:`text-xs leading-4 text-[#8a8e97]`}),(0,K.jsx)(`span`,{className:`line-clamp-4`})]})]})})]},t)),k&&[k,O].map(t=>(0,K.jsxs)(`div`,{ref:e=>void(e?i.current.set(t.number,e):i.current.delete(t.number)),className:`absolute flex h-[26px] items-baseline gap-2 px-0.5 pt-0.5 pb-1.5 text-xs text-faint`,children:[t===k&&ze,(0,K.jsx)(`b`,{className:`flex-none font-medium text-soft`,children:nf(t.number)}),e.about&&(0,K.jsxs)(`span`,{className:`truncate`,children:[(0,K.jsx)(`span`,{className:`mr-1.5 -ml-0.5`,children:`·`}),t===k?e.about.earlier:e.about.now]}),t===O&&e.bare===`kept`&&Be(`-mt-px ml-auto flex-none self-start`)]},t.number)),!k&&e.bare!==`kept`&&(0,K.jsx)(`div`,{ref:e=>void(e?i.current.set(O.number,e):i.current.delete(O.number)),className:`pointer-events-none absolute top-0 left-0 flex h-[26px] items-baseline justify-center px-0.5 pt-0.5 pb-1.5 text-xs transition-opacity duration-160 ease-calm ${j&&e.peeking?`opacity-0`:`opacity-100`}`,children:e.over?.take?(0,K.jsx)(`button`,{className:`pointer-events-auto flex-none animate-arrive font-medium text-fg before:mr-1.5 before:mb-px before:inline-block before:size-1.5 before:rounded-full before:bg-amber before:align-middle before:content-[''] hover:underline`,onClick:e.over.take,children:e.over.words}):e.over&&(0,K.jsx)(`b`,{className:`flex-none animate-arrive font-medium text-soft`,children:e.over.words})}),j&&(0,K.jsxs)(`div`,{className:`pointer-events-none absolute top-0 left-0 flex h-[26px] items-baseline justify-center gap-2 px-0.5 pt-0.5 pb-1.5 text-xs text-faint transition-opacity duration-160 ease-calm ${e.peeking?`opacity-100`:`opacity-0`}`,ref:e=>void(e?i.current.set(j.number,e):i.current.delete(j.number)),children:[(0,K.jsx)(`b`,{className:`flex-none font-medium text-soft`,children:nf(j.number)}),e.about&&(0,K.jsxs)(`span`,{className:`truncate`,children:[(0,K.jsx)(`span`,{className:`mr-1.5 -ml-0.5`,children:`·`}),e.about.earlier]})]}),!k&&ze&&(0,K.jsx)(`div`,{ref:a,inert:!!e.live?.shown,className:`absolute top-0 z-20 flex h-[26px] items-baseline px-0.5 pt-0.5 pb-1.5 text-xs`,style:{opacity:Ce?.32:void 0,transition:`opacity 520ms ${PC}`},children:ze}),!k&&e.bare===`kept`&&!(j&&e.peeking)&&Be(`absolute -top-px left-1/2 -translate-x-1/2`)]})}var vC=`transition-[filter] duration-180 ease-calm group-data-bare/stage:[filter:opacity(0)]`;function yC({mark:e,onMark:t}){let{on:n,pin:r,chosen:i}=e,a=e.shows&&{"data-from":e.shows.at,"data-until":e.shows.until},o=n=>{n.stopPropagation(),t(e.id)},s=r===`diamond`?(0,K.jsxs)(`button`,{"data-pin":e.id,"aria-label":`What changed here`,className:`absolute grid size-[18px] place-items-center ${xC}`,onClick:o,children:[(0,K.jsx)(`i`,{className:`size-[9px] rotate-45 bg-[#2b2e35] shadow-pin`}),e.dot&&(0,K.jsx)(`b`,{className:`absolute top-px left-[11px] size-1.5 rounded-full shadow-[0_0_0_1.5px_#fff]`,style:{background:e.dot}})]}):r&&(0,K.jsx)(`button`,{"data-pin":e.id,className:`absolute ${CC} ${r.fill}`,onClick:o,children:r.number});if(`point`in n)return(0,K.jsx)(`div`,{"data-mark-id":e.id,"data-kind":e.kind,...a,className:`absolute size-0`,style:{left:wC(n.point.x),top:wC(n.point.y)},children:r&&r!==`diamond`&&(0,K.jsx)(`button`,{"data-pin":e.id,className:`${CC} ${r.fill} absolute -top-[9px] -left-[9px]`,onClick:o,children:r.number})});let c=e.kind===`writing`?`outline-[1.5px] outline-dashed outline-amber`:e.kind===`change`?e.ink?`${e.pointed?`outline-[1.5px]`:`outline-1`} outline-(--c) outline-solid`:i?`outline-[1.5px] outline-[#2b2e35] outline-solid`:`outline-1 outline-[rgba(43,46,53,0.4)] outline-solid`:i?`outline-[1.5px] outline-(--c) outline-solid`:`outline-1 outline-[color-mix(in_srgb,var(--c)_50%,transparent)] outline-solid`;return(0,K.jsx)(`div`,{"data-mark-id":e.id,"data-kind":e.kind,"data-paused":e.kind===`change`?``:void 0,"data-answers":e.answers,"data-pointed":e.pointed?``:void 0,"data-node":`node`in n?n.node:void 0,"data-box":`box`in n?`${n.box.x} ${n.box.y} ${n.box.width} ${n.box.height}`:void 0,...a,hidden:!0,className:`pointer-events-none absolute rounded-[4px] outline-offset-4 [transition:opacity_250ms_var(--ease-calm),outline-color_150ms_var(--ease-calm),outline-width_150ms_var(--ease-calm)] data-playing:opacity-0 ${c} data-one:outline-transparent`,style:e.ink?{"--c":e.ink}:void 0,children:s})}function bC({placing:e,aim:t}){return(0,K.jsxs)(K.Fragment,{children:[e&&(0,K.jsx)(`span`,{className:`${SC} absolute -translate-x-1/2 -translate-y-1/2 animate-drop bg-amber`,style:{left:wC(e.x),top:wC(e.y)}}),t&&(0,K.jsx)(`span`,{className:`pointer-events-none absolute size-[18px] -translate-x-1/2 -translate-y-1/2 animate-arrive rounded-full border-[1.5px] border-amber/70`,style:{left:wC(t.x),top:wC(t.y)}})]})}var xC=`pointer-events-auto cursor-pointer opacity-90 transition duration-150 ease-calm hover:scale-112 hover:opacity-100`,SC=`size-[18px] rounded-full text-[10px] leading-[18px] font-semibold text-white shadow-pin`,CC=`${SC} ${xC}`,wC=e=>`${(e*100).toFixed(3)}%`,TC=(e,t)=>{let n=Math.floor(Math.max(0,Math.min(e.width,e.height*t.width/t.height,t.width)));return{width:n,height:Math.floor(n*t.height/t.width)}};function EC(e,t){e.querySelector(`[data-arrow]`).style.display=t?`none`:``,e.querySelector(`[data-beam]`).style.display=t?``:`none`}function DC(e,t,n,r=!0,i=!0){let a=e.getBoundingClientRect().width;if(t.textContent=n,r?e.dataset.mine=``:delete e.dataset.mine,!i||!a)return;let o=e.getBoundingClientRect().width;e.animate([{width:`${a}px`},{width:`${o}px`}],{duration:380,easing:PC}),t.animate([{opacity:0,transform:`translateY(3px)`},{opacity:1,transform:`none`}],{delay:90,duration:280,easing:PC,fill:`backwards`})}var OC=`relative isolate before:pointer-events-none before:absolute before:-inset-x-20 before:-inset-y-12 before:-z-1 before:bg-[radial-gradient(closest-side,rgba(255,255,255,.92)_40%,rgba(255,255,255,0))] before:content-['']`,kC=`absolute top-[17px] left-[13px] overflow-hidden rounded-full bg-[#2B2E35] px-[7px] font-ui text-[11px] leading-[17px] whitespace-nowrap text-white tabular-nums shadow-[0_1px_3px_rgba(0,0,0,0.25)]`,AC=420,jC=`inset 0 0 0 3px rgba(236,170,50,1), inset 0 0 70px 6px rgba(226,160,50,0.55)`,MC=1050,NC=560,PC=`cubic-bezier(0.22, 0.8, 0.24, 1)`,FC=1500,IC=(e,t)=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate(${(-e.x*e.k).toFixed(2)}px,${(-e.y*e.k).toFixed(2)}px) scale(${e.k.toFixed(5)})`}),LC={from:0,width:1280,height:800,touch:!1},RC=448,zC=new WeakMap;function BC(e){if(!zC.has(e)){let t=t=>e.querySelector(`[data-${t}]`);zC.set(e,{app:t(`app`),stack:t(`stack`),marks:t(`marks`),ring:t(`ring`),dialog:t(`dialog`),cursor:t(`cursor`),card:t(`card`),name:t(`name`),as:t(`as`),line:t(`line`)})}return zC.get(e)}function VC(e){let{review:t,round:n,up:r,step:i}=e,[a,o]=(0,l.useState)(),s=(0,l.useRef)(void 0);i?.kind===`go`&&i.flow&&(s.current=i.flow);let c=n.flows.filter(t=>e.needs(t.name)).length,u=n.flows.find(t=>t.name===(a??e.back))??n.flows.find(e=>e.name===s.current)??n.flows[0],d=r=>(0,K.jsx)(JC,{review:t,round:n,flow:r,standing:e.standing(r.name),on:r===u,onPoint:o,onFlow:e.onFlow},r.name),f=t.accepted?null:c?(0,K.jsxs)(K.Fragment,{children:[` `,(0,K.jsx)(GC,{count:c,className:`ml-1.5`})]}):n.flows.every(t=>e.standing(t.name)?.is===`good`)?` · All good`:null;return(0,K.jsx)(`div`,{ref:e.room,inert:!r,className:`absolute inset-0 z-20 flex overflow-y-auto bg-ground transition-[opacity,visibility] duration-240 ease-calm ${r?`visible opacity-100`:`invisible opacity-0`}`,children:(0,K.jsxs)(`div`,{className:HC,onPointerLeave:()=>o(void 0),children:[(0,K.jsxs)(`div`,{className:UC,children:[(0,K.jsxs)(`div`,{className:`px-2.5`,children:[(0,K.jsx)(`h2`,{className:`line-clamp-2 text-[15px] leading-[21px] font-semibold`,children:t.title}),t.asked&&(0,K.jsx)(`p`,{className:`mt-1 line-clamp-6 text-[13px] leading-5 text-soft`,children:t.asked}),(0,K.jsxs)(`div`,{className:`${t.asked?`mt-2`:`mt-1`} -ml-2.5 flex items-center gap-1 text-[13px] leading-5 text-soft`,children:[(0,K.jsx)(af,{quiet:!0,rounds:t.rounds,watching:n.number,arrived:e.arrived,working:e.working,onRound:e.onRound}),(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.accepted?(0,K.jsxs)(`span`,{className:`text-green`,children:[`· `,e.accepted]}):f})]})]}),(0,K.jsx)(`div`,{className:`-mx-1 mt-5 min-h-0 overflow-y-auto px-1`,children:n.flows.map(d)})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col justify-center`,children:[(0,K.jsx)(XC,{review:t,round:n,flow:u,onFlow:e.onFlow}),(0,K.jsx)(`div`,{className:`mt-3 flex min-h-8 items-start justify-end gap-2`,children:(0,K.jsxs)(`div`,{className:`w-[300px] max-w-full`,children:[i?.kind===`go`&&(0,K.jsx)(Jf,{step:i,className:`w-full gap-3`}),i?.kind===`agent`&&!e.working&&(0,K.jsx)(Yf,{step:i,className:`justify-end`}),e.trouble.length>0&&(0,K.jsx)(`p`,{className:`mt-2 text-xs leading-[18px] text-amber-ink`,children:e.trouble.join(` `)})]})})]})]})})}var HC=`m-auto grid w-full max-w-[1240px] grid-cols-[320px_minmax(0,1fr)] gap-10 px-8 py-6 phone:grid-cols-1 phone:gap-5 phone:px-0`,UC=`flex max-h-[calc(100dvh-140px)] min-h-0 flex-col phone:max-h-none`,WC=`relative aspect-[1.6] w-full max-w-[calc((100dvh-200px)*1.6)] self-center overflow-hidden rounded-lg bg-paper shadow-frame`;function GC({count:e,className:t=``}){return(0,K.jsxs)(`span`,{className:`${t} whitespace-nowrap text-fg before:mr-[5px] before:mb-px before:ml-px before:inline-block before:size-1.5 before:rounded-full before:bg-amber before:align-middle before:content-['']`,children:[e,` `,e===1?`flow`:`flows`,` to check`]})}var KC=`group/row grid w-full grid-cols-[64px_minmax(0,1fr)_auto] items-center gap-x-3 rounded-lg p-2 text-left transition-colors duration-150 ease-calm hover:bg-hover data-on:bg-hover`,qC=`relative block aspect-[1.6] overflow-hidden rounded-[5px] bg-paper shadow-frame`;function JC({review:e,round:t,flow:n,standing:r,on:i,onPoint:a,onFlow:o}){return(0,K.jsxs)(`button`,{"data-on":i?``:void 0,className:KC,"aria-label":`Play ${n.name}${r?`. ${Xf(r)}`:``}`,onPointerEnter:()=>a(n.name),onFocus:()=>a(n.name),onClick:()=>o(n.name),children:[(0,K.jsx)(`span`,{className:qC,children:(0,K.jsx)(KS,{shot:qS(e,t,n)})}),(0,K.jsxs)(`span`,{className:`grid min-w-0`,children:[(0,K.jsxs)(`span`,{className:`line-clamp-2 text-[13px] leading-[18px] text-fg`,children:[n.name,q(e)&&(0,K.jsxs)(`span`,{className:`text-soft`,children:[` `,qf(n)]})]}),(0,K.jsxs)(`span`,{className:`mt-0.5 flex min-w-0 items-center gap-1 text-xs leading-4`,children:[r&&(0,K.jsx)(Pd,{end:Nd(r),ahead:r.is===`to watch`,just:!1,className:`size-3 flex-none`}),r&&(0,K.jsx)(`span`,{className:`truncate ${YC[r.is]}`,children:Xf(r)})]})]}),(0,K.jsx)(`span`,{className:`self-start text-xs leading-[18px] text-faint tabular-nums`,children:il(n.length)})]})}var YC={good:`text-green`,"looked good":`text-amber-ink`,"to watch":`text-faint`,"not saved":`text-amber-ink`,"needs you":`text-amber-ink`,"is it good":`text-amber-ink`,"to send":`text-amber-ink`,"with the agent":`text-slate`};function XC({review:e,round:t,flow:n,onFlow:r}){return(0,K.jsxs)(`button`,{"data-picture":n.name,className:`${WC} data-flying:invisible`,"aria-label":`Play ${n.name}`,onClick:()=>r(n.name),children:[(0,K.jsx)(KS,{shot:{src:Kl(e.id,t.number,n.recording,0)}},n.name),(0,K.jsxs)(ZC,{children:[n.name,q(e)&&qf(n)&&(0,K.jsx)(`span`,{className:`font-ui text-[14px] leading-[1.4] font-normal tracking-normal text-[#6c707a]`,children:qf(n)})]})]})}function ZC({children:e}){return(0,K.jsx)(`span`,{className:`absolute inset-0 grid place-content-center bg-[rgba(247,247,245,.45)] p-4 text-center font-recorded text-[20px] leading-[1.2] font-medium tracking-[-0.01em] text-[#222222]`,children:(0,K.jsx)(`span`,{className:`grid justify-items-center gap-1.5 ${OC}`,children:e})})}var QC=(e,t)=>e?.step===t?.step&&e?.actions===t?.actions,$C=new Map,ew=(e,t,n)=>JSON.stringify([e,t,n.step,n.actions]),tw=(e,t,n)=>void $C.delete(ew(e,t,n));function nw(e,t,n,{did:r,ahead:i}={}){if(r)return $C.clear(),ow(e,t,n,{did:r});let a=ew(e,t,n),o=$C.get(a);if(o&&(i||!rw.has(o)))return o;let s=o?o.then(r=>typeof r==`string`?r:ow(e,t,n,{})):ow(e,t,n,{ahead:i});return o||$C.clear(),i&&rw.add(s),$C.set(a,s),s.then(e=>typeof e==`string`||$C.get(a)===s&&$C.delete(a)),s}var rw=new WeakSet,iw=(e,t,n)=>void fetch(`/api/reviews/${encodeURIComponent(e)}/follow`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({flow:t,...n})}).catch(()=>{}),aw=(e,t,n)=>fetch(`/api/reviews/${encodeURIComponent(e)}/ready-in`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({flow:t,...n})}).then(e=>e.json()).then(e=>e.in??void 0,()=>void 0);async function ow(e,t,n,{did:r,ahead:i}){try{let a=await fetch(`/api/reviews/${encodeURIComponent(e)}/take-over`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({flow:t,...n,did:r,ahead:i})}),o=await a.json();return a.ok?`${location.protocol}//${location.hostname}:${o.port}/take-over/${o.moment}`:o.problems??[`It couldn't be made ready (${a.status}).`]}catch{return[`Playthrough isn't running here any more. Start it again with playthrough open, then try again.`]}}function sw({id:e,colour:t,hidden:n,faded:r}){let i=(0,l.useRef)(null),a=()=>{let t=i.current;if(!t)return;let r=t.getAnimations()[0];if(!e&&!n&&t.getAttribute(`d`)&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches){r||(t.animate([{},{opacity:0}],{duration:140,easing:`cubic-bezier(0.4, 0, 1, 1)`,fill:`forwards`}).onfinish=()=>t.setAttribute(`d`,``));return}r?.cancel();let a=e&&document.querySelector(`aside:not([aria-hidden]) [data-open] [data-mark]`),o=e&&document.querySelector(`[data-frame][data-watched] [data-pin="${CSS.escape(e)}"]`),s=a&&a.closest(`aside`);s&&(t.style.opacity=s.style.visibility===`hidden`?`0`:getComputedStyle(s).opacity);let c=a&&a.closest(`[data-card]`)?.getBoundingClientRect(),l=a&&a.getBoundingClientRect(),u=o&&o.getBoundingClientRect(),d=o&&o.closest(`[data-frame]`)?.getBoundingClientRect();if(n||!l||!u||!c||!d||!u.width||!((e,t)=>t[0]>=e.left&&t[0]<=e.right&&t[1]>=e.top&&t[1]<=e.bottom)(d,[u.left+u.width/2,u.top+u.height/2]))return t.setAttribute(`d`,``);let f=u.left+u.width/2;if(c.left>=u.right||c.right<=u.left){let e=c.left>=u.right,n=[e?l.left-1:c.right+1,l.top+l.height/2],r=[e?u.right+1:u.left-1,u.top+u.height/2],i=Math.max(40,Math.abs(n[0]-r[0])*.5)*(e?1:-1);return t.setAttribute(`d`,`M${n[0]},${n[1]} C${n[0]-i},${n[1]} ${r[0]+i},${r[1]} ${r[0]},${r[1]}`)}if(c.top>=u.bottom||c.bottom<=u.top){let e=c.top>=u.bottom,n=Math.min(Math.max(f,c.left+12),c.right-12);return t.setAttribute(`d`,`M${n},${e?c.top-1:c.bottom+1} L${f},${e?u.bottom+1:u.top-1}`)}t.setAttribute(`d`,``)};return(0,l.useLayoutEffect)(a),(0,l.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(function e(){a(),t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}),(0,K.jsx)(`svg`,{className:`pointer-events-none fixed inset-0 z-20 size-full transition-opacity duration-250 ease-calm phone:hidden ${r?`opacity-0`:``}`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{ref:i,fill:`none`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`})})}var cw=400,lw=.05;function uw({id:e,flow:t}){let n=Fl(e),r=Ll(),i=Array.isArray(n)?void 0:n?.title;return(0,l.useEffect)(()=>void(document.title=i?`${i} · Playthrough`:`Playthrough`),[i]),Array.isArray(n)?(0,K.jsx)(dw,{children:(0,K.jsx)(`p`,{className:`m-auto text-soft`,children:n[0]})}):!n||!r?(0,K.jsx)(dw,{}):(0,K.jsx)(fw,{review:ju(n),you:r,flow:t})}function dw({title:e,actions:t,children:n}){return(0,K.jsxs)(`div`,{className:`grid h-dvh grid-rows-[auto_minmax(0,1fr)] overflow-hidden px-5 phone:px-4`,children:[(0,K.jsxs)(`header`,{className:`flex min-h-[46px] min-w-0 items-center gap-2 py-2.5 text-soft`,children:[(0,K.jsx)(`a`,{href:`/`,className:`font-semibold text-fg`,children:`Playthrough`}),e&&(0,K.jsx)(`span`,{className:`text-faint`,children:`/`}),e&&(0,K.jsx)(`span`,{className:`truncate`,children:e}),t&&(0,K.jsx)(`div`,{className:`-my-1.5 -mr-2.5 ml-auto flex flex-none items-center`,children:t})]}),n]})}function fw({review:e,you:t,flow:n}){let r=e.rounds.at(-1),[i,a]=(0,l.useState)(r?.number),[o,s]=(0,l.useState)(r?.number);i===void 0&&r&&(a(r.number),s(r.number));let c=e.rounds.find(e=>e.number===i);if(!c||!r)return(0,K.jsx)(dw,{title:e.title,children:(0,K.jsx)(`p`,{className:`m-auto text-soft`,children:`Nothing’s been recorded yet. The first round shows here once the agent finishes it.`})});let u=e=>{a(e),e===r.number&&s(e)},d=i===o&&r.number!==o;return(0,K.jsx)(pw,{review:e,round:c,latest:r,newer:d?r:void 0,arrived:r.number!==o&&!d,you:t,flow:n,onRound:u})}function pw({review:e,round:t,latest:n,newer:r,arrived:i,you:a,flow:o,onRound:s}){let[c,u]=(0,l.useState)([]),d=c.filter(t=>!e.sends.some(e=>e.id===t.id)),f=d.length?{...e,sends:[...e.sends,...d]}:e,[p,m]=Af(f.id),h=Cu(p,t.number),g=e=>m(t=>wu(t,e)),_=e=>m(n=>Tu(n,t.number,e));(0,l.useEffect)(()=>{let e=e=>e.on?.app&&e.on.flow!==e.on.app.from.flow?{...e,on:{...e.on,flow:e.on.app.from.flow}}:e;[...h.notes,...h.unsaved].some(t=>e(t)!==t)&&g(t=>({...t,notes:t.notes.map(e),unsaved:t.unsaved.map(e)}))});let v=p[t.number]??Su,y=[...f.sends.filter(e=>e.round===t.number).flatMap(e=>e.notes),...v.notes,...v.unsaved],b=JSON.stringify([..._w(y),...yw(t)]),x=(0,l.useMemo)(()=>JSON.parse(b),[b]),S=(0,l.useMemo)(()=>bw(t,x),[t,x]),[C,w]=jf(f.id),T=Eu(f,t.number,C),[E,D]=(0,l.useState)(),O=t===n||!!r,k=(0,l.useRef)(!1),[A,j]=(0,l.useState)();A&&!(E&&`note`in E&&E.note===A)&&j(void 0);let[M,N]=(0,l.useState)({}),ee=(e,t)=>N(({[e]:n,...r})=>t===void 0?r:{...r,[e]:t}),[te,ne]=(0,l.useState)(),[re,ie]=(0,l.useState)([]),[ae,oe]=(0,l.useState)(t.number),se=t.flows.length>0,[ce]=(0,l.useState)(()=>t.flows.find(e=>Sw(e.name)===o)?.name),[le,ue]=(0,l.useState)(se&&!ce),de=le&&se,fe=(0,l.useRef)([t.number]);ae!==t.number&&(oe(t.number),D(void 0),ue(le||se&&!k.current&&!fe.current.includes(t.number)),fe.current.push(t.number));let[P]=(0,l.useState)(()=>new td(S.flows,{flow:ce??t.flows[0]?.name??``,at:Yu}));(0,l.useEffect)(()=>()=>P.destroy(),[P]);let pe=(0,l.useRef)(t.number);(0,l.useLayoutEffect)(()=>{if(pe.current===t.number)return P.keep(S.flows);pe.current=t.number;let e=P.flow,n=S.flows.find(t=>t.name===e.name),r=k.current&&P.now.playing;k.current=!1,P.pause(),P.watch(S.flows,n?{flow:n.name,at:hl(P.now.moment.at,e,n)}:{flow:t.flows[0]?.name??``,at:-Ku}),r&&P.play()},[t,S,P]);let me=id(P,e=>e.moment.flow),he=x.find(e=>e.name===me),F=he?.from.flow??me,I=t.flows.find(e=>e.name===F)??t.flows[0];(0,l.useEffect)(()=>{let e=`/${encodeURIComponent(f.id)}${de||!F?``:`/${Sw(F)}`}`;location.pathname!==e&&history.replaceState(null,``,e)},[f.id,de,F]);let ge=id(P,({moment:e,playing:t})=>{let n=P.flows.find(t=>t.name===e.flow)?.length??0,r=x.some(t=>t.name===e.flow);return t?`playing`:e.at>=n-.06&&!r?`end`:e.at<=0?`start`:`partway`}),[L,_e]=(0,l.useState)(),ve=(0,l.useRef)({});(0,l.useEffect)(()=>void(L?.address&&!L.settled&&(ve.current.since=Date.now())),[L?.address]);let ye=id(P,({moment:e,playing:n})=>{let r=t.flows.find(t=>t.name===e.flow),i=!n&&O&&!de&&r&&e.at>=0?vl(r,e.at):void 0;return i&&JSON.stringify({flow:r.name,paused:i})});(0,l.useEffect)(()=>{if(!ye||L?.shown)return;let{flow:e,paused:t}=JSON.parse(ye),n=setTimeout(()=>void nw(f.id,e,t,{ahead:!0}).then(n=>typeof n==`string`&&_e(r=>r?.shown?r:{flow:e,paused:t,address:n,shown:!1})),200);return()=>clearTimeout(n)},[ye,f.id]);let R=id(P,({moment:e,playing:n})=>{let r=t.flows.find(t=>t.name===e.flow),i=n&&O&&!de&&r&&e.at>=0?vl(r,e.at):void 0;return i&&JSON.stringify({flow:r.name,paused:i})});(0,l.useEffect)(()=>{if(!R)return;let{flow:e,paused:t}=JSON.parse(R);iw(f.id,e,t)},[R,f.id]);let be=id(P,e=>e.playing),xe=e=>{_e(t=>t&&{...t,shown:!1,at:e}),window.focus()};L?.shown&&(be||ae!==t.number)&&_e({...L,shown:!1});let Se=(0,l.useRef)(void 0),Ce=e=>{let t=L?.shown&<.current.address===L.address&&x.find(e=>e.session===lt.current.id);t&&P.go({flow:t.name,at:t.length}),Se.current=void 0,xe(e)},we=(0,l.useRef)(Ce);we.current=Ce;let z=()=>{if(L?.shown)return Ce();if(U&&kt.get(U.id)?.at!==void 0&&U.on?.flow===F)return Te(U);Se.current=void 0;let e=he&&t.flows.find(e=>e.name===he.from.flow);if(he&&e)return ut.current={from:he.from,carry:lt.current.id===he.session?lt.current:void 0},Ee(e,he.from.at,he.did);ut.current={from:{flow:P.flow.name,at:Math.round(Math.max(0,P.now.moment.at)*100)/100}},Ee(P.flow,Math.max(0,P.now.moment.at))},Te=e=>{let n=kt.get(e.id),r=t.flows.find(t=>t.name===e.on?.flow);r&&n?.at!==void 0&&O&&(Se.current=e.id,D({note:e.id}),ut.current={from:{flow:r.name,at:n.at}},Ee(r,n.at,n.did))},Ee=(e,t,n)=>{let r=vl(e,t);if(!O||t<0||!r)return;if(P.pause(),Ze(!1),Ve(`one`),!n&&L&&L.flow===e.name&&QC(L.paused,r)&&L.address){tw(f.id,e.name,r);let{since:t,took:n}=ve.current;return _e({...L,shown:!0,at:void 0,due:!L.settled&&t&&n?t+n:void 0})}_e({flow:e.name,paused:r,shown:!0});let i=t=>t?.flow===e.name&&QC(t.paused,r);nw(f.id,e.name,r,{did:n}).then(t=>{tw(f.id,e.name,r),_e(e=>i(e)?typeof t==`string`?{...e,address:t}:{...e,problems:t,shown:!1}:e)}),n||aw(f.id,e.name,r).then(e=>e!==void 0&&_e(t=>i(t)&&t.shown&&!t.address?{...t,due:Date.now()+e+(ve.current.took??0)}:t))};(0,l.useEffect)(()=>{let e=({data:e,source:t})=>{let n=document.querySelector(`[data-live] iframe`)?.contentWindow;e?.playthrough===`settled`&&t===n&&(ve.current.since&&(ve.current={took:Math.min(Date.now()-ve.current.since,ve.current.took??1/0)}),_e(e=>e&&{...e,settled:!0})),e?.playthrough===`recorded`&&t===n&&ft.current(e.events),e?.playthrough===`did`&&t===n&&(lt.current.did=e.did),e?.playthrough===`pinned`&&ht(e.at),e?.playthrough===`escape`&&(ot.current?at(!1):we.current({x:e.x,y:e.y})),e?.playthrough===`note`&&st.current(),e?.playthrough===`noted`&&ct.current(e)};return addEventListener(`message`,e),()=>removeEventListener(`message`,e)},[]);let De=e=>{C.some(n=>n.flow===e&&n.round===t.number)||w(n=>[...n,{flow:e,round:t.number}])},Oe=(0,l.useRef)(De);Oe.current=De,(0,l.useEffect)(()=>P.subscribe(()=>{let{moment:e}=P.now;e.at>=P.flow.length-.06&&!P.flow.fork&&Oe.current(e.flow)}),[P]);let[ke,Ae]=(0,l.useState)(`one`),[je,Me]=(0,l.useState)(!1),[Ne,Pe]=(0,l.useState)(!1),Fe=(0,l.useRef)(void 0),[Ie,Le]=(0,l.useState)(),[Re,ze]=(0,l.useState)(),Be=f.rounds[0].number,Ve=e=>{e!==ke&&(Ae(e),e===`side`&&Pe(!1))},He=e=>{s(e)},Ue=Fu(f,t.number,a,p),We=e=>e.on?.at!==void 0&&e.turns.some(e=>e.agent),Ge=E&&`note`in E?Ue.find(e=>e.id===E.note):void 0,Ke=Ge&&We(Ge)?Ge.turns.filter(e=>!e.agent&&e.round<t.number).map(e=>e.round):[],qe=Ke.length?Math.max(...Ke):void 0,Je=I?yl(f,a,I.name,t.number):void 0,Ye=t.number>Be?qe??Je??Be:void 0,[Xe,Ze]=(0,l.useState)(!1),Qe=(0,l.useRef)(void 0),$e=()=>{Qe.current===void 0&&(Qe.current=window.setTimeout(()=>{Ze(!0),yr&&Pe(!1)},160))},et=()=>{if(Qe.current!==void 0){if(clearTimeout(Qe.current),Qe.current=void 0,Xe)return Ze(!1);Ve(ke===`side`?`one`:`side`)}},[tt,nt]=(0,l.useState)(!1),[rt,it]=(0,l.useState)(),[B,at]=(0,l.useState)(!1),ot=(0,l.useRef)(B);ot.current=B;let st=(0,l.useRef)(()=>{}),ct=(0,l.useRef)(()=>{}),lt=(0,l.useRef)({id:``,events:[],did:[],kept:0,shift:0,from:{flow:``,at:0}}),ut=(0,l.useRef)(void 0),[dt,V]=(0,l.useState)(),ft=(0,l.useRef)(()=>{});ft.current=e=>{if(!L||!e.length)return;if(lt.current.address!==L.address){let{from:t,carry:n}=ut.current??{from:{flow:L.flow,at:0}},r=n?.events.at(-1);lt.current=n&&r?{...n,address:L.address,shift:r.timestamp+400-e[0].timestamp}:{address:L.address,id:nl(),events:[],did:[],kept:0,shift:0,from:t}}let t=lt.current;t.events.push(...e.map(e=>({...e,timestamp:e.timestamp+t.shift}))),t.heard=Date.now();let n=L.address??``;V(e=>e?.address===n?e:{address:n,name:`fork:${t.id}`,at:t.from.at,length:t.from.at})};let pt=async e=>{let n=`${e.id}-${++e.kept}.json`,r={type:5,data:{tag:`now`,payload:{}},timestamp:e.events.at(-1).timestamp+Date.now()-(e.heard??Date.now())},i=await $l(f.id,t.number,e.from,[...e.events,r],n);if(typeof i!=`number`)return i;let a=`branches/${n}`,o=t=>t.on?.app&&mw(t.on.app.recording)===e.id?{...t,on:{...t.on,app:{...t.on.app,recording:a,length:i}}}:t;return g(e=>({...e,notes:e.notes.map(o),unsaved:e.unsaved.map(o)})),{name:`fork:${e.id}`,session:e.id,from:e.from,did:e.did,recording:a,length:i}},mt=(0,l.useRef)(new Map),ht=e=>{let t=document.querySelector(`[data-live] iframe`),n=t?.getBoundingClientRect();if(!t||!n)return;let r=n.width/t.offsetWidth;mt.current=new Map(Object.entries(e).map(([e,t])=>[e,{x:n.left+t.x*r,y:n.top+t.y*r}]))},gt=!!L?.shown&&!!L.settled&&!!L.address,_t=L?.shown?gt?`shown`:`waiting`:void 0;(0,l.useEffect)(()=>{document.querySelector(`[data-live] iframe`)?.contentWindow?.postMessage({playthrough:`noting`,on:B&>},`*`)},[B,gt]);let vt=id(P,e=>e.playing);(0,l.useEffect)(()=>void(vt&&at(!1)),[vt]);let yt=Bu(f,n),[bt,xt]=(0,l.useState)();(0,l.useEffect)(()=>{if(!I)return;let e=!0;return Vl(f.id,t.number,I.recording).then(n=>{let{changes:r,clicks:i,acted:a}=IS(n),o=new Map(t.replies.flatMap(e=>e.watch&&e.on?.flow===I.name&&e.on.element?.node!==void 0?[[e.note,RS(n,e.on.element.node)]]:[]));e&&xt({flow:I.name,at:r,clicks:i,acted:a,moved:o})}),()=>void(e=!1)},[f.id,t.number,I]);let St=x.filter(e=>e.from.flow===F).map(e=>({name:e.name,at:e.from.at,length:e.length})),Ct=(e,t)=>{let n=P.flows,r=$u(n,P.now.moment),i=n.map(e=>$u(n,{flow:e.name,at:0})),a=bt?.flow===I?.name?(bt?.at??[]).map(e=>$u(n,{flow:I.name,at:Math.min(e,I.length-.02)})):[],o=[...i,...a].sort((e,t)=>e-t),s=e>0?o.find(e=>e>r+.02):o.findLast(e=>e<r-.02);P.go(ed(n,t?r+e*.1:s!==void 0&&Math.abs(s-r)<1?s:r+e))},wt=!!f.accepted||t.number===0||!O&&!i,Tt=[t.number,...Ye===void 0?[]:[Ye],...Ue.map(e=>e.written)],Et=YS(f,f.rounds.filter(e=>Tt.includes(e.number)).map(e=>e.number===t.number?S:e)),Dt=e=>e.on?.app&&e.written!==t.number?t.replies.find(t=>t.note===e.id&&t.on?.app)?.on:void 0,Ot=new Map(Ue.flatMap(e=>{let t=Dt(e)?.app?.did.length??1/0,n=e.on?.app?.did[t];return n?[[e.id,vw(n)]]:[]})),kt=new Map(Ue.flatMap(e=>e.on?.app&&e.written!==t.number&&!Dt(e)?[[e.id,{...xw(f,e.on,e.written,t,Et),did:e.on.app.did}]]:[])),At=Ue.map(e=>{let n=Dt(e);if(n)return{...e,on:n};let r=kt.get(e.id);return r?{...e,on:{flow:e.on.app.from.flow,...r.at!==void 0&&{at:r.at,...r.element&&{element:r.element}}}}:e.on&&!e.on.app?{...e,on:rC(f,e.id,e.on,e.written,t,Et)??e.on}:e}),jt=Ue.filter((e,t)=>e.on?.element&&!e.on.app&&At[t].on!==e.on&&!At[t].on?.element).map(e=>e.id),[Mt,Nt]=(0,l.useState)([]),Pt=Iu(f,t.number,a),Ft=At.filter(e=>!e.on||!t.flows.some(t=>t.name===e.on?.flow)),It=I?At.filter(e=>e.on?.flow===I.name&&e.on.at!==void 0):[],Lt=!wt||!!f.accepted&&t===n,Rt=(0,l.useMemo)(()=>Lt?Ru(f,t.number,a,p,T):void 0,[Lt,f,t.number,a,p,C]),zt=e=>zu(Rt?.get(e)),Bt=!!E&&`end`in E&&E.end===F;E&&`end`in E&&(ge!==`end`||F!==E.end)&&D(void 0);let[Vt,Ht]=(0,l.useState)(),H=I&&Rt?.get(I.name),Ut=I&&ge===`end`?At.filter(e=>e.on?.flow===I.name&&e.on.at===void 0):[],Wt=I&&ge===`end`&&(H||wt)&&(Bt||!E)?I.name:void 0,Gt=!!E&&`writing`in E&&ge===`end`&&h.unsaved.some(e=>e.id===E.writing&&e.on?.flow===F&&e.on.at===void 0),Kt=Gt||(!E||Bt)&&(!!Wt||Ut.length>0),qt=Kt&&!be,Jt=H&&Nd(H),Yt=I&&!wt&&Jt?{end:Jt,words:H?.is===`not saved`?`Finish your note`:{asks:`Looks good?`,"to send":`Send`,good:`Looks good`,"with the agent":`With the agent`}[Jt],just:yd(Vt,I.name),go:()=>Hn(I.name)}:void 0,Xt=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{if(!r)return void(Xt.current=void 0);Xt.current?.round!==r.number&&(Xt.current={round:r.number,flow:F}),(de||F!==Xt.current.flow)&&(k.current=!0,s(r.number))});let Zt=(e,t=Ju)=>{P.pause(),P.go({flow:e,at:t})},Qt=gu(f,t.number,a),$t=bt?.flow===I?.name?bt?.clicks??[]:[],en=id(P,e=>xu(Qt,e.moment,$t)?.id),tn=E&&`change`in E?Qt.find(e=>e.id===E.change):void 0,nn=new Map([...At.filter(e=>e.yours),...h.unsaved].flatMap(e=>{let t=yu(Qt,e.on);return t?[[e.id,t]]:[]})),rn=E&&(`note`in E||`writing`in E)?nn.get(`note`in E?E.note:E.writing):void 0,an=tn??rn,on=tn?.id??en,[sn,cn]=(0,l.useState)();(0,l.useEffect)(()=>cn(void 0),[an?.id]);let[ln,un]=(0,l.useState)(),dn=ln&&Qt.find(e=>e.id===ln.diamond),fn=id(P,({moment:e})=>!!dn&&(e.flow!==dn.flow||Math.abs(e.at-dn.at)>lw));(0,l.useEffect)(()=>{fn&&un(void 0)},[fn]);let pn=(e,t)=>{let n=Qt.find(e=>e.changes.includes(t));n&&(D(void 0),Zt(n.flow,n.at),un({note:e.id,diamond:n.id}))},mn=an?.flow===F?an:!E&&!dn?Qt.find(e=>e.id===en):void 0,hn=(0,l.useRef)(void 0),gn=(e,t,n)=>{hn.current=e,P.run(t,n)},_n=e=>{D({change:e.id}),Zt(e.flow,e.at)},vn=e=>{D(e.on&&e.on.at===void 0?{end:e.on.flow}:{note:e.id}),ie(t=>t.includes(e.id)?t:[...t,e.id]),e.on&&Zt(gw(e.on),e.on.at??S.flows.find(t=>t.name===gw(e.on))?.length)},yn=e=>{let n=aC(t,e.id,bt?.flow===I?.name?bt?.moved.get(e.id):void 0);return n&&e.on&&gw(e.on)===n.flow?n:void 0},bn=e=>yn(e)??{at:e.on?.at??0,until:e.on?.until},xn=e=>{let t=e.on,n=t&&S.flows.find(e=>e.name===gw(t)),{at:r,until:i}=bn(e);if(!n||i===void 0)return vn(e);D({note:e.id}),ie(t=>t.includes(e.id)?t:[...t,e.id]),gn(e.id,{flow:n.name,at:r},Math.min(n.length,i))},[Sn,Cn]=(0,l.useState)([]),wn=id(P,e=>e.moment.at>=0?e.moment.flow:void 0);wn&&!Sn.includes(wn)&&Cn([...Sn,wn]);let Tn=x.filter(e=>e.walked),En=e=>It.some(t=>t.on&&gw(t.on)===e.name&&t.state===`needs you`&&!t.unsent&&!re.includes(t.id)),Dn=(e,t)=>()=>{P.go({flow:e,at:t}),P.play()};(0,l.useEffect)(()=>P.stopAt([...Tn.filter(En).map(e=>({id:e.name,flow:e.from.flow,at:e.from.at,reached:Dn(e.name,e.from.at)})),...t.flows.filter(e=>e.line&&!Sn.includes(e.name)).map(e=>({id:`card:${e.name}`,flow:e.name,at:Yu,reached:()=>{}})),...It.flatMap(e=>e.on&&e.state===`needs you`&&!e.unsent&&!re.includes(e.id)?[{id:e.id,flow:gw(e.on),at:bn(e).at,reached:()=>xn(e)}]:[])]));let On=e=>{if(wt)return;let t=nl();_(n=>({...n,unsaved:[...n.unsaved,{id:t,on:e,words:``}]})),D({writing:t})},kn=E&&`writing`in E?E.writing:void 0,An=()=>{wt||(P.pause(),at(!B))};st.current=An,ct.current=async({element:e,point:t,did:n,x:r,y:i})=>{at(!1);let a=document.querySelector(`[data-live] iframe`),o=a?.getBoundingClientRect();a&&o&&Rd(o.left+r*o.width/a.offsetWidth,o.top+i*o.height/a.offsetHeight);let s=lt.current;if(!L||wt||s.address!==L.address||!s.events.length)return;s.did=n;let c=await pt(s);if(Array.isArray(c))return void Rr(c);let l={from:c.from,did:n,recording:c.recording,length:c.length};On({flow:c.from.flow,at:Math.floor(c.length*100)/100,...e?{element:e}:t&&{point:t},app:l})};let jn=(e,t)=>document.querySelector(`[data-live] iframe`)?.contentWindow?.postMessage({playthrough:`pin`,id:e,number:At.find(t=>t.id===e)?.number??At.length+1,css:t.element?.css,point:t.point},`*`);(0,l.useEffect)(()=>{let e=Se.current??U?.id,t=gt?Ue.find(t=>t.id===e&&t.on?.app):void 0;t?.on&&jn(t.id,t.on)},[gt]),(0,l.useEffect)(()=>{h.unsaved.some(e=>!e.words.trim()&&e.id!==kn)&&g(e=>({...e,unsaved:e.unsaved.filter(e=>e.words.trim()||e.id===kn)}))});let Mn=e=>{ne(e),setTimeout(()=>ne(t=>t===e?void 0:t),1200)},Nn=(e,t)=>{g(n=>({...e.on?Hu(n,e.on.flow,At):n,notes:n.unsaved.some(t=>t.id===e.id)?[...n.notes,{id:e.id,...e.on&&{on:e.on},words:t}]:n.notes,unsaved:n.unsaved.filter(t=>t.id!==e.id)})),D(e.on&&e.on.at===void 0?{end:e.on.flow}:{note:e.id}),Mn(e.id),e.on?.app&>&&jn(e.id,e.on)},Pn=(e,t)=>g(n=>({...n,unsaved:n.unsaved.map(n=>n.id===e?{...n,words:t}:n)})),Fn=e=>{g(t=>({...t,unsaved:t.unsaved.filter(t=>t.id!==e)})),D(void 0)},In=(e,t)=>{g(n=>({...n,notes:n.notes.flatMap(n=>n.id===e?t?[{...n,words:t}]:[]:[n])})),t||D(void 0)},Ln=(e,n)=>m(r=>{let i=wu(r,t=>{let r=n?.verdict===`not quite`&&e.on?Hu(t,e.on.flow,At):t;return{...r,verdicts:r.verdicts.filter(t=>t.note!==e.id),withTheFlow:r.withTheFlow.filter(t=>t!==e.id)}});return n?Tu(i,t.number,e=>({...e,verdicts:[...e.verdicts,n]})):i}),Rn=e=>At.filter(t=>t.on?.flow===e&&t.on.at!==void 0&&t.state===`needs you`&&!t.unsent&&!re.includes(t.id)),zn=async e=>{let t=Rt?.get(e)?.is===`good`;if(t&&h.looksGood.includes(e))return g(t=>Hu(t,e,At));if(t)return void Hr(e,t=>({...t,takenBack:[...t.takenBack,e]}));let n=Rn(e)[0];if(n)return xn(n);await Hr(e,t=>Vu(t,e,At))&&Vn(e)},Bn=async e=>{await Hr(e)&&Vn(e)},Vn=e=>{D({end:e}),Ht({flow:e,at:performance.now()})},Hn=e=>{let t=S.flows.find(t=>t.name===e);if(!t)return;let n=h.unsaved.find(t=>t.on?.flow===e);if(Zt(e,n?.on?.at??t.length),n)return D({writing:n.id});D({end:e})},Un=e=>{D(void 0),P.go({flow:e,at:Yu}),P.play()},Wn=e=>{D(void 0),P.go({flow:e,at:Ju}),P.play()},Gn=(0,l.useRef)(null),Kn=!!L?.shown,qn=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=qn.current;e&&(e.inert=Kn,e.style.transition=`opacity 520ms cubic-bezier(0.22, 0.8, 0.24, 1)`,e.style.opacity=gt?`0.32`:``)},[gt,Kn]);let Jn=(0,l.useRef)(void 0),Yn=(0,l.useRef)(void 0);(0,l.useEffect)(()=>()=>clearTimeout(Yn.current),[]);let Xn=(e,t)=>{Jn.current={taking:Bf(Gn.current),playing:t},ue(!1),e&&Zt(e)},Zn=e=>{let t=Gr(e);return t.kind===`go`?t:{kind:`go`,words:`All flows`,take:nr}},Qn=e=>e.kind===`go`?void 0:`what`in e&&e.what?`${e.words} ${e.what}`:e.words,[$n,er]=(0,l.useState)(),tr=(0,l.useRef)(void 0),nr=()=>{let e=P.flow,n=document.querySelector(`[data-frame][data-watched]`),r=e.fork,i=Math.max(0,e.steps.findLastIndex(e=>e.at<=P.now.moment.at));n&&(tr.current={frame:n,box:n.getBoundingClientRect(),showing:r?void 0:Kl(f.id,t.number,e.recording,i)}),er(r??e.name),P.pause(),P.go({flow:t.flows[0].name,at:Yu}),E&&!(`writing`in E)&&D(void 0),ue(!0)};(0,l.useLayoutEffect)(()=>{let e=tr.current;tr.current=void 0;let t=$n&&Gn.current?.querySelector(`[data-picture="${CSS.escape($n)}"]`);e&&t&&de&&Hf(e.frame,e.box,e.showing,t)}),(0,l.useLayoutEffect)(()=>{let e=Jn.current;if(Jn.current=void 0,!e)return;let n=document.querySelector(`[data-frame="${t.number}"]`),r=n?Vf(e.taking.filter(e=>e.flow===P.flow.name),n):0;if(!e.playing)return;let i=P.now.moment;clearTimeout(Yn.current),Yn.current=window.setTimeout(()=>{let{moment:e,playing:t}=P.now;!t&&e.flow===i.flow&&e.at===i.at&&P.play()},r+cw)});let rr=[...t.flows.flatMap(e=>[{flow:e},...bd(e.name,At,Qt,xd(Rt?.get(e.name),e.name===F)),...wt?[]:[{end:e.name}]]),...Ft.map(e=>({note:e,at:1/0}))],ir=e=>{let t=rr.findIndex(e=>`note`in e?E&&`note`in E&&E.note===e.note.id:`diamond`in e?tn===e.diamond:`end`in e?e.end===F&&(Bt||!E&&!!Wt):!E&&!Wt&&e.flow.name===F),n=rr[t<0?0:Xu(t+e,0,rr.length-1)];!n||t>=0&&rr[t]===n||(`note`in n?xn(n.note):`diamond`in n?_n(n.diamond):`end`in n?Hn(n.end):(D(void 0),Zt(n.flow.name)))},ar=Math.max(0,...At.map(e=>e.number))+1,or=h.unsaved.find(e=>e.id===kn),sr=e=>tC(e&&{...e,flow:gw(e)},Et,t.number),cr=e=>(0,K.jsxs)(`div`,{"data-open":!0,className:`grid gap-2.5 px-4 py-2`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-x-2`,children:[(0,K.jsx)(`span`,{"data-mark":!0,className:`${ad} relative z-1 mt-px bg-amber text-white`,children:ar+h.unsaved.indexOf(e)}),(0,K.jsx)(`span`,{className:`truncate`,children:sr(e.on)}),(0,K.jsx)(`span`,{className:`min-w-[78px] text-right text-xs leading-5 text-amber-ink tabular-nums`,children:e.on?.at===void 0?``:il(e.on.at)})]}),(0,K.jsx)(vd,{words:e.words,placeholder:e.on&&e.on.at===void 0?`What isn’t good about it?`:`What do you think?`,question:e.on?.app?`Your new note, on what’s in the app`:`Your new note`,onWords:t=>Pn(e.id,t),onSave:t=>Nn(e,t),onCancel:()=>Fn(e.id)})]},e.id),lr=e=>{let t=[...nn].find(([,t])=>t===e)?.[0],n=At.find(e=>e.id===t);if(n)return xn(n);if(t)return D({writing:t});let r=e.changes.find(e=>!e.answers)?.on;Zt(e.flow,e.at),On({flow:e.flow,at:e.at,...e.until===void 0&&(r?.element?{element:r.element}:r?.box&&{box:r.box})})},ur=()=>{D(void 0),ge!==`end`&&P.play()},dr=(e,n)=>{let r=!!E&&`note`in E&&E.note===e.id,i=!!e.on&&t.flows.some(t=>t.name===e.on.flow)&&e.on.flow!==F||(Mt.includes(e.id)||jt.includes(e.id))&&(ge!==`playing`||hn.current!==e.id),o=kt.get(e.id),s=O&&!wt,c=Ot.has(e.id)?{round:t.number,stopped:Ot.get(e.id)}:o&&(o.at===void 0||s)?{round:t.number,live:Se.current===e.id?_t:void 0,...o.at!==void 0&&{onTakeOver:()=>Te(e)}}:void 0;return(0,K.jsx)(md,{note:e,playhead:P,you:a,readOnly:wt,open:r,fresh:te===e.id,answers:vu(Qt,e.id),compare:r&&!o&&!Ot.has(e.id)&&(We(e)||n)?kr:void 0,whereYouWere:c,asking:A===e.id,unfinished:M[e.id],away:i,grown:n,whole:e.on?.at===void 0,onOpen:()=>xn(e),onClose:()=>D(void 0),onAsking:t=>j(t?e.id:void 0),onUnfinished:t=>ee(e.id,t),onJudge:t=>Ln(e,t),onEdit:t=>In(e.id,t),onPoint:cn,seen:e=>Qt.find(t=>t.changes.includes(e))?.at,onVisit:e.on?.at===void 0?t=>pn(e,t):void 0,onPlayOn:gt&&Se.current===e.id?()=>{}:ur,onShow:()=>vn(e)},e.id)},fr=(0,l.useRef)({down:0,up:0,kept:!1}),pr=e=>{let t=fr.current,n=performance.now();if(e)return t.kept?(t.kept=!1,t.down=-1,ze(void 0)):(t.kept=n-t.up<350,t.down=n,ze(t.kept?`kept`:`held`));if(t.down===-1)return void(t.down=0);t.kept||(ze(void 0),t.up=n-t.down<300?n:0)},U=E&&`note`in E?At.find(e=>e.id===E.note):void 0,mr=!!U&&!wt&&U.on?.at!==void 0&&U.toJudge&&!h.verdicts.some(e=>e.note===U.id)&&U.on?.flow===F,hr=gt&&!!U&&Se.current===U.id,gr=U?.on?.at!==void 0&&!U.on.app?{flow:U.on.flow,...bn(U)}:tn&&{flow:tn.flow,at:tn.at,until:void 0},_r=id(P,({moment:e})=>!!gr&&!L?.shown&&(e.flow!==gr.flow||e.at<gr.at-lw||e.at>(gr.until??gr.at)+lw));(0,l.useEffect)(()=>{_r&&D(void 0)},[_r]);let vr=Ye===void 0?void 0:f.rounds.find(e=>e.number===Ye),yr=U&&yn(U),br=ke===`side`||Xe&&!!yr,xr=(U&&Dt(U)?Tn.find(e=>e.notes?.some(e=>e.id===U.id)):void 0)??(he?.walked?he:void 0)??(br?Tn.find(e=>e.name===Fe.current):void 0);Fe.current=br?xr?.name:void 0;let Sr=(xr?.notes??[]).flatMap(({id:e})=>{let t=Ue.find(t=>t.id===e)?.on;return t?.app&&t.at!==void 0?[{id:e,at:t.at,app:t.app}]:[]}),Cr=Sr.toSorted((e,t)=>t.app.length-e.app.length)[0]?.app,wr=xr&&S.flows.find(e=>e.name===xr.name),Tr=wr?.steps.findLast(e=>e.title.startsWith(`Note `)),Er=wr&&Tr?wr.length-Tr.at:void 0,Dr=Math.max(...Sr.map(e=>e.at)),Or=vr&&Cr?bw(vr,[{name:hw(Cr.recording),session:mw(Cr.recording),...Cr,length:Er===void 0?Cr.length:Math.min(Cr.length,Dr+Er),notes:Sr.map(({id:e,at:t})=>({id:e,at:t}))}]):vr,kr=Or?.flows.some(e=>e.name===me)?{on:Xe||br,off:!!L?.shown,onPress:$e,onRelease:et}:void 0,Ar=br&&!!Or,jr=Ar?Or:void 0,Mr=Ar?!Ne:je,Nr=(0,l.useRef)(null),Pr=()=>I&&!de?{review:f.id,filmed:{round:t.number,flow:I.name,beside:jr?.number,dark:matchMedia(`(prefers-color-scheme: dark)`).matches},name:`${I.name} · ${jr?`${nf(jr.number)} and ${nf(t.number)}`:nf(t.number)}`}:void 0,Fr=Xe&&!yr&&!!vr,Ir=Ar&&yr?`${U.id} ${yr.flow} ${yr.at} ${yr.until}`:void 0;(0,l.useEffect)(()=>{if(Ir&&yr)return hn.current=U.id,P.repeat({flow:yr.flow,at:yr.at},yr.until),()=>{P.pause(),P.go({flow:yr.flow,at:yr.until})}},[Ir]);let[Lr,Rr]=(0,l.useState)([]),[zr,Br]=(0,l.useState)(!1),Vr=(0,l.useRef)(!1),Hr=async(e,n)=>{let r=t=>e?ku(t,e,At).sending:t,i=n?Tu(p,t.number,n):p,o=Object.entries(i).filter(([e,n])=>Number(e)<=t.number&&Ou(r(n)));if(!o.length||Vr.current)return!1;Vr.current=!0;for(let[i,s]of o){let o={id:nl(),round:Number(i),by:a,sent:new Date().toISOString(),...Du(r(s))},c=await ql(f.id,o);if(Rr(c),c.length)return Vr.current=!1,!1;u(e=>[...e,o]),m(r=>Tu(r,Number(i),r=>{let a=n&&Number(i)===t.number?n(r):r;return e?ku(a,e,At).left:{...Su,unsaved:a.unsaved}}))}return Vr.current=!1,!0},Ur=async()=>{if(Ou(h)&&!await Hr())return;let e=await Jl(f.id,a);Rr(e),!e.length&&(Br(!0),se&&setTimeout(nr,900))},Wr=e=>[`to send`,`not saved`].includes(Rt?.get(e)?.is??``),Gr=e=>{let n=t.flows.slice(e+1).find(e=>zt(e.name)),r=h.unsaved.find(e=>!e.on)??Ft.find(e=>e.state===`needs you`),i=n??(r?void 0:t.flows.slice(0,Math.max(0,e)).find(e=>zt(e.name)));return i?{kind:`go`,words:`Next`,what:i.name,flow:i.name,take:()=>Wr(i.name)?Hn(i.name):Un(i.name)}:r&&`turns`in r?{kind:`go`,words:`Next to check`,what:r.turns[0]?.words,take:()=>xn(r)}:r?{kind:`go`,words:`Finish your note`,what:sr(r.on),take:()=>D({writing:r.id})}:Tl(Nu(f,a,p),a)?{kind:`go`,words:`All good`,what:`Accept the work`,take:Ur,final:!0}:ll(f).length?yt?{kind:`agent`,words:`The agent is working`,what:`started at ${tf(yt)}`,busy:!0}:{kind:`agent`,words:`Sent, waiting for the agent`,busy:!1}:{kind:`say`,words:`All good`}},Kr=(()=>{if(f.accepted||zr)return{kind:`done`,words:!f.accepted||f.accepted.by===a?`Accepted`:`Accepted by ${f.accepted.by}`,just:zr};if(t!==n&&i)return{kind:`go`,words:`${nf(n.number)} is in`,what:`See it`,take:()=>He(n.number)};if(!O)return{kind:`go`,words:`Back to now`,what:nf(n.number),take:()=>He(n.number)};if(t.number===0)return{kind:`agent`,words:`The agent is working`,what:`on round 1`,busy:!0};if(!I)return Gr(-1);if(ge===`playing`)return{kind:`say`,words:`Playing`,what:I.name};if(ge!==`end`)return{kind:`go`,words:ge===`start`?`Play`:`Play on`,what:I.name,take:()=>P.play()};let e=h.unsaved.find(e=>e.on?.flow===I.name);return e&&zt(I.name)?{kind:`go`,words:`Finish your note`,what:sr(e.on),take:()=>D({writing:e.id})}:Wt?H?.is===`good`||H?.is===`with the agent`?Zn(t.flows.indexOf(I)):{kind:`say`,words:`End of`,what:I.name}:zt(I.name)?{kind:`go`,words:`Watch it`,what:`from the start`,take:()=>Wn(I.name)}:Gr(t.flows.indexOf(I))})(),qr=T.length>0||Ou(h)>0||h.unsaved.length>0,Jr=(()=>{if(f.accepted||zr)return;if(!O)return i?void 0:Kr;if(wt)return;let e=Gr(-1);if(e.kind===`agent`)return e;if(e.kind===`go`)return e.flow?{...e,words:qr?`Carry on checking`:`Start checking`,what:void 0,take:()=>{let t=Wr(e.flow);Xn(e.flow,!t),t&&Hn(e.flow)}}:e.final?e:{...e,take:()=>{Xn(void 0,!1),e.take()}}})(),Yr=de?Jr:Kr,Xr=[...Pt,...At].filter(e=>e.state===`settled`).length,Zr=`Accepted${Xr?` · ${Xr} ${Xr===1?`note`:`notes`} settled`:``}`,Qr=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=e=>e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement,t=(e,t)=>{let n=e.target.closest?.(t);return!!n&&n!==Qr.current},r=e=>Qr.current=e.target.closest?.(`button, [role=button], [role=slider]`)??null,i=r=>{if(r.key===`Tab`&&(Qr.current=null),r.key===`Enter`&&(r.ctrlKey||r.metaKey)&&!e(r)&&!L?.shown&&Yr?.kind===`go`&&Yr.final)return r.preventDefault(),Yr.take();if(!(e(r)||r.metaKey||r.ctrlKey||r.altKey||r.defaultPrevented)&&(!L?.shown||/^(n|t|escape)$/i.test(r.key))){if(de)r.key===` `?(r.preventDefault(),Xn(Gn.current?.querySelector(`[data-picture]`)?.dataset.picture??P.flow.name,!0)):r.key===`Enter`&&!t(r,`button`)&&Jr?.kind===`go`&&!Jr.final&&(r.preventDefault(),Jr.take());else if(r.key===` `)r.preventDefault(),P.toggle();else if(r.key===`ArrowRight`||r.key===`ArrowLeft`){if(r.target.closest?.(`[role=slider][aria-label=Rounds]`))return;r.preventDefault(),Ct(r.key===`ArrowRight`?1:-1,r.shiftKey)}else r.key===`ArrowDown`||r.key===`ArrowUp`?(r.preventDefault(),ir(r.key===`ArrowDown`?1:-1)):r.key.toLowerCase()===`h`?r.repeat||pr(!0):r.key===`Enter`&&!t(r,`button, [role=button], [role=slider]`)?mr?(r.preventDefault(),Ln(U,{note:U.id,verdict:`looks good`}),ur()):U||tn?(r.preventDefault(),ur()):Wt&&H?.is===`to send`?(r.preventDefault(),Bn(Wt)):Wt&&H?.is!==`good`&&H?.is!==`with the agent`&&H?.is!==`not saved`?(r.preventDefault(),zn(Wt)):E&&!Bt||Kr.kind!==`go`||Kr.final||(r.preventDefault(),Kr.take()):r.key.toLowerCase()===`x`&&!r.repeat?(r.preventDefault(),mr?j(U.id):tn&&!wt?lr(tn):Wt&&H?.is!==`not saved`&&On({flow:Wt})):r.key.toLowerCase()===`c`&&!r.repeat&&kr&&!L?.shown?$e():r.key.toLowerCase()===`n`&&!r.repeat?(r.preventDefault(),An()):r.key===`Escape`&&B?at(!1):r.key.toLowerCase()===`t`&&!r.repeat?(r.preventDefault(),z()):r.key.toLowerCase()===`v`&&!r.repeat&&!L?.shown?(r.preventDefault(),Nr.current?.start()):r.key===`Escape`&&L?.shown?Ce():r.key===`Escape`&&(Xe||Ar)?(Ze(!1),Ve(`one`)):r.key===`Escape`&&(E&&!Bt?D(void 0):se?nr():O||He(n.number))}},a=t=>{t.key===` `&&!e(t)&&t.preventDefault(),t.key.toLowerCase()===`h`&&pr(!1),t.key.toLowerCase()===`c`&&et()},o=()=>fr.current.kept||ze(void 0);return addEventListener(`keydown`,i),addEventListener(`keyup`,a),addEventListener(`blur`,o),addEventListener(`pointerdown`,r,!0),()=>{removeEventListener(`pointerdown`,r,!0),removeEventListener(`keydown`,i),removeEventListener(`keyup`,a),removeEventListener(`blur`,o)}});let $r=e=>{let t=[...nn].find(([,t])=>t===e)?.[0],n=At.find(e=>e.id===t);return t===void 0?void 0:n?Gu(n):`var(--amber)`},ei=e=>e?.element?.node===void 0?e?.point?{point:e.point}:e?.box?{box:e.box}:void 0:{node:e.element.node},ti=e=>[ei(e),...(e?.alike??[]).map(e=>e.node!==void 0&&{node:e.node})].filter(e=>!!e),ni=e=>{let t=e.filter(e=>e.change.id===sn);return t.length?t:e},ri=dn&&At.find(e=>e.id===ln?.note),ii=e=>{let[t,n]=U&&U.on?.at!==void 0?[U,ni(vu(Qt,U.id).filter(e=>e.on.flow===F))]:ri&&dn.flow===F?[ri,vu(Qt,ri.id).filter(e=>dn.changes.includes(e))]:[void 0,[]];return t?n.flatMap(n=>ti(e(n)).map(e=>({id:n.change.id,kind:`change`,on:e,ink:Gu(t),answers:t.id,pointed:n.change.id===sn,chosen:t===ri}))):[]},ai=e=>ni(e.changes),oi=e=>e.until===void 0||bt?.flow!==e.flow?[]:[...new Set(bt.acted.filter(([t])=>t>=e.at&&t<=e.until).map(([,e])=>e))].map(e=>({node:e})),si=(mn?ai(mn):[]).flatMap(e=>ei(e.on)?ti(e.on):oi(mn)),ci=new Map([[t.number,[...It.flatMap(e=>{let t=!nn.has(e.id)&&gw(e.on)===me&&ei(e.on),n=U?.id===e.id;return t?[{id:e.id,kind:`note`,on:t,pin:{number:e.number,fill:Wu(e)},ink:Gu(e),chosen:n,shows:n?void 0:bn(e)}]:[]}),...or?.on&&gw(or.on)===me&&or.on.element?.node!==void 0&&!nn.has(or.id)?[{id:or.id,kind:`writing`,on:{node:or.on.element.node},chosen:!0}]:[],...si.map((e,t)=>({id:mn.id,kind:`change`,on:e,pin:t===0?`diamond`:void 0,dot:$r(mn),chosen:mn===tn||mn===rn})),...ii(e=>e.on)]]]),li=jr??vr;if(li){let e=U&&Ue.find(e=>e.id===U.id),n=e?.on&&ei(rC(f,e.id,e.on,e.written,li,Et));ci.set(li.number,[...n?[{id:e.id,kind:`note`,on:n,ink:Gu(e),chosen:!0}]:[],...tn?.flow===F?ai(tn).flatMap(e=>ti(sC(f,e.on,t.number,li,Et)).map(e=>({id:tn.id,kind:`change`,on:e,chosen:!0}))):[],...ii(e=>sC(f,e.on,t.number,li,Et))])}let ui={round:t,playhead:P,notes:At,diamonds:Qt,chosen:tn?.id,standing:e=>Rt?.get(e),unseen:Rn,asked:Wt,landed:Vt,note:dr,grown:new Map([...nn].map(([e,t])=>[e,t.id])),compare:an?.flow===F?kr:void 0,onDiamond:_n,onClose:()=>D(void 0),onPoint:cn,onPlayOn:ur,onNoteOn:lr,onNote:xn,onGood:zn,onNotQuite:e=>On({flow:e}),onSend:e=>void Bn(e),onward:H&&H.is!==`not saved`?Zn(I?t.flows.indexOf(I):-1):Kr,waiting:Qn(Gr(I?t.flows.indexOf(I):-1)),onAgain:e=>Wn(e.name)};return(0,K.jsxs)(dw,{title:f.title,actions:(0,K.jsx)(wf,{ref:Nr,asked:Pr,shown:!de&&!!I,resting:gt}),children:[(0,K.jsx)(sw,{id:rn?.id??U?.id??tn?.id,colour:U?Gu(U):rn?`var(--amber)`:`var(--soft)`,hidden:!!Re||Fr||gt,faded:be}),(0,K.jsxs)(`main`,{className:`relative grid min-h-0 grid-cols-[minmax(0,1fr)] phone:flex phone:flex-col`,children:[(0,K.jsxs)(`section`,{inert:de,className:`grid min-h-0 min-w-0 grid-rows-[minmax(0,1fr)_auto] pb-4 phone:flex-none phone:grid-rows-[auto_auto] phone:pr-0 phone:pb-3 ${de?`invisible`:``}`,children:[(0,K.jsxs)(`div`,{className:`relative grid min-h-0 grid-rows-[minmax(0,1fr)] pb-6`,children:[(0,K.jsx)(_C,{ending:qt,review:f,playhead:P,round:S,earlier:jr,about:xr&&Cr?{earlier:`what you did`,now:`your steps again`}:void 0,then:!Ar&&(Fr||!be)?Or:void 0,peeking:Fr,zoomed:Mr,bare:Re,onShown:Le,onBareOff:()=>{fr.current.kept=!1,ze(void 0)},marks:ci,placing:or?.on?.point,writing:!!or,onPlace:wt||!B?void 0:e=>{at(!1);let t=he&&{from:he.from,did:he.did,recording:he.recording,length:he.length};I&&On({flow:I.name,at:Math.round(Math.max(0,P.now.moment.at)*100)/100,...e,...t&&{app:t}})},onMark:e=>{let t=At.find(t=>t.id===e),n=Qt.find(t=>t.id===e);t?xn(t):n&&_n(n)},read:Et,onGone:Nt,onAllFlows:se?()=>nr():void 0,over:i?{words:`${nf(n.number)} is in`,take:()=>He(n.number)}:O?void 0:{words:nf(t.number)},live:L}),(0,K.jsx)(`div`,{className:`absolute bottom-6 left-1/2 z-20 -translate-x-1/2 translate-y-1/2`,children:(0,K.jsx)(Id,{live:_t,latest:O,compare:_t===`shown`?void 0:kr,noting:B,onNote:wt?void 0:An,onTakeOver:z,onBack:()=>Ce(),flow:F??``,notes:At.filter(e=>e.on?.flow===F&&e.on.at!==void 0&&e.turns[0]?.words).sort((e,t)=>e.on.at-t.on.at).map(e=>({id:e.id,ink:Gu(e),words:e.turns[0].words,at:il(e.on.at),app:!!e.on.app||kt.has(e.id)})),whole:Yt&&{end:Yt.end,words:Yt.words,notes:At.filter(e=>e.on?.flow===F&&e.on.at===void 0&&e.turns[0]?.words).length},onWhole:()=>{nt(!1),L?.shown&&Ce(),Yt?.go()},listed:tt,onList:e=>(nt(e),e||it(void 0)),onLight:it,onSaid:e=>{nt(!1),it(void 0);let t=At.find(t=>t.id===e);L?.shown&&Ce(),t&&xn(t)}})})]}),(L?.problems||!de&&Lr.length>0)&&(0,K.jsxs)(`div`,{role:`alert`,className:`fixed right-4 bottom-4 z-30 max-w-[28rem] animate-arrive rounded-lg bg-surface px-3 py-2 text-sm whitespace-pre-wrap shadow-tip [overflow-wrap:anywhere]`,children:[[...L?.problems??[],...de?[]:Lr].join(`
|
|
194
|
-
`),(0,K.jsx)(`button`,{className:`ml-3 text-soft hover:text-fg`,onClick:()=>{L?.problems&&_e(void 0),Rr([])},children:`Close`})]}),(0,K.jsx)(`div`,{ref:qn,className:`flex items-end gap-5 phone:flex-col phone:items-stretch phone:gap-0`,children:(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(yf,{stage:!0,end:Yt,forks:St,lit:rt,growing:gt?dt:void 0,live:_t,onTakeOver:z,playhead:P,dots:It.filter(e=>!nn.has(e.id)).map(e=>({id:e.id,...bn(e),ink:Gu(e),number:e.number,words:e.turns[0]?.words??``,...e.on?.app&&{fork:gw(e.on)}})),onDot:e=>{let t=At.find(t=>t.id===e);t&&xn(t)},marks:Qt.filter(e=>e.flow===F&&(e.row||e===dn)).map(e=>{let t=e===dn?ri:At.find(t=>nn.get(t.id)===e);return{...e,note:t&&{number:t.number,ink:Gu(t)},lit:e.id===on||!!t&&(t===U||e===dn)}}),onMark:e=>{let t=Qt.find(t=>t.id===e);t&&_n(t)},shown:Ie,zoomed:Mr,onSize:()=>Ar?Pe(!Ne):Me(!je),rounds:f.rounds,watching:t.number,earlier:jr?.number,arrived:i?n:void 0,working:yt,onRound:He,look:ke,onLook:Ve})})})]}),(0,K.jsx)(Gd,{id:U?.id??kn??tn?.id,standing:qt,still:be,resting:(or?or.on?.app:U&&(U.on?.app||Se.current===U.id))?void 0:_t,over:(!kn||Gt)&&!tn&&(Kt||!!U&&kt.has(U.id)&&!U.on?.element&&!hr),pinned:U&>&&(U.on?.app||hr)?()=>mt.current.get(U.id):void 0,onAway:U&&!hr||tn?()=>D(void 0):void 0,children:tt||de?void 0:U?dr(U):or&&!Gt?cr(or):tn||Kt?(0,K.jsx)(Sd,{...ui,writing:Gt&&or?cr(or):void 0}):void 0}),se&&(0,K.jsx)(VC,{room:Gn,review:f,round:t,up:de,standing:e=>Rt?.get(e),needs:zt,accepted:f.accepted||zr?Zr:void 0,step:Jr,trouble:Lr,onFlow:e=>Xn(e,!0),back:$n,arrived:i?n:void 0,working:yt,onRound:He})]})]})}var mw=e=>e.match(/^(?:branches\/(.+)-\d+|walks\/(.+))\.json$/)?.slice(1).find(Boolean)??e,hw=e=>`fork:${mw(e)}`,gw=e=>e.app?hw(e.app.recording):e.flow;function _w(e){let t=new Map,n=e=>void((t.get(e.name)?.length??0)<e.length&&t.set(e.name,e));for(let{on:t}of e)t?.app&&n({name:hw(t.app.recording),session:mw(t.app.recording),...t.app});return[...t.values()]}function vw({does:e,what:t}){let n=t?`“${t}”`:`What you did next`;return e===`fill`||e===`type`?`${n} isn’t there to type into any more.`:e===`selectOption`?`${n} isn’t there to choose from any more.`:`${n} isn’t there to click any more.`}function yw(e){let t=new Map;for(let{note:n,on:r}of e.replies){if(!r?.app||r.at===void 0)continue;let e=hw(r.app.recording);(t.get(e)??t.set(e,{name:e,session:mw(r.app.recording),...r.app,walked:!0,notes:[]}).get(e)).notes.push({id:n,at:r.at})}return[...t.values()]}function bw(e,t){if(!t.length)return e;let n=e=>t.filter(t=>t.from.flow===e.name).map(t=>({name:t.name,length:t.length,steps:[...e.steps.filter(e=>e.at<t.from.at),{title:`In the app`,at:t.from.at},...(t.notes??[]).toSorted((e,t)=>e.at-t.at).map(e=>({title:`Note ${e.id}`,at:e.at}))],recording:t.recording,person:`You`,fork:e.name}));return{...e,flows:e.flows.flatMap(e=>[e,...n(e)])}}function xw(e,t,n,r,i){let a=t.app.from,o=e.rounds.find(e=>e.number===n)?.flows.find(e=>e.name===a.flow),s=r.flows.find(e=>e.name===a.flow),c=o&&vl(o,a.at),l=c&&s?.steps.find(e=>e.title===c.step);if(!o||!s||!c||!l||(l.actions?.length??0)<(c.actions??0))return{};let u=hl(a.at,o,s),d=Math.round((QC(vl(s,u),c)?u:(c.actions?l.actions[c.actions-1]:l.actions?.at(-1)??l.at)+.05)*100)/100,f=i(r.number,s.name)??[],p=f.findLast(e=>e.at<=d+.05)??f[0],m=t.element&&p?.things.find(e=>e.role===t.element.role&&e.name===t.element.name);return{at:d,...m&&{element:Pl(m,t.element.name)}}}var Sw=e=>e.normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/['’]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``);function Cw(e,t){let n=ju(e),r=n.rounds.findLast(e=>e.number>0),i=[n.started,...n.rounds.map(e=>e.finished??``),...n.sends.map(e=>e.sent),...n.taken.map(e=>e.at),n.accepted?.at??``].sort().at(-1);if(!r)return{review:n,toCheck:0,good:!1,moved:i};let a=Ru(n,r.number,t,Mf(n.id),Eu(n,r.number,Nf(n.id)));return{review:n,latest:r,toCheck:n.accepted?0:r.flows.filter(e=>zu(a.get(e.name))).length,good:r.flows.every(e=>a.get(e.name)?.is===`good`),working:Bu(n,r),moved:i}}var ww=(e,t)=>Number(t.toCheck>0)-Number(e.toCheck>0)||t.moved.localeCompare(e.moved);function Tw(){let e=Il(),t=Ll(),[n,r]=(0,l.useState)();if((0,l.useEffect)(()=>void(document.title=e?`${e.app} · Playthrough`:`Playthrough`),[e]),!e||!t)return(0,K.jsx)(dw,{});if(!e.reviews.length)return(0,K.jsx)(dw,{children:(0,K.jsx)(`p`,{className:`m-auto text-soft`,children:`There are no reviews here yet. An agent starts one with playthrough start.`})});let i=e.reviews.map(e=>Cw(e,t)).sort(ww),a=i.find(e=>e.review.id===n)??i[0];return(0,K.jsx)(dw,{children:(0,K.jsx)(`main`,{className:`relative min-h-0`,children:(0,K.jsx)(`div`,{className:`absolute inset-0 flex overflow-y-auto`,children:(0,K.jsxs)(`div`,{className:HC,onPointerLeave:()=>r(void 0),children:[(0,K.jsxs)(`div`,{className:UC,children:[(0,K.jsx)(`h2`,{className:`line-clamp-2 px-2.5 text-[15px] leading-[21px] font-semibold`,children:e.app}),(0,K.jsx)(`div`,{className:`-mx-1 mt-5 min-h-0 overflow-y-auto px-1`,children:i.map(e=>(0,K.jsx)(Ew,{it:e,on:e===a,onPoint:r},e.review.id))})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col justify-center`,children:[(0,K.jsxs)(`a`,{href:`/${a.review.id}`,className:`${WC} block`,"aria-label":`Open ${a.review.title}`,children:[(0,K.jsx)(Ow,{it:a}),(0,K.jsx)(ZC,{children:a.review.title})]}),(0,K.jsx)(`div`,{className:`mt-3 min-h-8`})]})]})})})})}function Ew({it:e,on:t,onPoint:n}){return(0,K.jsxs)(`a`,{href:`/${e.review.id}`,"data-on":t?``:void 0,className:KC,onPointerEnter:()=>n(e.review.id),onFocus:()=>n(e.review.id),children:[(0,K.jsx)(`span`,{className:qC,children:(0,K.jsx)(Ow,{it:e})}),(0,K.jsxs)(`span`,{className:`grid min-w-0`,children:[(0,K.jsx)(`span`,{className:`line-clamp-2 text-[13px] leading-[18px] text-fg`,children:e.review.title}),(0,K.jsx)(`span`,{className:`mt-0.5 text-xs leading-4`,children:(0,K.jsx)(Dw,{it:e})})]}),(0,K.jsx)(`span`,{className:`self-start text-xs leading-[18px] whitespace-nowrap text-faint tabular-nums`,children:kw(e.moved)})]})}function Dw({it:e}){return e.review.accepted?(0,K.jsx)(`span`,{className:`text-green`,children:`Accepted`}):e.latest?(0,K.jsxs)(`span`,{className:`flex flex-wrap gap-x-1.5 text-soft`,children:[e.working?(0,K.jsxs)(`span`,{className:`text-slate before:mr-1.5 before:mb-px before:inline-block before:size-1.5 before:animate-breathe before:rounded-full before:bg-slate before:align-middle before:content-['']`,children:[nf(e.latest.number+1),` coming`]}):(0,K.jsx)(`span`,{children:nf(e.latest.number)}),e.toCheck?(0,K.jsx)(GC,{count:e.toCheck}):e.good?(0,K.jsx)(`span`,{children:`· All good`}):null]}):(0,K.jsx)(`span`,{className:`text-faint`,children:`Nothing recorded yet`})}function Ow({it:e}){let t=e.latest?.flows[0];return t?(0,K.jsx)(KS,{shot:{src:Kl(e.review.id,e.latest.number,t.recording,0)}},e.review.id):null}function kw(e){let t=new Date(e);return t.toDateString()===new Date().toDateString()?tf(e):t.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`})}var Aw=1,jw=.8,Mw=1.8;function Nw({id:e,filmed:t}){let n=Fl(e);if(!n||Array.isArray(n))return null;let r=n.rounds.find(e=>e.number===t.round),i=r?.flows.find(e=>e.name===t.flow),a=n.rounds.find(e=>e.number===t.beside);return r&&i?(0,K.jsx)(Pw,{review:n,round:r,flow:i,beside:a,larger:t.larger}):null}function Pw({review:e,round:t,flow:n,beside:r,larger:i}){let a=YS(e,r?[r,t]:[t]),[o]=(0,l.useState)(()=>new td([n],{flow:n.name,at:Yu})),[s,c]=(0,l.useState)(),u=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=e=>new Promise(t=>setTimeout(t,e*1e3));window.video={length:Aw-Yu+n.length+jw+Mw,play:async()=>{await e(Aw),o.play(),await new Promise(e=>{let t=o.subscribe(()=>!o.now.playing&&(t(),e()))}),await e(jw);for(let e of document.querySelectorAll(`[data-frame]:not([hidden])`)){let{left:n,top:r,width:i,height:a}=e.style,o=document.createElement(`div`);o.className=`absolute rounded-lg bg-[rgba(247,247,245,.45)] opacity-0 backdrop-blur-[6px] transition-opacity ease-calm`,Object.assign(o.style,{left:n,top:r,width:i,height:a,transitionDuration:`500ms`}),u.current.prepend(o),o.offsetWidth,o.style.opacity=`1`,e.dataset.frame===String(t.number)&&c({left:n,top:r,width:i,height:a})}await e(Mw)}}},[o]),(0,K.jsxs)(`div`,{className:`relative grid origin-top-left grid-rows-[minmax(0,1fr)] bg-ground p-8`,style:{width:`${100/i}vw`,height:`${100/i}vh`,transform:`scale(${i})`},children:[(0,K.jsx)(_C,{review:e,playhead:o,round:t,earlier:r,peeking:!1,zoomed:!1,onShown:()=>{},onBareOff:()=>{},marks:new Map,writing:!1,onMark:()=>{},read:a,onGone:()=>{}}),(0,K.jsx)(`div`,{ref:u,className:`pointer-events-none absolute inset-8 z-30`,children:(0,K.jsx)(`div`,{className:`absolute grid place-items-center transition-opacity ease-calm ${s?`opacity-100`:`opacity-0`}`,style:{...s,transitionDuration:`500ms`,transitionDelay:`150ms`},children:(0,K.jsxs)(`span`,{className:`grid justify-items-center gap-3 ${OC}`,children:[(0,K.jsx)(Fw,{}),(0,K.jsx)(`span`,{className:`font-ui text-[17px] font-medium tracking-[-0.01em] text-[#222222]`,children:`playthrough.sh`})]})})})]})}function Fw(){return(0,K.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:`size-11`,"aria-label":`Playthrough`,children:[(0,K.jsxs)(`mask`,{id:`around-the-note`,children:[(0,K.jsx)(`rect`,{width:`32`,height:`32`,fill:`#fff`}),(0,K.jsx)(`circle`,{cx:`16`,cy:`16`,r:`7`,fill:`#000`})]}),(0,K.jsxs)(`g`,{mask:`url(#around-the-note)`,fill:`#2b2e35`,children:[(0,K.jsx)(`rect`,{x:`2`,y:`6`,width:`12`,height:`20`,rx:`3`,opacity:`0.35`}),(0,K.jsx)(`rect`,{x:`18`,y:`6`,width:`12`,height:`20`,rx:`3`})]}),(0,K.jsx)(`circle`,{cx:`16`,cy:`16`,r:`5`,fill:`#d9a23a`})]})}var[Iw,Lw]=location.pathname.slice(1).split(`/`).map(decodeURIComponent),Rw=new URLSearchParams(location.search).get(`video`);(0,u.createRoot)(document.getElementById(`root`)).render(Iw&&Rw?(0,K.jsx)(Nw,{id:Iw,filmed:JSON.parse(Rw)}):Iw?(0,K.jsx)(uw,{id:Iw,flow:Lw}):(0,K.jsx)(Tw,{}));
|