@botuyo/chat-widget-standalone 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botuyo-chat.es.js +34 -34
- package/dist/botuyo-chat.es.js.map +1 -1
- package/dist/botuyo-chat.umd.js +1 -1
- package/dist/botuyo-chat.umd.js.map +1 -1
- package/dist/{chunk-audio-Cx_99pbh.js → chunk-audio-eOKrpaWh.js} +2 -2
- package/dist/{chunk-audio-Cx_99pbh.js.map → chunk-audio-eOKrpaWh.js.map} +1 -1
- package/dist/{chunk-chat-ui-DRDmUvk-.js → chunk-chat-ui-DlJ_-YHV.js} +47 -47
- package/dist/chunk-chat-ui-DlJ_-YHV.js.map +1 -0
- package/dist/{chunk-gallery-CJ48rYJy.js → chunk-gallery-Cw1c-yo-.js} +2 -2
- package/dist/{chunk-gallery-CJ48rYJy.js.map → chunk-gallery-Cw1c-yo-.js.map} +1 -1
- package/dist/stats-umd.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +6 -6
- package/dist/chunk-chat-ui-DRDmUvk-.js.map +0 -1
package/dist/botuyo-chat.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BotUyoChat={})}(this,function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r,o={exports:{}},i={},a={exports:{}},s={};function l(){return r||(r=1,a.exports=(n||(n=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>o(l,n))c<i&&0>o(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(l,o)}o=n(c)}}function k(e){if(m=!1,w(e),!h)if(null!==n(l))h=!0,S||(S=!0,x());else{var t=n(c);null!==t&&O(k,t.startTime-e)}}var x,S=!1,_=-1,E=5,C=-1;function z(){return!(!g&&e.unstable_now()-C<E)}function A(){if(g=!1,S){var t=e.unstable_now();C=t;var o=!0;try{e:{h=!1,m&&(m=!1,b(_),_=-1),p=!0;var i=f;try{t:{for(w(t),d=n(l);null!==d&&!(d.expirationTime>t&&z());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,w(t),o=!0;break t}d===n(l)&&r(l),w(t)}else r(l);d=n(l)}if(null!==d)o=!0;else{var u=n(c);null!==u&&O(k,u.startTime-t),o=!1}}break e}finally{d=null,f=i,p=!1}o=void 0}}finally{o?x():S=!1}}}if("function"==typeof v)x=function(){v(A)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,T=N.port2;N.port1.onmessage=A,x=function(){T.postMessage(null)}}else x=function(){y(A,0)};function O(t,n){_=y(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"):E=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,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,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 r={id:u++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(c,r),null===n(l)&&r===n(c)&&(m?(b(_),_=-1):m=!0,O(k,i-a))):(r.sortIndex=s,t(l,r),h||p||(h=!0,S||(S=!0,x()))),r},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(s)),s)),a.exports}var c,u,d={exports:{}},f={};function p(){if(c)return f;c=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function b(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||m}function v(){}function w(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||m}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)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")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=b.prototype;var k=w.prototype=new v;k.constructor=w,g(k,b.prototype),k.isPureReactComponent=!0;var x=Array.isArray;function S(){}var _={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function C(t,n,r){var o=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==o?o:null,props:r}}function z(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var A=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function T(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,u=!1;if(null===n)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case e:case t:u=!0;break;case d:return T((u=n._init)(n._payload),r,o,i,a)}}if(u)return a=a(n),u=""===i?"."+N(n,0):i,x(a)?(o="",null!=u&&(o=u.replace(A,"$&/")+"/"),T(a,r,o,"",function(e){return e})):null!=a&&(z(a)&&(l=a,c=o+(null==a.key||n&&n.key===a.key?"":(""+a.key).replace(A,"$&/")+"/")+u,a=C(l.type,c,l.props)),r.push(a)),1;u=0;var f,p=""===i?".":i+":";if(x(n))for(var m=0;m<n.length;m++)u+=T(i=n[m],r,o,s=p+N(i,m),a);else if("function"==typeof(m=null===(f=n)||"object"!=typeof f?null:"function"==typeof(f=h&&f[h]||f["@@iterator"])?f:null))for(n=m.call(n),m=0;!(i=n.next()).done;)u+=T(i=i.value,r,o,s=p+N(i,m++),a);else if("object"===s){if("function"==typeof n.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(S,S):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,o,i,a);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return u}function O(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function P(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var j="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},M={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!z(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return f.Activity=p,f.Children=M,f.Component=b,f.Fragment=n,f.Profiler=o,f.PureComponent=w,f.StrictMode=r,f.Suspense=l,f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,f.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _.H.useMemoCache(e)}},f.cache=function(e){return function(){return e.apply(null,arguments)}},f.cacheSignal=function(){return null},f.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=g({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!E.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];r.children=a}return C(e.type,o,r)},f.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},f.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)E.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];o.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return C(e,i,o)},f.createRef=function(){return{current:null}},f.forwardRef=function(e){return{$$typeof:s,render:e}},f.isValidElement=z,f.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},f.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},f.startTransition=function(e){var t=_.T,n={};_.T=n;try{var r=e(),o=_.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(S,j)}catch(i){j(i)}finally{null!==t&&null!==n.types&&(t.types=n.types),_.T=t}},f.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},f.use=function(e){return _.H.use(e)},f.useActionState=function(e,t,n){return _.H.useActionState(e,t,n)},f.useCallback=function(e,t){return _.H.useCallback(e,t)},f.useContext=function(e){return _.H.useContext(e)},f.useDebugValue=function(){},f.useDeferredValue=function(e,t){return _.H.useDeferredValue(e,t)},f.useEffect=function(e,t){return _.H.useEffect(e,t)},f.useEffectEvent=function(e){return _.H.useEffectEvent(e)},f.useId=function(){return _.H.useId()},f.useImperativeHandle=function(e,t,n){return _.H.useImperativeHandle(e,t,n)},f.useInsertionEffect=function(e,t){return _.H.useInsertionEffect(e,t)},f.useLayoutEffect=function(e,t){return _.H.useLayoutEffect(e,t)},f.useMemo=function(e,t){return _.H.useMemo(e,t)},f.useOptimistic=function(e,t){return _.H.useOptimistic(e,t)},f.useReducer=function(e,t,n){return _.H.useReducer(e,t,n)},f.useRef=function(e){return _.H.useRef(e)},f.useState=function(e){return _.H.useState(e)},f.useSyncExternalStore=function(e,t,n){return _.H.useSyncExternalStore(e,t,n)},f.useTransition=function(){return _.H.useTransition()},f.version="19.2.3",f}function h(){return u||(u=1,d.exports=p()),d.exports}var m,g,y,b,v={exports:{}},w={};function k(){if(m)return w;m=1;var e=h();function t(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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return w.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,w.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},w.flushSync=function(e){var t=i.T,n=r.p;try{if(i.T=null,r.p=2,e)return e()}finally{i.T=t,r.p=n,r.d.f()}},w.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},w.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},w.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:s}):"script"===n&&r.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},w.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},w.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},w.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},w.requestFormReset=function(e){r.d.r(e)},w.unstable_batchedUpdates=function(e,t){return e(t)},w.useFormState=function(e,t,n){return i.H.useFormState(e,t,n)},w.useFormStatus=function(){return i.H.useHostTransitionStatus()},w.version="19.2.3",w}function x(){if(g)return v.exports;return g=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),v.exports=k(),v.exports}function S(){if(y)return i;y=1;var e=l(),t=h(),n=x();function r(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 o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function s(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function c(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function u(e){if(a(e)!==e)throw Error(r(188))}function d(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=d(e)))return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),O=Symbol.iterator;function P(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var j=Symbol.for("react.client.reference");function M(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===j?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case b:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case E:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case g:return"Portal";case S:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case z:return null!==(t=e.displayName||null)?t:M(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return M(e(t))}catch(n){}}return null}var I=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},R=[],U=-1;function B(e){return{current:e}}function $(e){0>U||(e.current=R[U],R[U]=null,U--)}function H(e,t){U++,R[U]=e.current,e.current=t}var V,q,W=B(null),Z=B(null),Q=B(null),K=B(null);function G(e,t){switch(H(Q,t),H(Z,e),H(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=wd(t=vd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(W),H(W,e)}function Y(){$(W),$(Z),$(Q)}function J(e){null!==e.memoizedState&&H(K,e);var t=W.current,n=wd(t,e.type);t!==n&&(H(Z,e),H(W,n))}function X(e){Z.current===e&&($(W),$(Z)),K.current===e&&($(K),pf._currentValue=D)}function ee(e){if(void 0===V)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);V=t&&t[1]||"",q=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+V+e+q}var te=!1;function ne(e,t){if(!e||te)return"";te=!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()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(o){var r=o}Reflect.construct(e,[],n)}else{try{n.call()}catch(i){r=i}e.call(n.prototype)}}else{try{throw Error()}catch(a){r=a}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),a=i[0],s=i[1];if(a&&s){var l=a.split("\n"),c=s.split("\n");for(o=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;o<c.length&&!c[o].includes("DetermineComponentFrameRoot");)o++;if(r===l.length||o===c.length)for(r=l.length-1,o=c.length-1;1<=r&&0<=o&&l[r]!==c[o];)o--;for(;1<=r&&0<=o;r--,o--)if(l[r]!==c[o]){if(1!==r||1!==o)do{if(r--,0>--o||l[r]!==c[o]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=o);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function re(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&null!==t?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return ne(e.type,!1);case 11:return ne(e.type.render,!1);case 1:return ne(e.type,!0);case 31:return ee("Activity");default:return""}}function oe(e){try{var t="",n=null;do{t+=re(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var ie=Object.prototype.hasOwnProperty,ae=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,le=e.unstable_shouldYield,ce=e.unstable_requestPaint,ue=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,me=e.unstable_LowPriority,ge=e.unstable_IdlePriority,ye=e.log,be=e.unstable_setDisableYieldValue,ve=null,we=null;function ke(e){if("function"==typeof ye&&be(e),we&&"function"==typeof we.setStrictMode)try{we.setStrictMode(ve,e)}catch(t){}}var xe=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(Se(e)/_e|0)|0},Se=Math.log,_e=Math.LN2;var Ee=256,Ce=262144,ze=4194304;function Ae(e){var t=42&e;if(0!==t)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 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ne(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var o=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~i)?o=Ae(r):0!==(a&=s)?o=Ae(a):n||0!==(n=s&~e)&&(o=Ae(n)):0!==(s=r&~i)?o=Ae(s):0!==a?o=Ae(a):n||0!==(n=r&~e)&&(o=Ae(n)),0===o?0:0!==t&&t!==o&&0===(t&i)&&((i=o&-o)>=(n=t&-t)||32===i&&4194048&n)?t:o}function Te(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Oe(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;default:return-1}}function Pe(){var e=ze;return!(62914560&(ze<<=1))&&(ze=4194304),e}function je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Me(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ie(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-xe(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Fe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xe(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function Le(e,t){var n=t&-t;return 0!==((n=42&n?1:De(n))&(e.suspendedLanes|t))?0:n}function De(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 Re(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Ue(){var e=L.p;return 0!==e?e:void 0===(e=window.event)?32:Nf(e.type)}function Be(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var $e=Math.random().toString(36).slice(2),He="__reactFiber$"+$e,Ve="__reactProps$"+$e,qe="__reactContainer$"+$e,We="__reactEvents$"+$e,Ze="__reactListeners$"+$e,Qe="__reactHandles$"+$e,Ke="__reactResources$"+$e,Ge="__reactMarker$"+$e;function Ye(e){delete e[He],delete e[Ve],delete e[We],delete e[Ze],delete e[Qe]}function Je(e){var t=e[He];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qe]||n[He]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Dd(e);null!==e;){if(n=e[He])return n;e=Dd(e)}return t}n=(e=n).parentNode}return null}function Xe(e){if(e=e[He]||e[qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function et(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function tt(e){var t=e[Ke];return t||(t=e[Ke]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Ge]=!0}var rt=new Set,ot={};function it(e,t){at(e,t),at(e+"Capture",t)}function at(e,t){for(ot[e]=t,e=0;e<t.length;e++)rt.add(t[e])}var st=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]*$"),lt={},ct={};function ut(e,t,n){if(o=t,ie.call(ct,o)||!ie.call(lt,o)&&(st.test(o)?ct[o]=!0:(lt[o]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var o}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function ft(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function mt(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,i.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]}}}}(e,t,""+e[t])}}function gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ht(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function yt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(ky){return e.body}}var bt=/[\n"\\]/g;function vt(e){return e.replace(bt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wt(e,t,n,r,o,i,a,s){e.name="",null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?xt(e,a,pt(t)):null!=n?xt(e,a,pt(n)):null!=r&&e.removeAttribute("value"),null==o&&null!=i&&(e.defaultChecked=!!i),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+pt(s):e.removeAttribute("name")}function kt(e,t,n,r,o,i,a,s){if(null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.type=i),null!=t||null!=n){if(("submit"===i||"reset"===i)&&null==t)return void mt(e);n=null!=n?""+pt(n):"",t=null!=t?""+pt(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:o)&&"symbol"!=typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.name=a),mt(e)}function xt(e,t,n){"number"===t&&yt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function St(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function _t(e,t,n){null==t||((t=""+pt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+pt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Et(e,t,n,o){if(null==t){if(null!=o){if(null!=n)throw Error(r(92));if(I(o)){if(1<o.length)throw Error(r(93));o=o[0]}n=o}null==n&&(n=""),t=n}n=pt(t),e.defaultValue=n,(o=e.textContent)===n&&""!==o&&null!==o&&(e.value=o),mt(e)}function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var zt=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 At(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||zt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Nt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var o in n)!n.hasOwnProperty(o)||null!=t&&t.hasOwnProperty(o)||(0===o.indexOf("--")?e.setProperty(o,""):"float"===o?e.cssFloat="":e[o]="");for(var i in t)o=t[i],t.hasOwnProperty(i)&&n[i]!==o&&At(e,i,o)}else for(var a in t)t.hasOwnProperty(a)&&At(e,a,t[a])}function Tt(e){if(-1===e.indexOf("-"))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 Ot=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Pt=/^[\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 jt(e){return Pt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mt(){}var It=null;function Ft(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Lt=null,Dt=null;function Rt(e){var t=Xe(e);if(t&&(e=t.stateNode)){var n=e[Ve]||null;e:switch(e=t.stateNode,t.type){case"input":if(wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+vt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=o[Ve]||null;if(!i)throw Error(r(90));wt(o,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)(o=n[t]).form===e.form&>(o)}break e;case"textarea":_t(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&St(e,!!n.multiple,t,!1)}}}var Ut=!1;function Bt(e,t,n){if(Ut)return e(t,n);Ut=!0;try{return e(t)}finally{if(Ut=!1,(null!==Lt||null!==Dt)&&(tu(),Lt&&(t=Lt,e=Dt,Dt=Lt=null,Rt(t),e)))for(t=0;t<e.length;t++)Rt(e[t])}}function $t(e,t){var n=e.stateNode;if(null===n)return null;var o=n[Ve]||null;if(null===o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var Ht=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Vt=!1;if(Ht)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Vt=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch(ky){Vt=!1}var Wt=null,Zt=null,Qt=null;function Kt(){if(Qt)return Qt;var e,t,n=Zt,r=n.length,o="value"in Wt?Wt.value:Wt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Qt=o.slice(e,1<t?1-t:void 0)}function Gt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Yt(){return!0}function Jt(){return!1}function Xt(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?Yt:Jt,this.isPropagationStopped=Jt,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Yt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Yt)},persist:function(){},isPersistent:Yt}),t}var en,tn,nn,rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},on=Xt(rn),an=f({},rn,{view:0,detail:0}),sn=Xt(an),ln=f({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&"mousemove"===e.type?(en=e.screenX-nn.screenX,tn=e.screenY-nn.screenY):tn=en=0,nn=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),cn=Xt(ln),un=Xt(f({},ln,{dataTransfer:0})),dn=Xt(f({},an,{relatedTarget:0})),fn=Xt(f({},rn,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=Xt(f({},rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),hn=Xt(f({},rn,{data:0})),mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gn={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"},yn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=yn[e])&&!!t[e]}function vn(){return bn}var wn=Xt(f({},an,{key:function(e){if(e.key){var t=mn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Gt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vn,charCode:function(e){return"keypress"===e.type?Gt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Gt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kn=Xt(f({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xn=Xt(f({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vn})),Sn=Xt(f({},rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),_n=Xt(f({},ln,{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})),En=Xt(f({},rn,{newState:0,oldState:0})),Cn=[9,13,27,32],zn=Ht&&"CompositionEvent"in window,An=null;Ht&&"documentMode"in document&&(An=document.documentMode);var Nn=Ht&&"TextEvent"in window&&!An,Tn=Ht&&(!zn||An&&8<An&&11>=An),On=String.fromCharCode(32),Pn=!1;function jn(e,t){switch(e){case"keyup":return-1!==Cn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var In=!1;var Fn={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 Ln(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Fn[e.type]:"textarea"===t}function Dn(e,t,n,r){Lt?Dt?Dt.push(r):Dt=[r]:Lt=r,0<(t=id(t,"onChange")).length&&(n=new on("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Rn=null,Un=null;function Bn(e){Yu(e,0)}function $n(e){if(gt(et(e)))return e}function Hn(e,t){if("change"===e)return t}var Vn=!1;if(Ht){var qn;if(Ht){var Wn="oninput"in document;if(!Wn){var Zn=document.createElement("div");Zn.setAttribute("oninput","return;"),Wn="function"==typeof Zn.oninput}qn=Wn}else qn=!1;Vn=qn&&(!document.documentMode||9<document.documentMode)}function Qn(){Rn&&(Rn.detachEvent("onpropertychange",Kn),Un=Rn=null)}function Kn(e){if("value"===e.propertyName&&$n(Un)){var t=[];Dn(t,Un,e,Ft(e)),Bt(Bn,t)}}function Gn(e,t,n){"focusin"===e?(Qn(),Un=n,(Rn=t).attachEvent("onpropertychange",Kn)):"focusout"===e&&Qn()}function Yn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return $n(Un)}function Jn(e,t){if("click"===e)return $n(t)}function Xn(e,t){if("input"===e||"change"===e)return $n(t)}var er="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function tr(e,t){if(er(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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 o=n[r];if(!ie.call(t,o)||!er(e[o],t[o]))return!1}return!0}function nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rr(e,t){var n,r=nr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nr(r)}}function or(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?or(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ir(e){for(var t=yt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=yt((e=t.contentWindow).document)}return t}function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sr=Ht&&"documentMode"in document&&11>=document.documentMode,lr=null,cr=null,ur=null,dr=!1;function fr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;dr||null==lr||lr!==yt(r)||("selectionStart"in(r=lr)&&ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ur&&tr(ur,r)||(ur=r,0<(r=id(cr,"onSelect")).length&&(t=new on("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=lr)))}function pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:pr("Animation","AnimationEnd"),animationiteration:pr("Animation","AnimationIteration"),animationstart:pr("Animation","AnimationStart"),transitionrun:pr("Transition","TransitionRun"),transitionstart:pr("Transition","TransitionStart"),transitioncancel:pr("Transition","TransitionCancel"),transitionend:pr("Transition","TransitionEnd")},mr={},gr={};function yr(e){if(mr[e])return mr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in gr)return mr[e]=n[t];return e}Ht&&(gr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var br=yr("animationend"),vr=yr("animationiteration"),wr=yr("animationstart"),kr=yr("transitionrun"),xr=yr("transitionstart"),Sr=yr("transitioncancel"),_r=yr("transitionend"),Er=new Map,Cr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function zr(e,t){Er.set(e,t),it(t,[e])}Cr.push("scrollEnd");var Ar="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Nr=[],Tr=0,Or=0;function Pr(){for(var e=Tr,t=Or=Tr=0;t<e;){var n=Nr[t];Nr[t++]=null;var r=Nr[t];Nr[t++]=null;var o=Nr[t];Nr[t++]=null;var i=Nr[t];if(Nr[t++]=null,null!==r&&null!==o){var a=r.pending;null===a?o.next=o:(o.next=a.next,a.next=o),r.pending=o}0!==i&&Fr(n,o,i)}}function jr(e,t,n,r){Nr[Tr++]=e,Nr[Tr++]=t,Nr[Tr++]=n,Nr[Tr++]=r,Or|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Mr(e,t,n,r){return jr(e,t,n,r),Lr(e)}function Ir(e,t){return jr(e,null,null,t),Lr(e)}function Fr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var o=!1,i=e.return;null!==i;)i.childLanes|=n,null!==(r=i.alternate)&&(r.childLanes|=n),22===i.tag&&(null===(e=i.stateNode)||1&e._visibility||(o=!0)),e=i,i=i.return;return 3===e.tag?(i=e.stateNode,o&&null!==t&&(o=31-xe(n),null===(r=(e=i.hiddenUpdates)[o])?e[o]=[t]:r.push(t),t.lane=536870912|n),i):null}function Lr(e){if(50<Wc)throw Wc=0,Zc=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Dr={};function Rr(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 Ur(e,t,n,r){return new Rr(e,t,n,r)}function Br(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return null===n?((n=Ur(e.tag,t,e.key,e.mode)).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=65011712&e.flags,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=null===t?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 Hr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vr(e,t,n,o,i,a){var s=0;if(o=e,"function"==typeof e)Br(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,W.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case N:return(e=Ur(31,n,t,i)).elementType=N,e.lanes=a,e;case b:return qr(n.children,i,a,t);case v:s=8,i|=24;break;case w:return(e=Ur(12,n,t,2|i)).elementType=w,e.lanes=a,e;case E:return(e=Ur(13,n,t,i)).elementType=E,e.lanes=a,e;case C:return(e=Ur(19,n,t,i)).elementType=C,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case S:s=10;break e;case k:s=9;break e;case _:s=11;break e;case z:s=14;break e;case A:s=16,o=null;break e}s=29,n=Error(r(130,null===e?"null":typeof e,"")),o=null}return(t=Ur(s,n,t,i)).elementType=e,t.type=o,t.lanes=a,t}function qr(e,t,n,r){return(e=Ur(7,e,r,t)).lanes=n,e}function Wr(e,t,n){return(e=Ur(6,e,null,t)).lanes=n,e}function Zr(e){var t=Ur(18,null,null,0);return t.stateNode=e,t}function Qr(e,t,n){return(t=Ur(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kr=new WeakMap;function Gr(e,t){if("object"==typeof e&&null!==e){var n=Kr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:oe(t)},Kr.set(e,t),t)}return{value:e,source:t,stack:oe(t)}}var Yr=[],Jr=0,Xr=null,eo=0,to=[],no=0,ro=null,oo=1,io="";function ao(e,t){Yr[Jr++]=eo,Yr[Jr++]=Xr,Xr=e,eo=t}function so(e,t,n){to[no++]=oo,to[no++]=io,to[no++]=ro,ro=e;var r=oo;e=io;var o=32-xe(r)-1;r&=~(1<<o),n+=1;var i=32-xe(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,oo=1<<32-xe(t)+o|n<<o|r,io=i+e}else oo=1<<i|n<<o|r,io=e}function lo(e){null!==e.return&&(ao(e,1),so(e,1,0))}function co(e){for(;e===Xr;)Xr=Yr[--Jr],Yr[Jr]=null,eo=Yr[--Jr],Yr[Jr]=null;for(;e===ro;)ro=to[--no],to[no]=null,io=to[--no],to[no]=null,oo=to[--no],to[no]=null}function uo(e,t){to[no++]=oo,to[no++]=io,to[no++]=ro,oo=t.id,io=t.overflow,ro=e}var fo=null,po=null,ho=!1,mo=null,go=!1,yo=Error(r(519));function bo(e){throw _o(Gr(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),yo}function vo(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[He]=e,t[Ve]=r,n){case"dialog":Ju("cancel",t),Ju("close",t);break;case"iframe":case"object":case"embed":Ju("load",t);break;case"video":case"audio":for(n=0;n<Ku.length;n++)Ju(Ku[n],t);break;case"source":Ju("error",t);break;case"img":case"image":case"link":Ju("error",t),Ju("load",t);break;case"details":Ju("toggle",t);break;case"input":Ju("invalid",t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ju("invalid",t);break;case"textarea":Ju("invalid",t),Et(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||dd(t.textContent,n)?(null!=r.popover&&(Ju("beforetoggle",t),Ju("toggle",t)),null!=r.onScroll&&Ju("scroll",t),null!=r.onScrollEnd&&Ju("scrollend",t),null!=r.onClick&&(t.onclick=Mt),t=!0):t=!1,t||bo(e,!0)}function wo(e){for(fo=e.return;fo;)switch(fo.tag){case 5:case 31:case 13:return void(go=!1);case 27:case 3:return void(go=!0);default:fo=fo.return}}function ko(e){if(e!==fo)return!1;if(!ho)return wo(e),ho=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||kd(e.type,e.memoizedProps)),t=!t),t&&po&&bo(e),wo(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));po=Ld(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));po=Ld(e)}else 27===n?(n=po,Ad(e.type)?(e=Fd,Fd=null,po=e):po=n):po=fo?Id(e.stateNode.nextSibling):null;return!0}function xo(){po=fo=null,ho=!1}function So(){var e=mo;return null!==e&&(null===Pc?Pc=e:Pc.push.apply(Pc,e),mo=null),e}function _o(e){null===mo?mo=[e]:mo.push(e)}var Eo=B(null),Co=null,zo=null;function Ao(e,t,n){H(Eo,t._currentValue),t._currentValue=n}function No(e){e._currentValue=Eo.current,$(Eo)}function To(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Oo(e,t,n,o){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var a=i.dependencies;if(null!==a){var s=i.child;a=a.firstContext;e:for(;null!==a;){var l=a;a=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),To(a.return,n,e),o||(s=null);break e}a=l.next}}else if(18===i.tag){if(null===(s=i.return))throw Error(r(341));s.lanes|=n,null!==(a=s.alternate)&&(a.lanes|=n),To(s,n,e),s=null}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===e){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}}function Po(e,t,n,o){e=null;for(var i=t,a=!1;null!==i;){if(!a)if(524288&i.flags)a=!0;else if(262144&i.flags)break;if(10===i.tag){var s=i.alternate;if(null===s)throw Error(r(387));if(null!==(s=s.memoizedProps)){var l=i.type;er(i.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(i===K.current){if(null===(s=i.alternate))throw Error(r(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(pf):e=[pf])}i=i.return}null!==e&&Oo(t,e,n,o),t.flags|=262144}function jo(e){for(e=e.firstContext;null!==e;){if(!er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Mo(e){Co=e,zo=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Io(e){return Lo(Co,e)}function Fo(e,t){return null===Co&&Mo(e),Lo(e,t)}function Lo(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===zo){if(null===e)throw Error(r(308));zo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zo=zo.next=t;return n}var Do="undefined"!=typeof AbortController?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()})}},Ro=e.unstable_scheduleCallback,Uo=e.unstable_NormalPriority,Bo={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $o(){return{controller:new Do,data:new Map,refCount:0}}function Ho(e){e.refCount--,0===e.refCount&&Ro(Uo,function(){e.controller.abort()})}var Vo=null,qo=0,Wo=0,Zo=null;function Qo(){if(0===--qo&&null!==Vo){null!==Zo&&(Zo.status="fulfilled");var e=Vo;Vo=null,Wo=0,Zo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Ko=F.S;F.S=function(e,t){Ic=ue(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Vo){var n=Vo=[];qo=0,Wo=Vu(),Zo={status:"pending",value:void 0,then:function(e){n.push(e)}}}qo++,t.then(Qo,Qo)}(0,t),null!==Ko&&Ko(e,t)};var Go=B(null);function Yo(){var e=Go.current;return null!==e?e:gc.pooledCache}function Jo(e,t){H(Go,null===t?Go.current:t.pool)}function Xo(){var e=Yo();return null===e?null:{parent:Bo._currentValue,pool:e}}var ei=Error(r(460)),ti=Error(r(474)),ni=Error(r(542)),ri={then:function(){}};function oi(e){return"fulfilled"===(e=e.status)||"rejected"===e}function ii(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Mt,Mt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ci(e=t.reason),e;default:if("string"==typeof t.status)t.then(Mt,Mt);else{if(null!==(e=gc)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ci(e=t.reason),e}throw si=t,ei}}function ai(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw si=t,ei;throw t}}var si=null;function li(){if(null===si)throw Error(r(459));var e=si;return si=null,e}function ci(e){if(e===ei||e===ni)throw Error(r(483))}var ui=null,di=0;function fi(e){var t=di;return di+=1,null===ui&&(ui=[]),ii(ui,e,t)}function pi(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function hi(e,t){if(t.$$typeof===p)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=$r(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Wr(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){var o=n.type;return o===b?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===A&&ai(o)===t.type)?(pi(t=i(t,n.props),n),t.return=e,t):(pi(t=Vr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qr(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=qr(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Wr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case m:return pi(n=Vr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case g:return(t=Qr(t,e.mode,n)).return=e,t;case A:return f(e,t=ai(t),n)}if(I(t)||P(t))return(t=qr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return f(e,fi(t),n);if(t.$$typeof===S)return f(e,Fo(e,t),n);hi(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case m:return n.key===o?c(e,t,n,r):null;case g:return n.key===o?u(e,t,n,r):null;case A:return p(e,t,n=ai(n),r)}if(I(n)||P(n))return null!==o?null:d(e,t,n,r,null);if("function"==typeof n.then)return p(e,t,fi(n),r);if(n.$$typeof===S)return p(e,t,Fo(e,n),r);hi(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case m:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case g:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case A:return h(e,t,n,r=ai(r),o)}if(I(r)||P(r))return d(t,e=e.get(n)||null,r,o,null);if("function"==typeof r.then)return h(e,t,n,fi(r),o);if(r.$$typeof===S)return h(e,t,n,Fo(t,r),o);hi(t,r)}return null}function y(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===b&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case m:e:{for(var v=u.key;null!==c;){if(c.key===v){if((v=u.type)===b){if(7===c.tag){n(l,c.sibling),(d=i(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===v||"object"==typeof v&&null!==v&&v.$$typeof===A&&ai(v)===c.type){n(l,c.sibling),pi(d=i(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===b?((d=qr(u.props.children,l.mode,d,u.key)).return=l,l=d):(pi(d=Vr(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case g:e:{for(v=u.key;null!==c;){if(c.key===v){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=i(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Qr(u,l.mode,d)).return=l,l=d}return s(l);case A:return y(l,c,u=ai(u),d)}if(I(u))return function(r,i,s,l){for(var c=null,u=null,d=i,m=i=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=p(r,d,s[m],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(r,d),i=a(y,i,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===s.length)return n(r,d),ho&&ao(r,m),c;if(null===d){for(;m<s.length;m++)null!==(d=f(r,s[m],l))&&(i=a(d,i,m),null===u?c=d:u.sibling=d,u=d);return ho&&ao(r,m),c}for(d=o(d);m<s.length;m++)null!==(g=h(d,r,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),i=a(g,i,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),ho&&ao(r,m),c}(l,c,u,d);if(P(u)){if("function"!=typeof(v=P(u)))throw Error(r(150));return function(i,s,l,c){if(null==l)throw Error(r(151));for(var u=null,d=null,m=s,g=s=0,y=null,b=l.next();null!==m&&!b.done;g++,b=l.next()){m.index>g?(y=m,m=null):y=m.sibling;var v=p(i,m,b.value,c);if(null===v){null===m&&(m=y);break}e&&m&&null===v.alternate&&t(i,m),s=a(v,s,g),null===d?u=v:d.sibling=v,d=v,m=y}if(b.done)return n(i,m),ho&&ao(i,g),u;if(null===m){for(;!b.done;g++,b=l.next())null!==(b=f(i,b.value,c))&&(s=a(b,s,g),null===d?u=b:d.sibling=b,d=b);return ho&&ao(i,g),u}for(m=o(m);!b.done;g++,b=l.next())null!==(b=h(m,i,g,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),s=a(b,s,g),null===d?u=b:d.sibling=b,d=b);return e&&m.forEach(function(e){return t(i,e)}),ho&&ao(i,g),u}(l,c,u=v.call(u),d)}if("function"==typeof u.then)return y(l,c,fi(u),d);if(u.$$typeof===S)return y(l,c,Fo(l,u),d);hi(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=i(c,u)).return=l,l=d):(n(l,c),(d=Wr(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,r){try{di=0;var o=y(e,t,n,r);return ui=null,o}catch(a){if(a===ei||a===ni)throw a;var i=Ur(29,a,null,e.mode);return i.lanes=r,i.return=e,i}}}var gi=mi(!0),yi=mi(!1),bi=!1;function vi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wi(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 ki(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xi(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&mc){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=Lr(e),Fr(e,null,n),t}return jr(e,r,t,n),Lr(e)}function Si(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Fe(e,n)}}function _i(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ei=!1;function Ci(){if(Ei){if(null!==Zo)throw Zo}}function zi(e,t,n,r){Ei=!1;var o=e.updateQueue;bi=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?i=c:a.next=c,a=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==i){var d=o.baseState;for(a=0,u=c=l=null,s=i;;){var p=-536870913&s.lane,h=p!==s.lane;if(h?(bc&p)===p:(r&p)===p){0!==p&&p===Wo&&(Ei=!0),null!==u&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;p=t;var y=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){d=m.call(y,d,p);break e}d=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(y,d,p):m))break e;d=f({},d,p);break e;case 2:bi=!0}}null!==(p=s.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=o.callbacks)?o.callbacks=[p]:h.push(p))}else h={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,a|=p;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(h=s).next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}null===u&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null===i&&(o.shared.lanes=0),Cc|=a,e.lanes=a,e.memoizedState=d}}function Ai(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function Ni(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Ai(n[e],t)}var Ti=B(null),Oi=B(0);function Pi(e,t){H(Oi,e=_c),H(Ti,t),_c=e|t.baseLanes}function ji(){H(Oi,_c),H(Ti,Ti.current)}function Mi(){_c=Oi.current,$(Ti),$(Oi)}var Ii=B(null),Fi=null;function Li(e){var t=e.alternate;H($i,1&$i.current),H(Ii,e),null===Fi&&(null===t||null!==Ti.current||null!==t.memoizedState)&&(Fi=e)}function Di(e){H($i,$i.current),H(Ii,e),null===Fi&&(Fi=e)}function Ri(e){22===e.tag?(H($i,$i.current),H(Ii,e),null===Fi&&(Fi=e)):Ui()}function Ui(){H($i,$i.current),H(Ii,Ii.current)}function Bi(e){$(Ii),Fi===e&&(Fi=null),$($i)}var $i=B(0);function Hi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||jd(n)||Md(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vi=0,qi=null,Wi=null,Zi=null,Qi=!1,Ki=!1,Gi=!1,Yi=0,Ji=0,Xi=null,ea=0;function ta(){throw Error(r(321))}function na(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!er(e[n],t[n]))return!1;return!0}function ra(e,t,n,r,o,i){return Vi=i,qi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=null===e||null===e.memoizedState?bs:vs,Gi=!1,i=n(r,o),Gi=!1,Ki&&(i=ia(t,n,r,o)),oa(e),i}function oa(e){F.H=ys;var t=null!==Wi&&null!==Wi.next;if(Vi=0,Zi=Wi=qi=null,Qi=!1,Ji=0,Xi=null,t)throw Error(r(300));null===e||Is||null!==(e=e.dependencies)&&jo(e)&&(Is=!0)}function ia(e,t,n,o){qi=e;var i=0;do{if(Ki&&(Xi=null),Ji=0,Ki=!1,25<=i)throw Error(r(301));if(i+=1,Zi=Wi=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}F.H=ws,a=t(n,o)}while(Ki);return a}function aa(){var e=F.H,t=e.useState()[0];return t="function"==typeof t.then?fa(t):t,e=e.useState()[0],(null!==Wi?Wi.memoizedState:null)!==e&&(qi.flags|=1024),t}function sa(){var e=0!==Yi;return Yi=0,e}function la(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ca(e){if(Qi){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Qi=!1}Vi=0,Zi=Wi=qi=null,Ki=!1,Ji=Yi=0,Xi=null}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Zi?qi.memoizedState=Zi=e:Zi=Zi.next=e,Zi}function da(){if(null===Wi){var e=qi.alternate;e=null!==e?e.memoizedState:null}else e=Wi.next;var t=null===Zi?qi.memoizedState:Zi.next;if(null!==t)Zi=t,Wi=e;else{if(null===e){if(null===qi.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Wi=e).memoizedState,baseState:Wi.baseState,baseQueue:Wi.baseQueue,queue:Wi.queue,next:null},null===Zi?qi.memoizedState=Zi=e:Zi=Zi.next=e}return Zi}function fa(e){var t=Ji;return Ji+=1,null===Xi&&(Xi=[]),e=ii(Xi,e,t),t=qi,null===(null===Zi?t.memoizedState:Zi.next)&&(t=t.alternate,F.H=null===t||null===t.memoizedState?bs:vs),e}function pa(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return fa(e);if(e.$$typeof===S)return Io(e)}throw Error(r(438,String(e)))}function ha(e){var t=null,n=qi.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=qi.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},qi.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=T;return t.index++,n}function ma(e,t){return"function"==typeof t?t(e):t}function ga(e){return ya(da(),Wi,e)}function ya(e,t,n){var o=e.queue;if(null===o)throw Error(r(311));o.lastRenderedReducer=n;var i=e.baseQueue,a=o.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,o.pending=null}if(a=e.baseState,null===i)e.memoizedState=a;else{var l=s=null,c=null,u=t=i.next,d=!1;do{var f=-536870913&u.lane;if(f!==u.lane?(bc&f)===f:(Vi&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Wo&&(d=!0);else{if((Vi&p)===p){u=u.next,p===Wo&&(d=!0);continue}f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=a):c=c.next=f,qi.lanes|=p,Cc|=p}f=u.action,Gi&&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},null===c?(l=c=p,s=a):c=c.next=p,qi.lanes|=f,Cc|=f;u=u.next}while(null!==u&&u!==t);if(null===c?s=a:c.next=l,!er(a,e.memoizedState)&&(Is=!0,d&&null!==(n=Zo)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=c,o.lastRenderedState=a}return null===i&&(o.lanes=0),[e.memoizedState,o.dispatch]}function ba(e){var t=da(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var o=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);er(a,t.memoizedState)||(Is=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,o]}function va(e,t,n){var o=qi,i=da(),a=ho;if(a){if(void 0===n)throw Error(r(407));n=n()}else n=t();var s=!er((Wi||i).memoizedState,n);if(s&&(i.memoizedState=n,Is=!0),i=i.queue,Va(xa.bind(null,o,i,e),[e]),i.getSnapshot!==t||s||null!==Zi&&1&Zi.memoizedState.tag){if(o.flags|=2048,Ra(9,{destroy:void 0},ka.bind(null,o,i,n,t),null),null===gc)throw Error(r(349));a||127&Vi||wa(o,t,n)}return n}function wa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=qi.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},qi.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function ka(e,t,n,r){t.value=n,t.getSnapshot=r,Sa(t)&&_a(e)}function xa(e,t,n){return n(function(){Sa(t)&&_a(e)})}function Sa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!er(e,n)}catch(r){return!0}}function _a(e){var t=Ir(e,2);null!==t&&Gc(t,e,2)}function Ea(e){var t=ua();if("function"==typeof e){var n=e;if(e=n(),Gi){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:e},t}function Ca(e,t,n,r){return e.baseState=n,ya(e,Wi,"function"==typeof r?r:ma)}function za(e,t,n,o,i){if(hs(e))throw Error(r(485));if(null!==(e=t.action)){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==F.T?n(!0):a.isTransition=!1,o(a),null===(n=t.pending)?(a.next=t.pending=a,Aa(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Aa(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var i=F.T,a={};F.T=a;try{var s=n(o,r),l=F.S;null!==l&&l(a,s),Na(e,t,s)}catch(c){Oa(e,t,c)}finally{null!==i&&null!==a.types&&(i.types=a.types),F.T=i}}else try{Na(e,t,i=n(o,r))}catch(u){Oa(e,t,u)}}function Na(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Ta(e,t,n)},function(n){return Oa(e,t,n)}):Ta(e,t,n)}function Ta(e,t,n){t.status="fulfilled",t.value=n,Pa(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Aa(e,n)))}function Oa(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Pa(t),t=t.next}while(t!==r)}e.action=null}function Pa(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ja(e,t){return t}function Ma(e,t){if(ho){var n=gc.formState;if(null!==n){e:{var r=qi;if(ho){if(po){t:{for(var o=po,i=go;8!==o.nodeType;){if(!i){o=null;break t}if(null===(o=Id(o.nextSibling))){o=null;break t}}o="F!"===(i=o.data)||"F"===i?o:null}if(o){po=Id(o.nextSibling),r="F!"===o.data;break e}}bo(r)}r=!1}r&&(t=n[0])}}return(n=ua()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:t},n.queue=r,n=ds.bind(null,qi,r),r.dispatch=n,r=Ea(!1),i=ps.bind(null,qi,!1,r.queue),o={state:t,dispatch:null,action:e,pending:null},(r=ua()).queue=o,n=za.bind(null,qi,o,i,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ia(e){return Fa(da(),Wi,e)}function Fa(e,t,n){if(t=ya(e,t,ja)[0],e=ga(ma)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=fa(t)}catch(a){if(a===ei)throw ni;throw a}else r=t;var o=(t=da()).queue,i=o.dispatch;return n!==t.memoizedState&&(qi.flags|=2048,Ra(9,{destroy:void 0},La.bind(null,o,n),null)),[r,i,e]}function La(e,t){e.action=t}function Da(e){var t=da(),n=Wi;if(null!==n)return Fa(t,n,e);da(),t=t.memoizedState;var r=(n=da()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ra(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=qi.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},qi.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ua(){return da().memoizedState}function Ba(e,t,n,r){var o=ua();qi.flags|=e,o.memoizedState=Ra(1|t,{destroy:void 0},n,void 0===r?null:r)}function $a(e,t,n,r){var o=da();r=void 0===r?null:r;var i=o.memoizedState.inst;null!==Wi&&null!==r&&na(r,Wi.memoizedState.deps)?o.memoizedState=Ra(t,i,n,r):(qi.flags|=e,o.memoizedState=Ra(1|t,i,n,r))}function Ha(e,t){Ba(8390656,8,e,t)}function Va(e,t){$a(2048,8,e,t)}function qa(e){var t=da().memoizedState;return function(e){qi.flags|=4;var t=qi.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},qi.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&mc)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Wa(e,t){return $a(4,2,e,t)}function Za(e,t){return $a(4,4,e,t)}function Qa(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Ka(e,t,n){n=null!=n?n.concat([e]):null,$a(4,4,Qa.bind(null,t,e),n)}function Ga(){}function Ya(e,t){var n=da();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&na(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ja(e,t){var n=da();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&na(t,r[1]))return r[0];if(r=e(),Gi){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function Xa(e,t,n){return void 0===n||1073741824&Vi&&!(261930&bc)?e.memoizedState=t:(e.memoizedState=n,e=Kc(),qi.lanes|=e,Cc|=e,n)}function es(e,t,n,r){return er(n,t)?n:null!==Ti.current?(e=Xa(e,n,r),er(e,t)||(Is=!0),e):42&Vi&&(!(1073741824&Vi)||261930&bc)?(e=Kc(),qi.lanes|=e,Cc|=e,t):(Is=!0,e.memoizedState=n)}function ts(e,t,n,r,o){var i=L.p;L.p=0!==i&&8>i?i:8;var a,s,l,c=F.T,u={};F.T=u,ps(e,!1,t,n);try{var d=o(),f=F.S;if(null!==f&&f(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)fs(e,t,(a=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then(function(){l.status="fulfilled",l.value=a;for(var e=0;e<s.length;e++)(0,s[e])(a)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),Qc());else fs(e,t,r,Qc())}catch(p){fs(e,t,{then:function(){},status:"rejected",reason:p},Qc())}finally{L.p=i,null!==c&&null!==u.types&&(c.types=u.types),F.T=c}}function ns(){}function rs(e,t,n,o){if(5!==e.tag)throw Error(r(476));var i=os(e).queue;ts(e,i,t,D,null===n?ns:function(){return is(e),n(o)})}function os(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:D},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function is(e){var t=os(e);null===t.next&&(t=e.alternate.memoizedState),fs(e,t.next.queue,{},Qc())}function as(){return Io(pf)}function ss(){return da().memoizedState}function ls(){return da().memoizedState}function cs(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Qc(),r=xi(t,e=ki(n),n);return null!==r&&(Gc(r,t,n),Si(r,t,n)),t={cache:$o()},void(e.payload=t)}t=t.return}}function us(e,t,n){var r=Qc();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hs(e)?ms(t,n):null!==(n=Mr(e,t,n,r))&&(Gc(n,e,r),gs(n,t,r))}function ds(e,t,n){fs(e,t,n,Qc())}function fs(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hs(e))ms(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,er(s,a))return jr(e,t,o,0),null===gc&&Pr(),!1}catch(l){}if(null!==(n=Mr(e,t,o,r)))return Gc(n,e,r),gs(n,t,r),!0}return!1}function ps(e,t,n,o){if(o={lane:2,revertLane:Vu(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},hs(e)){if(t)throw Error(r(479))}else null!==(t=Mr(e,n,o,2))&&Gc(t,e,2)}function hs(e){var t=e.alternate;return e===qi||null!==t&&t===qi}function ms(e,t){Ki=Qi=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gs(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Fe(e,n)}}var ys={readContext:Io,use:pa,useCallback:ta,useContext:ta,useEffect:ta,useImperativeHandle:ta,useLayoutEffect:ta,useInsertionEffect:ta,useMemo:ta,useReducer:ta,useRef:ta,useState:ta,useDebugValue:ta,useDeferredValue:ta,useTransition:ta,useSyncExternalStore:ta,useId:ta,useHostTransitionStatus:ta,useFormState:ta,useActionState:ta,useOptimistic:ta,useMemoCache:ta,useCacheRefresh:ta};ys.useEffectEvent=ta;var bs={readContext:Io,use:pa,useCallback:function(e,t){return ua().memoizedState=[e,void 0===t?null:t],e},useContext:Io,useEffect:Ha,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Ba(4194308,4,Qa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ba(4194308,4,e,t)},useInsertionEffect:function(e,t){Ba(4,2,e,t)},useMemo:function(e,t){var n=ua();t=void 0===t?null:t;var r=e();if(Gi){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ua();if(void 0!==n){var o=n(t);if(Gi){ke(!0);try{n(t)}finally{ke(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=us.bind(null,qi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ua().memoizedState=e},useState:function(e){var t=(e=Ea(e)).queue,n=ds.bind(null,qi,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ga,useDeferredValue:function(e,t){return Xa(ua(),e,t)},useTransition:function(){var e=Ea(!1);return e=ts.bind(null,qi,e.queue,!0,!1),ua().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=qi,i=ua();if(ho){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===gc)throw Error(r(349));127&bc||wa(o,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ha(xa.bind(null,o,a,e),[e]),o.flags|=2048,Ra(9,{destroy:void 0},ka.bind(null,o,a,n,t),null),n},useId:function(){var e=ua(),t=gc.identifierPrefix;if(ho){var n=io;t="_"+t+"R_"+(n=(oo&~(1<<32-xe(oo)-1)).toString(32)+n),0<(n=Yi++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=ea++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:as,useFormState:Ma,useActionState:Ma,useOptimistic:function(e){var t=ua();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ps.bind(null,qi,!0,n),n.dispatch=t,[e,t]},useMemoCache:ha,useCacheRefresh:function(){return ua().memoizedState=cs.bind(null,qi)},useEffectEvent:function(e){var t=ua(),n={impl:e};return t.memoizedState=n,function(){if(2&mc)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},vs={readContext:Io,use:pa,useCallback:Ya,useContext:Io,useEffect:Va,useImperativeHandle:Ka,useInsertionEffect:Wa,useLayoutEffect:Za,useMemo:Ja,useReducer:ga,useRef:Ua,useState:function(){return ga(ma)},useDebugValue:Ga,useDeferredValue:function(e,t){return es(da(),Wi.memoizedState,e,t)},useTransition:function(){var e=ga(ma)[0],t=da().memoizedState;return["boolean"==typeof e?e:fa(e),t]},useSyncExternalStore:va,useId:ss,useHostTransitionStatus:as,useFormState:Ia,useActionState:Ia,useOptimistic:function(e,t){return Ca(da(),0,e,t)},useMemoCache:ha,useCacheRefresh:ls};vs.useEffectEvent=qa;var ws={readContext:Io,use:pa,useCallback:Ya,useContext:Io,useEffect:Va,useImperativeHandle:Ka,useInsertionEffect:Wa,useLayoutEffect:Za,useMemo:Ja,useReducer:ba,useRef:Ua,useState:function(){return ba(ma)},useDebugValue:Ga,useDeferredValue:function(e,t){var n=da();return null===Wi?Xa(n,e,t):es(n,Wi.memoizedState,e,t)},useTransition:function(){var e=ba(ma)[0],t=da().memoizedState;return["boolean"==typeof e?e:fa(e),t]},useSyncExternalStore:va,useId:ss,useHostTransitionStatus:as,useFormState:Da,useActionState:Da,useOptimistic:function(e,t){var n=da();return null!==Wi?Ca(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ha,useCacheRefresh:ls};function ks(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:f({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}ws.useEffectEvent=qa;var xs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qc(),o=ki(r);o.payload=t,null!=n&&(o.callback=n),null!==(t=xi(e,o,r))&&(Gc(t,e,r),Si(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qc(),o=ki(r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=xi(e,o,r))&&(Gc(t,e,r),Si(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qc(),r=ki(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=xi(e,r,n))&&(Gc(t,e,n),Si(t,e,n))}};function Ss(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!tr(n,r)||!tr(o,i))}function _s(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xs.enqueueReplaceState(t,t.state,null)}function Es(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var o in n===t&&(n=f({},n)),e)void 0===n[o]&&(n[o]=e[o]);return n}function Cs(e){Ar(e)}function zs(e){console.error(e)}function As(e){Ar(e)}function Ns(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ts(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Os(e,t,n){return(n=ki(n)).tag=3,n.payload={element:null},n.callback=function(){Ns(e,t)},n}function Ps(e){return(e=ki(e)).tag=3,e}function js(e,t,n,r){var o=n.type.getDerivedStateFromError;if("function"==typeof o){var i=r.value;e.payload=function(){return o(i)},e.callback=function(){Ts(t,n,r)}}var a=n.stateNode;null!==a&&"function"==typeof a.componentDidCatch&&(e.callback=function(){Ts(t,n,r),"function"!=typeof o&&(null===Dc?Dc=new Set([this]):Dc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Ms=Error(r(461)),Is=!1;function Fs(e,t,n,r){t.child=null===e?yi(t,null,n,r):gi(t,e.child,n,r)}function Ls(e,t,n,r,o){n=n.render;var i=t.ref;if("ref"in r){var a={};for(var s in r)"ref"!==s&&(a[s]=r[s])}else a=r;return Mo(t),r=ra(e,t,n,a,i,o),s=sa(),null===e||Is?(ho&&s&&lo(t),t.flags|=1,Fs(e,t,r,o),t.child):(la(e,t,o),al(e,t,o))}function Ds(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Br(i)||void 0!==i.defaultProps||null!==n.compare?((e=Vr(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Rs(e,t,i,r,o))}if(i=e.child,!sl(e,o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:tr)(a,r)&&e.ref===t.ref)return al(e,t,o)}return t.flags|=1,(e=$r(i,r)).ref=t.ref,e.return=t,t.child=e}function Rs(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(tr(i,r)&&e.ref===t.ref){if(Is=!1,t.pendingProps=r=i,!sl(e,o))return t.lanes=e.lanes,al(e,t,o);131072&e.flags&&(Is=!0)}}return Ws(e,t,n,r,o)}function Us(e,t,n,r){var o=r.children,i=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(i=null!==i?i.baseLanes|n:n,null!==e){for(r=t.child=e.child,o=0;null!==r;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~i}else r=0,t.child=null;return $s(e,t,i,n,r)}if(!(536870912&n))return r=t.lanes=536870912,$s(e,t,null!==i?i.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Jo(0,null!==i?i.cachePool:null),null!==i?Pi(t,i):ji(),Ri(t)}else null!==i?(Jo(0,i.cachePool),Pi(t,i),Ui(),t.memoizedState=null):(null!==e&&Jo(0,null),ji(),Ui());return Fs(e,t,o,n),t.child}function Bs(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $s(e,t,n,r,o){var i=Yo();return i=null===i?null:{parent:Bo._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},null!==e&&Jo(0,null),ji(),Ri(t),null!==e&&Po(e,t,r,!0),t.childLanes=o,null}function Hs(e,t){return(t=tl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function Vs(e,t,n){return gi(t,e.child,null,n),(e=Hs(t,t.pendingProps)).flags|=2,Bi(t),t.memoizedState=null,e}function qs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Ws(e,t,n,r,o){return Mo(t),n=ra(e,t,n,r,void 0,o),r=sa(),null===e||Is?(ho&&r&&lo(t),t.flags|=1,Fs(e,t,n,o),t.child):(la(e,t,o),al(e,t,o))}function Zs(e,t,n,r,o,i){return Mo(t),t.updateQueue=null,n=ia(t,r,n,o),oa(e),r=sa(),null===e||Is?(ho&&r&&lo(t),t.flags|=1,Fs(e,t,n,i),t.child):(la(e,t,i),al(e,t,i))}function Qs(e,t,n,r,o){if(Mo(t),null===t.stateNode){var i=Dr,a=n.contextType;"object"==typeof a&&null!==a&&(i=Io(a)),i=new n(r,i),t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,i.updater=xs,t.stateNode=i,i._reactInternals=t,(i=t.stateNode).props=r,i.state=t.memoizedState,i.refs={},vi(t),a=n.contextType,i.context="object"==typeof a&&null!==a?Io(a):Dr,i.state=t.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(ks(t,n,a,r),i.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(a=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),a!==i.state&&xs.enqueueReplaceState(i,i.state,null),zi(t,r,i,o),Ci(),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){i=t.stateNode;var s=t.memoizedProps,l=Es(n,s);i.props=l;var c=i.context,u=n.contextType;a=Dr,"object"==typeof u&&null!==u&&(a=Io(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof i.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s||c!==a)&&_s(t,i,r,a),bi=!1;var f=t.memoizedState;i.state=f,zi(t,r,i,o),Ci(),c=t.memoizedState,s||f!==c||bi?("function"==typeof d&&(ks(t,n,d,r),c=t.memoizedState),(l=bi||Ss(t,n,l,r,f,c,a))?(u||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=a,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,wi(e,t),u=Es(n,a=t.memoizedProps),i.props=u,d=t.pendingProps,f=i.context,c=n.contextType,l=Dr,"object"==typeof c&&null!==c&&(l=Io(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(a!==d||f!==l)&&_s(t,i,r,l),bi=!1,f=t.memoizedState,i.state=f,zi(t,r,i,o),Ci();var p=t.memoizedState;a!==d||f!==p||bi||null!==e&&null!==e.dependencies&&jo(e.dependencies)?("function"==typeof s&&(ks(t,n,s,r),p=t.memoizedState),(u=bi||Ss(t,n,u,r,f,p,l)||null!==e&&null!==e.dependencies&&jo(e.dependencies))?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,p,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=l,r=u):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,qs(e,t),r=!!(128&t.flags),i||r?(i=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:i.render(),t.flags|=1,null!==e&&r?(t.child=gi(t,e.child,null,o),t.child=gi(t,null,n,o)):Fs(e,t,n,o),t.memoizedState=i.state,e=t.child):e=al(e,t,o),e}function Ks(e,t,n,r){return xo(),t.flags|=256,Fs(e,t,n,r),t.child}var Gs={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ys(e){return{baseLanes:e,cachePool:Xo()}}function Js(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Nc),e}function Xs(e,t,n){var o,i=t.pendingProps,a=!1,s=!!(128&t.flags);if((o=s)||(o=(null===e||null!==e.memoizedState)&&!!(2&$i.current)),o&&(a=!0,t.flags&=-129),o=!!(32&t.flags),t.flags&=-33,null===e){if(ho){if(a?Li(t):Ui(),(e=po)?null!==(e=null!==(e=Pd(e,go))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ro?{id:oo,overflow:io}:null,retryLane:536870912,hydrationErrors:null},(n=Zr(e)).return=t,t.child=n,fo=t,po=null):e=null,null===e)throw bo(t);return Md(e)?t.lanes=32:t.lanes=536870912,null}var l=i.children;return i=i.fallback,a?(Ui(),l=tl({mode:"hidden",children:l},a=t.mode),i=qr(i,a,n,null),l.return=t,i.return=t,l.sibling=i,t.child=l,(i=t.child).memoizedState=Ys(n),i.childLanes=Js(e,o,n),t.memoizedState=Gs,Bs(null,i)):(Li(t),el(t,l))}var c=e.memoizedState;if(null!==c&&null!==(l=c.dehydrated)){if(s)256&t.flags?(Li(t),t.flags&=-257,t=nl(e,t,n)):null!==t.memoizedState?(Ui(),t.child=e.child,t.flags|=128,t=null):(Ui(),l=i.fallback,a=t.mode,i=tl({mode:"visible",children:i.children},a),(l=qr(l,a,n,null)).flags|=2,i.return=t,l.return=t,i.sibling=l,t.child=i,gi(t,e.child,null,n),(i=t.child).memoizedState=Ys(n),i.childLanes=Js(e,o,n),t.memoizedState=Gs,t=Bs(null,i));else if(Li(t),Md(l)){if(o=l.nextSibling&&l.nextSibling.dataset)var u=o.dgst;o=u,(i=Error(r(419))).stack="",i.digest=o,_o({value:i,source:null,stack:null}),t=nl(e,t,n)}else if(Is||Po(e,t,n,!1),o=0!==(n&e.childLanes),Is||o){if(null!==(o=gc)&&(0!==(i=Le(o,n))&&i!==c.retryLane))throw c.retryLane=i,Ir(e,i),Gc(o,e,i),Ms;jd(l)||lu(),t=nl(e,t,n)}else jd(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,po=Id(l.nextSibling),fo=t,ho=!0,mo=null,go=!1,null!==e&&uo(t,e),(t=el(t,i.children)).flags|=4096);return t}return a?(Ui(),l=i.fallback,a=t.mode,u=(c=e.child).sibling,(i=$r(c,{mode:"hidden",children:i.children})).subtreeFlags=65011712&c.subtreeFlags,null!==u?l=$r(u,l):(l=qr(l,a,n,null)).flags|=2,l.return=t,i.return=t,i.sibling=l,t.child=i,Bs(null,i),i=t.child,null===(l=e.child.memoizedState)?l=Ys(n):(null!==(a=l.cachePool)?(c=Bo._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=Xo(),l={baseLanes:l.baseLanes|n,cachePool:a}),i.memoizedState=l,i.childLanes=Js(e,o,n),t.memoizedState=Gs,Bs(e.child,i)):(Li(t),e=(n=e.child).sibling,(n=$r(n,{mode:"visible",children:i.children})).return=t,n.sibling=null,null!==e&&(null===(o=t.deletions)?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return(t=tl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function tl(e,t){return(e=Ur(22,e,null,t)).lanes=0,e}function nl(e,t,n){return gi(t,e.child,null,n),(e=el(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function rl(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),To(e.return,t,n)}function ol(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=i)}function il(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=$i.current,s=!!(2&a);if(s?(a=1&a|2,t.flags|=128):a&=1,H($i,a),Fs(e,t,r,n),r=ho?eo:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&rl(e,n,t);else if(19===e.tag)rl(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Hi(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ol(t,!1,o,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Hi(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ol(t,!0,n,null,i,r);break;case"together":ol(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function al(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Cc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Po(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=$r(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$r(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function sl(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!jo(e))}function ll(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Is=!0;else{if(!(sl(e,n)||128&t.flags))return Is=!1,function(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),Ao(0,Bo,e.memoizedState.cache),xo();break;case 27:case 5:J(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:Ao(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Di(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Li(t),t.flags|=128,null):0!==(n&t.child.childLanes)?Xs(e,t,n):(Li(t),null!==(e=al(e,t,n))?e.sibling:null);Li(t);break;case 19:var o=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Po(e,t,n,!1),r=0!==(n&t.childLanes)),o){if(r)return il(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),H($i,$i.current),r)break;return null;case 22:return t.lanes=0,Us(e,t,n,t.pendingProps);case 24:Ao(0,Bo,e.memoizedState.cache)}return al(e,t,n)}(e,t,n);Is=!!(131072&e.flags)}else Is=!1,ho&&1048576&t.flags&&so(t,eo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ai(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var i=e.$$typeof;if(i===_){t.tag=11,t=Ls(null,t,e,o,n);break e}if(i===z){t.tag=14,t=Ds(null,t,e,o,n);break e}}throw t=M(e)||e,Error(r(306,t,""))}Br(e)?(o=Es(e,o),t.tag=1,t=Qs(null,t,e,o,n)):(t.tag=0,t=Ws(null,t,e,o,n))}return t;case 0:return Ws(e,t,t.type,t.pendingProps,n);case 1:return Qs(e,t,o=t.type,i=Es(o,t.pendingProps),n);case 3:e:{if(G(t,t.stateNode.containerInfo),null===e)throw Error(r(387));o=t.pendingProps;var a=t.memoizedState;i=a.element,wi(e,t),zi(t,o,null,n);var s=t.memoizedState;if(o=s.cache,Ao(0,Bo,o),o!==a.cache&&Oo(t,[Bo],n,!0),Ci(),o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Ks(e,t,o,n);break e}if(o!==i){_o(i=Gr(Error(r(424)),t)),t=Ks(e,t,o,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(po=Id(e.firstChild),fo=t,ho=!0,mo=null,go=!0,n=yi(t,null,o,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(xo(),o===i){t=al(e,t,n);break e}Fs(e,t,o,n)}t=t.child}return t;case 26:return qs(e,t),null===e?(n=Zd(t.type,null,t.pendingProps,null))?t.memoizedState=n:ho||(n=t.type,e=t.pendingProps,(o=bd(Q.current).createElement(n))[He]=t,o[Ve]=e,hd(o,n,e),nt(o),t.stateNode=o):t.memoizedState=Zd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J(t),null===e&&ho&&(o=t.stateNode=Rd(t.type,t.pendingProps,Q.current),fo=t,go=!0,i=po,Ad(t.type)?(Fd=i,po=Id(o.firstChild)):po=i),Fs(e,t,t.pendingProps.children,n),qs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&ho&&((i=o=po)&&(null!==(o=function(e,t,n,r){for(;1===e.nodeType;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ge])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(i=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(i!==o.rel||e.getAttribute("href")!==(null==o.href||""===o.href?null:o.href)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin)||e.getAttribute("title")!==(null==o.title?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((i=e.getAttribute("src"))!==(null==o.src?null:o.src)||e.getAttribute("type")!==(null==o.type?null:o.type)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var i=null==o.name?null:""+o.name;if("hidden"===o.type&&e.getAttribute("name")===i)return e}if(null===(e=Id(e.nextSibling)))break}return null}(o,t.type,t.pendingProps,go))?(t.stateNode=o,fo=t,po=Id(o.firstChild),go=!1,i=!0):i=!1),i||bo(t)),J(t),i=t.type,a=t.pendingProps,s=null!==e?e.memoizedProps:null,o=a.children,kd(i,a)?o=null:null!==s&&kd(i,s)&&(t.flags|=32),null!==t.memoizedState&&(i=ra(e,t,aa,null,null,n),pf._currentValue=i),qs(e,t),Fs(e,t,o,n),t.child;case 6:return null===e&&ho&&((e=n=po)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Id(e.nextSibling)))return null}return e}(n,t.pendingProps,go))?(t.stateNode=n,fo=t,po=null,e=!0):e=!1),e||bo(t)),null;case 13:return Xs(e,t,n);case 4:return G(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=gi(t,null,o,n):Fs(e,t,o,n),t.child;case 11:return Ls(e,t,t.type,t.pendingProps,n);case 7:return Fs(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fs(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,Ao(0,t.type,o.value),Fs(e,t,o.children,n),t.child;case 9:return i=t.type._context,o=t.pendingProps.children,Mo(t),o=o(i=Io(i)),t.flags|=1,Fs(e,t,o,n),t.child;case 14:return Ds(e,t,t.type,t.pendingProps,n);case 15:return Rs(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return function(e,t,n){var o=t.pendingProps,i=!!(128&t.flags);if(t.flags&=-129,null===e){if(ho){if("hidden"===o.mode)return e=Hs(t,o),t.lanes=536870912,Bs(null,e);if(Di(t),(e=po)?null!==(e=null!==(e=Pd(e,go))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ro?{id:oo,overflow:io}:null,retryLane:536870912,hydrationErrors:null},(n=Zr(e)).return=t,t.child=n,fo=t,po=null):e=null,null===e)throw bo(t);return t.lanes=536870912,null}return Hs(t,o)}var a=e.memoizedState;if(null!==a){var s=a.dehydrated;if(Di(t),i)if(256&t.flags)t.flags&=-257,t=Vs(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Is||Po(e,t,n,!1),i=0!==(n&e.childLanes),Is||i){if(null!==(o=gc)&&0!==(s=Le(o,n))&&s!==a.retryLane)throw a.retryLane=s,Ir(e,s),Gc(o,e,s),Ms;lu(),t=Vs(e,t,n)}else e=a.treeContext,po=Id(s.nextSibling),fo=t,ho=!0,mo=null,go=!1,null!==e&&uo(t,e),(t=Hs(t,o)).flags|=4096;return t}return(e=$r(e.child,{mode:o.mode,children:o.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Us(e,t,n,t.pendingProps);case 24:return Mo(t),o=Io(Bo),null===e?(null===(i=Yo())&&(i=gc,a=$o(),i.pooledCache=a,a.refCount++,null!==a&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:o,cache:i},vi(t),Ao(0,Bo,i)):(0!==(e.lanes&n)&&(wi(e,t),zi(t,null,null,n),Ci()),i=e.memoizedState,a=t.memoizedState,i.parent!==o?(i={parent:o,cache:o},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),Ao(0,Bo,o)):(o=a.cache,Ao(0,Bo,o),o!==i.cache&&Oo(t,[Bo],n,!0))),Fs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function cl(e){e.flags|=4}function ul(e,t,n,r,o){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&o)===o)if(e.stateNode.complete)e.flags|=8192;else{if(!iu())throw si=ri,ti;e.flags|=8192}}else e.flags&=-16777217}function dl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!sf(t)){if(!iu())throw si=ri,ti;e.flags|=8192}}function fl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Pe():536870912,e.lanes|=t,Tc|=t)}function pl(e,t){if(!ho)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function hl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=65011712&o.subtreeFlags,r|=65011712&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ml(e,t,n){var o=t.pendingProps;switch(co(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return hl(t),null;case 3:return n=t.stateNode,o=null,null!==e&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),No(Bo),Y(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ko(t)?cl(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,So())),hl(t),null;case 26:var i=t.type,a=t.memoizedState;return null===e?(cl(t),null!==a?(hl(t),dl(t,a)):(hl(t),ul(t,i,0,0,n))):a?a!==e.memoizedState?(cl(t),hl(t),dl(t,a)):(hl(t),t.flags&=-16777217):((e=e.memoizedProps)!==o&&cl(t),hl(t),ul(t,i,0,0,n)),null;case 27:if(X(t),n=Q.current,i=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==o&&cl(t);else{if(!o){if(null===t.stateNode)throw Error(r(166));return hl(t),null}e=W.current,ko(t)?vo(t):(e=Rd(i,o,n),t.stateNode=e,cl(t))}return hl(t),null;case 5:if(X(t),i=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==o&&cl(t);else{if(!o){if(null===t.stateNode)throw Error(r(166));return hl(t),null}if(a=W.current,ko(t))vo(t);else{var s=bd(Q.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":(a=s.createElement("div")).innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a="string"==typeof o.is?s.createElement("select",{is:o.is}):s.createElement("select"),o.multiple?a.multiple=!0:o.size&&(a.size=o.size);break;default:a="string"==typeof o.is?s.createElement(i,{is:o.is}):s.createElement(i)}}a[He]=t,a[Ve]=o;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)a.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;e:switch(hd(a,i,o),i){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&cl(t)}}return hl(t),ul(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==o&&cl(t);else{if("string"!=typeof o&&null===t.stateNode)throw Error(r(166));if(e=Q.current,ko(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,null!==(i=fo))switch(i.tag){case 27:case 5:o=i.memoizedProps}e[He]=t,(e=!!(e.nodeValue===n||null!==o&&!0===o.suppressHydrationWarning||dd(e.nodeValue,n)))||bo(t,!0)}else(e=bd(e).createTextNode(o))[He]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(o=ko(t),null!==n){if(null===e){if(!o)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[He]=t}else xo(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=So(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Bi(t),t):(Bi(t),null);if(128&t.flags)throw Error(r(558))}return hl(t),null;case 13:if(o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=ko(t),null!==o&&null!==o.dehydrated){if(null===e){if(!i)throw Error(r(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(r(317));i[He]=t}else xo(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=So(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Bi(t),t):(Bi(t),null)}return Bi(t),128&t.flags?(t.lanes=n,t):(n=null!==o,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(o=t.child).alternate&&null!==o.alternate.memoizedState&&null!==o.alternate.memoizedState.cachePool&&(i=o.alternate.memoizedState.cachePool.pool),a=null,null!==o.memoizedState&&null!==o.memoizedState.cachePool&&(a=o.memoizedState.cachePool.pool),a!==i&&(o.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fl(t,t.updateQueue),hl(t),null);case 4:return Y(),null===e&&td(t.stateNode.containerInfo),hl(t),null;case 10:return No(t.type),hl(t),null;case 19:if($($i),null===(o=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(a=o.rendering))if(i)pl(o,!1);else{if(0!==Ec||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(a=Hi(e))){for(t.flags|=128,pl(o,!1),e=a.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Hr(n,e),n=n.sibling;return H($i,1&$i.current|2),ho&&ao(t,o.treeForkCount),t.child}e=e.sibling}null!==o.tail&&ue()>Fc&&(t.flags|=128,i=!0,pl(o,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Hi(a))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!ho)return hl(t),null}else 2*ue()-o.renderingStartTime>Fc&&536870912!==n&&(t.flags|=128,i=!0,pl(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ue(),e.sibling=null,n=$i.current,H($i,i?1&n|2:1&n),ho&&ao(t,o.treeForkCount),e):(hl(t),null);case 22:case 23:return Bi(t),Mi(),o=null!==t.memoizedState,null!==e?null!==e.memoizedState!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&fl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),o=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(o=t.memoizedState.cachePool.pool),o!==n&&(t.flags|=2048),null!==e&&$(Go),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),No(Bo),hl(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function gl(e,t){switch(co(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return No(Bo),Y(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return X(t),null;case 31:if(null!==t.memoizedState){if(Bi(t),null===t.alternate)throw Error(r(340));xo()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Bi(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));xo()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return $($i),null;case 4:return Y(),null;case 10:return No(t.type),null;case 22:case 23:return Bi(t),Mi(),null!==e&&$(Go),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return No(Bo),null;default:return null}}function yl(e,t){switch(co(t),t.tag){case 3:No(Bo),Y();break;case 26:case 27:case 5:X(t);break;case 4:Y();break;case 31:null!==t.memoizedState&&Bi(t);break;case 13:Bi(t);break;case 19:$($i);break;case 10:No(t.type);break;case 22:case 23:Bi(t),Mi(),null!==e&&$(Go);break;case 24:No(Bo)}}function bl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==o)}}catch(s){Eu(t,t.return,s)}}function vl(e,t,n){try{var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var i=o.next;r=i;do{if((r.tag&e)===e){var a=r.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,o=t;var l=n,c=s;try{c()}catch(u){Eu(o,l,u)}}}r=r.next}while(r!==i)}}catch(u){Eu(t,t.return,u)}}function wl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Ni(t,n)}catch(r){Eu(e,e.return,r)}}}function kl(e,t,n){n.props=Es(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Eu(e,t,r)}}function xl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(o){Eu(e,t,o)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(o){Eu(e,t,o)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(i){Eu(e,t,i)}else n.current=null}function _l(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){Eu(e,e.return,o)}}function El(e,t,n){try{var o=e.stateNode;!function(e,t,n,o){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,s=null,l=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:o.hasOwnProperty(h)||fd(e,t,h,null,o,f)}}for(var p in o){var h=o[p];if(f=n[p],o.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":a=h;break;case"name":i=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":s=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:h!==f&&fd(e,t,p,h,o,f)}}return void wt(e,s,l,c,u,d,a,i);case"select":for(a in h=s=l=p=null,n)if(c=n[a],n.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":h=c;default:o.hasOwnProperty(a)||fd(e,t,a,null,o,c)}for(i in o)if(a=o[i],c=n[i],o.hasOwnProperty(i)&&(null!=a||null!=c))switch(i){case"value":p=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:a!==c&&fd(e,t,i,a,o,c)}return t=l,n=s,o=h,void(null!=p?St(e,!!n,p,!1):!!o!=!!n&&(null!=t?St(e,!!n,t,!0):St(e,!!n,n?[]:"",!1)));case"textarea":for(l in h=p=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!o.hasOwnProperty(l))switch(l){case"value":case"children":break;default:fd(e,t,l,null,o,i)}for(s in o)if(i=o[s],a=n[s],o.hasOwnProperty(s)&&(null!=i||null!=a))switch(s){case"value":p=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(r(91));break;default:i!==a&&fd(e,t,s,i,o,a)}return void _t(e,p,h);case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&null!=p&&!o.hasOwnProperty(m))if("selected"===m)e.selected=!1;else fd(e,t,m,null,o,p);for(c in o)if(p=o[c],h=n[c],o.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h))if("selected"===c)e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p;else fd(e,t,c,p,o,h);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)&&null!=p&&!o.hasOwnProperty(g)&&fd(e,t,g,null,o,p);for(u in o)if(p=o[u],h=n[u],o.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(r(137,t));break;default:fd(e,t,u,p,o,h)}return;default:if(Tt(t)){for(var y in n)p=n[y],n.hasOwnProperty(y)&&void 0!==p&&!o.hasOwnProperty(y)&&pd(e,t,y,void 0,o,p);for(d in o)p=o[d],h=n[d],!o.hasOwnProperty(d)||p===h||void 0===p&&void 0===h||pd(e,t,d,p,o,h);return}}for(var b in n)p=n[b],n.hasOwnProperty(b)&&null!=p&&!o.hasOwnProperty(b)&&fd(e,t,b,null,o,p);for(f in o)p=o[f],h=n[f],!o.hasOwnProperty(f)||p===h||null==p&&null==h||fd(e,t,f,p,o,h)}(o,e.type,n,t),o[Ve]=t}catch(i){Eu(e,e.return,i)}}function Cl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Ad(e.type)||4===e.tag}function zl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Cl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Ad(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Mt));else if(4!==r&&(27===r&&Ad(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Al(e,t,n),e=e.sibling;null!==e;)Al(e,t,n),e=e.sibling}function Nl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Ad(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Nl(e,t,n),e=e.sibling;null!==e;)Nl(e,t,n),e=e.sibling}function Tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);hd(t,r,n),t[He]=e,t[Ve]=n}catch(i){Eu(e,e.return,i)}}var Ol=!1,Pl=!1,jl=!1,Ml="function"==typeof WeakSet?WeakSet:Set,Il=null;function Fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gl(e,n),4&r&&bl(5,n);break;case 1:if(Gl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(a){Eu(n,n.return,a)}else{var o=Es(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Eu(n,n.return,s)}}64&r&&wl(n),512&r&&xl(n,n.return);break;case 3:if(Gl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Ni(e,t)}catch(a){Eu(n,n.return,a)}}break;case 27:null===t&&4&r&&Tl(n);case 26:case 5:Gl(e,n),null===t&&4&r&&_l(n),512&r&&xl(n,n.return);break;case 12:Gl(e,n);break;case 31:Gl(e,n),4&r&&$l(e,n);break;case 13:Gl(e,n),4&r&&Hl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Nu.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Ol)){t=null!==t&&null!==t.memoizedState||Pl,o=Ol;var i=Pl;Ol=r,(Pl=t)&&!i?Jl(e,n,!!(8772&n.subtreeFlags)):Gl(e,n),Ol=o,Pl=i}break;case 30:break;default:Gl(e,n)}}function Ll(e){var t=e.alternate;null!==t&&(e.alternate=null,Ll(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ye(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 Dl=null,Rl=!1;function Ul(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(we&&"function"==typeof we.onCommitFiberUnmount)try{we.onCommitFiberUnmount(ve,n)}catch(i){}switch(n.tag){case 26:Pl||Sl(n,t),Ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Pl||Sl(n,t);var r=Dl,o=Rl;Ad(n.type)&&(Dl=n.stateNode,Rl=!1),Ul(e,t,n),Ud(n.stateNode),Dl=r,Rl=o;break;case 5:Pl||Sl(n,t);case 6:if(r=Dl,o=Rl,Dl=null,Ul(e,t,n),Rl=o,null!==(Dl=r))if(Rl)try{(9===Dl.nodeType?Dl.body:"HTML"===Dl.nodeName?Dl.ownerDocument.body:Dl).removeChild(n.stateNode)}catch(a){Eu(n,t,a)}else try{Dl.removeChild(n.stateNode)}catch(a){Eu(n,t,a)}break;case 18:null!==Dl&&(Rl?(Nd(9===(e=Dl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Zf(e)):Nd(Dl,n.stateNode));break;case 4:r=Dl,o=Rl,Dl=n.stateNode.containerInfo,Rl=!0,Ul(e,t,n),Dl=r,Rl=o;break;case 0:case 11:case 14:case 15:vl(2,n,t),Pl||vl(4,n,t),Ul(e,t,n);break;case 1:Pl||(Sl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&kl(n,t,r)),Ul(e,t,n);break;case 21:Ul(e,t,n);break;case 22:Pl=(r=Pl)||null!==n.memoizedState,Ul(e,t,n),Pl=r;break;default:Ul(e,t,n)}}function $l(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Zf(e)}catch(n){Eu(t,t.return,n)}}}function Hl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Zf(e)}catch(n){Eu(t,t.return,n)}}function Vl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Ml),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Ml),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Tu.bind(null,e,t);t.then(r,r)}})}function ql(e,t){var n=t.deletions;if(null!==n)for(var o=0;o<n.length;o++){var i=n[o],a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(Ad(l.type)){Dl=l.stateNode,Rl=!1;break e}break;case 5:Dl=l.stateNode,Rl=!1;break e;case 3:case 4:Dl=l.stateNode.containerInfo,Rl=!0;break e}l=l.return}if(null===Dl)throw Error(r(160));Bl(a,s,i),Dl=null,Rl=!1,null!==(a=i.alternate)&&(a.return=null),i.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Zl(t,e),t=t.sibling}var Wl=null;function Zl(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ql(t,e),Ql(e),4&o&&(vl(3,e,e.return),bl(3,e),vl(5,e,e.return));break;case 1:ql(t,e),Ql(e),512&o&&(Pl||null===n||Sl(n,n.return)),64&o&&Ol&&(null!==(e=e.updateQueue)&&(null!==(o=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?o:n.concat(o))));break;case 26:var i=Wl;if(ql(t,e),Ql(e),512&o&&(Pl||null===n||Sl(n,n.return)),4&o){var a=null!==n?n.memoizedState:null;if(o=e.memoizedState,null===n)if(null===o)if(null===e.stateNode){e:{o=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(o){case"title":(!(a=i.getElementsByTagName("title")[0])||a[Ge]||a[He]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=i.createElement(o),i.head.insertBefore(a,i.querySelector("head > title"))),hd(a,o,n),a[He]=e,nt(a),o=a;break e;case"link":var s=of("link","href",i).get(o+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((a=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}hd(a=i.createElement(o),o,n),i.head.appendChild(a);break;case"meta":if(s=of("meta","content",i).get(o+(n.content||"")))for(l=0;l<s.length;l++)if((a=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}hd(a=i.createElement(o),o,n),i.head.appendChild(a);break;default:throw Error(r(468,o))}a[He]=e,nt(a),o=a}e.stateNode=o}else af(i,e.type,e.stateNode);else e.stateNode=Xd(i,o,e.memoizedProps);else a!==o?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===o?af(i,e.type,e.stateNode):Xd(i,o,e.memoizedProps)):null===o&&null!==e.stateNode&&El(e,e.memoizedProps,n.memoizedProps)}break;case 27:ql(t,e),Ql(e),512&o&&(Pl||null===n||Sl(n,n.return)),null!==n&&4&o&&El(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ql(t,e),Ql(e),512&o&&(Pl||null===n||Sl(n,n.return)),32&e.flags){i=e.stateNode;try{Ct(i,"")}catch(m){Eu(e,e.return,m)}}4&o&&null!=e.stateNode&&El(e,i=e.memoizedProps,null!==n?n.memoizedProps:i),1024&o&&(jl=!0);break;case 6:if(ql(t,e),Ql(e),4&o){if(null===e.stateNode)throw Error(r(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(m){Eu(e,e.return,m)}}break;case 3:if(rf=null,i=Wl,Wl=Hd(t.containerInfo),ql(t,e),Wl=i,Ql(e),4&o&&null!==n&&n.memoizedState.isDehydrated)try{Zf(t.containerInfo)}catch(m){Eu(e,e.return,m)}jl&&(jl=!1,Kl(e));break;case 4:o=Wl,Wl=Hd(e.stateNode.containerInfo),ql(t,e),Ql(e),Wl=o;break;case 12:default:ql(t,e),Ql(e);break;case 31:case 19:ql(t,e),Ql(e),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,Vl(e,o)));break;case 13:ql(t,e),Ql(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Mc=ue()),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,Vl(e,o)));break;case 22:i=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=Ol,d=Pl;if(Ol=u||i,Pl=d||c,ql(t,e),Pl=d,Ol=u,Ql(e),8192&o)e:for(t=e.stateNode,t._visibility=i?-2&t._visibility:1|t._visibility,i&&(null===n||c||Ol||Pl||Yl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(a=c.stateNode,i)"function"==typeof(s=a.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;l.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(m){Eu(c,c.return,m)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(m){Eu(c,c.return,m)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;i?Td(h,!0):Td(c.stateNode,!1)}catch(m){Eu(c,c.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&o&&(null!==(o=e.updateQueue)&&(null!==(n=o.retryQueue)&&(o.retryQueue=null,Vl(e,n))));case 30:case 21:}}function Ql(e){var t=e.flags;if(2&t){try{for(var n,o=e.return;null!==o;){if(Cl(o)){n=o;break}o=o.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode;Nl(e,zl(e),i);break;case 5:var a=n.stateNode;32&n.flags&&(Ct(a,""),n.flags&=-33),Nl(e,zl(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Al(e,zl(e),s);break;default:throw Error(r(161))}}catch(l){Eu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Kl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Kl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Gl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Fl(e,t.alternate,t),t=t.sibling}function Yl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vl(4,t,t.return),Yl(t);break;case 1:Sl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&kl(t,t.return,n),Yl(t);break;case 27:Ud(t.stateNode);case 26:case 5:Sl(t,t.return),Yl(t);break;case 22:null===t.memoizedState&&Yl(t);break;default:Yl(t)}e=e.sibling}}function Jl(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,o=e,i=t,a=i.flags;switch(i.tag){case 0:case 11:case 15:Jl(o,i,n),bl(4,i);break;case 1:if(Jl(o,i,n),"function"==typeof(o=(r=i).stateNode).componentDidMount)try{o.componentDidMount()}catch(c){Eu(r,r.return,c)}if(null!==(o=(r=i).updateQueue)){var s=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(null!==l)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)Ai(l[o],s)}catch(c){Eu(r,r.return,c)}}n&&64&a&&wl(i),xl(i,i.return);break;case 27:Tl(i);case 26:case 5:Jl(o,i,n),n&&null===r&&4&a&&_l(i),xl(i,i.return);break;case 12:Jl(o,i,n);break;case 31:Jl(o,i,n),n&&4&a&&$l(o,i);break;case 13:Jl(o,i,n),n&&4&a&&Hl(o,i);break;case 22:null===i.memoizedState&&Jl(o,i,n),xl(i,i.return);break;case 30:break;default:Jl(o,i,n)}t=t.sibling}}function Xl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Ho(n))}function ec(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ho(e))}function tc(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)nc(e,t,n,r),t=t.sibling}function nc(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:tc(e,t,n,r),2048&o&&bl(9,t);break;case 1:case 31:case 13:default:tc(e,t,n,r);break;case 3:tc(e,t,n,r),2048&o&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ho(e)));break;case 12:if(2048&o){tc(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,s=i.onPostCommit;"function"==typeof s&&s(a,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Eu(t,t.return,l)}}else tc(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,null!==t.memoizedState?2&i._visibility?tc(e,t,n,r):oc(e,t):2&i._visibility?tc(e,t,n,r):(i._visibility|=2,rc(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&o&&Xl(a,t);break;case 24:tc(e,t,n,r),2048&o&&ec(t.alternate,t)}}function rc(e,t,n,r,o){for(o=o&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var i=e,a=t,s=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:rc(i,a,s,l,o),bl(8,a);break;case 23:break;case 22:var u=a.stateNode;null!==a.memoizedState?2&u._visibility?rc(i,a,s,l,o):oc(i,a):(u._visibility|=2,rc(i,a,s,l,o)),o&&2048&c&&Xl(a.alternate,a);break;case 24:rc(i,a,s,l,o),o&&2048&c&&ec(a.alternate,a);break;default:rc(i,a,s,l,o)}t=t.sibling}}function oc(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:oc(n,r),2048&o&&Xl(r.alternate,r);break;case 24:oc(n,r),2048&o&&ec(r.alternate,r);break;default:oc(n,r)}t=t.sibling}}var ic=8192;function ac(e,t,n){if(e.subtreeFlags&ic)for(e=e.child;null!==e;)sc(e,t,n),e=e.sibling}function sc(e,t,n){switch(e.tag){case 26:ac(e,t,n),e.flags&ic&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var o=Qd(r.href),i=t.querySelector(Kd(o));if(i)return null!==(t=i._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=cf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,void nt(i);i=t.ownerDocument||t,r=Gd(r),(o=Bd.get(o))&&tf(r,o),nt(i=i.createElement("link"));var a=i;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),hd(i,"link",r),n.instance=i}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=cf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Wl,e.memoizedState,e.memoizedProps);break;case 5:default:ac(e,t,n);break;case 3:case 4:var r=Wl;Wl=Hd(e.stateNode.containerInfo),ac(e,t,n),Wl=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=ic,ic=16777216,ac(e,t,n),ic=r):ac(e,t,n))}}function lc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function cc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Il=r,fc(r,e)}lc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)uc(e),e=e.sibling}function uc(e){switch(e.tag){case 0:case 11:case 15:cc(e),2048&e.flags&&vl(9,e,e.return);break;case 3:case 12:default:cc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,dc(e)):cc(e)}}function dc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Il=r,fc(r,e)}lc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:vl(8,t,t.return),dc(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,dc(t));break;default:dc(t)}e=e.sibling}}function fc(e,t){for(;null!==Il;){var n=Il;switch(n.tag){case 0:case 11:case 15:vl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Ho(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Il=r;else e:for(n=e;null!==Il;){var o=(r=Il).sibling,i=r.return;if(Ll(r),r===n){Il=null;break e}if(null!==o){o.return=i,Il=o;break e}Il=i}}}var pc={getCacheForType:function(e){var t=Io(Bo),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Io(Bo).controller.signal}},hc="function"==typeof WeakMap?WeakMap:Map,mc=0,gc=null,yc=null,bc=0,vc=0,wc=null,kc=!1,xc=!1,Sc=!1,_c=0,Ec=0,Cc=0,zc=0,Ac=0,Nc=0,Tc=0,Oc=null,Pc=null,jc=!1,Mc=0,Ic=0,Fc=1/0,Lc=null,Dc=null,Rc=0,Uc=null,Bc=null,$c=0,Hc=0,Vc=null,qc=null,Wc=0,Zc=null;function Qc(){return 2&mc&&0!==bc?bc&-bc:null!==F.T?Vu():Ue()}function Kc(){if(0===Nc)if(536870912&bc&&!ho)Nc=536870912;else{var e=Ce;!(3932160&(Ce<<=1))&&(Ce=262144),Nc=e}return null!==(e=Ii.current)&&(e.flags|=32),Nc}function Gc(e,t,n){(e!==gc||2!==vc&&9!==vc)&&null===e.cancelPendingCommit||(ru(e,0),eu(e,bc,Nc,!1)),Me(e,n),2&mc&&e===gc||(e===gc&&(!(2&mc)&&(zc|=n),4===Ec&&eu(e,bc,Nc,!1)),Lu(e))}function Yc(e,t,n){if(6&mc)throw Error(r(327));for(var o=!n&&!(127&t)&&0===(t&e.expiredLanes)||Te(e,t),i=o?function(e,t){var n=mc;mc|=2;var o=au(),i=su();gc!==e||bc!==t?(Lc=null,Fc=ue()+500,ru(e,t)):xc=Te(e,t);e:for(;;)try{if(0!==vc&&null!==yc){t=yc;var a=wc;t:switch(vc){case 1:vc=0,wc=null,hu(e,t,a,1);break;case 2:case 9:if(oi(a)){vc=0,wc=null,pu(t);break}t=function(){2!==vc&&9!==vc||gc!==e||(vc=7),Lu(e)},a.then(t,t);break e;case 3:vc=7;break e;case 4:vc=5;break e;case 7:oi(a)?(vc=0,wc=null,pu(t)):(vc=0,wc=null,hu(e,t,a,7));break;case 5:var s=null;switch(yc.tag){case 26:s=yc.memoizedState;case 5:case 27:var l=yc;if(s?sf(s):l.stateNode.complete){vc=0,wc=null;var c=l.sibling;if(null!==c)yc=c;else{var u=l.return;null!==u?(yc=u,mu(u)):yc=null}break t}}vc=0,wc=null,hu(e,t,a,5);break;case 6:vc=0,wc=null,hu(e,t,a,6);break;case 8:nu(),Ec=6;break e;default:throw Error(r(462))}}du();break}catch(d){ou(e,d)}return zo=Co=null,F.H=o,F.A=i,mc=n,null!==yc?0:(gc=null,bc=0,Pr(),Ec)}(e,t):cu(e,t,!0),a=o;;){if(0===i){xc&&!o&&eu(e,t,0,!1);break}if(n=e.current.alternate,!a||Xc(n)){if(2===i){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;i=Oc;var c=l.current.memoizedState.isDehydrated;if(c&&(ru(l,s).flags|=256),2!==(s=cu(l,s,!1))){if(Sc&&!c){l.errorRecoveryDisabledLanes|=a,zc|=a,i=4;break e}a=Pc,Pc=i,null!==a&&(null===Pc?Pc=a:Pc.push.apply(Pc,a))}i=s}if(a=!1,2!==i)continue}}if(1===i){ru(e,0),eu(e,t,0,!0);break}e:{switch(o=e,a=i){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:eu(o,t,Nc,!kc);break e;case 2:Pc=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(i=Mc+300-ue())){if(eu(o,t,Nc,!kc),0!==Ne(o,0,!0))break e;$c=t,o.timeoutHandle=Sd(Jc.bind(null,o,n,Pc,Lc,jc,t,Nc,zc,Tc,kc,a,"Throttled",-0,0),i)}else Jc(o,n,Pc,Lc,jc,t,Nc,zc,Tc,kc,a,null,-0,0)}break}i=cu(e,t,!1),a=!1}Lu(e)}function Jc(e,t,n,r,o,i,a,s,l,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){sc(t,i,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mt});var h=(62914560&i)===i?Mc-ue():(4194048&i)===i?Ic-ue():0;if(null!==(h=function(e,t){return e.stylesheets&&0===e.count&&df(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&df(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===lf&&(lf=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],i=o.transferSize,a=o.initiatorType,s=o.duration;if(i&&s&&md(a)){for(a=0,s=o.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&md(d)&&(a+=u*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--r,t+=8*(i+a)/(o.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var o=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&df(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}(d,h)))return $c=i,e.cancelPendingCommit=h(yu.bind(null,e,t,i,n,r,o,a,s,l,u,d,null,f,p)),void eu(e,i,a,!c)}yu(e,t,i,n,r,o,a,s,l)}function Xc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!er(i(),o))return!1}catch(a){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function eu(e,t,n,r){t&=~Ac,t&=~zc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var i=31-xe(o),a=1<<i;r[i]=-1,o&=~a}0!==n&&Ie(e,n,t)}function tu(){return!!(6&mc)||(Du(0),!1)}function nu(){if(null!==yc){if(0===vc)var e=yc.return;else zo=Co=null,ca(e=yc),ui=null,di=0,e=yc;for(;null!==e;)yl(e.alternate,e),e=e.return;yc=null}}function ru(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,_d(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),$c=0,nu(),gc=e,yc=n=$r(e.current,null),bc=t,vc=0,wc=null,kc=!1,xc=Te(e,t),Sc=!1,Tc=Nc=Ac=zc=Cc=Ec=0,Pc=Oc=null,jc=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var o=31-xe(r),i=1<<o;t|=e[o],r&=~i}return _c=t,Pr(),n}function ou(e,t){qi=null,F.H=ys,t===ei||t===ni?(t=li(),vc=3):t===ti?(t=li(),vc=4):vc=t===Ms?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,wc=t,null===yc&&(Ec=1,Ns(e,Gr(t,e.current)))}function iu(){var e=Ii.current;return null===e||((4194048&bc)===bc?null===Fi:!!((62914560&bc)===bc||536870912&bc)&&e===Fi)}function au(){var e=F.H;return F.H=ys,null===e?ys:e}function su(){var e=F.A;return F.A=pc,e}function lu(){Ec=4,kc||(4194048&bc)!==bc&&null!==Ii.current||(xc=!0),!(134217727&Cc)&&!(134217727&zc)||null===gc||eu(gc,bc,Nc,!1)}function cu(e,t,n){var r=mc;mc|=2;var o=au(),i=su();gc===e&&bc===t||(Lc=null,ru(e,t)),t=!1;var a=Ec;e:for(;;)try{if(0!==vc&&null!==yc){var s=yc,l=wc;switch(vc){case 8:nu(),a=6;break e;case 3:case 2:case 9:case 6:null===Ii.current&&(t=!0);var c=vc;if(vc=0,wc=null,hu(e,s,l,c),n&&xc){a=0;break e}break;default:c=vc,vc=0,wc=null,hu(e,s,l,c)}}uu(),a=Ec;break}catch(u){ou(e,u)}return t&&e.shellSuspendCounter++,zo=Co=null,mc=r,F.H=o,F.A=i,null===yc&&(gc=null,bc=0,Pr()),a}function uu(){for(;null!==yc;)fu(yc)}function du(){for(;null!==yc&&!le();)fu(yc)}function fu(e){var t=ll(e.alternate,e,_c);e.memoizedProps=e.pendingProps,null===t?mu(e):yc=t}function pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Zs(n,t,t.pendingProps,t.type,void 0,bc);break;case 11:t=Zs(n,t,t.pendingProps,t.type.render,t.ref,bc);break;case 5:ca(t);default:yl(n,t),t=ll(n,t=yc=Hr(t,_c),_c)}e.memoizedProps=e.pendingProps,null===t?mu(e):yc=t}function hu(e,t,n,o){zo=Co=null,ca(t),ui=null,di=0;var i=t.return;try{if(function(e,t,n,o,i){if(n.flags|=32768,null!==o&&"object"==typeof o&&"function"==typeof o.then){if(null!==(t=n.alternate)&&Po(t,n,i,!0),null!==(n=Ii.current)){switch(n.tag){case 31:case 13:return null===Fi?lu():null===n.alternate&&0===Ec&&(Ec=3),n.flags&=-257,n.flags|=65536,n.lanes=i,o===ri?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([o]):t.add(o),Cu(e,o,i)),!1;case 22:return n.flags|=65536,o===ri?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([o]):n.add(o),Cu(e,o,i)),!1}throw Error(r(435,n.tag))}return Cu(e,o,i),lu(),!1}if(ho)return null!==(t=Ii.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,o!==yo&&_o(Gr(e=Error(r(422),{cause:o}),n))):(o!==yo&&_o(Gr(t=Error(r(423),{cause:o}),n)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,o=Gr(o,n),_i(e,i=Os(e.stateNode,o,i)),4!==Ec&&(Ec=2)),!1;var a=Error(r(520),{cause:o});if(a=Gr(a,n),null===Oc?Oc=[a]:Oc.push(a),4!==Ec&&(Ec=2),null===t)return!0;o=Gr(o,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,_i(n,e=Os(n.stateNode,o,e)),!1;case 1:if(t=n.type,a=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===a||"function"!=typeof a.componentDidCatch||null!==Dc&&Dc.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,js(i=Ps(i),e,n,o),_i(n,i),!1}n=n.return}while(null!==n);return!1}(e,i,t,n,bc))return Ec=1,Ns(e,Gr(n,e.current)),void(yc=null)}catch(a){if(null!==i)throw yc=i,a;return Ec=1,Ns(e,Gr(n,e.current)),void(yc=null)}32768&t.flags?(ho||1===o?e=!0:xc||536870912&bc?e=!1:(kc=e=!0,(2===o||9===o||3===o||6===o)&&(null!==(o=Ii.current)&&13===o.tag&&(o.flags|=16384))),gu(t,e)):mu(t)}function mu(e){var t=e;do{if(32768&t.flags)return void gu(t,kc);e=t.return;var n=ml(t.alternate,t,_c);if(null!==n)return void(yc=n);if(null!==(t=t.sibling))return void(yc=t);yc=t=e}while(null!==t);0===Ec&&(Ec=5)}function gu(e,t){do{var n=gl(e.alternate,e);if(null!==n)return n.flags&=32767,void(yc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(yc=e);yc=e=n}while(null!==e);Ec=6,yc=null}function yu(e,t,n,o,i,a,s,l,c){e.cancelPendingCommit=null;do{xu()}while(0!==Rc);if(6&mc)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(a=t.lanes|t.childLanes,function(e,t,n,r,o,i){var a=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,l=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var u=31-xe(n),d=1<<u;s[u]=0,l[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&Ie(e,r,0),0!==i&&0===o&&0!==e.tag&&(e.suspendedLanes|=i&~(a&~t))}(e,n,a|=Or,s,l,c),e===gc&&(yc=gc=null,bc=0),Bc=t,Uc=e,$c=n,Hc=a,Vc=i,qc=o,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,ae(he,function(){return Su(),null})):(e.callbackNode=null,e.callbackPriority=0),o=!!(13878&t.flags),13878&t.subtreeFlags||o){o=F.T,F.T=null,i=L.p,L.p=2,s=mc,mc|=4;try{!function(e,t){if(e=e.containerInfo,gd=xf,ar(e=ir(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(o&&0!==o.rangeCount){n=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{n.nodeType,a.nodeType}catch(g){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||0!==i&&3!==f.nodeType||(l=s+i),f!==a||0!==o&&3!==f.nodeType||(c=s+o),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(l=s),p===a&&++d===o&&(c=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yd={focusedElem:e,selectionRange:n},xf=!1,Il=t;null!==Il;)if(e=(t=Il).child,1028&t.subtreeFlags&&null!==e)e.return=t,Il=e;else for(;null!==Il;){switch(a=(t=Il).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(i=e[n]).ref.impl=i.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==a){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,o=n.stateNode;try{var m=Es(n.type,i);e=o.getSnapshotBeforeUpdate(m,a),o.__reactInternalSnapshotBeforeUpdate=e}catch(y){Eu(n,n.return,y)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Od(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Il=e;break}Il=t.return}}(e,t)}finally{mc=s,L.p=i,F.T=o}}Rc=1,bu(),vu(),wu()}}function bu(){if(1===Rc){Rc=0;var e=Uc,t=Bc,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=F.T,F.T=null;var r=L.p;L.p=2;var o=mc;mc|=4;try{Zl(t,e);var i=yd,a=ir(e.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&or(s.ownerDocument.documentElement,s)){if(null!==l&&ar(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,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(),h=s.textContent.length,m=Math.min(l.start,h),g=void 0===l.end?m:Math.min(l.end,h);!p.extend&&m>g&&(a=g,g=m,m=a);var y=rr(s,m),b=rr(s,g);if(y&&b&&(1!==p.rangeCount||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var v=d.createRange();v.setStart(y.node,y.offset),p.removeAllRanges(),m>g?(p.addRange(v),p.extend(b.node,b.offset)):(v.setEnd(b.node,b.offset),p.addRange(v))}}}}for(d=[],p=s;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var w=d[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}xf=!!gd,yd=gd=null}finally{mc=o,L.p=r,F.T=n}}e.current=t,Rc=2}}function vu(){if(2===Rc){Rc=0;var e=Uc,t=Bc,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=F.T,F.T=null;var r=L.p;L.p=2;var o=mc;mc|=4;try{Fl(e,t.alternate,t)}finally{mc=o,L.p=r,F.T=n}}Rc=3}}function wu(){if(4===Rc||3===Rc){Rc=0,ce();var e=Uc,t=Bc,n=$c,r=qc;10256&t.subtreeFlags||10256&t.flags?Rc=5:(Rc=0,Bc=Uc=null,ku(e,e.pendingLanes));var o=e.pendingLanes;if(0===o&&(Dc=null),Re(n),t=t.stateNode,we&&"function"==typeof we.onCommitFiberRoot)try{we.onCommitFiberRoot(ve,t,void 0,!(128&~t.current.flags))}catch(l){}if(null!==r){t=F.T,o=L.p,L.p=2,F.T=null;try{for(var i=e.onRecoverableError,a=0;a<r.length;a++){var s=r[a];i(s.value,{componentStack:s.stack})}}finally{F.T=t,L.p=o}}3&$c&&xu(),Lu(e),o=e.pendingLanes,261930&n&&42&o?e===Zc?Wc++:(Wc=0,Zc=e):Wc=0,Du(0)}}function ku(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Ho(t)))}function xu(){return bu(),vu(),wu(),Su()}function Su(){if(5!==Rc)return!1;var e=Uc,t=Hc;Hc=0;var n=Re($c),o=F.T,i=L.p;try{L.p=32>n?32:n,F.T=null,n=Vc,Vc=null;var a=Uc,s=$c;if(Rc=0,Bc=Uc=null,$c=0,6&mc)throw Error(r(331));var l=mc;if(mc|=4,uc(a.current),nc(a,a.current,s,n),mc=l,Du(0,!1),we&&"function"==typeof we.onPostCommitFiberRoot)try{we.onPostCommitFiberRoot(ve,a)}catch(c){}return!0}finally{L.p=i,F.T=o,ku(e,t)}}function _u(e,t,n){t=Gr(n,t),null!==(e=xi(e,t=Os(e.stateNode,t,2),2))&&(Me(e,2),Lu(e))}function Eu(e,t,n){if(3===e.tag)_u(e,e,n);else for(;null!==t;){if(3===t.tag){_u(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Dc||!Dc.has(r))){e=Gr(n,e),null!==(r=xi(t,n=Ps(2),2))&&(js(n,r,t,e),Me(r,2),Lu(r));break}}t=t.return}}function Cu(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hc;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(Sc=!0,o.add(n),e=zu.bind(null,e,t,n),t.then(e,e))}function zu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,gc===e&&(bc&n)===n&&(4===Ec||3===Ec&&(62914560&bc)===bc&&300>ue()-Mc?!(2&mc)&&ru(e,0):Ac|=n,Tc===bc&&(Tc=0)),Lu(e)}function Au(e,t){0===t&&(t=Pe()),null!==(e=Ir(e,t))&&(Me(e,t),Lu(e))}function Nu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Au(e,n)}function Tu(e,t){var n=0;switch(e.tag){case 31:case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==o&&o.delete(t),Au(e,n)}var Ou=null,Pu=null,ju=!1,Mu=!1,Iu=!1,Fu=0;function Lu(e){e!==Pu&&null===e.next&&(null===Pu?Ou=Pu=e:Pu=Pu.next=e),Mu=!0,ju||(ju=!0,Cd(function(){6&mc?ae(fe,Ru):Uu()}))}function Du(e,t){if(!Iu&&Mu){Iu=!0;do{for(var n=!1,r=Ou;null!==r;){if(0!==e){var o=r.pendingLanes;if(0===o)var i=0;else{var a=r.suspendedLanes,s=r.pingedLanes;i=(1<<31-xe(42|e)+1)-1,i=201326741&(i&=o&~(a&~s))?201326741&i|1:i?2|i:0}0!==i&&(n=!0,Hu(r,i))}else i=bc,!(3&(i=Ne(r,r===gc?i:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Te(r,i)||(n=!0,Hu(r,i));r=r.next}}while(n);Iu=!1}}function Ru(){Uu()}function Uu(){Mu=ju=!1;var e=0;0!==Fu&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==xd&&(xd=e,!0);return xd=null,!1}()&&(e=Fu);for(var t=ue(),n=null,r=Ou;null!==r;){var o=r.next,i=Bu(r,t);0===i?(r.next=null,null===n?Ou=o:n.next=o,null===o&&(Pu=n)):(n=r,(0!==e||3&i)&&(Mu=!0)),r=o}0!==Rc&&5!==Rc||Du(e),0!==Fu&&(Fu=0)}function Bu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=-62914561&e.pendingLanes;0<i;){var a=31-xe(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=Oe(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}if(n=bc,n=Ne(e,e===(t=gc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===vc||9===vc)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&se(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Te(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&se(r),Re(n)){case 2:case 8:n=pe;break;case 32:default:n=he;break;case 268435456:n=ge}return r=$u.bind(null,e),n=ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&se(r),e.callbackPriority=2,e.callbackNode=null,2}function $u(e,t){if(0!==Rc&&5!==Rc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xu()&&e.callbackNode!==n)return null;var r=bc;return 0===(r=Ne(e,e===gc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Yc(e,r,t),Bu(e,ue()),null!=e.callbackNode&&e.callbackNode===n?$u.bind(null,e):null)}function Hu(e,t){if(xu())return null;Yc(e,t,!0)}function Vu(){if(0===Fu){var e=Wo;0===e&&(e=Ee,!(261888&(Ee<<=1))&&(Ee=256)),Fu=e}return Fu}function qu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:jt(""+e)}function Wu(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Zu=0;Zu<Cr.length;Zu++){var Qu=Cr[Zu];zr(Qu.toLowerCase(),"on"+(Qu[0].toUpperCase()+Qu.slice(1)))}zr(br,"onAnimationEnd"),zr(vr,"onAnimationIteration"),zr(wr,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(kr,"onTransitionRun"),zr(xr,"onTransitionStart"),zr(Sr,"onTransitionCancel"),zr(_r,"onTransitionEnd"),at("onMouseEnter",["mouseout","mouseover"]),at("onMouseLeave",["mouseout","mouseover"]),at("onPointerEnter",["pointerout","pointerover"]),at("onPointerLeave",["pointerout","pointerover"]),it("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),it("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),it("onBeforeInput",["compositionend","keypress","textInput","paste"]),it("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),it("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),it("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ku="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(" "),Gu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ku));function Yu(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;i=s,o.currentTarget=c;try{i(o)}catch(u){Ar(u)}o.currentTarget=null,i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;i=s,o.currentTarget=c;try{i(o)}catch(u){Ar(u)}o.currentTarget=null,i=l}}}}function Ju(e,t){var n=t[We];void 0===n&&(n=t[We]=new Set);var r=e+"__bubble";n.has(r)||(nd(t,e,2,!1),n.add(r))}function Xu(e,t,n){var r=0;t&&(r|=4),nd(n,e,r,t)}var ed="_reactListening"+Math.random().toString(36).slice(2);function td(e){if(!e[ed]){e[ed]=!0,rt.forEach(function(t){"selectionchange"!==t&&(Gu.has(t)||Xu(t,!1,e),Xu(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[ed]||(t[ed]=!0,Xu("selectionchange",!1,t))}}function nd(e,t,n,r){switch(Nf(t)){case 2:var o=Sf;break;case 8:o=_f;break;default:o=Ef}n=o.bind(null,t,n,e),o=void 0,!Vt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function rd(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===o)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===o)return;s=s.return}for(;null!==l;){if(null===(s=Je(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){r=i=s;continue e}l=l.parentNode}}r=r.return}Bt(function(){var r=i,o=Ft(n),s=[];e:{var l=Er.get(e);if(void 0!==l){var c=on,u=e;switch(e){case"keypress":if(0===Gt(n))break e;case"keydown":case"keyup":c=wn;break;case"focusin":u="focus",c=dn;break;case"focusout":u="blur",c=dn;break;case"beforeblur":case"afterblur":c=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=un;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=xn;break;case br:case vr:case wr:c=fn;break;case _r:c=Sn;break;case"scroll":case"scrollend":c=sn;break;case"wheel":c=_n;break;case"copy":case"cut":case"paste":c=pn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kn;break;case"toggle":case"beforetoggle":c=En}var d=!!(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var g=m;if(h=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===h||null===p||null!=(g=$t(m,p))&&d.push(od(m,g,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,o),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===It||!(u=n.relatedTarget||n.fromElement)||!Je(u)&&!u[qe])&&(c||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?Je(u):null)&&(f=a(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=cn,g="onMouseLeave",p="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=kn,g="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:et(c),h=null==u?l:et(u),(l=new d(g,m+"leave",c,n,o)).target=f,l.relatedTarget=h,g=null,Je(o)===r&&((d=new d(p,m+"enter",u,n,o)).target=h,d.relatedTarget=f,g=d),f=g,c&&u)e:{for(d=ad,m=u,h=0,g=p=c;g;g=d(g))h++;g=0;for(var y=m;y;y=d(y))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break e}p=d(p),m=d(m)}d=null}else d=null;null!==c&&sd(s,l,c,d,!1),null!==u&&null!==f&&sd(s,f,u,d,!0)}if("select"===(c=(l=r?et(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var b=Hn;else if(Ln(l))if(Vn)b=Xn;else{b=Yn;var v=Gn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&Tt(r.elementType)&&(b=Hn):b=Jn;switch(b&&(b=b(e,r))?Dn(s,b,n,o):(v&&v(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&xt(l,"number",l.value)),v=r?et(r):window,e){case"focusin":(Ln(v)||"true"===v.contentEditable)&&(lr=v,cr=r,ur=null);break;case"focusout":ur=cr=lr=null;break;case"mousedown":dr=!0;break;case"contextmenu":case"mouseup":case"dragend":dr=!1,fr(s,n,o);break;case"selectionchange":if(sr)break;case"keydown":case"keyup":fr(s,n,o)}var w;if(zn)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else In?jn(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(Tn&&"ko"!==n.locale&&(In||"onCompositionStart"!==k?"onCompositionEnd"===k&&In&&(w=Kt()):(Zt="value"in(Wt=o)?Wt.value:Wt.textContent,In=!0)),0<(v=id(r,k)).length&&(k=new hn(k,e,null,n,o),s.push({event:k,listeners:v}),w?k.data=w:null!==(w=Mn(n))&&(k.data=w))),(w=Nn?function(e,t){switch(e){case"compositionend":return Mn(t);case"keypress":return 32!==t.which?null:(Pn=!0,On);case"textInput":return(e=t.data)===On&&Pn?null:e;default:return null}}(e,n):function(e,t){if(In)return"compositionend"===e||!zn&&jn(e,t)?(e=Kt(),Qt=Zt=Wt=null,In=!1,e):null;switch(e){case"paste":default: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 Tn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(k=id(r,"onBeforeInput")).length&&(v=new hn("onBeforeInput","beforeinput",null,n,o),s.push({event:v,listeners:k}),v.data=w)),function(e,t,n,r,o){if("submit"===t&&n&&n.stateNode===o){var i=qu((o[Ve]||null).action),a=r.submitter;a&&null!==(t=(t=a[Ve]||null)?qu(t.formAction):a.getAttribute("formAction"))&&(i=t,a=null);var s=new on("action","action",null,r,o);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Fu){var e=a?Wu(o,a):new FormData(o);rs(n,{pending:!0,data:e,method:o.method,action:i},null,e)}}else"function"==typeof i&&(s.preventDefault(),e=a?Wu(o,a):new FormData(o),rs(n,{pending:!0,data:e,method:o.method,action:i},i,e))},currentTarget:o}]})}}(s,e,r,n,o)}Yu(s,t)})}function od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function id(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;if(5!==(o=o.tag)&&26!==o&&27!==o||null===i||(null!=(o=$t(e,n))&&r.unshift(od(e,o,i)),null!=(o=$t(e,t))&&r.push(od(e,o,i))),3===e.tag)return r;e=e.return}return[]}function ad(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function sd(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===r)break;5!==s&&26!==s&&27!==s||null===c||(l=c,o?null!=(c=$t(n,i))&&a.unshift(od(n,c,l)):o||null!=(c=$t(n,i))&&a.push(od(n,c,l))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var ld=/\r\n?/g,cd=/\u0000|\uFFFD/g;function ud(e){return("string"==typeof e?e:""+e).replace(ld,"\n").replace(cd,"")}function dd(e,t){return t=ud(t),ud(e)===t}function fd(e,t,n,o,i,a){switch(n){case"children":"string"==typeof o?"body"===t||"textarea"===t&&""===o||Ct(e,o):("number"==typeof o||"bigint"==typeof o)&&"body"!==t&&Ct(e,""+o);break;case"className":dt(e,"class",o);break;case"tabIndex":dt(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,o);break;case"style":Nt(e,o,a);break;case"data":if("object"!==t){dt(e,"data",o);break}case"src":case"href":if(""===o&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==o||"function"==typeof o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(n);break}o=jt(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if("function"==typeof o){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("function"==typeof a&&("formAction"===n?("input"!==t&&fd(e,t,"name",i.name,i,null),fd(e,t,"formEncType",i.formEncType,i,null),fd(e,t,"formMethod",i.formMethod,i,null),fd(e,t,"formTarget",i.formTarget,i,null)):(fd(e,t,"encType",i.encType,i,null),fd(e,t,"method",i.method,i,null),fd(e,t,"target",i.target,i,null))),null==o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(n);break}o=jt(""+o),e.setAttribute(n,o);break;case"onClick":null!=o&&(e.onclick=Mt);break;case"onScroll":null!=o&&Ju("scroll",e);break;case"onScrollEnd":null!=o&&Ju("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(r(61));if(null!=(n=o.__html)){if(null!=i.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"muted":e.muted=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==o||"function"==typeof o||"boolean"==typeof o||"symbol"==typeof o){e.removeAttribute("xlink:href");break}n=jt(""+o),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":null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===o?e.setAttribute(n,""):!1!==o&&null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":null==o||"function"==typeof o||"symbol"==typeof o||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":Ju("beforetoggle",e),Ju("toggle",e),ut(e,"popover",o);break;case"xlinkActuate":ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ft(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ft(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ft(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ft(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ut(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ut(e,n=Ot.get(n)||n,o)}}function pd(e,t,n,o,i,a){switch(n){case"style":Nt(e,o,a);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(r(61));if(null!=(n=o.__html)){if(null!=i.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof o?Ct(e,o):("number"==typeof o||"bigint"==typeof o)&&Ct(e,""+o);break;case"onScroll":null!=o&&Ju("scroll",e);break;case"onScrollEnd":null!=o&&Ju("scrollend",e);break;case"onClick":null!=o&&(e.onclick=Mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:ot.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),"function"==typeof(a=null!=(a=e[Ve]||null)?a[n]:null)&&e.removeEventListener(t,a,i),"function"!=typeof o)?n in e?e[n]=o:!0===o?e.setAttribute(n,""):ut(e,n,o):("function"!=typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,i)))}}function hd(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ju("error",e),Ju("load",e);var o,i=!1,a=!1;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(null!=s)switch(o){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:fd(e,t,o,s,n,null)}}return a&&fd(e,t,"srcSet",n.srcSet,n,null),void(i&&fd(e,t,"src",n.src,n,null));case"input":Ju("invalid",e);var l=o=s=a=null,c=null,u=null;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(null!=d)switch(i){case"name":a=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:fd(e,t,i,d,n,null)}}return void kt(e,o,l,c,u,s,a,!1);case"select":for(a in Ju("invalid",e),i=s=o=null,n)if(n.hasOwnProperty(a)&&null!=(l=n[a]))switch(a){case"value":o=l;break;case"defaultValue":s=l;break;case"multiple":i=l;default:fd(e,t,a,l,n,null)}return t=o,n=s,e.multiple=!!i,void(null!=t?St(e,!!i,t,!1):null!=n&&St(e,!!i,n,!0));case"textarea":for(s in Ju("invalid",e),o=a=i=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":i=l;break;case"defaultValue":a=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(r(91));break;default:fd(e,t,s,l,n,null)}return void Et(e,i,a,o);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(i=n[c]))if("selected"===c)e.selected=i&&"function"!=typeof i&&"symbol"!=typeof i;else fd(e,t,c,i,n,null);return;case"dialog":Ju("beforetoggle",e),Ju("toggle",e),Ju("cancel",e),Ju("close",e);break;case"iframe":case"object":Ju("load",e);break;case"video":case"audio":for(i=0;i<Ku.length;i++)Ju(Ku[i],e);break;case"image":Ju("error",e),Ju("load",e);break;case"details":Ju("toggle",e);break;case"embed":case"source":case"link":Ju("error",e),Ju("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)&&null!=(i=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:fd(e,t,u,i,n,null)}return;default:if(Tt(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(i=n[d])&&pd(e,t,d,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(i=n[l])&&fd(e,t,l,i,n,null))}function md(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var gd=null,yd=null;function bd(e){return 9===e.nodeType?e:e.ownerDocument}function vd(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 wd(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function kd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var xd=null;var Sd="function"==typeof setTimeout?setTimeout:void 0,_d="function"==typeof clearTimeout?clearTimeout:void 0,Ed="function"==typeof Promise?Promise:void 0,Cd="function"==typeof queueMicrotask?queueMicrotask:void 0!==Ed?function(e){return Ed.resolve(null).then(e).catch(zd)}:Sd;function zd(e){setTimeout(function(){throw e})}function Ad(e){return"head"===e}function Nd(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)||"/&"===n){if(0===r)return e.removeChild(o),void Zf(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)Ud(e.ownerDocument.documentElement);else if("head"===n){Ud(n=e.ownerDocument.head);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[Ge]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===i.rel.toLowerCase()||n.removeChild(i),i=a}}else"body"===n&&Ud(e.ownerDocument.body);n=o}while(n);Zf(t)}function Td(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Od(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Od(n),Ye(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Pd(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Id(e.nextSibling)))return null}return e}function jd(e){return"$?"===e.data||"$~"===e.data}function Md(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Id(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Fd=null;function Ld(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Id(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Dd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function Rd(e,t,n){switch(t=bd(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function Ud(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ye(e)}var Bd=new Map,$d=new Set;function Hd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Vd=L.d;L.d={f:function(){var e=Vd.f(),t=tu();return e||t},r:function(e){var t=Xe(e);null!==t&&5===t.tag&&"form"===t.type?is(t):Vd.r(e)},D:function(e){Vd.D(e),Wd("dns-prefetch",e,null)},C:function(e,t){Vd.C(e,t),Wd("preconnect",e,t)},L:function(e,t,n){Vd.L(e,t,n);var r=qd;if(r&&e&&t){var o='link[rel="preload"][as="'+vt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(o+='[imagesrcset="'+vt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(o+='[imagesizes="'+vt(n.imageSizes)+'"]')):o+='[href="'+vt(e)+'"]';var i=o;switch(t){case"style":i=Qd(e);break;case"script":i=Yd(e)}Bd.has(i)||(e=f({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Bd.set(i,e),null!==r.querySelector(o)||"style"===t&&r.querySelector(Kd(i))||"script"===t&&r.querySelector(Jd(i))||(hd(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}},m:function(e,t){Vd.m(e,t);var n=qd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",o='link[rel="modulepreload"][as="'+vt(r)+'"][href="'+vt(e)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Yd(e)}if(!Bd.has(i)&&(e=f({rel:"modulepreload",href:e},t),Bd.set(i,e),null===n.querySelector(o))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Jd(i)))return}hd(r=n.createElement("link"),"link",e),nt(r),n.head.appendChild(r)}}},X:function(e,t){Vd.X(e,t);var n=qd;if(n&&e){var r=tt(n).hoistableScripts,o=Yd(e),i=r.get(o);i||((i=n.querySelector(Jd(o)))||(e=f({src:e,async:!0},t),(t=Bd.get(o))&&nf(e,t),nt(i=n.createElement("script")),hd(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}},S:function(e,t,n){Vd.S(e,t,n);var r=qd;if(r&&e){var o=tt(r).hoistableStyles,i=Qd(e);t=t||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Kd(i)))s.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bd.get(i))&&tf(e,n);var l=a=r.createElement("link");nt(l),hd(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,ef(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}},M:function(e,t){Vd.M(e,t);var n=qd;if(n&&e){var r=tt(n).hoistableScripts,o=Yd(e),i=r.get(o);i||((i=n.querySelector(Jd(o)))||(e=f({src:e,async:!0,type:"module"},t),(t=Bd.get(o))&&nf(e,t),nt(i=n.createElement("script")),hd(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}};var qd="undefined"==typeof document?null:document;function Wd(e,t,n){var r=qd;if(r&&"string"==typeof t&&t){var o=vt(t);o='link[rel="'+e+'"][href="'+o+'"]',"string"==typeof n&&(o+='[crossorigin="'+n+'"]'),$d.has(o)||($d.add(o),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(o)&&(hd(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}}function Zd(e,t,n,o){var i,a,s,l,c=(c=Q.current)?Hd(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Qd(n.href),(o=(n=tt(c).hoistableStyles).get(t))||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Qd(n.href);var u=tt(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Kd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Bd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bd.set(e,n),u||(i=c,a=e,s=n,l=d.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=i.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),hd(a,"link",s),nt(a),i.head.appendChild(a))))),t&&null===o)throw Error(r(528,""));return d}if(t&&null!==o)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Yd(n),(o=(n=tt(c).hoistableScripts).get(t))||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Qd(e){return'href="'+vt(e)+'"'}function Kd(e){return'link[rel="stylesheet"]['+e+"]"}function Gd(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Yd(e){return'[src="'+vt(e)+'"]'}function Jd(e){return"script[async]"+e}function Xd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+vt(n.href)+'"]');if(o)return t.instance=o,nt(o),o;var i=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return nt(o=(e.ownerDocument||e).createElement("style")),hd(o,"style",i),ef(o,n.precedence,e),t.instance=o;case"stylesheet":i=Qd(n.href);var a=e.querySelector(Kd(i));if(a)return t.state.loading|=4,t.instance=a,nt(a),a;o=Gd(n),(i=Bd.get(i))&&tf(o,i),nt(a=(e.ownerDocument||e).createElement("link"));var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),hd(a,"link",o),t.state.loading|=4,ef(a,n.precedence,e),t.instance=a;case"script":return a=Yd(n.src),(i=e.querySelector(Jd(a)))?(t.instance=i,nt(i),i):(o=n,(i=Bd.get(a))&&nf(o=f({},n),i),nt(i=(e=e.ownerDocument||e).createElement("script")),hd(i,"link",o),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(o=t.instance,t.state.loading|=4,ef(o,n.precedence,e));return t.instance}function ef(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,i=o,a=0;a<r.length;a++){var s=r[a];if(s.dataset.precedence===t)i=s;else if(i!==o)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function tf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function nf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var rf=null;function of(e,t,n){if(null===rf){var r=new Map,o=rf=new Map;o.set(n,r)}else(r=(o=rf).get(n))||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var i=n[o];if(!(i[Ge]||i[He]||"link"===e&&"stylesheet"===i.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==i.namespaceURI){var a=i.getAttribute(t)||"";a=e+a;var s=r.get(a);s?s.push(i):r.set(a,[i])}}return r}function af(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function sf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var lf=0;function cf(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)df(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var uf=null;function df(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,uf=new Map,t.forEach(ff,e),uf=null,cf.call(e))}function ff(e,t){if(!(4&t.state.loading)){var n=uf.get(e);if(n)var r=n.get(null);else{n=new Map,uf.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var a=o[i];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}a=(o=t.instance).getAttribute("data-precedence"),(i=n.get(a)||r)===r&&n.set(null,o),n.set(a,o),this.count++,r=cf.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(o,e.firstChild),t.state.loading|=4}}var pf={$$typeof:S,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function hf(e,t,n,r,o,i,a,s,l){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=je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=je(0),this.hiddenUpdates=je(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function mf(e,t,n,r,o,i,a,s,l,c,u,d){return e=new hf(e,t,n,a,l,c,u,d,s),t=1,!0===i&&(t|=24),i=Ur(3,null,null,t),e.current=i,i.stateNode=e,(t=$o()).refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},vi(i),e}function gf(e){return e?e=Dr:Dr}function yf(e,t,n,r,o,i){o=gf(o),null===r.context?r.context=o:r.pendingContext=o,(r=ki(t)).payload={element:n},null!==(i=void 0===i?null:i)&&(r.callback=i),null!==(n=xi(e,r,t))&&(Gc(n,0,t),Si(n,e,t))}function bf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function vf(e,t){bf(e,t),(e=e.alternate)&&bf(e,t)}function wf(e){if(13===e.tag||31===e.tag){var t=Ir(e,67108864);null!==t&&Gc(t,0,67108864),vf(e,67108864)}}function kf(e){if(13===e.tag||31===e.tag){var t=Qc(),n=Ir(e,t=De(t));null!==n&&Gc(n,0,t),vf(e,t)}}var xf=!0;function Sf(e,t,n,r){var o=F.T;F.T=null;var i=L.p;try{L.p=2,Ef(e,t,n,r)}finally{L.p=i,F.T=o}}function _f(e,t,n,r){var o=F.T;F.T=null;var i=L.p;try{L.p=8,Ef(e,t,n,r)}finally{L.p=i,F.T=o}}function Ef(e,t,n,r){if(xf){var o=Cf(r);if(null===o)rd(e,t,r,zf,n),Df(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Of=Rf(Of,e,t,n,r,o),!0;case"dragenter":return Pf=Rf(Pf,e,t,n,r,o),!0;case"mouseover":return jf=Rf(jf,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Mf.set(i,Rf(Mf.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,If.set(i,Rf(If.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Df(e,r),4&t&&-1<Lf.indexOf(e)){for(;null!==o;){var i=Xe(o);if(null!==i)switch(i.tag){case 3:if((i=i.stateNode).current.memoizedState.isDehydrated){var a=Ae(i.pendingLanes);if(0!==a){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-xe(a);s.entanglements[1]|=l,a&=~l}Lu(i),!(6&mc)&&(Fc=ue()+500,Du(0))}}break;case 31:case 13:null!==(s=Ir(i,2))&&Gc(s,0,2),tu(),vf(i,2)}if(null===(i=Cf(r))&&rd(e,t,r,zf,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else rd(e,t,r,null,n)}}function Cf(e){return Af(e=Ft(e))}var zf=null;function Af(e){if(zf=null,null!==(e=Je(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=s(t)))return e;e=null}else if(31===n){if(null!==(e=c(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zf=e,null}function Nf(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"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case fe:return 2;case pe:return 8;case he:case me:return 32;case ge:return 268435456;default:return 32}default:return 32}}var Tf=!1,Of=null,Pf=null,jf=null,Mf=new Map,If=new Map,Ff=[],Lf="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 Df(e,t){switch(e){case"focusin":case"focusout":Of=null;break;case"dragenter":case"dragleave":Pf=null;break;case"mouseover":case"mouseout":jf=null;break;case"pointerover":case"pointerout":Mf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":If.delete(t.pointerId)}}function Rf(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=Xe(t))&&wf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Uf(e){var t=Je(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=s(n)))return e.blockedOn=t,void Be(e.priority,function(){kf(n)})}else if(31===t){if(null!==(t=c(n)))return e.blockedOn=t,void Be(e.priority,function(){kf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cf(e.nativeEvent);if(null!==n)return null!==(t=Xe(n))&&wf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);It=r,n.target.dispatchEvent(r),It=null,t.shift()}return!0}function $f(e,t,n){Bf(e)&&n.delete(t)}function Hf(){Tf=!1,null!==Of&&Bf(Of)&&(Of=null),null!==Pf&&Bf(Pf)&&(Pf=null),null!==jf&&Bf(jf)&&(jf=null),Mf.forEach($f),If.forEach($f)}function Vf(t,n){t.blockedOn===n&&(t.blockedOn=null,Tf||(Tf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Hf)))}var qf=null;function Wf(t){qf!==t&&(qf=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qf===t&&(qf=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],o=t[e+2];if("function"!=typeof r){if(null===Af(r||n))continue;break}var i=Xe(n);null!==i&&(t.splice(e,3),e-=3,rs(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Zf(e){function t(t){return Vf(t,e)}null!==Of&&Vf(Of,e),null!==Pf&&Vf(Pf,e),null!==jf&&Vf(jf,e),Mf.forEach(t),If.forEach(t);for(var n=0;n<Ff.length;n++){var r=Ff[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ff.length&&null===(n=Ff[0]).blockedOn;)Uf(n),null===n.blockedOn&&Ff.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var o=n[r],i=n[r+1],a=o[Ve]||null;if("function"==typeof i)a||Wf(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[Ve]||null)s=a.formAction;else if(null!==Af(o))continue}else s=a.action;"function"==typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Wf(n)}}}function Qf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return o=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==o&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,o=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),null!==o&&(o(),o=null)}}}function Kf(e){this._internalRoot=e}function Gf(e){this._internalRoot=e}Gf.prototype.render=Kf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));yf(t.current,Qc(),e,t,null,null)},Gf.prototype.unmount=Kf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;yf(e.current,2,null,e,null,null),tu(),t[qe]=null}},Gf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ue();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ff.length&&0!==t&&t<Ff[n].priority;n++);Ff.splice(n,0,e),0===n&&Uf(e)}};var Yf=t.version;if("19.2.3"!==Yf)throw Error(r(527,Yf,"19.2.3"));L.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,o=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(o=i.return)){n=o;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return u(i),e;if(s===o)return u(i),t;s=s.sibling}throw Error(r(188))}if(n.return!==o.return)n=i,o=s;else{for(var l=!1,c=i.child;c;){if(c===n){l=!0,n=i,o=s;break}if(c===o){l=!0,o=i,n=s;break}c=c.sibling}if(!l){for(c=s.child;c;){if(c===n){l=!0,n=s,o=i;break}if(c===o){l=!0,o=s,n=i;break}c=c.sibling}if(!l)throw Error(r(189))}}if(n.alternate!==o)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?d(e):null)?null:e.stateNode};var Jf={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xf.isDisabled&&Xf.supportsFiber)try{ve=Xf.inject(Jf),we=Xf}catch(ep){}}return i.createRoot=function(e,t){if(!o(e))throw Error(r(299));var n=!1,i="",a=Cs,s=zs,l=As;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onUncaughtError&&(a=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=mf(e,1,!1,null,0,n,i,null,a,s,l,Qf),e[qe]=t.current,td(e),new Kf(t)},i.hydrateRoot=function(e,t,n){if(!o(e))throw Error(r(299));var i=!1,a="",s=Cs,l=zs,c=As,u=null;return null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.formState&&(u=n.formState)),(t=mf(e,1,!0,t,0,i,a,u,s,l,c,Qf)).context=gf(null),n=t.current,(a=ki(i=De(i=Qc()))).callback=null,xi(n,a,i),n=i,t.current.lanes=n,Me(t,n),Lu(t),e[qe]=t.current,td(e),new Gf(t)},i.version="19.2.3",i}var _=(b||(b=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),o.exports=S()),o.exports),E=h();const C=t(E);var z,A,N={exports:{}},T={};var O=(A||(A=1,N.exports=function(){if(z)return T;z=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return T.Fragment=t,T.jsx=n,T.jsxs=n,T}()),N.exports);const P={es:{online:"En línea",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Con ❤️ por BotUyo",preview:"Vista previa",fotos:"Fotos",ubicacion:"Ubicación",input_placeholder:"Escribe un mensaje...",send:"Enviar",attach_photo:"Adjuntar foto",attach_location:"Compartir ubicación",recording:"Grabando...",rate_limit_exceeded:"Has enviado demasiados mensajes. Espera un momento.",connection_error:"Error de conexión",file_too_large:"Archivo demasiado grande",invalid_file:"Tipo de archivo no válido",extracted:{assistant:"Asistente",anterior:"Anterior",siguiente:"Siguiente",cerrar:"Cerrar",cerrar_chat:"Cerrar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver ubicación"},accessibility:{closeChat:"Cerrar ventana de chat",closeChatHint:"Presiona Escape para cerrar",chatMessages:"Mensajes del chat",messageHistory:"Historial de mensajes",dialogDescription:"Ventana de chat con {{botName}}. Presiona Escape para cerrar. Usa Ctrl+Enter para enviar mensajes.",sendMessage:"Enviar mensaje",sendMessageHint:"Presiona Enter o Ctrl+Enter para enviar",typeMessage:"Escribe tu mensaje aquí",botMessage:"Mensaje del asistente",userMessage:"Tu mensaje",messageFrom:"Mensaje de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nuevo mensaje recibido"}},en:{online:"Online",offline:"Offline",connecting:"Connecting...",con_amor_paseo_libre:"With ❤️ by BotUyo",preview:"Preview",fotos:"Photos",ubicacion:"Location",input_placeholder:"Type a message...",send:"Send",attach_photo:"Attach photo",attach_location:"Share location",recording:"Recording...",rate_limit_exceeded:"You have sent too many messages. Please wait.",connection_error:"Connection error",file_too_large:"File too large",invalid_file:"Invalid file type",extracted:{assistant:"Assistant",anterior:"Previous",siguiente:"Next",cerrar:"Close",cerrar_chat:"Close chat",abrir_chat:"Open chat",ver_ubicacion:"View location"},accessibility:{closeChat:"Close chat window",closeChatHint:"Press Escape to close",chatMessages:"Chat messages",messageHistory:"Message history",dialogDescription:"Chat window with {{botName}}. Press Escape to close. Use Ctrl+Enter to send messages.",sendMessage:"Send message",sendMessageHint:"Press Enter or Ctrl+Enter to send",typeMessage:"Type your message here",botMessage:"Assistant message",userMessage:"Your message",messageFrom:"Message from {{sender}}",messageTime:"Sent {{time}}",newMessage:"New message received"}},pt:{online:"Online",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Com ❤️ por BotUyo",preview:"Visualizar",fotos:"Fotos",ubicacion:"Localização",input_placeholder:"Digite uma mensagem...",send:"Enviar",attach_photo:"Anexar foto",attach_location:"Compartilhar localização",recording:"Gravando...",rate_limit_exceeded:"Você enviou muitas mensagens. Aguarde um momento.",connection_error:"Erro de conexão",file_too_large:"Arquivo muito grande",invalid_file:"Tipo de arquivo inválido",extracted:{assistant:"Assistente",anterior:"Anterior",siguiente:"Próximo",cerrar:"Fechar",cerrar_chat:"Fechar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver localização"},accessibility:{closeChat:"Fechar janela de chat",closeChatHint:"Pressione Escape para fechar",chatMessages:"Mensagens do chat",messageHistory:"Histórico de mensagens",dialogDescription:"Janela de chat com {{botName}}. Pressione Escape para fechar. Use Ctrl+Enter para enviar mensagens.",sendMessage:"Enviar mensagem",sendMessageHint:"Pressione Enter ou Ctrl+Enter para enviar",typeMessage:"Digite sua mensagem aqui",botMessage:"Mensagem do assistente",userMessage:"Sua mensagem",messageFrom:"Mensagem de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nova mensagem recebida"}},fr:{online:"En ligne",offline:"Déconnecté",connecting:"Connexion...",con_amor_paseo_libre:"Avec ❤️ par BotUyo",preview:"Aperçu",fotos:"Photos",ubicacion:"Emplacement",input_placeholder:"Tapez un message...",send:"Envoyer",attach_photo:"Joindre une photo",attach_location:"Partager la localisation",recording:"Enregistrement...",rate_limit_exceeded:"Vous avez envoyé trop de messages. Veuillez patienter.",connection_error:"Erreur de connexion",file_too_large:"Fichier trop volumineux",invalid_file:"Type de fichier invalide",extracted:{assistant:"Assistant",anterior:"Précédent",siguiente:"Suivant",cerrar:"Fermer",cerrar_chat:"Fermer le chat",abrir_chat:"Ouvrir le chat",ver_ubicacion:"Voir l'emplacement"},accessibility:{closeChat:"Fermer la fenêtre de chat",closeChatHint:"Appuyez sur Échap pour fermer",chatMessages:"Messages du chat",messageHistory:"Historique des messages",dialogDescription:"Fenêtre de chat avec {{botName}}. Appuyez sur Échap pour fermer. Utilisez Ctrl+Entrée pour envoyer des messages.",sendMessage:"Envoyer un message",sendMessageHint:"Appuyez sur Entrée ou Ctrl+Entrée pour envoyer",typeMessage:"Tapez votre message ici",botMessage:"Message de l'assistant",userMessage:"Votre message",messageFrom:"Message de {{sender}}",messageTime:"Envoyé {{time}}",newMessage:"Nouveau message reçu"}}};function j(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return P[e]?e:"es"}const M=E.createContext(void 0),I="botuyo-chat-locale";function F({children:e,defaultLocale:t}){const[n,r]=E.useState(()=>{if(t)return t;if("undefined"!=typeof window){const e=localStorage.getItem(I);if(e)return e}return j()});return E.useEffect(()=>{if("undefined"==typeof window||t)return;const e=()=>{localStorage.getItem(I)||r(j())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[t]),O.jsx(M.Provider,{value:{locale:n,setLocale:e=>{["es","en","pt","fr"].includes(e)?(r(e),"undefined"!=typeof window&&localStorage.setItem(I,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${n}"`)}},children:e})}function L(){const e=E.useContext(M);if(void 0===e)throw new Error("useLanguage debe usarse dentro de un LanguageProvider");return e}function D(e){const{locale:t,setLocale:n}=L();return{t:E.useCallback(n=>{const r=e?`${e}.${n}`:n,o=(i=P[t],(a=r).split(".").reduce((e,t)=>e?.[t],i)||a);var i,a;return o||n},[t,e]),setLocale:n,currentLocale:t}}const R=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),U=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var B={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const $=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},H=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>E.createElement("svg",{ref:l,...B,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:R("lucide",o),...!i&&!$(s)&&{"aria-hidden":"true"},...s},[...a.map(([e,t])=>E.createElement(e,t)),...Array.isArray(i)?i:[i]])),V=(e,t)=>{const n=E.forwardRef(({className:n,...r},o)=>{return E.createElement(H,{ref:o,iconNode:t,className:R(`lucide-${i=U(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var i});return n.displayName=U(e),n},q=V("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),W=V("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Z=V("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Q=V("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),K=V("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),G=V("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Y=V("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),J=V("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),X=V("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),ee=V("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),te=V("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ne=V("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),re=V("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]),oe=V("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),ie=V("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),ae=V("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),se=V("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),le=V("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),ce=V("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),ue=V("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),de=V("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),fe=V("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),pe=V("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),he=V("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),me=V("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),ge=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ye=V("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function be(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=be(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const ve=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),we="-",ke=[],xe=e=>{const t=Ee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return _e(e);const n=e.split(we),r=""===n[0]&&n.length>1?1:0;return Se(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],o=n[e];return t?o?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(o,t):t:o||ke}return n[e]||ke}}},Se=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const n=Se(e,t+1,o);if(n)return n}const i=n.validators;if(null===i)return;const a=0===t?e.join(we):e.slice(t).join(we),s=i.length;for(let l=0;l<s;l++){const e=i[l];if(e.validator(a))return e.classGroupId}},_e=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),Ee=e=>{const{theme:t,classGroups:n}=e;return Ce(n,t)},Ce=(e,t)=>{const n=ve();for(const r in e){const o=e[r];ze(o,n,r,t)}return n},ze=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];Ae(o,t,n,r)}},Ae=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?Oe(e,t,n,r):Te(e,t,n,r):Ne(e,t,n)},Ne=(e,t,n)=>{(""===e?t:Pe(t,e)).classGroupId=n},Te=(e,t,n,r)=>{je(e)?ze(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},Oe=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let a=0;a<i;a++){const[e,i]=o[a];ze(i,Pe(t,e),n,r)}},Pe=(e,t)=>{let n=e;const r=t.split(we),o=r.length;for(let i=0;i<o;i++){const e=r[i];let t=n.nextPart.get(e);t||(t=ve(),n.nextPart.set(e,t)),n=t}return n},je=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Me=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}},Ie=[],Fe=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Le=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,i=0;const a=e.length;for(let u=0;u<a;u++){const a=e[u];if(0===r&&0===o){if(":"===a){t.push(e.slice(i,u)),i=u+1;continue}if("/"===a){n=u;continue}}"["===a?r++:"]"===a?r--:"("===a?o++:")"===a&&o--}const s=0===t.length?e:e.slice(i);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return Fe(t,c,l,n&&n>i?n-i:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Fe(Ie,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},De=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let o=0;o<e.length;o++){const i=e[o],a="["===i[0],s=t.has(i);a||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},Re=/\s+/,Ue=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ue(e[r]))&&(n&&(n+=" "),n+=t);return n},Be=(e,...t)=>{let n,r,o,i;const a=e=>{const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(Re);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=e+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=e+(l.length>0?" "+l:l);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:i(u).join(":"),y=d?g+"!":g,b=y+m;if(a.indexOf(b)>-1)continue;a.push(b);const v=o(m,h);for(let n=0;n<v.length;++n){const e=v[n];a.push(y+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return o(e,i),i};return i=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Me(e.cacheSize),parseClassName:Le(e),sortModifiers:De(e),...xe(e)}))(l),r=n.cache.get,o=n.cache.set,i=a,a(s)},(...e)=>i(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=Ue(t))&&(o&&(o+=" "),o+=n);return o})(...e))},$e=[],He=e=>{const t=t=>t[e]||$e;return t.isThemeGetter=!0,t},Ve=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,We=/^\d+\/\d+$/,Ze=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ke=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ge=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Je=e=>We.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),et=e=>!!e&&Number.isInteger(Number(e)),tt=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),nt=e=>Ze.test(e),rt=()=>!0,ot=e=>Qe.test(e)&&!Ke.test(e),it=()=>!1,at=e=>Ge.test(e),st=e=>Ye.test(e),lt=e=>!ut(e)&&!gt(e),ct=e=>St(e,zt,it),ut=e=>Ve.test(e),dt=e=>St(e,At,ot),ft=e=>St(e,Nt,Xe),pt=e=>St(e,Et,it),ht=e=>St(e,Ct,st),mt=e=>St(e,Ot,at),gt=e=>qe.test(e),yt=e=>_t(e,At),bt=e=>_t(e,Tt),vt=e=>_t(e,Et),wt=e=>_t(e,zt),kt=e=>_t(e,Ct),xt=e=>_t(e,Ot,!0),St=(e,t,n)=>{const r=Ve.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},_t=(e,t,n=!1)=>{const r=qe.exec(e);return!!r&&(r[1]?t(r[1]):n)},Et=e=>"position"===e||"percentage"===e,Ct=e=>"image"===e||"url"===e,zt=e=>"length"===e||"size"===e||"bg-size"===e,At=e=>"length"===e,Nt=e=>"number"===e,Tt=e=>"family-name"===e,Ot=e=>"shadow"===e,Pt=Be(()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),a=He("breakpoint"),s=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),d=He("inset-shadow"),f=He("text-shadow"),p=He("drop-shadow"),h=He("blur"),m=He("perspective"),g=He("aspect"),y=He("ease"),b=He("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",gt,ut],w=()=>[gt,ut,l],k=()=>[Je,"full","auto",...w()],x=()=>[et,"none","subgrid",gt,ut],S=()=>["auto",{span:["full",et,gt,ut]},et,gt,ut],_=()=>[et,"auto",gt,ut],E=()=>["auto","min","max","fr",gt,ut],C=()=>["auto",...w()],z=()=>[Je,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],A=()=>[e,gt,ut],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",vt,pt,{position:[gt,ut]}],T=()=>["auto","cover","contain",wt,ct,{size:[gt,ut]}],O=()=>[tt,yt,dt],P=()=>["","none","full",c,gt,ut],j=()=>["",Xe,yt,dt],M=()=>[Xe,tt,vt,pt],I=()=>["","none",h,gt,ut],F=()=>["none",Xe,gt,ut],L=()=>["none",Xe,gt,ut],D=()=>[Xe,gt,ut],R=()=>[Je,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nt],breakpoint:[nt],color:[rt],container:[nt],"drop-shadow":[nt],ease:["in","out","in-out"],font:[lt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nt],shadow:[nt],spacing:["px",Xe],text:[nt],"text-shadow":[nt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Je,ut,gt,g]}],container:["container"],columns:[{columns:[Xe,ut,gt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[et,"auto",gt,ut]}],basis:[{basis:[Je,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Je,"auto","initial","none",ut]}],grow:[{grow:["",Xe,gt,ut]}],shrink:[{shrink:["",Xe,gt,ut]}],order:[{order:[et,"first","last","none",gt,ut]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[s,"screen",...z()]}],"min-w":[{"min-w":[s,"screen","none",...z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,yt,dt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,gt,ft]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tt,ut]}],"font-family":[{font:[bt,ut,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,gt,ut]}],"line-clamp":[{"line-clamp":[Xe,"none",gt,ft]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",gt,ut]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",gt,ut]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",gt,dt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Xe,"auto",gt,ut]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gt,ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gt,ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},et,gt,ut],radial:["",gt,ut],conic:[et,gt,ut]},kt,ht]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":j()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,gt,ut]}],"outline-w":[{outline:["",Xe,yt,dt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,xt,mt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",d,xt,mt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Xe,dt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",f,xt,mt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Xe,gt,ut]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[gt,ut]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",gt,ut]}],filter:[{filter:["","none",gt,ut]}],blur:[{blur:I()}],brightness:[{brightness:[Xe,gt,ut]}],contrast:[{contrast:[Xe,gt,ut]}],"drop-shadow":[{"drop-shadow":["","none",p,xt,mt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Xe,gt,ut]}],"hue-rotate":[{"hue-rotate":[Xe,gt,ut]}],invert:[{invert:["",Xe,gt,ut]}],saturate:[{saturate:[Xe,gt,ut]}],sepia:[{sepia:["",Xe,gt,ut]}],"backdrop-filter":[{"backdrop-filter":["","none",gt,ut]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,gt,ut]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,gt,ut]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,gt,ut]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,gt,ut]}],"backdrop-invert":[{"backdrop-invert":["",Xe,gt,ut]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,gt,ut]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,gt,ut]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,gt,ut]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",gt,ut]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",gt,ut]}],ease:[{ease:["linear","initial",y,gt,ut]}],delay:[{delay:[Xe,gt,ut]}],animate:[{animate:["none",b,gt,ut]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,gt,ut]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[gt,ut,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gt,ut]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gt,ut]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Xe,yt,dt,ft]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function jt(...e){return Pt(function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=be(e))&&(r&&(r+=" "),r+=t);return r}(e))}const Mt={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",primary:"160 84% 39%",primaryForeground:"0 0% 100%",muted:"240 4.8% 95.9%",mutedForeground:"240 3.8% 46.1%",border:"240 5.9% 90%",destructive:"0 84.2% 60.2%",radius:"0.5rem",spacing1:"0.25rem",spacing2:"0.5rem",spacing3:"0.75rem",spacing4:"1rem",spacing5:"0.75rem",spacing6:"1.5rem",spacing8:"2rem"},It="hsl(160, 84%, 39%)",Ft="Asistente",Lt="",Dt="bottom-right",Rt="¡Hola! ¿En qué puedo ayudarte?",Ut="Escribe un mensaje...";function Bt(e){return e.primaryColor||It}const $t={enabled:!0,messageEntry:"spring",typingIndicator:"wave",buttonEffects:!0,smoothScroll:!0,speedMultiplier:1,staggerDelay:50,windowTransitions:!0,launcherPulse:!0},Ht={glassmorphism:!0,gradients:!0,softShadows:!0,glowEffects:!0,particles:!1,soundEffects:!1,hapticFeedback:!0,shimmerLoading:!0,hoverLift:!0},Vt=E.createContext($t),qt=E.createContext(Ht);function Wt({children:e,animations:t,effects:n}){const r=E.useMemo(()=>({...$t,...t}),[t]),o=E.useMemo(()=>({...Ht,...n}),[n]);return O.jsx(Vt.Provider,{value:r,children:O.jsx(qt.Provider,{value:o,children:e})})}function Zt(){return"undefined"!=typeof window&&!!window.DEBUG}const Qt=(e,...t)=>{Zt()&&console.warn(`[BotUyo] ${e}`,...t)},Kt=(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},Gt=(e,...t)=>{Zt()&&console.debug(`[BotUyo] ${e}`,...t)},Yt=(e,...t)=>{Zt()&&console.info(`[BotUyo] ${e}`,...t)},Jt=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,Xt=function(){const e=8e3,t=Math.floor(1200),n=2*t,r=44+n,o=new ArrayBuffer(r),i=new DataView(o);en(i,0,"RIFF"),i.setUint32(4,r-8,!0),en(i,8,"WAVE"),en(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,e,!0),i.setUint32(28,16e3,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),en(i,36,"data"),i.setUint32(40,n,!0);for(let l=0;l<t;l++){const n=l/e,r=1-l/t,o=Math.sin(2*Math.PI*880*n)*r*.5*32767;i.setInt16(44+2*l,o,!0)}const a=new Uint8Array(o);let s="";for(let l=0;l<a.length;l++)s+=String.fromCharCode(a[l]);return`data:audio/wav;base64,${btoa(s)}`}();function en(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}function tn({isOpen:e,onClick:t,unreadCount:n=0,primaryColor:r,logoUrl:o,starterPrompt:i,position:a="bottom-right",emotion:s="default",avatars:l={},styles:c,promptPersistence:u="session",avatarScale:d=1}){const{t:f}=D("extracted"),p=Bt({primaryColor:r}),h=c?.launcher?.bg,m=E.useContext(Vt),{triggerHaptic:g,getGlowClass:y}=function(){const e=E.useContext(qt);return{getGlassClass:()=>e.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>e.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>e.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>e.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>e.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>e.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{e.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:t=>{e.soundEffects&&console.log(`[Sound] ${t}`)},triggerParticles:t=>{e.particles&&console.log("[Particles] triggered on",t)}}}(),b=m.launcherPulse&&!1!==c?.launcher?.pulse,[v,w]=E.useState(!1),[k,x]=E.useState(!1),[S,_]=E.useState(!1),[C,z]=E.useState(!1),A="bottom-right"===a,N="chat_launcher_prompt_state",T=E.useMemo(()=>l[s]||l.default||o||Jt,[s,l,o]);E.useEffect(()=>{z(!1)},[T]),E.useEffect(()=>{const e=Object.values(l).filter(e=>!!e);o&&e.push(o),e.forEach(e=>{(new Image).src=e})},[l,o]),E.useEffect(()=>{"forever"===u&&"dismissed"===localStorage.getItem(N)&&_(!0)},[u]);const P=E.useCallback(()=>{x(!0),setTimeout(()=>w(!1),500),"always"!==u&&(_(!0),"forever"===u&&localStorage.setItem(N,"dismissed"))},[u]);E.useEffect(()=>{if("always"!==u&&S||!i||e)return void w(!1);const t=setTimeout(()=>{w(!0),x(!1)},2e3),n=setTimeout(()=>P(),12e3);return()=>{clearTimeout(t),clearTimeout(n)}},[i,e,S,u,P]);return O.jsxs("div",{className:jt("flex items-center w-fit transition-all duration-500",A?"flex-row ml-auto":"flex-row-reverse mr-auto"),children:[O.jsx("div",{className:jt("transition-all duration-700 ease-in-out flex items-center",v?jt("opacity-100 translate-x-0 w-auto max-w-[350px]",A?"mr-4":"ml-4"):"opacity-0 translate-x-8 w-0 max-w-0 overflow-hidden"),children:O.jsxs("div",{className:jt("relative px-5 py-3.5 shadow-soft-xl border flex items-center gap-3",c?.radius?.card||"rounded-[20px]",k&&"opacity-0 scale-95 transition-all duration-300",!v&&"hidden"),style:{width:"max-content",maxWidth:"280px",backgroundColor:"hsl(var(--background))",color:"hsl(var(--foreground))",borderColor:"hsl(var(--border))"},children:[O.jsx("span",{className:"text-sm font-semibold leading-tight tracking-tight whitespace-nowrap",children:i}),O.jsx("button",{onClick:e=>{e.stopPropagation(),P()},className:"text-muted-foreground hover:text-foreground transition-colors p-1 rounded-full hover:bg-muted shrink-0",children:O.jsx(ge,{className:"h-3.5 w-3.5 stroke-[2.5]"})}),O.jsx("div",{className:jt("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent",A?"right-[-14px] border-l-background":"left-[-14px] border-r-background")}),O.jsx("div",{className:jt("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent -z-10",A?"right-[-15px] border-l-border":"left-[-15px] border-r-border")})]})}),O.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[!e&&b&&O.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:O.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-20",style:{backgroundColor:p}})}),O.jsxs("button",{type:"button",onClick:()=>{Gt("Launcher handleMainAction called, isOpen:",e),g(),_(!0),"forever"===u&&localStorage.setItem(N,"dismissed"),t()},className:jt("relative z-10 h-14 w-14 sm:h-16 sm:w-16","flex items-center justify-center text-white transition-all duration-500","hover:scale-110 active:scale-95 shadow-soft-xl cursor-pointer",!e&&"hover:rotate-6",!e&&m.enabled&&"animate-glow-pulse",c?.radius?.button||"rounded-full",h,y()),style:{backgroundColor:p||"hsl(160, 84%, 39%)","--primary-glow":`${p}66`},"aria-label":e?"Cerrar chat":"Abrir chat",children:[O.jsxs("div",{className:"relative h-full w-full flex items-center justify-center overflow-hidden rounded-inherit",children:[O.jsx("div",{className:jt("absolute inset-0 transition-all duration-500 flex items-center justify-center",e?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:T&&!C?O.jsx("img",{src:T,alt:f("assistant"),className:"w-full h-full object-cover",style:{transform:`scale(${d})`},onError:()=>z(!0)},T):O.jsx(re,{className:"h-7 w-7 sm:h-8 sm:w-8 fill-current"})}),O.jsx("div",{className:jt("absolute inset-0 transition-all duration-500 flex items-center justify-center bg-black/5 dark:bg-white/10",e?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 -rotate-90"),children:O.jsx(ge,{className:"h-7 w-7 sm:h-8 sm:w-8 stroke-[2.5]"})})]}),!e&&n>0&&O.jsx("div",{className:"absolute -top-1 -right-1 z-20 flex h-6 w-6 items-center justify-center bg-destructive text-destructive-foreground rounded-full border-2 border-background text-[10px] font-black shadow-soft-md tabular-nums",children:n>9?"9+":n})]})]})]})}var nn=x();function rn(e,t,n){let r,o=n.initialDeps??[],i=!0;function a(){var a,s,l;let c;n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(c=Date.now());const u=e();if(!(u.length!==o.length||u.some((e,t)=>o[t]!==e)))return r;let d;if(o=u,n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(d=Date.now()),r=t(...u),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-d))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(r),i=!1,r}return a.updateDeps=e=>{o=e},a}function on(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const an=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},sn=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ln=e=>e,cn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},un=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(sn(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(sn(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},dn={passive:!0},fn="undefined"==typeof window||"onscrollend"in window,pn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&fn?()=>{}:an(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),a=r=>()=>{const{horizontal:a,isRtl:s}=e.options;o=a?n.scrollLeft*(s?-1:1):n.scrollTop,i(),t(o,r)},s=a(!0),l=a(!1);n.addEventListener("scroll",s,dn);const c=e.options.useScrollendEvent&&fn;return c&&n.addEventListener("scrollend",l,dn),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},hn=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},mn=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const a=e+t;null==(i=null==(o=r.scrollElement)?void 0:o.scrollTo)||i.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class gn{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{void 0===n&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ln,rangeExtractor:cn,onChange:()=>{},measureElement:hn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=rn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=rn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,o,i)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i}),{key:!1}),this.getMeasurements=rn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const u of this.laneAssignments.keys())u>=e&&this.laneAssignments.delete(u);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,s),c=new Array(i).fill(void 0);for(let u=0;u<s;u++){const e=l[u];e&&(c[e.lane]=u)}for(let u=s;u<e;u++){const e=r(u),o=this.laneAssignments.get(u);let i,s;if(void 0!==o&&this.options.lanes>1){i=o;const e=c[i],r=void 0!==e?l[e]:void 0;s=r?r.end+this.options.gap:t+n}else{const e=1===this.options.lanes?l[u-1]:this.getFurthestMeasurement(l,u);s=e?e.end+this.options.gap:t+n,i=e?e.lane:u%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(u,i)}const d=a.get(e),f="number"==typeof d?d:this.options.estimateSize(u),p=s+f;l[u]={index:u,start:s,size:f,end:p,key:e,lane:i},c[i]=u}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=rn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:o};let a=yn(0,o,i,n),s=a;if(1===r)for(;s<o&&e[s].end<n+t;)s++;else if(r>1){const i=Array(r).fill(0);for(;s<o&&i.some(e=>e<n+t);){const t=e[s];i[t.lane]=t.end,s++}const l=Array(r).fill(n+t);for(;a>=0&&l.some(e=>e>=n);){const t=e[a];l[t.lane]=t.start,a--}a=Math.max(0,a-a%r),s=Math.min(o,s+(r-1-s%r))}return{startIndex:a,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=rn(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,o)=>null===r||null===o?[]:e({startIndex:r,endIndex:o,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const o=r.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=rn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return on(t[yn(0,t.length-1,e=>on(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(n.end>=o+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0;const o=t=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);const[o,a]=r;this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),n=this.getOffsetForIndex(e,a);var r,o;n?(r=n[0],o=t,Math.abs(r-o)<1.01||i(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},i=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(r++,r<10?this.targetWindow.requestAnimationFrame(()=>o(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};o(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some(e=>null===e);){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const yn=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else{if(!(i>r))return o;t=o-1}}return e>0?e-1:0};const bn="undefined"!=typeof document?E.useLayoutEffect:E.useEffect;function vn(e){return function({useFlushSync:e=!0,...t}){const n=E.useReducer(()=>({}),{})[1],r={...t,onChange:(r,o)=>{var i;e&&o?nn.flushSync(n):n(),null==(i=t.onChange)||i.call(t,r,o)}},[o]=E.useState(()=>new gn(r));return o.setOptions(r),bn(()=>o._didMount(),[]),bn(()=>o._willUpdate()),o}({observeElementRect:un,observeElementOffset:pn,scrollToFn:mn,...e})}function wn(){}function kn(){}const xn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_n={};function En(e,t){return(_n.jsx?Sn:xn).test(e)}const Cn=/[ \t\n\f\r]/g;function zn(e){return""===e.replace(Cn,"")}class An{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Nn(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new An(n,r,t)}function Tn(e){return e.toLowerCase()}An.prototype.normal={},An.prototype.property={},An.prototype.space=void 0;class On{constructor(e,t){this.attribute=t,this.property=e}}On.prototype.attribute="",On.prototype.booleanish=!1,On.prototype.boolean=!1,On.prototype.commaOrSpaceSeparated=!1,On.prototype.commaSeparated=!1,On.prototype.defined=!1,On.prototype.mustUseProperty=!1,On.prototype.number=!1,On.prototype.overloadedBoolean=!1,On.prototype.property="",On.prototype.spaceSeparated=!1,On.prototype.space=void 0;let Pn=0;const jn=Un(),Mn=Un(),In=Un(),Fn=Un(),Ln=Un(),Dn=Un(),Rn=Un();function Un(){return 2**++Pn}const Bn=Object.freeze(Object.defineProperty({__proto__:null,boolean:jn,booleanish:Mn,commaOrSpaceSeparated:Rn,commaSeparated:Dn,number:Fn,overloadedBoolean:In,spaceSeparated:Ln},Symbol.toStringTag,{value:"Module"})),$n=Object.keys(Bn);class Hn extends On{constructor(e,t,n,r){let o=-1;if(super(e,t),Vn(this,"space",r),"number"==typeof n)for(;++o<$n.length;){const e=$n[o];Vn(this,$n[o],(n&Bn[e])===Bn[e])}}}function Vn(e,t,n){n&&(e[t]=n)}function qn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Hn(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Tn(r)]=r,n[Tn(i.attribute)]=r}return new An(t,n,e.space)}Hn.prototype.defined=!0;const Wn=qn({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Fn,ariaColIndex:Fn,ariaColSpan:Fn,ariaControls:Ln,ariaCurrent:null,ariaDescribedBy:Ln,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:Ln,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:Ln,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ln,ariaLevel:Fn,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:Ln,ariaPlaceholder:null,ariaPosInSet:Fn,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:Ln,ariaRowCount:Fn,ariaRowIndex:Fn,ariaRowSpan:Fn,ariaSelected:Mn,ariaSetSize:Fn,ariaSort:null,ariaValueMax:Fn,ariaValueMin:Fn,ariaValueNow:Fn,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Zn(e,t){return t in e?e[t]:t}function Qn(e,t){return Zn(e,t.toLowerCase())}const Kn=qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Dn,acceptCharset:Ln,accessKey:Ln,action:null,allow:null,allowFullScreen:jn,allowPaymentRequest:jn,allowUserMedia:jn,alt:null,as:null,async:jn,autoCapitalize:null,autoComplete:Ln,autoFocus:jn,autoPlay:jn,blocking:Ln,capture:null,charSet:null,checked:jn,cite:null,className:Ln,cols:Fn,colSpan:null,content:null,contentEditable:Mn,controls:jn,controlsList:Ln,coords:Fn|Dn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:jn,defer:jn,dir:null,dirName:null,disabled:jn,download:In,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:jn,formTarget:null,headers:Ln,height:Fn,hidden:In,high:Fn,href:null,hrefLang:null,htmlFor:Ln,httpEquiv:Ln,id:null,imageSizes:null,imageSrcSet:null,inert:jn,inputMode:null,integrity:null,is:null,isMap:jn,itemId:null,itemProp:Ln,itemRef:Ln,itemScope:jn,itemType:Ln,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:jn,low:Fn,manifest:null,max:null,maxLength:Fn,media:null,method:null,min:null,minLength:Fn,multiple:jn,muted:jn,name:null,nonce:null,noModule:jn,noValidate:jn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:jn,optimum:Fn,pattern:null,ping:Ln,placeholder:null,playsInline:jn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:jn,referrerPolicy:null,rel:Ln,required:jn,reversed:jn,rows:Fn,rowSpan:Fn,sandbox:Ln,scope:null,scoped:jn,seamless:jn,selected:jn,shadowRootClonable:jn,shadowRootDelegatesFocus:jn,shadowRootMode:null,shape:null,size:Fn,sizes:null,slot:null,span:Fn,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fn,step:null,style:null,tabIndex:Fn,target:null,title:null,translate:null,type:null,typeMustMatch:jn,useMap:null,value:Mn,width:Fn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ln,axis:null,background:null,bgColor:null,border:Fn,borderColor:null,bottomMargin:Fn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:jn,declare:jn,event:null,face:null,frame:null,frameBorder:null,hSpace:Fn,leftMargin:Fn,link:null,longDesc:null,lowSrc:null,marginHeight:Fn,marginWidth:Fn,noResize:jn,noHref:jn,noShade:jn,noWrap:jn,object:null,profile:null,prompt:null,rev:null,rightMargin:Fn,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Fn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:jn,disableRemotePlayback:jn,prefix:null,property:null,results:Fn,security:null,unselectable:null},space:"html",transform:Qn}),Gn=qn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Rn,accentHeight:Fn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fn,amplitude:Fn,arabicForm:null,ascent:Fn,attributeName:null,attributeType:null,azimuth:Fn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fn,by:null,calcMode:null,capHeight:Fn,className:Ln,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fn,diffuseConstant:Fn,direction:null,display:null,dur:null,divisor:Fn,dominantBaseline:null,download:jn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fn,enableBackground:null,end:null,event:null,exponent:Fn,externalResourcesRequired:null,fill:null,fillOpacity:Fn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Dn,g2:Dn,glyphName:Dn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fn,horizOriginX:Fn,horizOriginY:Fn,id:null,ideographic:Fn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fn,k:Fn,k1:Fn,k2:Fn,k3:Fn,k4:Fn,kernelMatrix:Rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fn,overlineThickness:Fn,paintOrder:null,panose1:null,path:null,pathLength:Fn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ln,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fn,pointsAtY:Fn,pointsAtZ:Fn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rn,rev:Rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rn,requiredFeatures:Rn,requiredFonts:Rn,requiredFormats:Rn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fn,specularExponent:Fn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fn,strikethroughThickness:Fn,string:null,stroke:null,strokeDashArray:Rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fn,strokeOpacity:Fn,strokeWidth:null,style:null,surfaceScale:Fn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rn,tabIndex:Fn,tableValues:null,target:null,targetX:Fn,targetY:Fn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fn,underlineThickness:Fn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fn,values:null,vAlphabetic:Fn,vMathematical:Fn,vectorEffect:null,vHanging:Fn,vIdeographic:Fn,version:null,vertAdvY:Fn,vertOriginX:Fn,vertOriginY:Fn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zn}),Yn=qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Jn=qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qn}),Xn=qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),er={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},tr=/[A-Z]/g,nr=/-[a-z]/g,rr=/^data[-\w.:]+$/i;function or(e){return"-"+e.toLowerCase()}function ir(e){return e.charAt(1).toUpperCase()}const ar=Nn([Wn,Kn,Yn,Jn,Xn],"html"),sr=Nn([Wn,Gn,Yn,Jn,Xn],"svg");var lr,cr,ur,dr={};function fr(){if(ur)return dr;ur=1;var e=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0}),dr.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(cr)return lr;cr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(s,l):l}return lr=function(s,u){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];u=u||{};var d=1,f=1;function p(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+f+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=f,t.source=s,!u.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return p(n),s=s.slice(n.length),t}}function b(){y(n)}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return f+=2,p(n),s=s.slice(t),f+=2,e({type:"comment",comment:n})}}function k(){var t=h(),n=y(r);if(n){if(w(),!y(o))return g("property missing ':'");var s=y(i),u=t({type:"declaration",property:c(n[0].replace(e,l)),value:s?c(s[0].replace(e,l)):l});return y(a),u}}return m.prototype.content=s,b(),function(){var e,t=[];for(v(t);e=k();)!1!==e&&(t.push(e),v(t));return t}()}}());return dr}var pr,hr,mr,gr={};function yr(){if(pr)return gr;pr=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return gr.camelCase=function(s,l){return void 0===l&&(l={}),function(t){return!t||n.test(t)||e.test(t)}(s)?s:(s=s.toLowerCase(),(s=l.reactCompat?s.replace(o,a):s.replace(r,a)).replace(t,i))},gr}const br=t(function(){if(mr)return hr;mr=1;var e=(hr&&hr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(fr()),t=yr();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,hr=n}()),vr=kr("end"),wr=kr("start");function kr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function xr(e){const t=wr(e),n=vr(e);if(t&&n)return{start:t,end:n}}function Sr(e){return e&&"object"==typeof e?"position"in e||"type"in e?Er(e.position):"start"in e||"end"in e?Er(e):"line"in e||"column"in e?_r(e):"":""}function _r(e){return Cr(e&&e.line)+":"+Cr(e&&e.column)}function Er(e){return _r(e&&e.start)+"-"+_r(e&&e.end)}function Cr(e){return e&&"number"==typeof e?e:1}class zr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Sr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zr.prototype.file="",zr.prototype.name="",zr.prototype.reason="",zr.prototype.message="",zr.prototype.stack="",zr.prototype.column=void 0,zr.prototype.line=void 0,zr.prototype.ancestors=void 0,zr.prototype.cause=void 0,zr.prototype.fatal=void 0,zr.prototype.place=void 0,zr.prototype.ruleId=void 0,zr.prototype.source=void 0;const Ar={}.hasOwnProperty,Nr=new Map,Tr=/[A-Z]/g,Or=new Set(["table","tbody","thead","tfoot","tr"]),Pr=new Set(["td","th"]),jr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=wr(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?sr:ar,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Ir(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ir(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=sr,e.schema=o);e.ancestors.push(t);const i=Ur(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Ar.call(t.properties,o)){const i=Rr(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&Pr.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Dr(e,t);Or.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&zn(t.value):zn(t));var t}));return Fr(e,a,i,t),Lr(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Br(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=sr,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:Ur(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];wn(t.type);const o=t.expression;wn(o.type);const i=o.properties[0];wn(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Br(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];wn(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Br(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Dr(e,t);return Fr(e,a,i,t),Lr(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Br(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Lr(r,Dr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Fr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Dr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Nr;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=Ir(e,i,a);void 0!==s&&n.push(s)}return n}function Rr(e,t,n){const r=function(e,t){const n=Tn(t);let r=t,o=On;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&rr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(nr,ir);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!nr.test(e)){let n=e.replace(tr,or);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Hn}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return br(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const t=n,r=new zr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=jr+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Ar.call(e,n)&&(t[$r(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?er[r.property]||r.property:r.attribute,n]}}function Ur(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=En(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=En(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Ar.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Br(e)}function Br(e,t){const n=new zr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=jr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $r(e){let t=e.replace(Tr,Hr);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Hr(e){return"-"+e.toLowerCase()}const Vr={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qr={};function Wr(e,t){return Zr(e,"boolean"!=typeof qr.includeImageAlt||qr.includeImageAlt,"boolean"!=typeof qr.includeHtml||qr.includeHtml)}function Zr(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Qr(e.children,t,n)}return Array.isArray(e)?Qr(e,t,n):""}function Qr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Zr(e[o],t,n);return r.join("")}const Kr=document.createElement("i");function Gr(e){const t="&"+e+";";Kr.innerHTML=t;const n=Kr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Yr(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function Jr(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}const Xr={}.hasOwnProperty;function eo(e){const t={};let n=-1;for(;++n<e.length;)to(t,e[n]);return t}function to(e,t){let n;for(n in t){const r=(Xr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Xr.call(r,i)||(r[i]=[]);const e=o[i];no(r[i],Array.isArray(e)?e:e?[e]:[])}}}function no(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Yr(e,0,0,r)}function ro(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function oo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const io=bo(/[A-Za-z]/),ao=bo(/[\dA-Za-z]/),so=bo(/[#-'*+\--9=?A-Z^-~]/);function lo(e){return null!==e&&(e<32||127===e)}const co=bo(/\d/),uo=bo(/[\dA-Fa-f]/),fo=bo(/[!-/:-@[-`{-~]/);function po(e){return null!==e&&e<-2}function ho(e){return null!==e&&(e<0||32===e)}function mo(e){return-2===e||-1===e||32===e}const go=bo(new RegExp("\\p{P}|\\p{S}","u")),yo=bo(/\s/);function bo(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function vo(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&ao(e.charCodeAt(n+1))&&ao(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function wo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(mo(r))return e.enter(n),a(r);return t(r)};function a(r){return mo(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const ko={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wo(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):po(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const xo={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&b();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Yr(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(So,u,d)(o)}function u(e){return r&&b(),y(a),f(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function f(n){return t.containerState={},e.attempt(So,p,h)(n)}function p(e){return a++,n.push([t.currentConstruct,t.containerState]),f(e)}function h(n){return null===n?(r&&b(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):po(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Yr(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},So={tokenize:function(e,t,n){return wo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function _o(e){return null===e||ho(e)||yo(e)?1:go(e)?2:void 0}function Eo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Co={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[u][1].start};zo(d,-s),zo(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Jr(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Jr(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=Jr(l,Eo(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Jr(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Jr(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Yr(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=_o(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=_o(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}};function zo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ao={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return io(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||ao(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||ao(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||lo(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):so(t)?(e.consume(t),l):n(t)}function c(e){return ao(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||ao(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const No={partial:!0,tokenize:function(e,t,n){return function(t){return mo(t)?wo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||po(e)?t(e):n(e)}}};const To={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(mo(t))return wo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(To,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return mo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Oo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return fo(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Po={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=ao,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=uo,c):(e.enter("characterReferenceValue"),o=7,i=co,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==ao||Gr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}};const jo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Mo={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),mo(t)?wo(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===i?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===i?(o++,e.consume(t),u):o>=s?(e.exit("codeFencedFenceSequence"),mo(t)?wo(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||po(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),mo(t)?wo(e,c,"whitespace")(t):c(t))}function c(n){return null===n||po(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(jo,p,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||po(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):mo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wo(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||po(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||po(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,b,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&mo(t)?wo(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||po(t)?e.check(jo,p,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||po(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}};const Io={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),wo(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):po(t)?e.attempt(Fo,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||po(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},Fo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):po(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):wo(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):po(e)?o(e):n(e)}}};const Lo={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):po(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||po(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class Do{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Ro(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ro(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ro(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Ro(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ro(this.left,t.reverse())}}}function Ro(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Uo(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new Do(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Bo(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return Yr(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Bo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,f=-1,p=n,h=0,m=0;const g=[m];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)"exit"===s[f][0]&&"enter"===s[f-1][0]&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(m=f+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){const t=s.slice(g[f],g[f+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),f=-1;++f<l.length;)c[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return c}const $o={resolve:function(e){return Uo(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):po(t)?e.check(Ho,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Ho={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wo(e,o,"linePrefix")};function o(o){if(null===o||po(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Vo(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||lo(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||po(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function h(o){return u||null!==o&&41!==o&&!ho(o)?u<c&&40===o?(e.consume(o),u++,h):41===o?(e.consume(o),u--,h):null===o||32===o||40===o||lo(o)?n(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function qo(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):po(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||po(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!mo(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Wo(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):po(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wo(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||po(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function Zo(e,t){let n;return function r(o){if(po(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(mo(o))return wo(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const Qo={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return qo.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=oo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return ho(t)?Zo(e,s)(t):s(t)}function s(t){return Vo(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Ko,c,c)(t)}function c(t){return mo(t)?wo(e,u,"whitespace")(t):u(t)}function u(i){return null===i||po(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Ko={partial:!0,tokenize:function(e,t,n){return function(t){return ho(t)?Zo(e,r)(t):n(t)};function r(t){return Wo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return mo(t)?wo(e,i,"whitespace")(t):i(t)}function i(e){return null===e||po(e)?t(e):n(e)}}};const Go={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return po(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Yo={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Yr(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||ho(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||po(n)?(e.exit("atxHeading"),t(n)):mo(n)?wo(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||ho(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Jo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xo=["pre","script","style","textarea"],ei={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),o=3,r.interrupt?t:M):io(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,f):io(i)?(e.consume(i),o=4,r.interrupt?t:M):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:M):n(o)}function f(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:C:f):n(o)}function p(t){return io(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||ho(s)){const l=47===s,c=a.toLowerCase();return l||i||!Xo.includes(c)?Jo.includes(a.toLowerCase())?(o=6,l?(e.consume(s),m):r.interrupt?t(s):C(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):y(s)):(o=1,r.interrupt?t(s):C(s))}return 45===s||ao(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:C):n(o)}function g(t){return mo(t)?(e.consume(t),g):_(t)}function y(t){return 47===t?(e.consume(t),_):58===t||95===t||io(t)?(e.consume(t),b):mo(t)?(e.consume(t),y):_(t)}function b(t){return 45===t||46===t||58===t||95===t||ao(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),w):mo(t)?(e.consume(t),v):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,k):mo(t)?(e.consume(t),w):x(t)}function k(t){return t===l?(e.consume(t),l=null,S):null===t||po(t)?n(t):(e.consume(t),k)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||ho(t)?v(t):(e.consume(t),x)}function S(e){return 47===e||62===e||mo(e)?y(e):n(e)}function _(t){return 62===t?(e.consume(t),E):n(t)}function E(t){return null===t||po(t)?C(t):mo(t)?(e.consume(t),E):n(t)}function C(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),O):62===t&&4===o?(e.consume(t),I):63===t&&3===o?(e.consume(t),M):93===t&&5===o?(e.consume(t),j):!po(t)||6!==o&&7!==o?null===t||po(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(ti,F,z)(t))}function z(t){return e.check(ni,A,F)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||po(t)?z(t):(e.enter("htmlFlowData"),C(t))}function T(t){return 45===t?(e.consume(t),M):C(t)}function O(t){return 47===t?(e.consume(t),a="",P):C(t)}function P(t){if(62===t){const n=a.toLowerCase();return Xo.includes(n)?(e.consume(t),I):C(t)}return io(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),P):C(t)}function j(t){return 93===t?(e.consume(t),M):C(t)}function M(t){return 62===t?(e.consume(t),I):45===t&&2===o?(e.consume(t),M):C(t)}function I(t){return null===t||po(t)?(e.exit("htmlFlowData"),F(t)):(e.consume(t),I)}function F(n){return e.exit("htmlFlow"),t(n)}}},ti={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(No,t,n)}}},ni={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(po(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const ri={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),b):io(t)?(e.consume(t),S):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):io(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):po(t)?(a=u,P(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?O(e):45===e?d(e):u(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:p):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):po(t)?(a=h,P(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):h(t)}function y(t){return null===t||62===t?O(t):po(t)?(a=y,P(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),v):po(t)?(a=b,P(t)):(e.consume(t),b)}function v(e){return 62===e?O(e):b(e)}function w(t){return io(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||ao(t)?(e.consume(t),k):x(t)}function x(t){return po(t)?(a=x,P(t)):mo(t)?(e.consume(t),x):O(t)}function S(t){return 45===t||ao(t)?(e.consume(t),S):47===t||62===t||ho(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),O):58===t||95===t||io(t)?(e.consume(t),E):po(t)?(a=_,P(t)):mo(t)?(e.consume(t),_):O(t)}function E(t){return 45===t||46===t||58===t||95===t||ao(t)?(e.consume(t),E):C(t)}function C(t){return 61===t?(e.consume(t),z):po(t)?(a=C,P(t)):mo(t)?(e.consume(t),C):_(t)}function z(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,A):po(t)?(a=z,P(t)):mo(t)?(e.consume(t),z):(e.consume(t),N)}function A(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):po(t)?(a=A,P(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||ho(t)?_(t):(e.consume(t),N)}function T(e){return 47===e||62===e||ho(e)?_(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),j}function j(t){return mo(t)?wo(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):M(t)}function M(t){return e.enter("htmlTextData"),a(t)}}};const oi={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&Yr(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=Jr(i,e.slice(r+1,r+s+3)),i=Jr(i,[["enter",u,t]]),i=Jr(i,Eo(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=Jr(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=Jr(i,e.slice(o+1)),i=Jr(i,[["exit",l,t]]),Yr(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(oo(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(ii,c,i?c:u)(t):91===t?e.attempt(ai,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(si,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},ii={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return ho(t)?Zo(e,o)(t):o(t)}function o(t){return 41===t?c(t):Vo(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return ho(t)?Zo(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Wo(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return ho(t)?Zo(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ai={tokenize:function(e,t,n){const r=this;return function(t){return qo.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(oo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},si={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const li={name:"labelStartImage",resolveAll:oi.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const ci={name:"labelStartLink",resolveAll:oi.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const ui={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wo(e,t,"linePrefix")}}};const di={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||po(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),mo(t)?wo(e,i,"whitespace")(t):i(t))}}};const fi={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(No,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!mo(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hi,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,wo(e,e.attempt(fi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:co(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(di,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return co(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(No,r.interrupt?n:c,e.attempt(pi,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return mo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},pi={partial:!0,tokenize:function(e,t,n){const r=this;return wo(e,function(e){const o=r.events[r.events.length-1];return!mo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},hi={partial:!0,tokenize:function(e,t,n){const r=this;return wo(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const mi={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),mo(t)?wo(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||po(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const gi={tokenize:function(e){const t=this,n=e.attempt(No,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,wo(e,e.attempt(this.parser.constructs.flow,r,e.attempt($o,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const yi={resolveAll:ki()},bi=wi("string"),vi=wi("text");function wi(e){return{resolveAll:ki("text"===e?xi:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function ki(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function xi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const Si={42:fi,43:fi,45:fi,48:fi,49:fi,50:fi,51:fi,52:fi,53:fi,54:fi,55:fi,56:fi,57:fi,62:To},_i={91:Qo},Ei={[-2]:Io,[-1]:Io,32:Io},Ci={35:Yo,42:di,45:[mi,di],60:ei,61:mi,95:di,96:Mo,126:Mo},zi={38:Po,92:Oo},Ai={[-5]:ui,[-4]:ui,[-3]:ui,33:li,38:Po,42:Co,60:[Ao,ri],91:ci,92:[Go,Oo],93:oi,95:Co,96:Lo},Ni={null:[Co,yi]},Ti=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:_i,disable:{null:[]},document:Si,flow:Ci,flowInitial:Ei,insideSpan:Ni,string:zi,text:Ai},Symbol.toStringTag,{value:"Module"}));function Oi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:g(function(e,t){y(e,t.from)}),check:g(m),consume:function(e){po(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,b()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=Jr(a,e),p(),null!==a[a.length-1])return[];return y(t,0),c.events=Eo(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function p(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,p;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){p=function(){const e=f(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,b()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,y)(n)}}function g(t){return e(d,p),o}function y(e){return p.restore(),++u<a.length?m(a[u]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Yr(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const Pi=/[\0\t\n\r]/g;const ji=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Mi(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return ro(n.slice(t?2:1),t?16:10)}return Gr(n)||e}const Ii={}.hasOwnProperty;function Fi(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:E,autolinkEmail:E,atxHeading:i(Y),blockQuote:i(W),characterEscape:E,characterReference:E,codeFenced:i(Z),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Z,a),codeText:i(Q,a),codeTextData:E,data:E,codeFlowValue:E,definition:i(K),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(G),hardBreakEscape:i(J),hardBreakTrailing:i(J),htmlFlow:i(X,a),htmlFlowData:E,htmlText:i(X,a),htmlTextData:E,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:f,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:R,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Y),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:q,autolinkProtocol:V,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:$,characterReference:H,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l(y),codeText:l(O),codeTextData:C,data:C,definition:l(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(N),htmlFlowData:C,htmlText:l(T),htmlTextData:C,image:l(j),label:I,labelText:M,lineEnding:z,link:l(P),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:F,resourceTitleString:L,resource:D,setextHeading:l(_),setextHeadingLineSequence:S,setextHeadingText:x,strong:l(),thematicBreak:l()}};Di(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];Ii.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Ui).call(i,void 0,e[0])}for(r.position={start:Li(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Li(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Li(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Sr({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Ui).call(this,e,r[0])}n.position.end=Li(e.end)}function u(){return Wr(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function b(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=oo(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function k(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function S(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:Li(e.start),end:void 0},t.push(n)),this.stack.push(n)}function C(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Li(e.end)}function z(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=Li(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),C.call(this,e))}function A(){this.data.atHardBreak=!0}function N(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function P(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(ji,Mi)}(t),n.identifier=oo(t).toLowerCase()}function I(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function F(){const e=this.resume();this.stack[this.stack.length-1].url=e}function L(){const e=this.resume();this.stack[this.stack.length-1].title=e}function D(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function U(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=oo(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function B(e){this.data.characterReferenceType=e.type}function $(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=ro(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Gr(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=Li(e.end)}function V(e){C.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function q(e){C.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function G(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function X(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Uo(e););return e}(function(e){const t={constructs:eo([Ti,...(e||{}).extensions||[]]),content:n(ko),defined:[],document:n(xo),flow:n(gi),lazy:{},string:n(bi),text:n(vi)};return t;function n(e){return function(n){return Oi(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,f;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(Pi.lastIndex=u,l=Pi.exec(o),d=l&&void 0!==l.index?l.index:o.length,f=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===f&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),f){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function Di(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Di(e,r):Ri(e,r)}}function Ri(e,t){let n;for(n in t)if(Ii.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ui(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Sr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Sr({start:t.start,end:t.end})+") is still open")}function Bi(e){const t=this;t.parser=function(n){return Fi(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $i(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function Hi(e){const t=e.spread;return null==t?e.children.length>1:t}function Vi(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(qi(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(qi(t.slice(o),o>0,!1)),i.join("")}function qi(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const Wi={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=vo(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $i(e,t);const o={src:vo(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:vo(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $i(e,t);const o={href:vo(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:vo(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Hi(n[r])}return t}(n):Hi(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=wr(t.children[1]),a=vr(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Vi(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Zi,yaml:Zi,definition:Zi,footnoteDefinition:Zi};function Zi(){}const Qi="object"==typeof self?self:globalThis,Ki=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new Qi[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new Qi[i](a),o)};return r})(new Map,e)(0),Gi="",{toString:Yi}={},{keys:Ji}=Object,Xi=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Yi.call(e).slice(8,-1);switch(n){case"Array":return[1,Gi];case"Object":return[2,Gi];case"Date":return[3,Gi];case"RegExp":return[4,Gi];case"Map":return[5,Gi];case"Set":return[6,Gi];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},ea=([e,t])=>0===e&&("function"===t||"symbol"===t),ta=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=Xi(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const n of r)e.push(i(n));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of Ji(r))!e&&ea(Xi(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[o,a]of r)(e||!ea(Xi(o))&&!ea(Xi(a)))&&t.push([i(o),i(a)]);return n}case 6:{const t=[],n=o([a,t],r);for(const o of r)!e&&ea(Xi(o))||t.push(i(o));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},na="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Ki(ta(e,t)):structuredClone(e):(e,t)=>Ki(ta(e,t));function ra(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oa(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const ia=function(e){if(null==e)return sa;if("function"==typeof e)return aa(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ia(e[n]);return aa(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return aa(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return aa(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function aa(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function sa(){return!0}const la=[],ca=!0,ua=!1;function da(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=ia(o),a=r?-1:1;!function e(o,s,l){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,f=la;if((!t||i(o,s,l[l.length-1]||void 0))&&(f=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[ca,e];return null==e?la:[e]}(n(o,l)),f[0]===ua))return f;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==f[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===ua)return c;u="number"==typeof c[1]?c[1]:u+a}}return f}}(e,void 0,[])()}function fa(e,t,n,r){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=r),da(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}const pa={}.hasOwnProperty,ha={};function ma(e,t){e.position&&(t.position=xr(e))}function ga(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,na(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function ya(e,t){const n=t.data||{},r=!("value"in t)||pa.call(n,"hProperties")||pa.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function ba(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function va(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function wa(e,t){const n=function(e,t){const n=t||ha,r=new Map,o=new Map,i=new Map,a={...Wi,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=va(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=va(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:ga,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(pa.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=na(n);return r.children=s.all(e),r}return na(e)}return(s.options.unknownHandler||ya)(s,e,t)},options:n,patch:ma,wrap:ba};return fa(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ra,r=e.options.footnoteBackLabel||oa,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),c=vo(a.toLowerCase());let u=0;const d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=i[i.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else i.push(...d);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(o,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...na(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function ka(e,t){return e&&"run"in e?async function(n,r){const o=wa(n,{file:r,...t});await e.run(o,r)}:function(n,r){return wa(n,{file:r,...e||t})}}function xa(e){if(e)throw e}var Sa,_a;var Ea=function(){if(_a)return Sa;_a=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Sa=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(i(l)||(c=o(l)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&i(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Sa}();const Ca=t(Ea);function za(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Aa(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let s;r&&t.push(o);try{s=e.apply(this,t)}catch(i){if(r&&n)throw i;return o(i)}r||(s&&s.then&&"function"==typeof s.then?s.then(a,o):s instanceof Error?o(s):a(s))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Na={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Ta(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(Ta(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Ta(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Ta(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Ta(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Ta(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Oa={cwd:function(){return"/"}};function Pa(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function ja(e){if("string"==typeof e)e=new URL(e);else if(!Pa(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Ma=["history","path","basename","stem","extname","dirname"];class Ia{constructor(e){let t;t=e?Pa(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":Oa.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Ma.length;){const e=Ma[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Ma.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Na.basename(this.path):void 0}set basename(e){La(e,"basename"),Fa(e,"basename"),this.path=Na.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Na.dirname(this.path):void 0}set dirname(e){Da(this.basename,"dirname"),this.path=Na.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Na.extname(this.path):void 0}set extname(e){if(Fa(e,"extname"),Da(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Na.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Pa(e)&&(e=ja(e)),La(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Na.basename(this.path,this.extname):void 0}set stem(e){La(e,"stem"),Fa(e,"stem"),this.path=Na.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new zr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Fa(e,t){if(e&&e.includes(Na.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Na.sep+"`")}function La(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Da(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ra=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Ua={}.hasOwnProperty;class Ba extends Ra{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Aa()}copy(){const e=new Ba;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Ca(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(qa("data",this.frozen),this.namespace[e]=t,this):Ua.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qa("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Qa(e),n=this.parser||this.Parser;return Ha("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ha("process",this.parser||this.Parser),Va("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Qa(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ha("processSync",this.parser||this.Parser),Va("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,xa(e),t=r}),Za("processSync","process",n),t}run(e,t,n){Wa(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=Qa(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){xa(e),n=t,r=!0}),Za("runSync","run",r),n}stringify(e,t){this.freeze();const n=Qa(t),r=this.compiler||this.Compiler;return Va("stringify",r),Wa(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(qa("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=Ca(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];za(a)&&za(r)&&(r=Ca(!0,a,r)),n[o]=[e,r,...i]}}}}const $a=(new Ba).freeze();function Ha(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Va(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function qa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wa(e){if(!za(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Za(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qa(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ia(e)}const Ka=[],Ga={allowDangerousHtml:!0},Ya=/^(https?|ircs?|mailto|xmpp)$/i,Ja=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Xa(e){const t=function(e){const t=e.rehypePlugins||Ka,n=e.remarkPlugins||Ka,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ga}:Ga,o=$a().use(Bi).use(n).use(ka,r).use(t);return o}(e),n=function(e){const t=e.children||"",n=new Ia;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||es;for(const u of Ja)Object.hasOwn(t,u.from)&&kn((u.from,u.to&&u.to,u.id));return fa(e,c),Mr(e,{Fragment:O.Fragment,components:o,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function c(e,t,o){if("raw"===e.type&&o&&"number"==typeof t)return a?o.children.splice(t,1):o.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Vr)if(Object.hasOwn(Vr,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Vr[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,o)),a&&o&&"number"==typeof t)return s&&e.children?o.children.splice(t,1,...e.children):o.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function es(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||Ya.test(e.slice(0,t))?e:""}function ts(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function ns(e,t,n){const r=ia((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([rs(e[0]),os(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)da(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],a=o[i][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,o={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function rs(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function os(e){return"function"==typeof e?e:function(){return e}}const is="phrasing",as=["autolink","link","image","label"];function ss(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ls(e){this.config.enter.autolinkProtocol.call(this,e)}function cs(e){this.config.exit.autolinkProtocol.call(this,e)}function us(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ds(e){this.config.exit.autolinkEmail.call(this,e)}function fs(e){this.exit(e)}function ps(e){ns(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hs],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ms]],{ignore:["link","linkReference"]})}function hs(e,t,n,r,o){let i="";if(!gs(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=ts(e,"(");let i=ts(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function ms(e,t,n,r){return!(!gs(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function gs(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||yo(n)||go(n))&&(!t||47!==n)}function ys(){this.buffer()}function bs(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vs(){this.buffer()}function ws(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ks(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xs(e){this.exit(e)}function Ss(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _s(e){this.exit(e)}function Es(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function Cs(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let a=i.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?As:zs)));return s(),a},footnoteReference:Es},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function zs(e,t,n){return 0===t?e:As(e,t,n)}function As(e,t,n){return(n?"":" ")+e}Es.peek=function(){return"["};const Ns=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Ts(e){this.enter({type:"delete",children:[]},e)}function Os(e){this.exit(e)}function Ps(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function js(e){return e.length}function Ms(e){return null==e?"":String(e)}function Is(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Fs(e,t,n){return">"+(n?"":" ")+e}function Ls(e,t){return Ds(e,t.inConstruct,!0)&&!Ds(e,t.notInConstruct,!1)}function Ds(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Rs(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&Ls(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function Us(e,t,n){return(n?"":" ")+e}function Bs(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hs(e,t,n){const r=_o(e),o=_o(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Vs(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=Hs(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=$s(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Hs(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+$s(d));const p=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+p}function qs(e){return e.value||""}function Ws(e,t,n,r){const o=Bs(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function Zs(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function Qs(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function Ks(e,t){const n=Wr(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function Gs(e,t,n,r){const o=Bs(n),i='"'===o?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Ks(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function Ys(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function Js(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Xs(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}Ps.peek=function(){return"~"},Vs.peek=function(e,t,n){return n.options.emphasis||"*"},qs.peek=function(){return"<"},Ws.peek=function(){return"!"},Zs.peek=function(){return"!"},Qs.peek=function(){return"`"},Gs.peek=function(e,t,n){return Ks(e,n)?"<":"["},Ys.peek=function(){return"["};const el=ia(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tl(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=Hs(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=$s(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Hs(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+$s(d));const p=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+p}tl.peek=function(e,t,n){return n.options.strong||"*"};const nl={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),Fs);return o(),a},break:Rs,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Us);return e(),t}const s=n.createTracker(r),l=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),i&&(u+=s.move(i+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const o=Bs(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c},emphasis:Vs,hardBreak:Rs,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return fa(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,ua}),Boolean((!e.depth||e.depth<3)&&Wr(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===o?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=$s(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:qs,image:Ws,imageReference:Zs,inlineCode:Qs,link:Gs,linkReference:Ys,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):Js(n);const s=e.ordered?"."===a?")":".":function(e){const t=Js(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),Xs(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||Js(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?i:i+" ".repeat(a-i.length))+e});return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a},root:function(e,t,n,r){return(e.children.some(function(e){return el(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:tl,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(Xs(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function rl(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function ol(e){this.exit(e),this.data.inTable=void 0}function il(e){this.enter({type:"tableRow",children:[]},e)}function al(e){this.exit(e)}function sl(e){this.enter({type:"tableCell",children:[]},e)}function ll(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,cl));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function cl(e,t){return"|"===t?t:e}function ul(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=nl.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const o=s([l(e,n,r)]);return o.slice(0,o.indexOf("\n"))}}};function a(e,t,n,r){const o=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return a(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||js,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=Ms(e[u][i]);if(!1!==n.alignDelimiters){const e=o(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)i[d]=Is(r[d]);else{const e=Is(r);for(;++d<c;)i[d]=e}d=-1;const f=[],p=[];for(;++d<c;){const e=i[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const a=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>l[d]&&(l[d]=o),p[d]=o),f[d]=a}a.splice(1,0,f),s.splice(1,0,p),u=-1;const h=[];for(;++u<a.length;){const e=a[u],t=s[u];d=-1;const r=[];for(;++d<c;){const o=e[d]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=i[d];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}h.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return h.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=a(r[o],0,t,n);return s(),i}}function dl(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function fl(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function pl(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=nl.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),l}const hl={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},ml={tokenize:function(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(yl,l,s)(t):null===t||ho(t)||yo(t)||45!==t&&go(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},gl={tokenize:function(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(yl,t,i)(a):null===a||ho(a)||yo(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},yl={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||ho(a)||yo(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||ho(e)||yo(e)?t(e):r(e)}function i(e){return io(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):io(t)?(e.consume(t),a):n(t)}},partial:!0},bl={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return ao(e)?n(e):t(e)}},partial:!0},vl={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!_l.call(r,r.previous)||Al(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hl,e.attempt(ml,e.attempt(gl,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:_l},wl={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&El.call(r,r.previous)&&!Al(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(io(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||lo(t)||ho(t)||yo(t)||go(t)?n(t):e.attempt(ml,e.attempt(gl,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:El},kl={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!zl(t)||!Cl.call(r,r.previous)||Al(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return zl(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(bl,c,l)(t):45===t||95===t||ao(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&io(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:Cl},xl={};let Sl=48;for(;Sl<123;)xl[Sl]=kl,Sl++,58===Sl?Sl=65:91===Sl&&(Sl=97);function _l(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||ho(e)}function El(e){return!io(e)}function Cl(e){return!(47===e||zl(e))}function zl(e){return 43===e||45===e||46===e||95===e||ao(e)}function Al(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}xl[43]=kl,xl[45]=kl,xl[46]=kl,xl[95]=kl,xl[72]=[kl,wl],xl[104]=[kl,wl],xl[87]=[kl,vl],xl[119]=[kl,vl];const Nl={tokenize:function(e,t,n){const r=this;return wo(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function Tl(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=oo(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function Ol(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Pl(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||ho(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(oo(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return ho(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function jl(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||ho(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=oo(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return ho(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),wo(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function Ml(e,t,n){return e.check(No,t,e.attempt(Nl,t,n))}function Il(e){e.exit("gfmFootnoteDefinition")}function Fl(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let a=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const l=_o(o);if(126===i)return a>1?r(i):(e.consume(i),a++,s);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=_o(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&Yr(a,a.length,0,Eo(s,e.slice(r+1,n),t)),Yr(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),Yr(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class Ll{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function Dl(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function Rl(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):po(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):mo(t)?wo(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||ho(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,mo(t)?wo(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t))}function f(t){return 45===t||58===t?h(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):v(t)}function p(t){return mo(t)?wo(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||po(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return mo(t)?wo(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?f(n):(null===n||po(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function w(t){return e.enter("tableRow"),k(t)}function k(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),k):null===n||po(n)?(e.exit("tableRow"),t(n)):mo(n)?wo(e,k,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||ho(t)?(e.exit("data"),k(t)):(e.consume(t),92===t?S:x)}function S(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function Ul(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const f=new Ll;for(;++i<e.length;){const p=e[i],h=p[1];"enter"===p[0]?"tableHead"===h.type?(u=!1,0!==d&&($l(f,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(i,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type?"tableCellDivider"===h.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=Bl(f,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=Bl(f,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===h.type?(u=!0,d=i):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=i,0!==l[1]?(c[0]=c[1],o=Bl(f,t,l,s,i,o)):0!==c[1]&&(o=Bl(f,t,c,s,i,o)),s=0):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type||(c[3]=i)}for(0!==d&&$l(f,t,d,n,r),f.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Dl(t.events,i))}return e}function Bl(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},Hl(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=Hl(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=Hl(t.events,n[2]),i=Hl(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},Hl(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function $l(e,t,n,r,o){const i=[],a=Hl(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function Hl(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Vl={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return ho(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return po(r)?t(r):mo(r)?e.check({tokenize:ql},t,n)(r):n(r)}}};function ql(e,t,n){return wo(e,function(e){return null===e?n(e):t(e)},"whitespace")}const Wl={};function Zl(e){const t=e||Wl,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return eo([{text:xl},{document:{91:{name:"gfmFootnoteDefinition",tokenize:jl,continuation:{tokenize:Ml},exit:Il}},text:{91:{name:"gfmFootnoteCall",tokenize:Pl},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tl,resolveTo:Ol}}},Fl(e),{flow:{null:{name:"table",tokenize:Rl,resolveAll:Ul}}},{text:{91:Vl}}])}(t)),o.push([{transforms:[ps],enter:{literalAutolink:ss,literalAutolinkEmail:ls,literalAutolinkHttp:ls,literalAutolinkWww:ls},exit:{literalAutolink:fs,literalAutolinkEmail:ds,literalAutolinkHttp:cs,literalAutolinkWww:us}},{enter:{gfmFootnoteCallString:ys,gfmFootnoteCall:bs,gfmFootnoteDefinitionLabelString:vs,gfmFootnoteDefinition:ws},exit:{gfmFootnoteCallString:ks,gfmFootnoteCall:xs,gfmFootnoteDefinitionLabelString:Ss,gfmFootnoteDefinition:_s}},{canContainEols:["delete"],enter:{strikethrough:Ts},exit:{strikethrough:Os}},{enter:{table:rl,tableData:sl,tableHeader:sl,tableRow:il},exit:{codeText:ll,table:ol,tableData:al,tableHeader:al,tableRow:al}},{exit:{taskListCheckValueChecked:dl,taskListCheckValueUnchecked:dl,paragraph:fl}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:is,notInConstruct:as},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:is,notInConstruct:as},{character:":",before:"[ps]",after:"\\/",inConstruct:is,notInConstruct:as}]},Cs(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ns}],handlers:{delete:Ps}},ul(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pl}}]}}(t))}const Ql=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Kl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ql,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ql],h2:[["className","sr-only"]],img:[...Ql,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ql,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ql],table:[...Ql],ul:[...Ql,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Gl={}.hasOwnProperty;function Yl(e,t){if(t&&"object"==typeof t){const n=t;switch("string"==typeof n.type?n.type:""){case"comment":return function(e,t){if(e.schema.allowComments){const e="string"==typeof t.value?t.value:"",n=e.indexOf("--\x3e"),r={type:"comment",value:n<0?e:e.slice(0,n)};return tc(r,t),r}}(e,n);case"doctype":return function(e,t){if(e.schema.allowDoctypes){const e={type:"doctype"};return tc(e,t),e}}(e,n);case"element":return function(e,t){const n="string"==typeof t.tagName?t.tagName:"";e.stack.push(n);const r=Jl(e,t.children),o=function(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,o=e.schema.required,i=r&&Gl.call(r,n)?r[n]:void 0,a=r&&Gl.call(r,"*")?r["*"]:void 0,s=t&&"object"==typeof t?t:{},l={};let c;for(c in s)if(Gl.call(s,c)){const t=s[c];let n=Xl(e,nc(i,c),c,t);null==n&&(n=Xl(e,nc(a,c),c,t)),null!=n&&(l[c]=n)}if(o&&Gl.call(o,n)){const e=o[n];for(c in e)Gl.call(e,c)&&!Gl.call(l,c)&&(l[c]=e[c])}return l}(e,t.properties);e.stack.pop();let i=!1;if(n&&"*"!==n&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&Gl.call(e.schema.ancestors,n))){const t=e.schema.ancestors[n];let r=-1;for(i=!1;++r<t.length;)e.stack.includes(t[r])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:o,children:r};return tc(a,t),a}(e,n);case"root":return function(e,t){const n=Jl(e,t.children),r={type:"root",children:n};return tc(r,t),r}(e,n);case"text":return function(e,t){const n="string"==typeof t.value?t.value:"",r={type:"text",value:n};return tc(r,t),r}(0,n)}}}function Jl(e,t){const n=[];if(Array.isArray(t)){const r=t;let o=-1;for(;++o<r.length;){const t=Yl(e,r[o]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Xl(e,t,n,r){return t?Array.isArray(r)?function(e,t,n,r){let o=-1;const i=[];for(;++o<r.length;){const a=ec(e,t,n,r[o]);"number"!=typeof a&&"string"!=typeof a||i.push(a)}return i}(e,t,n,r):ec(e,t,n,r):void 0}function ec(e,t,n,r){if(("boolean"==typeof r||"number"==typeof r||"string"==typeof r)&&function(e,t,n){const r=e.schema.protocols&&Gl.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||0===r.length)return!0;const o=String(n),i=o.indexOf(":"),a=o.indexOf("?"),s=o.indexOf("#"),l=o.indexOf("/");if(i<0||l>-1&&i>l||a>-1&&i>a||s>-1&&i>s)return!0;let c=-1;for(;++c<r.length;){const e=r[c];if(i===e.length&&o.slice(0,e.length)===e)return!0}return!1}(e,n,r)){if("object"==typeof t&&t.length>1){let e=!1,n=0;for(;++n<t.length;){const o=t[n];if(o&&"object"==typeof o&&"flags"in o){if(o.test(String(r))){e=!0;break}}else if(o===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function tc(e,t){const n=xr(t);t.data&&(e.data=na(t.data)),n&&(e.position=n)}function nc(e,t){let n,r=-1;if(e)for(;++r<e.length;){const o=e[r],i="string"==typeof o?o:o[0];if(i===t)return o;"data*"===i&&(n=o)}if(t.length>4&&"data"===t.slice(0,4).toLowerCase())return n}function rc(e){return function(t){const n=function(e,t){let n={type:"root",children:[]};const r=Yl({schema:t?{...Kl,...t}:Kl,stack:[]},e);return r&&(Array.isArray(r)?1===r.length?n=r[0]:n.children=r:n=r),n}(t,e);return n}}const oc=E.lazy(()=>Promise.resolve().then(()=>uy).then(e=>({default:e.AudioPlayer}))),ic=E.lazy(()=>Promise.resolve().then(()=>py).then(e=>({default:e.Gallery}))),ac=E.memo(function({message:e,primaryColor:t,botAvatar:n,botName:r="Mar",avatars:o,isFirst:i=!0,isLast:a=!0,index:s=0}){const{t:l}=D("extracted"),c="user"===e.sender,u="system"===e.type||"system"===e.sender,d=!c&&!u,f=Bt({primaryColor:t}),p=function(){const e=E.useContext(Vt);return e.enabled&&"none"!==e.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[e.messageEntry]||"animate-message-spring":""}(),h=E.useMemo(()=>{if(c)return null;if("text"===e.type){const t=e;if(t.emotion&&o?.[t.emotion])return o[t.emotion]}return n},[e,o,n,c]),m=({href:e,children:t})=>{if(!e)return null;const n=String(t).toLowerCase(),r=n.includes("reservar")||n.includes("ver")||n.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?O.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:O.jsxs("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[O.jsx("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${f}1a`,color:f},children:O.jsx(ne,{size:16,strokeWidth:2.5})}),O.jsx("span",{className:"flex flex-col min-w-0 flex-1 text-[11px] font-bold text-foreground leading-tight uppercase tracking-tight",children:l("ver_ubicacion")}),O.jsx(Y,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):r?O.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 mt-2 text-[11px] font-black w-full sm:w-auto rounded-xl shadow-md uppercase tracking-widest transition-transform active:scale-95 text-white",style:{backgroundColor:f},children:[t," ",O.jsx(q,{size:14})]}):O.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-bold underline decoration-primary/30 hover:decoration-primary transition-all",style:{color:c?"inherit":f},children:t})},g=({src:e,alt:t})=>e?O.jsx(E.Suspense,{fallback:O.jsx("div",{className:"my-3 animate-pulse",children:O.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:O.jsx(ic,{images:[{src:e,alt:t}],radius:"rounded-xl"})}):null;return u?O.jsx("div",{className:"flex justify-center my-4 animate-in fade-in zoom-in-95 w-full",children:O.jsx("span",{className:"px-3 py-1 border rounded-full text-[9px] font-black uppercase tracking-widest",style:{backgroundColor:"hsl(var(--muted))",borderColor:"hsl(var(--border))",color:"hsl(var(--muted-foreground))"},children:e.content})}):O.jsxs("div",{className:jt("flex w-full mb-0.5 group",p,c?"justify-end":"justify-start gap-3",i&&"mt-3",a&&"mb-3"),style:{animationDelay:50*s+"ms"},children:[!c&&O.jsx("div",{className:"w-9 shrink-0 flex flex-col justify-end pb-1",children:a?O.jsx("div",{className:"h-9 w-9 rounded-full overflow-hidden border shadow-sm",style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--background))"},children:h?O.jsx("img",{src:h,alt:r,className:"h-full w-full object-cover"}):O.jsx("div",{className:"h-full w-full flex items-center justify-center text-white text-[10px] font-black uppercase",style:{backgroundColor:f},children:r.charAt(0)})}):O.jsx("div",{className:"w-9"})}),O.jsxs("div",{className:jt("max-w-[85%] shadow-sm transition-all duration-300 relative",c?"text-primary-foreground":"border",c?jt("rounded-[18px]",i&&"rounded-tr-[4px]",!a&&"rounded-br-[4px]",!i&&!a&&"rounded-r-[4px]"):jt("rounded-[18px]",i&&"rounded-tl-[4px]",!a&&"rounded-bl-[4px]",!i&&!a&&"rounded-l-[4px]")),style:c?{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:f,boxShadow:a?`0 8px 20px -6px ${f}33`:"none"}:{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border) / 0.6)",color:"hsl(var(--foreground))"},children:[(()=>{switch(e.type){case"audio":return O.jsx(E.Suspense,{fallback:O.jsxs("div",{className:"flex items-center gap-3 py-1 min-w-[200px] animate-pulse",children:[O.jsx("div",{className:"w-8 h-8 rounded-full bg-muted"}),O.jsx("div",{className:"flex-1 space-y-1",children:O.jsx("div",{className:"h-1 w-full bg-muted rounded-full"})})]}),children:O.jsx(oc,{url:e.content,isBot:d,primaryColor:t})});case"image":{const t=e;return O.jsx(E.Suspense,{fallback:O.jsx("div",{className:"my-3 animate-pulse",children:O.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:O.jsx(ic,{images:[{src:t.imageUrl||t.content,alt:t.altText||"Imagen"}],radius:"rounded-xl"})})}case"location":{const t=e;return O.jsx(m,{href:`https://www.google.com/maps/search/?api=1&query=${t.latitude},${t.longitude}`,children:"Ver ubicación"})}case"file":{const t=e,n=t.fileName?.split(".").pop()?.toLowerCase()||"",r=t.fileSize?`${(t.fileSize/1024/1024).toFixed(2)} MB`:"";return O.jsxs("a",{href:t.fileUrl,download:t.fileName,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 border rounded-xl transition-all hover:scale-[1.02] group",style:{backgroundColor:c?"rgba(255,255,255,0.1)":"hsl(var(--muted))",borderColor:c?"rgba(255,255,255,0.2)":"hsl(var(--border))"},children:[O.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg shrink-0",style:{backgroundColor:c?"rgba(255,255,255,0.2)":`${f}1a`,color:c?"white":f},children:O.jsx(J,{size:20,strokeWidth:2.5})}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:"text-sm font-bold truncate",children:t.fileName}),r&&O.jsxs("p",{className:"text-xs opacity-60 mt-0.5",children:[n?.toUpperCase()," • ",r]})]}),O.jsx(G,{size:18,className:"shrink-0 opacity-60 group-hover:opacity-100 transition-opacity"})]})}default:return O.jsx("div",{className:jt("prose prose-sm max-w-none break-words leading-relaxed dark:prose-invert",c?"text-primary-foreground prose-p:text-white":"text-foreground"),children:O.jsx(Xa,{remarkPlugins:[Zl],rehypePlugins:[[rc,{tagNames:["p","a","img","strong","em","ul","ol","li","br","span"],attributes:{a:["href","target","rel"],img:["src","alt"],span:["className"]},protocols:{a:{href:["http","https","mailto","tel"]},img:{src:["http","https","data"]}}}]],components:{a:m,img:g,p:({children:e})=>O.jsx("p",{className:"mb-0 last:mb-0",children:e})},children:e.content||""})})}})(),a&&O.jsxs("div",{className:jt("flex items-center gap-1 mt-1.5 opacity-50 select-none text-[9px]",c?"justify-end":"justify-start"),children:[O.jsx("span",{className:"font-bold tabular-nums uppercase tracking-tighter",children:(e=>{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})(e.timestamp)}),c&&O.jsx(W,{className:"h-2.5 w-2.5"})]})]})]})},(e,t)=>e.message.id===t.message.id&&(e.message.timestamp===t.message.timestamp&&(e.primaryColor===t.primaryColor&&(e.botAvatar===t.botAvatar&&(e.botName===t.botName&&(e.isFirst===t.isFirst&&(e.isLast===t.isLast&&JSON.stringify(e.styles)===JSON.stringify(t.styles)))))))),sc=E.memo(function(){return O.jsx("div",{className:jt("flex items-center self-start animate-in fade-in duration-200","max-w-[85%] sm:max-w-[75%]"),children:O.jsx("div",{className:"border rounded-[18px] rounded-tl-[4px] px-4 py-3 shadow-soft-sm",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:O.jsx("div",{className:"flex items-center gap-1.5",children:[0,1,2].map(e=>O.jsx("span",{className:"h-1.5 w-1.5 rounded-full animate-bounce",style:{backgroundColor:"hsl(var(--primary) / 0.4)",animationDelay:150*e+"ms",animationDuration:"800ms"}},e))})})})});function lc(e,t){const n=e.getTime()-t.getTime();return Math.floor(n/1e3/60)}function cc(e){return new Intl.DateTimeFormat("es-ES",{hour:"2-digit",minute:"2-digit"}).format(e)}function uc(e){return function(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Hoy, ${cc(e)}`:function(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Ayer, ${cc(e)}`:function(e){return new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}).format(e)}(e)}const dc=E.memo(function({messages:e,isTyping:t,welcomeMessage:n="¡Hola! ¿En qué puedo ayudarte?",primaryColor:r,logoUrl:o,botName:i="Mar",bubbleStyles:a,avatars:s}){const l=E.useRef(null),c=E.useRef(null),[u,d]=E.useState(!1),[f,p]=E.useState(!1),h=Bt({primaryColor:r}),m=e.length>100,g=vn({count:e.length,getScrollElement:()=>c.current,estimateSize:()=>80,overscan:5,enabled:m});E.useEffect(()=>{d(!0)},[]),E.useEffect(()=>{if(u&&(e.length>0||t)){const t=setTimeout(()=>{m?g.scrollToIndex(e.length-1,{align:"end",behavior:e.length<=1?"auto":"smooth"}):l.current?.scrollIntoView({behavior:e.length<=1?"auto":"smooth",block:"end"})},100);return()=>clearTimeout(t)}},[e.length,t,u,m,g]);const y=e=>{const t=new Date(e);return isNaN(t.getTime())?"":uc(t)};return u?m?O.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto scroll-smooth bg-background/50 scrollbar-none",style:{padding:"var(--spacing-5)"},children:[O.jsx("div",{style:{height:`${g.getTotalSize()}px`,width:"100%",position:"relative"},children:g.getVirtualItems().map(t=>{const n=e[t.index],l=t.index,c=e[l-1],u=e[l+1],d=c&&lc(new Date(n.timestamp),new Date(c.timestamp))>15,f=c&&c.sender===n.sender&&lc(new Date(n.timestamp),new Date(c.timestamp))<5&&!d,p=u&&u.sender===n.sender&&lc(new Date(u.timestamp),new Date(n.timestamp))<5;return O.jsxs("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${t.start}px)`},children:[d&&O.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:O.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:y(n.timestamp)})}),O.jsx(ac,{message:n,primaryColor:r,botAvatar:o,botName:i,styles:a,avatars:s,isFirst:!f,isLast:!p})]},t.key)})}),t&&O.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[O.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:O.jsxs("div",{className:"flex gap-[2px]",children:[O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),O.jsx(sc,{})]})]}):O.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto scroll-smooth p-4 bg-background/50 scrollbar-none",children:[O.jsxs("div",{className:"min-h-full flex flex-col justify-end",children:[0===e.length&&O.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-16 text-center animate-in fade-in zoom-in-95 duration-1000",children:[O.jsxs("div",{className:"relative h-24 w-24 mb-6",children:[O.jsx("div",{className:"absolute inset-0 bg-primary/20 rounded-full animate-pulse blur-2xl"}),O.jsx("div",{className:"relative h-full w-full rounded-[28px] border-2 border-primary/20 overflow-hidden bg-card shadow-soft-2xl transition-transform hover:scale-105 duration-500",children:f?O.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:h},children:"👋"}):o?O.jsx("img",{src:o,className:"object-cover h-full w-full",alt:i,onError:()=>p(!0)}):O.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:h},children:"👋"})})]}),O.jsxs("div",{className:"space-y-2",children:[O.jsx("h3",{className:"font-black text-xl text-foreground uppercase tracking-tighter italic",children:i}),O.jsxs("p",{className:"text-[12px] font-bold text-muted-foreground italic px-10 leading-relaxed opacity-60",children:['"',n,'"']})]})]}),O.jsx("div",{className:"flex flex-col",style:{gap:"var(--spacing-3)"},children:e.map((t,n)=>{const l=e[n-1],c=e[n+1],u=l&&lc(new Date(t.timestamp),new Date(l.timestamp))>15,d=l&&l.sender===t.sender&&lc(new Date(t.timestamp),new Date(l.timestamp))<5&&!u,f=c&&c.sender===t.sender&&lc(new Date(c.timestamp),new Date(t.timestamp))<5;return O.jsxs(C.Fragment,{children:[u&&O.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:O.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:y(t.timestamp)})}),O.jsx(ac,{message:t,primaryColor:r,botAvatar:o,botName:i,styles:a,avatars:s,isFirst:!d,isLast:!f})]},t.id||`msg-${n}`)})}),O.jsx("div",{ref:l,className:"h-6 shrink-0"})]}),t&&O.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[O.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:O.jsxs("div",{className:"flex gap-[2px]",children:[O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),O.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),O.jsx(sc,{})]})]}):O.jsx("div",{className:"flex-1 bg-background"})},(e,t)=>{if(e.messages.length!==t.messages.length)return!1;if(e.isTyping!==t.isTyping)return!1;if(e.primaryColor!==t.primaryColor)return!1;if(e.botName!==t.botName)return!1;if(e.logoUrl!==t.logoUrl)return!1;const n=e.messages[e.messages.length-1],r=t.messages[t.messages.length-1];return n?.id===r?.id}),fc={"image/jpeg":[255,216,255],"image/png":[137,80,78,71,13,10,26,10],"image/webp":[82,73,70,70],"image/gif":[71,73,70,56],"audio/mpeg":[255,251],"audio/wav":[82,73,70,70],"audio/webm":[26,69,223,163],"audio/ogg":[79,103,103,83]};async function pc(e,t={}){const{maxSizeMB:n=10,allowedExtensions:r,checkMagicBytes:o=!0}=t;if(!function(e,t=10){const n=1024*t*1024;return e.size<=n}(e,n))return{valid:!1,error:`El archivo es demasiado grande. Máximo ${n}MB`};if(r&&!function(e,t){const n=e.name.split(".").pop()?.toLowerCase();return!!n&&t.includes(n)}(e,r))return{valid:!1,error:`Extensión no permitida. Solo: ${r.join(", ")}`};if(o){const t=await async function(e){try{const t=fc[e.type];if(!t)return!0;const n=await e.slice(0,12).arrayBuffer(),r=new Uint8Array(n);return t.every((e,t)=>r[t]===e)}catch(t){return console.error("File validation error:",t),!1}}(e);if(!t)return{valid:!1,error:"El archivo está corrupto o no es del tipo indicado"}}return{valid:!0}}const hc=1e3,mc={enableImages:!0,enableAudio:!0,enableFiles:!0,enableLocation:!0,allowedFileTypes:["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],maxFileSizeMB:10};function gc({isConnected:e,placeholder:t="Escribe un mensaje...",primaryColor:n,mediaConfig:r,onSendMessage:o,onSendAttachment:i,onSendLocation:a,onVoiceCall:s}){const{t:l}=D(),[c,u]=E.useState(""),[d,f]=E.useState(!1),[p,h]=E.useState(!1),[m,g]=E.useState(0),[y,b]=E.useState(null),[v,w]=E.useState(!1),[k,x]=E.useState(!1),S=E.useRef(null),_=E.useRef(null),C=E.useRef(null),z=E.useRef(null),A=E.useRef([]),N=E.useRef(null),T=Bt({primaryColor:n}),P=E.useMemo(()=>({...mc,...r}),[r]),j=E.useMemo(()=>P.enableImages||P.enableAudio||P.enableFiles||P.enableLocation,[P]),M=()=>{const t=c.trim();y?(i?.(y.file,y.type),b(null),u("")):t&&e&&(o(t),u("")),S.current&&(S.current.style.height="40px")},I=async e=>{const t=e.target.files?.[0];if(!t)return;f(!1);const n=await pc(t,{maxSizeMB:P.maxFileSizeMB||10,allowedExtensions:P.allowedFileTypes||["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],checkMagicBytes:!0});if(n.valid)if(t.type.startsWith("image/")&&P.enableImages){w(!0);try{const{default:e}=await Promise.resolve().then(()=>Gy),n={maxSizeMB:.8,maxWidthOrHeight:1200,useWebWorker:!0},r=await e(t,n);b({type:"image",file:r,previewUrl:URL.createObjectURL(r)})}catch(r){Kt("Image compression failed:",r),b({type:"image",file:t,previewUrl:URL.createObjectURL(t)})}finally{w(!1)}}else b({type:"file",file:t,previewUrl:""});else alert(n.error||"Archivo no válido")},F=async e=>{if(z.current&&(e||(z.current.onstop=null),z.current.stop(),z.current.stream.getTracks().forEach(e=>e.stop())),N.current&&clearInterval(N.current),h(!1),g(0),e&&A.current.length>0){const e=new Blob(A.current,{type:"audio/webm"}),t=new File([e],`audio-${Date.now()}.webm`,{type:"audio/webm"}),n=await pc(t,{maxSizeMB:10});if(!n.valid)return Kt("Audio validation failed:",n.error),alert(n.error),void(A.current=[]);i?.(t,"audio"),A.current=[]}};return O.jsxs("div",{className:"relative",children:[(y||v)&&O.jsx("div",{className:"absolute bottom-full left-0 mb-2 p-2 rounded-2xl border shadow-soft-2xl animate-in slide-in-from-bottom-2 z-50",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:O.jsx("div",{className:"relative w-16 h-16",children:v?O.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl",children:O.jsx(te,{className:"animate-spin text-primary h-5 w-5"})}):"image"===y?.type?O.jsxs(O.Fragment,{children:[O.jsx("img",{src:y?.previewUrl,className:"w-full h-full object-cover rounded-xl border",alt:l("preview")}),O.jsx("button",{onClick:()=>b(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:O.jsx(ge,{size:10,strokeWidth:3})})]}):O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl border",children:[O.jsx(J,{className:"text-primary h-6 w-6"}),O.jsx("span",{className:"text-[8px] mt-1 font-bold truncate max-w-[60px]",children:y?.file.name})]}),O.jsx("button",{onClick:()=>b(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:O.jsx(ge,{size:10,strokeWidth:3})})]})})}),O.jsx("input",{type:"file",accept:"image/*",className:"hidden",ref:C,onChange:I}),O.jsx("input",{type:"file",accept:P.allowedFileTypes?.map(e=>`.${e}`).join(","),className:"hidden",ref:_,onChange:I}),O.jsxs("div",{className:"flex items-center max-w-full",style:{gap:"var(--spacing-3)"},children:[j&&i&&O.jsxs("div",{className:"relative shrink-0",children:[d&&O.jsxs("div",{className:"absolute bottom-full left-0 flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300 z-[60]",style:{marginBottom:"var(--spacing-2)",gap:"var(--spacing-2)"},children:[P.enableImages&&O.jsxs("button",{onClick:()=>C.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[O.jsx(ee,{size:18,className:"text-blue-500"})," ",l("fotos")]}),P.enableFiles&&O.jsxs("button",{onClick:()=>_.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[O.jsx(J,{size:18,className:"text-purple-500"})," Archivos"]}),P.enableLocation&&a&&O.jsxs("button",{onClick:()=>{x(!0),navigator.geolocation.getCurrentPosition(e=>{a?.({latitude:e.coords.latitude,longitude:e.coords.longitude}),x(!1),f(!1)},()=>x(!1))},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[k?O.jsx(te,{size:18,className:"animate-spin"}):O.jsx(ne,{size:18,className:"text-emerald-500"})," ",l("ubicacion")]}),P.enableVoice&&s&&O.jsxs("button",{onClick:()=>{s?.(),f(!1)},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[O.jsx(le,{size:18,className:"text-amber-500"})," Llamar"]})]}),O.jsx("button",{onClick:()=>f(!d),className:jt("h-10 w-10 rounded-full flex items-center justify-center transition-all shadow-sm z-10",d?"bg-muted text-foreground rotate-45":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:O.jsx(ue,{size:22,strokeWidth:2.5})})]}),O.jsx("div",{className:jt("flex-1 relative flex items-center min-w-0 rounded-[24px] border px-4 transition-all shadow-inner",p?"h-[44px]":"min-h-[40px] max-h-[120px]"),style:{backgroundColor:p?"hsl(var(--destructive) / 0.05)":"hsl(var(--muted))",borderColor:p?"hsl(var(--destructive))":"hsl(var(--border))"},children:p?O.jsxs("div",{className:"flex items-center w-full animate-in zoom-in-95",style:{gap:"var(--spacing-4)"},children:[O.jsx("button",{onClick:()=>F(!1),className:"text-destructive/50 hover:text-destructive",children:O.jsx(he,{size:18})}),O.jsxs("div",{className:"flex-1 flex items-center",style:{gap:"var(--spacing-2)"},children:[O.jsx("div",{className:"flex gap-[3px]",children:[1,2,3,4].map(e=>O.jsx("span",{className:"w-[3px] h-3 bg-destructive/60 rounded-full animate-pulse",style:{animationDelay:.15*e+"s"}},e))}),O.jsxs("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(m/60),":",(m%60).toString().padStart(2,"0")]})]}),O.jsx("button",{onClick:()=>F(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:O.jsx(fe,{size:12,fill:"currentColor"})})]}):O.jsxs("div",{className:"w-full relative flex items-center",children:[O.jsx("textarea",{ref:S,rows:1,value:c,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey?"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),M()):(e.preventDefault(),M())},onChange:e=>{const t=e.target.value.slice(0,hc);u(t),S.current&&(S.current.style.height="40px",S.current.style.height=`${Math.min(S.current.scrollHeight,120)}px`)},onFocus:()=>f(!1),placeholder:t,"aria-label":l("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":c.length>hc,disabled:!e,className:"w-full bg-transparent text-sm py-2.5 outline-none resize-none overflow-hidden leading-tight pr-8 scrollbar-none disabled:opacity-50",style:{scrollbarWidth:"none",msOverflowStyle:"none",color:"hsl(var(--foreground))"}}),O.jsx("span",{id:"send-message-hint",className:"sr-only",children:l("accessibility.sendMessageHint")}),c.length>800&&O.jsx("span",{className:jt("absolute right-0 text-[9px] font-bold tabular-nums",c.length>=hc?"text-destructive":"text-muted-foreground/40"),children:hc-c.length})]})}),!p&&O.jsx(O.Fragment,{children:c.trim()||y?O.jsx("button",{onClick:M,disabled:!e||v&&!!y,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:O.jsx(fe,{size:18,className:"text-white ml-0.5 fill-current"})}):P.enableAudio&&i?O.jsx("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);z.current=t,A.current=[],t.ondataavailable=e=>A.current.push(e.data),t.onstop=()=>{const e=new File([new Blob(A.current)],"voice.webm",{type:"audio/webm"});i?.(e,"audio")},t.start(),h(!0),N.current=setInterval(()=>g(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:O.jsx(ie,{size:20,strokeWidth:2.5,className:"text-white"})}):O.jsx("button",{onClick:M,disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:O.jsx(fe,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function yc(e,t){let n=0,r=null;return function(...o){const i=Date.now(),a=i-n,s=()=>{n=i,e(...o)};a>=t?(r&&(clearTimeout(r),r=null),s()):r||(r=setTimeout(()=>{s(),r=null},t-a))}}function bc(e=640){const[t,n]=E.useState(()=>"undefined"!=typeof window&&window.innerWidth<e);return E.useEffect(()=>{const t=yc(()=>{n(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const vc="24px";const wc=["¡Hola! Gracias por llamar. ¿En qué puedo ayudarte hoy?","Entendido. Déjame revisar esa información para ti.","Claro, puedo ayudarte con eso. ¿Necesitas algo más?","Perfecto. Tu solicitud ha sido registrada.","No hay problema. ¿Tienes alguna otra consulta?"];function kc({isOpen:e,onClose:t,primaryColor:n="#10b981"}){const[r,o]=E.useState("idle"),[i,a]=E.useState(0),[s,l]=E.useState(0),[c,u]=E.useState(null),[d,f]=E.useState([.15,.15,.15,.15,.15,.15,.15]),[p,h]=E.useState(""),[m,g]=E.useState(0),[y,b]=E.useState(!1),v=E.useRef(null),w=E.useRef(null),k=E.useRef(null),x=E.useRef(null),S=E.useRef(null),_=E.useRef(null),C=E.useRef(0),z=E.useCallback(()=>{const e=wc[m%wc.length];h(e),g(e=>e+1),o("speaking"),b(!1);const t=Math.max(2500,60*e.length);_.current=setTimeout(()=>{o("listening"),h(""),C.current=0},t)},[m]),A=E.useCallback(async()=>{try{o("connecting"),u(null);const e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}});v.current=e;const t=new(window.AudioContext||window.webkitAudioContext);w.current=t,"suspended"===t.state&&await t.resume();const n=t.createAnalyser();n.fftSize=256,n.smoothingTimeConstant=.3,k.current=n;t.createMediaStreamSource(e).connect(n);const r=new Uint8Array(n.frequencyBinCount),i=7,s=()=>{if(!k.current)return;k.current.getByteTimeDomainData(r);let e=0;for(let i=0;i<r.length;i++){const t=(r[i]-128)/128;e+=t*t}const t=Math.sqrt(e/r.length),n=Math.min(15*t,1);l(n);const o=Array.from({length:i},(e,t)=>{const r=Math.abs(t-Math.floor(i/2)),o=.05+.1*Math.random(),a=n*(1-.12*r);return Math.max(.12,Math.min(1,a+o))});f(o),x.current=requestAnimationFrame(s)};s(),S.current=setInterval(()=>{a(e=>e+1)},1e3),o("speaking"),h(wc[0]),g(1),_.current=setTimeout(()=>{o("listening"),h("")},3500)}catch(e){console.error("[VoiceCallDemo] Microphone error:",e),u("No se pudo acceder al micrófono"),o("idle")}},[]);E.useEffect(()=>{if("listening"===r){if(s>.08)b(!0),C.current=0;else if(y&&s<.05)if(0===C.current)C.current=Date.now();else{(Date.now()-C.current)/1e3>=1&&z()}}else C.current=0},[s,r,y,z]);const N=E.useCallback(()=>{x.current&&(cancelAnimationFrame(x.current),x.current=null),S.current&&(clearInterval(S.current),S.current=null),_.current&&(clearTimeout(_.current),_.current=null),v.current&&(v.current.getTracks().forEach(e=>e.stop()),v.current=null),w.current&&(w.current.close(),w.current=null),k.current=null,l(0),a(0),f([.15,.15,.15,.15,.15,.15,.15]),o("idle"),h(""),b(!1),C.current=0},[]),T=E.useCallback(()=>{if(!v.current)return;const e=v.current.getAudioTracks()[0];e&&(e.enabled=!e.enabled,o(e.enabled?"listening":"muted"))},[]),P=E.useCallback(()=>{N(),t()},[N,t]);if(E.useEffect(()=>(e&&"idle"===r&&A(),()=>{e||N()}),[e,r,A,N]),E.useEffect(()=>()=>{N()},[N]),!e)return null;const j=Array.from({length:7},(e,t)=>{const n=(Date.now()/120+.6*t)%(2*Math.PI);return.25+.5*Math.sin(n)});return O.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-2xl overflow-hidden",style:{background:"hsl(var(--background) / 0.98)",backdropFilter:"blur(10px)"},children:[O.jsxs("div",{className:"absolute top-0 left-0 right-0 flex items-center justify-between p-4 border-b border-border/50",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(le,{className:"h-4 w-4",style:{color:n}}),O.jsx("span",{className:"text-sm font-medium",children:"Llamada"})]}),O.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:(e=>{const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`})(i)})]}),O.jsxs("div",{className:"flex flex-col items-center gap-5 px-4",children:[O.jsxs("div",{className:jt("h-20 w-20 rounded-full flex items-center justify-center transition-all duration-150","connecting"===r&&"animate-pulse"),style:{backgroundColor:"muted"===r?"hsl(var(--muted))":"speaking"===r?"#3b82f620":`${n}20`,boxShadow:"listening"===r?`0 0 ${15+35*s}px ${n}50`:"speaking"===r?"0 0 25px #3b82f650":"none",transform:"listening"===r?`scale(${1+.08*s})`:"scale(1)"},children:["connecting"===r&&O.jsx(le,{className:"h-8 w-8 animate-bounce",style:{color:n}}),"listening"===r&&O.jsx(ie,{className:"h-8 w-8",style:{color:n}}),"muted"===r&&O.jsx(oe,{className:"h-8 w-8 text-muted-foreground"}),"speaking"===r&&O.jsx(me,{className:"h-8 w-8 text-blue-500"})]}),("listening"===r||"muted"===r||"speaking"===r)&&O.jsx("div",{className:"flex items-center gap-1.5 h-12",children:("speaking"===r?j:d).map((e,t)=>O.jsx("div",{className:"w-2 rounded-full",style:{height:`${Math.max(5,45*e)}px`,backgroundColor:"muted"===r?"hsl(var(--muted-foreground))":"speaking"===r?"#3b82f6":n,opacity:"muted"===r?.3:.85,transition:"height 60ms ease-out"}},t))}),"speaking"===r&&p&&O.jsx("div",{className:"max-w-[280px] p-3 rounded-xl text-center text-sm leading-relaxed",style:{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--foreground))"},children:p}),c&&O.jsx("p",{className:"text-sm text-red-500 text-center px-4",children:c})]}),O.jsxs("div",{className:"absolute bottom-6 flex items-center gap-4",children:[O.jsx("button",{type:"button",onClick:T,disabled:"connecting"===r||"speaking"===r,className:jt("h-12 w-12 rounded-full flex items-center justify-center","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2","disabled:opacity-50","muted"===r?"bg-amber-500 hover:bg-amber-600 text-white focus:ring-amber-500":"bg-muted hover:bg-muted/80 text-foreground focus:ring-primary"),"aria-label":"muted"===r?"Activar micrófono":"Silenciar",children:"muted"===r?O.jsx(oe,{className:"h-5 w-5"}):O.jsx(ie,{className:"h-5 w-5"})}),O.jsx("button",{type:"button",onClick:P,className:jt("h-14 w-14 rounded-full flex items-center justify-center","bg-red-500 hover:bg-red-600 text-white","shadow-lg transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2","active:scale-95"),"aria-label":"Terminar llamada",children:O.jsx(se,{className:"h-6 w-6"})})]})]})}function xc({isOpen:e,isConnected:t,isTyping:n,messages:r,botName:o="Mar",logoUrl:i,welcomeMessage:a,inputPlaceholder:s,primaryColor:l,mediaConfig:c,onClose:u,onSendMessage:d,bubbleStyles:f,avatars:p,onSendAttachment:h,onSendLocation:m,onVoiceCall:g,theme:y}){const[b,v]=E.useState(!1),[w,k]=E.useState(!1),{t:x}=D(),S=bc(),_=Bt({primaryColor:l}),C=function({isOpen:e,height:t,bottom:n}){const r=bc(),[o,i]=E.useState({}),a=E.useCallback(()=>{if(r){const e=()=>{window.visualViewport?i({height:`${window.visualViewport.height}px`,width:"100%",top:`${window.visualViewport.offsetTop}px`,left:"0px",bottom:"auto",right:"auto",transform:"none"}):i({height:"100dvh",width:"100%",top:"0px",left:"0px"})};return e(),window.visualViewport?.addEventListener("resize",e),window.visualViewport?.addEventListener("scroll",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.visualViewport?.removeEventListener("scroll",e)}}{const e=parseFloat(n||vc)||24,r=window.innerHeight-64-e;if(t){const e=parseFloat(t)||700,o=Math.min(e,r);i({height:`${o}px`,maxHeight:`${r}px`,bottom:n||vc})}else{const e=Math.min(700,Math.max(500,r));i({height:`${e}px`,maxHeight:`${r}px`,bottom:n||vc})}}},[r,t,n]);return E.useEffect(()=>{if(!e)return;const t=a();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),t&&t()}},[e,a]),o}({isOpen:e,height:y?.height,bottom:y?.bottom}),z=function({enabled:e,returnFocusRef:t,onEscape:n}){const r=E.useRef(null),o=E.useRef(null);return E.useEffect(()=>{if(!e)return;o.current=document.activeElement;const i=t?.current,a=r.current;if(!a)return;const s=setTimeout(()=>{const e=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():a.focus()},100),l=e=>{if(a)if("Escape"!==e.key){if("Tab"===e.key){const t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus())}}else n?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(s),document.removeEventListener("keydown",l);const e=i||o.current;e&&"function"==typeof e.focus&&e.focus()}},[e,n,t]),r}({enabled:e,onEscape:u});if(E.useEffect(()=>{if(e)return S&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width=""}},[e,S]),!e)return null;const A="bottom-left"===y?.position;return O.jsxs(O.Fragment,{children:[O.jsx("div",{id:"chat-window-description",className:"sr-only",children:x("accessibility.dialogDescription")}),O.jsxs("div",{ref:z,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:jt("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!S&&["fixed",A?"left-6":"right-6","w-[350px] min-w-[350px] max-w-[350px]","rounded-[32px] border shadow-soft-2xl","animate-in fade-in zoom-in-95","slide-in-from-bottom-10"],S&&["fixed inset-0 w-full"]),style:{...C,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[O.jsx("header",{className:"relative shrink-0 border-b z-20",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--background) / 0.9)",borderColor:"hsl(var(--border))",backdropFilter:"blur(24px)"},children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"relative",children:[O.jsx("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:b?O.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:O.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}):O.jsx("img",{src:i||Jt,alt:o,className:"h-full w-full object-cover",onError:()=>v(!0)})}),O.jsx("div",{className:jt("absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full border-2 border-background",t?"bg-emerald-500":"bg-amber-500 animate-pulse")})]}),O.jsxs("div",{className:"flex flex-col",children:[O.jsxs("div",{className:"flex items-center gap-1",children:[O.jsx("span",{id:"chat-window-title",className:"font-black text-xs uppercase tracking-tight text-foreground",children:o}),O.jsx(pe,{className:"h-3 w-3 text-primary fill-primary/10"})]}),O.jsxs("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[O.jsx("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),O.jsx("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:x(t?"online":"offline")})]})]})]}),O.jsxs("div",{className:"flex items-center gap-2",children:[g&&O.jsx("button",{onClick:()=>k(!0),"aria-label":"Iniciar llamada de voz",title:"Llamar",className:"h-8 w-8 flex items-center justify-center rounded-full bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-600 transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2",children:O.jsx(le,{className:"h-4 w-4","aria-hidden":"true"})}),O.jsx("button",{onClick:u,"aria-label":x("accessibility.closeChat"),title:"Esc",className:"h-8 w-8 flex items-center justify-center rounded-full bg-muted/60 hover:bg-muted text-foreground transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:O.jsx(ge,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),O.jsxs("main",{role:"region","aria-label":x("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[O.jsx(dc,{messages:r,isTyping:n,welcomeMessage:a,primaryColor:l,logoUrl:i,botName:o,bubbleStyles:f,avatars:p}),O.jsx("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),O.jsxs("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:S?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[O.jsx(gc,{isConnected:t,placeholder:s,primaryColor:_,mediaConfig:c,onSendMessage:d,onSendAttachment:h,onSendLocation:m,onVoiceCall:g}),O.jsxs("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[O.jsx(X,{className:"h-2 w-2 text-primary fill-primary"}),O.jsx("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:x("con_amor_paseo_libre")})]})]}),O.jsx(kc,{isOpen:w,onClose:()=>k(!1),primaryColor:_})]})]})}class Sc extends E.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){Kt("ErrorBoundary caught error:",e,t),this.props.onError?.(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:O.jsxs("div",{className:"flex flex-col items-center justify-center p-8 bg-background text-center",children:[O.jsx("div",{className:"text-6xl mb-4",children:"⚠️"}),O.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Algo salió mal"}),O.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-md",children:this.state.error?.message||"Ocurrió un error inesperado"}),O.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const _c={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},Ec={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},Cc={text:"text-primary-foreground"};function zc(e,t){const n=function(){const[e,t]=E.useState(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return E.useEffect(()=>{const e=window.matchMedia("(prefers-contrast: high)"),n=window.matchMedia("(prefers-contrast: more)"),r=e=>{t(e.matches)};return e.addEventListener("change",r),n.addEventListener("change",r),()=>{e.removeEventListener("change",r),n.removeEventListener("change",r)}},[]),e}(),r=E.useMemo(()=>{const r=function(e,t){const n={...Mt,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||It,botName:e?.botName||t?.botName||Ft,logoUrl:e?.logoUrl||t?.logoUrl||Lt,position:e?.position||t?.position||Dt,welcomeMessage:e?.welcomeMessage||t?.welcomeMessage||Rt,inputPlaceholder:e?.inputPlaceholder||t?.inputPlaceholder||Ut,cssVariables:n}}(e,t);return n?{...r,primaryColor:"#000000",cssVariables:{...r.cssVariables,background:"#FFFFFF",foreground:"#000000",card:"#FFFFFF",cardForeground:"#000000",primary:"#000000",primaryForeground:"#FFFFFF",muted:"#F5F5F5",mutedForeground:"#000000",border:"#000000"}}:r},[e,t,n]),o=E.useMemo(()=>({radius:{..._c,...e?.bubbleStyles?.radius},bot:{...Ec,...e?.bubbleStyles?.bot},user:{...Cc,...e?.bubbleStyles?.user},launcher:{...e?.bubbleStyles?.launcher},mapCard:{...e?.bubbleStyles?.mapCard}}),[e?.bubbleStyles]);return{mergedTheme:r,mergedStyles:o,getContainerStyle:(e,t,n)=>({"--chat-primary":r.primaryColor,zIndex:e?2147483647:9999,position:"fixed",top:t&&e?0:"auto",left:t&&e?0:"bottom-left"===n?"24px":"auto",right:t&&e?0:"bottom-right"!==n&&n?"auto":"24px",bottom:t&&e?0:"100px",width:t&&e?"100%":"auto",height:t&&e?"100%":"auto"})}}const Ac=(e,t)=>t.some(t=>e instanceof t);let Nc,Tc;const Oc=new WeakMap,Pc=new WeakMap,jc=new WeakMap;let Mc={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Oc.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Dc(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ic(e){Mc=e(Mc)}function Fc(e){return(Tc||(Tc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Rc(this),t),Dc(this.request)}:function(...t){return Dc(e.apply(Rc(this),t))}}function Lc(e){return"function"==typeof e?Fc(e):(e instanceof IDBTransaction&&function(e){if(Oc.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});Oc.set(e,t)}(e),Ac(e,Nc||(Nc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Mc):e)}function Dc(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(Dc(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return jc.set(t,e),t}(e);if(Pc.has(e))return Pc.get(e);const t=Lc(e);return t!==e&&(Pc.set(e,t),jc.set(t,e)),t}const Rc=e=>jc.get(e);const Uc=["get","getKey","getAll","getAllKeys","count"],Bc=["put","add","delete","clear"],$c=new Map;function Hc(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if($c.get(t))return $c.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=Bc.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!Uc.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]};return $c.set(t,i),i}Ic(e=>({...e,get:(t,n,r)=>Hc(t,n)||e.get(t,n,r),has:(t,n)=>!!Hc(t,n)||e.has(t,n)}));const Vc=["continue","continuePrimaryKey","advance"],qc={},Wc=new WeakMap,Zc=new WeakMap,Qc={get(e,t){if(!Vc.includes(t))return e[t];let n=qc[t];return n||(n=qc[t]=function(...e){Wc.set(this,Zc.get(this)[t](...e))}),n}};async function*Kc(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,Qc);for(Zc.set(n,t),jc.set(n,Rc(t));t;)yield n,t=await(Wc.get(n)||t.continue()),Wc.delete(n)}function Gc(e,t){return t===Symbol.asyncIterator&&Ac(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ac(e,[IDBIndex,IDBObjectStore])}Ic(e=>({...e,get:(t,n,r)=>Gc(t,n)?Kc:e.get(t,n,r),has:(t,n)=>Gc(t,n)||e.has(t,n)}));const Yc=new class{db=null;DB_NAME="botuyo-chat";DB_VERSION=1;async init(){try{this.db=await function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=Dc(a);return r&&a.addEventListener("upgradeneeded",e=>{r(Dc(a.result),e.oldVersion,e.newVersion,Dc(a.transaction),e)}),n&&a.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(this.DB_NAME,this.DB_VERSION,{upgrade(e){if(!e.objectStoreNames.contains("messages")){e.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp")}e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata")}}),Yt("IndexedDB initialized")}catch(e){throw Kt("Failed to initialize IndexedDB:",e),e}}async saveMessage(e){this.db||await this.init();try{await this.db.put("messages",e)}catch(t){Kt("Failed to save message:",t)}}async saveMessages(e){this.db||await this.init();try{const t=this.db.transaction("messages","readwrite");await Promise.all([...e.map(e=>t.store.put(e)),t.done])}catch(t){Kt("Failed to save messages:",t)}}async getMessages(e=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-e)}catch(t){return Kt("Failed to get messages:",t),[]}}async getMessage(e){this.db||await this.init();try{return await this.db.get("messages",e)}catch(t){return void Kt("Failed to get message:",t)}}async deleteMessage(e){this.db||await this.init();try{await this.db.delete("messages",e)}catch(t){Kt("Failed to delete message:",t)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),Yt("Messages cleared from IndexedDB")}catch(e){Kt("Failed to clear messages:",e)}}async setMetadata(e){this.db||await this.init();try{await this.db.put("metadata",e,"chat-metadata")}catch(t){Kt("Failed to set metadata:",t)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(e){return Kt("Failed to get metadata:",e),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),Yt("All data cleared from IndexedDB")}catch(e){Kt("Failed to clear all data:",e)}}async migrateFromLocalStorage(){try{const e="botuyo_chat_v1",t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(n.messages&&Array.isArray(n.messages)){const e=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}));await this.saveMessages(e),Yt(`Migrated ${e.length} messages from localStorage`)}n.sessionId&&await this.setMetadata({sessionId:n.sessionId}),localStorage.removeItem(e),Yt("Migration from localStorage completed")}catch(e){Kt("Failed to migrate from localStorage:",e)}}},Jc="botuyo_chat_v1",Xc={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function eu(e,t){switch(t.type){case"TOGGLE_WINDOW":return{...e,isOpen:!e.isOpen};case"OPEN_WINDOW":return{...e,isOpen:!0};case"CLOSE_WINDOW":return{...e,isOpen:!1};case"SET_CONNECTED":return{...e,isConnected:t.payload};case"SET_TYPING":return{...e,isTyping:t.payload};case"ADD_MESSAGE":{if(e.messages.some(e=>e.id===t.payload.id))return e;const n=[...e.messages,t.payload],r="bot"===t.payload.sender;return{...e,messages:n,isTyping:!r&&e.isTyping}}case"SET_MESSAGES":return{...e,messages:[...t.payload]};case"SET_ERROR":return{...e,error:t.payload};case"SET_SESSION_ID":return{...e,sessionId:t.payload};case"CLEAR_CHAT":return{...Xc,isOpen:e.isOpen};case"RESTORE_SESSION":return{...e,...t.payload,isConnected:!1,isTyping:!1,error:null};default:return e}}function tu(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=a.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function a(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class nu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ru extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ou={};function iu(e){return ou}function au(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function su(e,t){return"bigint"==typeof t?t.toString():t}function lu(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cu(e){return null==e}function uu(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const du=Symbol("evaluating");function fu(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==du)return void 0===r&&(r=du,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function pu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function hu(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function mu(e){return JSON.stringify(e)}const gu="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function yu(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const bu=lu(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function vu(e){if(!1===yu(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==yu(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function wu(e){return vu(e)?{...e}:Array.isArray(e)?[...e]:e}const ku=new Set(["string","number","symbol"]);function xu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Su(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function _u(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Eu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Cu(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function zu(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Au(e){return"string"==typeof e?e:e?.message}function Nu(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Au(e.inst?._zod.def?.error?.(e))??Au(t?.error?.(e))??Au(n.customError?.(e))??Au(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Tu(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ou(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Pu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,su,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ju=tu("$ZodError",Pu),Mu=tu("$ZodError",Pu,{Parent:Error});const Iu=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new nu;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map(e=>Nu(e,i,iu())));throw gu(t,o?.callee),t}return a.value},Fu=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(o?.Err??e)(a.issues.map(e=>Nu(e,i,iu())));throw gu(t,o?.callee),t}return a.value},Lu=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new nu;return i.issues.length?{success:!1,error:new(e??ju)(i.issues.map(e=>Nu(e,o,iu())))}:{success:!0,data:i.value}},Du=Lu(Mu),Ru=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Nu(e,o,iu())))}:{success:!0,data:i.value}},Uu=Ru(Mu),Bu=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Iu(e)(t,n,o)},$u=e=>(t,n,r)=>Iu(e)(t,n,r),Hu=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fu(e)(t,n,o)},Vu=e=>async(t,n,r)=>Fu(e)(t,n,r),qu=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Lu(e)(t,n,o)},Wu=e=>(t,n,r)=>Lu(e)(t,n,r),Zu=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ru(e)(t,n,o)},Qu=e=>async(t,n,r)=>Ru(e)(t,n,r),Ku=/^[cC][^\s-]{8,}$/,Gu=/^[0-9a-z]+$/,Yu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ju=/^[0-9a-vA-V]{20}$/,Xu=/^[A-Za-z0-9]{27}$/,ed=/^[a-zA-Z0-9_-]{21}$/,td=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nd=/^([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})$/,rd=e=>e?new 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)$/,od=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const id=/^(?:(?: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])$/,ad=/^(([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}|:))$/,sd=/^((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])$/,ld=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ud=/^[A-Za-z0-9_-]*$/,dd=/^\+[1-9]\d{6,14}$/,fd="(?:(?:\\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])))",pd=new RegExp(`^${fd}$`);function hd(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const md=/^-?\d+$/,gd=/^-?\d+(?:\.\d+)?$/,yd=/^[^A-Z]*$/,bd=/^[^a-z]*$/,vd=tu("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wd={number:"number",bigint:"bigint",object:"date"},kd=tu("$ZodCheckLessThan",(e,t)=>{vd.init(e,t);const n=wd[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xd=tu("$ZodCheckGreaterThan",(e,t)=>{vd.init(e,t);const n=wd[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sd=tu("$ZodCheckMultipleOf",(e,t)=>{vd.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_d=tu("$ZodCheckNumberFormat",(e,t)=>{vd.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Eu[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=md)}),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ed=tu("$ZodCheckMaxLength",(e,t)=>{var n;vd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!cu(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=Tu(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cd=tu("$ZodCheckMinLength",(e,t)=>{var n;vd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!cu(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=Tu(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zd=tu("$ZodCheckLengthEquals",(e,t)=>{var n;vd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!cu(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=Tu(r),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ad=tu("$ZodCheckStringFormat",(e,t)=>{var n,r;vd.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),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=()=>{})}),Nd=tu("$ZodCheckRegex",(e,t)=>{Ad.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})}}),Td=tu("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yd),Ad.init(e,t)}),Od=tu("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bd),Ad.init(e,t)}),Pd=tu("$ZodCheckIncludes",(e,t)=>{vd.init(e,t);const n=xu(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),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})}}),jd=tu("$ZodCheckStartsWith",(e,t)=>{vd.init(e,t);const n=new RegExp(`^${xu(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Md=tu("$ZodCheckEndsWith",(e,t)=>{vd.init(e,t);const n=new RegExp(`.*${xu(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Id=tu("$ZodCheckOverwrite",(e,t)=>{vd.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Fd{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Ld={major:4,minor:3,patch:6},Dd=tu("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ld;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=Cu(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=i._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new nu;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a;e.issues.length!==t&&(o||(o=Cu(e,t)))});else{if(e.issues.length===t)continue;o||(o=Cu(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(Cu(n))return n.aborted=!0,n;const a=t(o,r,i);if(a instanceof Promise){if(!1===i.async)throw new nu;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const a=e._zod.parse(o,i);if(a instanceof Promise){if(!1===i.async)throw new nu;return a.then(e=>t(e,r,i))}return t(a,r,i)}}fu(e,"~standard",()=>({validate:t=>{try{const n=Du(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Uu(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Rd=tu("$ZodString",(e,t)=>{var n;Dd.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ud=tu("$ZodStringFormat",(e,t)=>{Ad.init(e,t),Rd.init(e,t)}),Bd=tu("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=nd),Ud.init(e,t)}),$d=tu("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rd(e))}else t.pattern??(t.pattern=rd());Ud.init(e,t)}),Hd=tu("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=od),Ud.init(e,t)}),Vd=tu("$ZodURL",(e,t)=>{Ud.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qd=tu("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ud.init(e,t)}),Wd=tu("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ed),Ud.init(e,t)}),Zd=tu("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ku),Ud.init(e,t)}),Qd=tu("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gu),Ud.init(e,t)}),Kd=tu("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Yu),Ud.init(e,t)}),Gd=tu("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ju),Ud.init(e,t)}),Yd=tu("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Xu),Ud.init(e,t)}),Jd=tu("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=hd({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${fd}T(?:${r})$`)}(t)),Ud.init(e,t)}),Xd=tu("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=pd),Ud.init(e,t)}),ef=tu("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${hd(t)}$`)),Ud.init(e,t)}),tf=tu("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=td),Ud.init(e,t)}),nf=tu("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=id),Ud.init(e,t),e._zod.bag.format="ipv4"}),rf=tu("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ad),Ud.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),of=tu("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sd),Ud.init(e,t)}),af=tu("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ld),Ud.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function sf(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const lf=tu("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=cd),Ud.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{sf(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const cf=tu("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ud),Ud.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ud.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return sf(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),uf=tu("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dd),Ud.init(e,t)});const df=tu("$ZodJWT",(e,t)=>{Ud.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ff=tu("$ZodNumber",(e,t)=>{Dd.init(e,t),e._zod.pattern=e._zod.bag.pattern??gd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),pf=tu("$ZodNumberFormat",(e,t)=>{_d.init(e,t),ff.init(e,t)}),hf=tu("$ZodAny",(e,t)=>{Dd.init(e,t),e._zod.parse=e=>e}),mf=tu("$ZodUnknown",(e,t)=>{Dd.init(e,t),e._zod.parse=e=>e}),gf=tu("$ZodNever",(e,t)=>{Dd.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function yf(e,t,n){e.issues.length&&t.issues.push(...zu(n,e.issues)),t.value[n]=e.value}const bf=tu("$ZodArray",(e,t)=>{Dd.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const a=o[e],s=t.element._zod.run({value:a,issues:[]},r);s instanceof Promise?i.push(s.then(t=>yf(t,n,e))):yf(s,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function vf(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...zu(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function wf(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function kf(e,t,n,r,o,i){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type,u="optional"===l.optout;for(const d in t){if(s.has(d))continue;if("never"===c){a.push(d);continue}const o=l.run({value:t[d],issues:[]},r);o instanceof Promise?e.push(o.then(e=>vf(e,n,d,t,u))):vf(o,n,d,t,u)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const xf=tu("$ZodObject",(e,t)=>{Dd.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=lu(()=>wf(t));fu(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=yu,i=t.catchall;let a;e._zod.parse=(t,n)=>{a??(a=r.value);const s=t.value;if(!o(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const l=[],c=a.shape;for(const e of a.keys){const r=c[e],o="optional"===r._zod.optout,i=r._zod.run({value:s[e],issues:[]},n);i instanceof Promise?l.push(i.then(n=>vf(n,t,e,s,o))):vf(i,t,e,s,o)}return i?kf(l,s,t,n,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),Sf=tu("$ZodObjectJIT",(e,t)=>{xf.init(e,t);const n=e._zod.parse,r=lu(()=>wf(t));let o;const i=yu,a=!ou.jitless,s=a&&bu.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=r.value);const f=u.value;return i(f)?a&&s&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new Fd(["shape","payload","ctx"]),n=r.value,o=e=>{const t=mu(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let a=0;for(const r of n.keys)i[r]="key_"+a++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],a=mu(r),s=e[r],l="optional"===s?._zod?.optout;t.write(`const ${n} = ${o(r)};`),l?t.write(`\n if (${n}.issues.length) {\n if (${a} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),u=o(u,d),l?kf([],f,u,d,c,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function _f(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!Cu(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Nu(e,r,iu())))}),t)}const Ef=tu("$ZodUnion",(e,t)=>{Dd.init(e,t),fu(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),fu(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),fu(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),fu(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>uu(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then(t=>_f(t,o,e,i)):_f(s,o,e,i)}}),Cf=tu("$ZodIntersection",(e,t)=>{Dd.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>Af(e,t,n)):Af(e,o,i)}});function zf(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(vu(e)&&vu(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const i of r){const n=zf(e[i],t[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};o[i]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=zf(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Af(e,t,n){const r=new Map;let o;for(const s of t.issues)if("unrecognized_keys"===s.code){o??(o=s);for(const e of s.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(s);for(const s of n.issues)if("unrecognized_keys"===s.code)for(const e of s.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(s);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),Cu(e))return e;const a=zf(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Nf=tu("$ZodEnum",(e,t)=>{Dd.init(e,t);const n=au(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>ku.has(typeof e)).map(e=>"string"==typeof e?xu(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Tf=tu("$ZodTransform",(e,t)=>{Dd.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ru(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n))}if(o instanceof Promise)throw new nu;return n.value=o,n}});function Of(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Pf=tu("$ZodOptional",(e,t)=>{Dd.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fu(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),fu(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${uu(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Of(t,e.value)):Of(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),jf=tu("$ZodExactOptional",(e,t)=>{Pf.init(e,t),fu(e._zod,"values",()=>t.innerType._zod.values),fu(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Mf=tu("$ZodNullable",(e,t)=>{Dd.init(e,t),fu(e._zod,"optin",()=>t.innerType._zod.optin),fu(e._zod,"optout",()=>t.innerType._zod.optout),fu(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${uu(e.source)}|null)$`):void 0}),fu(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),If=tu("$ZodDefault",(e,t)=>{Dd.init(e,t),e._zod.optin="optional",fu(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ff(e,t)):Ff(r,t)}});function Ff(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Lf=tu("$ZodPrefault",(e,t)=>{Dd.init(e,t),e._zod.optin="optional",fu(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Df=tu("$ZodNonOptional",(e,t)=>{Dd.init(e,t),fu(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Rf(t,e)):Rf(o,e)}});function Rf(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Uf=tu("$ZodCatch",(e,t)=>{Dd.init(e,t),fu(e._zod,"optin",()=>t.innerType._zod.optin),fu(e._zod,"optout",()=>t.innerType._zod.optout),fu(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Nu(e,n,iu()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Nu(e,n,iu()))},input:e.value}),e.issues=[]),e)}}),Bf=tu("$ZodPipe",(e,t)=>{Dd.init(e,t),fu(e._zod,"values",()=>t.in._zod.values),fu(e._zod,"optin",()=>t.in._zod.optin),fu(e._zod,"optout",()=>t.out._zod.optout),fu(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>$f(e,t.in,n)):$f(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>$f(e,t.out,n)):$f(r,t.out,n)}});function $f(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Hf=tu("$ZodReadonly",(e,t)=>{Dd.init(e,t),fu(e._zod,"propValues",()=>t.innerType._zod.propValues),fu(e._zod,"values",()=>t.innerType._zod.values),fu(e._zod,"optin",()=>t.innerType?._zod?.optin),fu(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Vf):Vf(r)}});function Vf(e){return e.value=Object.freeze(e.value),e}const qf=tu("$ZodCustom",(e,t)=>{vd.init(e,t),Dd.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Wf(t,n,r,e));Wf(o,n,r,e)}});function Wf(e,t,n,r){if(!e){const 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(Ou(e))}}var Zf;class Qf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const 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)}}(Zf=globalThis).__zod_globalRegistry??(Zf.__zod_globalRegistry=new Qf);const Kf=globalThis.__zod_globalRegistry;function Gf(e,t){return new e({type:"string",..._u(t)})}function Yf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._u(t)})}function Jf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._u(t)})}function Xf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._u(t)})}function ep(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._u(t)})}function tp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._u(t)})}function np(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._u(t)})}function rp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._u(t)})}function op(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._u(t)})}function ip(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._u(t)})}function ap(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._u(t)})}function sp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._u(t)})}function lp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._u(t)})}function cp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._u(t)})}function up(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._u(t)})}function dp(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._u(t)})}function fp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._u(t)})}function pp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._u(t)})}function hp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._u(t)})}function mp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._u(t)})}function gp(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._u(t)})}function yp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._u(t)})}function bp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._u(t)})}function vp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._u(t)})}function wp(e,t){return new e({type:"string",format:"date",check:"string_format",..._u(t)})}function kp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._u(t)})}function xp(e,t){return new e({type:"string",format:"duration",check:"string_format",..._u(t)})}function Sp(e,t){return new e({type:"number",checks:[],..._u(t)})}function _p(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._u(t)})}function Ep(e){return new e({type:"any"})}function Cp(e){return new e({type:"unknown"})}function zp(e,t){return new e({type:"never",..._u(t)})}function Ap(e,t){return new kd({check:"less_than",..._u(t),value:e,inclusive:!1})}function Np(e,t){return new kd({check:"less_than",..._u(t),value:e,inclusive:!0})}function Tp(e,t){return new xd({check:"greater_than",..._u(t),value:e,inclusive:!1})}function Op(e,t){return new xd({check:"greater_than",..._u(t),value:e,inclusive:!0})}function Pp(e,t){return new Sd({check:"multiple_of",..._u(t),value:e})}function jp(e,t){return new Ed({check:"max_length",..._u(t),maximum:e})}function Mp(e,t){return new Cd({check:"min_length",..._u(t),minimum:e})}function Ip(e,t){return new zd({check:"length_equals",..._u(t),length:e})}function Fp(e,t){return new Nd({check:"string_format",format:"regex",..._u(t),pattern:e})}function Lp(e){return new Td({check:"string_format",format:"lowercase",..._u(e)})}function Dp(e){return new Od({check:"string_format",format:"uppercase",..._u(e)})}function Rp(e,t){return new Pd({check:"string_format",format:"includes",..._u(t),includes:e})}function Up(e,t){return new jd({check:"string_format",format:"starts_with",..._u(t),prefix:e})}function Bp(e,t){return new Md({check:"string_format",format:"ends_with",..._u(t),suffix:e})}function $p(e){return new Id({check:"overwrite",tx:e})}function Hp(e){return $p(t=>t.normalize(e))}function Vp(){return $p(e=>e.trim())}function qp(){return $p(e=>e.toLowerCase())}function Wp(){return $p(e=>e.toUpperCase())}function Zp(){return $p(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Qp(e,t,n){return new e({type:"array",element:t,..._u(n)})}function Kp(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._u(n)})}function Gp(e){const t=Yp(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Ou(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Ou(r))}},e(n.value,n)));return t}function Yp(e,t){const n=new vd({check:"custom",..._u(t)});return n._zod.check=e,n}function Jp(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Kf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Xp(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i){i.count++;return n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema}const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{const n=a.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(a.ref||(a.ref=i),Xp(i,t,r),t.seen.get(i).isParent=!0)}const l=t.metadataRegistry.get(e);l&&Object.assign(a.schema,l),"input"===t.io&&nh(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault;return t.seen.get(e).schema}function eh(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const t=e.metadataRegistry.get(i[0])?.id;if(t){const e=r.get(t);if(e&&e!==i[0])throw new Error(`Duplicate schema id "${t}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(t,i[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const a=r.schema;for(const e in a)delete a[e];a.$ref=o};if("throw"===e.cycles)for(const i of e.seen.entries()){const e=i[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const n=i[1];if(t===i[0]){o(i);continue}if(e.external){const n=e.external.registry.get(i[0])?.id;if(t!==i[0]&&n){o(i);continue}}const r=e.metadataRegistry.get(i[0])?.id;r?o(i):(n.cycle||n.count>1&&"ref"===e.reused)&&o(i)}}function th(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},a=n.ref;if(n.ref=null,a){r(a);const n=e.seen.get(a),s=n.schema;!s.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,s):(o.allOf=o.allOf??[],o.allOf.push(s)),Object.assign(o,i);if(t._zod.parent===a)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(s.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const s=t._zod.parent;if(s&&s!==a){r(s);const t=e.seen.get(s);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const e=s[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:rh(t,"input",e.processors),output:rh(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(a){throw new Error("Error converting schema to JSON.")}}function nh(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return nh(r.element,n);if("set"===r.type)return nh(r.valueType,n);if("lazy"===r.type)return nh(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return nh(r.innerType,n);if("intersection"===r.type)return nh(r.left,n)||nh(r.right,n);if("record"===r.type||"map"===r.type)return nh(r.keyType,n)||nh(r.valueType,n);if("pipe"===r.type)return nh(r.in,n)||nh(r.out,n);if("object"===r.type){for(const e in r.shape)if(nh(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(nh(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(nh(e,n))return!0;return!(!r.rest||!nh(r.rest,n))}return!1}const rh=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=Jp({...o??{},target:i,io:t,processors:n});return Xp(e,a),eh(a,e),th(a,e)},oh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ih=(e,t,n,r)=>{const o=e._zod.def;Xp(o.innerType,t,r);t.seen.get(e).ref=o.innerType},ah=tu("ZodISODateTime",(e,t)=>{Jd.init(e,t),zh.init(e,t)});const sh=tu("ZodISODate",(e,t)=>{Xd.init(e,t),zh.init(e,t)});const lh=tu("ZodISOTime",(e,t)=>{ef.init(e,t),zh.init(e,t)});const ch=tu("ZodISODuration",(e,t)=>{tf.init(e,t),zh.init(e,t)});const uh=tu("ZodError",(e,t)=>{ju.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,su,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,su,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),dh=Iu(uh),fh=Fu(uh),ph=Lu(uh),hh=Ru(uh),mh=Bu(uh),gh=$u(uh),yh=Hu(uh),bh=Vu(uh),vh=qu(uh),wh=Wu(uh),kh=Zu(uh),xh=Qu(uh),Sh=tu("ZodType",(e,t)=>(Dd.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rh(e,"input"),output:rh(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Jp({...n,processors:t});return Xp(e,r),eh(r,e),th(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(hu(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Su(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>dh(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ph(e,t,n),e.parseAsync=async(t,n)=>fh(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>hh(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>mh(e,t,n),e.decode=(t,n)=>gh(e,t,n),e.encodeAsync=async(t,n)=>yh(e,t,n),e.decodeAsync=async(t,n)=>bh(e,t,n),e.safeEncode=(t,n)=>vh(e,t,n),e.safeDecode=(t,n)=>wh(e,t,n),e.safeEncodeAsync=async(t,n)=>kh(e,t,n),e.safeDecodeAsync=async(t,n)=>xh(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return Kp(wm,e,t)}(t,n)),e.superRefine=t=>e.check(Gp(t)),e.overwrite=t=>e.check($p(t)),e.optional=()=>cm(e),e.exactOptional=()=>new um({type:"optional",innerType:e}),e.nullable=()=>fm(e),e.nullish=()=>cm(fm(e)),e.nonoptional=t=>function(e,t){return new mm({type:"nonoptional",innerType:e,..._u(t)})}(e,t),e.array=()=>{return Qp(tm,e,t);var t},e.or=t=>{return new rm({type:"union",options:[e,t],..._u(n)});var n},e.and=t=>new om({type:"intersection",left:e,right:t}),e.transform=t=>bm(e,new sm({type:"transform",transform:t})),e.default=t=>{return n=t,new pm({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():wu(n)}});var n},e.prefault=t=>{return n=t,new hm({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():wu(n)}});var n},e.catch=t=>{return new gm({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>bm(e,t),e.readonly=()=>new vm({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Kf.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Kf.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Kf.get(e);const n=e.clone();return Kf.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),_h=tu("_ZodString",(e,t)=>{Rd.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:a,patterns:s,contentEncoding:l}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),a&&(r.format=oh[a]??a,""===r.format&&delete r.format,"time"===a&&delete r.format),l&&(r.contentEncoding=l),s&&s.size>0){const e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Fp(...t)),e.includes=(...t)=>e.check(Rp(...t)),e.startsWith=(...t)=>e.check(Up(...t)),e.endsWith=(...t)=>e.check(Bp(...t)),e.min=(...t)=>e.check(Mp(...t)),e.max=(...t)=>e.check(jp(...t)),e.length=(...t)=>e.check(Ip(...t)),e.nonempty=(...t)=>e.check(Mp(1,...t)),e.lowercase=t=>e.check(Lp(t)),e.uppercase=t=>e.check(Dp(t)),e.trim=()=>e.check(Vp()),e.normalize=(...t)=>e.check(Hp(...t)),e.toLowerCase=()=>e.check(qp()),e.toUpperCase=()=>e.check(Wp()),e.slugify=()=>e.check(Zp())}),Eh=tu("ZodString",(e,t)=>{Rd.init(e,t),_h.init(e,t),e.email=t=>e.check(Yf(Ah,t)),e.url=t=>e.check(rp(Oh,t)),e.jwt=t=>e.check(bp(Wh,t)),e.emoji=t=>e.check(op(Ph,t)),e.guid=t=>e.check(Jf(Nh,t)),e.uuid=t=>e.check(Xf(Th,t)),e.uuidv4=t=>e.check(ep(Th,t)),e.uuidv6=t=>e.check(tp(Th,t)),e.uuidv7=t=>e.check(np(Th,t)),e.nanoid=t=>e.check(ip(jh,t)),e.guid=t=>e.check(Jf(Nh,t)),e.cuid=t=>e.check(ap(Mh,t)),e.cuid2=t=>e.check(sp(Ih,t)),e.ulid=t=>e.check(lp(Fh,t)),e.base64=t=>e.check(mp(Hh,t)),e.base64url=t=>e.check(gp(Vh,t)),e.xid=t=>e.check(cp(Lh,t)),e.ksuid=t=>e.check(up(Dh,t)),e.ipv4=t=>e.check(dp(Rh,t)),e.ipv6=t=>e.check(fp(Uh,t)),e.cidrv4=t=>e.check(pp(Bh,t)),e.cidrv6=t=>e.check(hp($h,t)),e.e164=t=>e.check(yp(qh,t)),e.datetime=t=>e.check(function(e){return vp(ah,e)}(t)),e.date=t=>e.check(function(e){return wp(sh,e)}(t)),e.time=t=>e.check(function(e){return kp(lh,e)}(t)),e.duration=t=>e.check(function(e){return xp(ch,e)}(t))});function Ch(e){return Gf(Eh,e)}const zh=tu("ZodStringFormat",(e,t)=>{Ud.init(e,t),_h.init(e,t)}),Ah=tu("ZodEmail",(e,t)=>{Hd.init(e,t),zh.init(e,t)}),Nh=tu("ZodGUID",(e,t)=>{Bd.init(e,t),zh.init(e,t)}),Th=tu("ZodUUID",(e,t)=>{$d.init(e,t),zh.init(e,t)}),Oh=tu("ZodURL",(e,t)=>{Vd.init(e,t),zh.init(e,t)}),Ph=tu("ZodEmoji",(e,t)=>{qd.init(e,t),zh.init(e,t)}),jh=tu("ZodNanoID",(e,t)=>{Wd.init(e,t),zh.init(e,t)}),Mh=tu("ZodCUID",(e,t)=>{Zd.init(e,t),zh.init(e,t)}),Ih=tu("ZodCUID2",(e,t)=>{Qd.init(e,t),zh.init(e,t)}),Fh=tu("ZodULID",(e,t)=>{Kd.init(e,t),zh.init(e,t)}),Lh=tu("ZodXID",(e,t)=>{Gd.init(e,t),zh.init(e,t)}),Dh=tu("ZodKSUID",(e,t)=>{Yd.init(e,t),zh.init(e,t)}),Rh=tu("ZodIPv4",(e,t)=>{nf.init(e,t),zh.init(e,t)}),Uh=tu("ZodIPv6",(e,t)=>{rf.init(e,t),zh.init(e,t)}),Bh=tu("ZodCIDRv4",(e,t)=>{of.init(e,t),zh.init(e,t)}),$h=tu("ZodCIDRv6",(e,t)=>{af.init(e,t),zh.init(e,t)}),Hh=tu("ZodBase64",(e,t)=>{lf.init(e,t),zh.init(e,t)}),Vh=tu("ZodBase64URL",(e,t)=>{cf.init(e,t),zh.init(e,t)}),qh=tu("ZodE164",(e,t)=>{uf.init(e,t),zh.init(e,t)}),Wh=tu("ZodJWT",(e,t)=>{df.init(e,t),zh.init(e,t)}),Zh=tu("ZodNumber",(e,t)=>{ff.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:a,multipleOf:s,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof a&&a.includes("int")?r.type="integer":r.type="number","number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c),"number"==typeof o&&(r.minimum=o,"number"==typeof c&&"draft-04"!==t.target&&(c>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l),"number"==typeof i&&(r.maximum=i,"number"==typeof l&&"draft-04"!==t.target&&(l<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof s&&(r.multipleOf=s)})(e,t,n),e.gt=(t,n)=>e.check(Tp(t,n)),e.gte=(t,n)=>e.check(Op(t,n)),e.min=(t,n)=>e.check(Op(t,n)),e.lt=(t,n)=>e.check(Ap(t,n)),e.lte=(t,n)=>e.check(Np(t,n)),e.max=(t,n)=>e.check(Np(t,n)),e.int=t=>e.check(Gh(t)),e.safe=t=>e.check(Gh(t)),e.positive=t=>e.check(Tp(0,t)),e.nonnegative=t=>e.check(Op(0,t)),e.negative=t=>e.check(Ap(0,t)),e.nonpositive=t=>e.check(Np(0,t)),e.multipleOf=(t,n)=>e.check(Pp(t,n)),e.step=(t,n)=>e.check(Pp(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Qh(e){return Sp(Zh,e)}const Kh=tu("ZodNumberFormat",(e,t)=>{pf.init(e,t),Zh.init(e,t)});function Gh(e){return _p(Kh,e)}const Yh=tu("ZodAny",(e,t)=>{hf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});const Jh=tu("ZodUnknown",(e,t)=>{mf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Xh(){return Cp(Jh)}const em=tu("ZodNever",(e,t)=>{gf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});const tm=tu("ZodArray",(e,t)=>{bf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;"number"==typeof a&&(o.minItems=a),"number"==typeof s&&(o.maxItems=s),o.type="array",o.items=Xp(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Mp(t,n)),e.nonempty=t=>e.check(Mp(1,t)),e.max=(t,n)=>e.check(jp(t,n)),e.length=(t,n)=>e.check(Ip(t,n)),e.unwrap=()=>e.element});const nm=tu("ZodObject",(e,t)=>{Sf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const c in a)o.properties[c]=Xp(a[c],t,{...r,path:[...r.path,"properties",c]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));l.size>0&&(o.required=Array.from(l)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Xp(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),fu(e,"shape",()=>t.shape),e.keyof=()=>am(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Xh()}),e.loose=()=>e.clone({...e._zod.def,catchall:Xh()}),e.strict=()=>{return e.clone({...e._zod.def,catchall:zp(em,t)});var t},e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!vu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=hu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return pu(this,"shape",n),n}});return Su(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!vu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=hu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return pu(this,"shape",n),n}});return Su(e,n)}(e,t),e.merge=t=>function(e,t){const n=hu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return pu(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Su(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Su(e,hu(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return pu(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=hu(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return pu(this,"shape",r),r},checks:[]});return Su(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=hu(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return pu(this,"shape",o),o},checks:[]});return Su(t,o)}(lm,e,t[0]),e.required=(...t)=>function(e,t,n){const r=hu(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return pu(this,"shape",o),o}});return Su(t,r)}(mm,e,t[0])});const rm=tu("ZodUnion",(e,t)=>{Ef.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,a=o.options.map((e,n)=>Xp(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=a:n.anyOf=a})(e,t,n,r),e.options=t.options});const om=tu("ZodIntersection",(e,t)=>{Cf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Xp(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=Xp(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l})(e,t,n,r)});const im=tu("ZodEnum",(e,t)=>{Nf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=au(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new im({...t,checks:[],..._u(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new im({...t,checks:[],..._u(r),entries:o})}});function am(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new im({type:"enum",entries:n,..._u(t)})}const sm=tu("ZodTransform",(e,t)=>{Tf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ru(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Ou(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Ou(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const lm=tu("ZodOptional",(e,t)=>{Pf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ih(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function cm(e){return new lm({type:"optional",innerType:e})}const um=tu("ZodExactOptional",(e,t)=>{jf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ih(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const dm=tu("ZodNullable",(e,t)=>{Mf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Xp(o.innerType,t,r),a=t.seen.get(e);"openapi-3.0"===t.target?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fm(e){return new dm({type:"nullable",innerType:e})}const pm=tu("ZodDefault",(e,t)=>{If.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Xp(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const hm=tu("ZodPrefault",(e,t)=>{Lf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Xp(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const mm=tu("ZodNonOptional",(e,t)=>{Df.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Xp(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const gm=tu("ZodCatch",(e,t)=>{Uf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;Xp(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const ym=tu("ZodPipe",(e,t)=>{Bf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;Xp(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function bm(e,t){return new ym({type:"pipe",in:e,out:t})}const vm=tu("ZodReadonly",(e,t)=>{Hf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Xp(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const wm=tu("ZodCustom",(e,t)=>{qf.init(e,t),Sh.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const km=Object.create(null);km.open="0",km.close="1",km.ping="2",km.pong="3",km.message="4",km.upgrade="5",km.noop="6";const xm=Object.create(null);Object.keys(km).forEach(e=>{xm[km[e]]=e});const Sm={type:"error",data:"parser error"},_m="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Em="function"==typeof ArrayBuffer,Cm=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,zm=({type:e,data:t},n,r)=>_m&&t instanceof Blob?n?r(t):Am(t,r):Em&&(t instanceof ArrayBuffer||Cm(t))?n?r(t):Am(new Blob([t]),r):r(km[e]+(t||"")),Am=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function Nm(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Tm;const Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pm="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let Jy=0;Jy<64;Jy++)Pm[Om.charCodeAt(Jy)]=Jy;const jm="function"==typeof ArrayBuffer,Mm=(e,t)=>{if("string"!=typeof e)return{type:"message",data:Fm(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:Im(e.substring(1),t)};return xm[n]?e.length>1?{type:xm[n],data:e.substring(1)}:{type:xm[n]}:Sm},Im=(e,t)=>{if(jm){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=Pm[e.charCodeAt(t)],r=Pm[e.charCodeAt(t+1)],o=Pm[e.charCodeAt(t+2)],i=Pm[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return Fm(n,t)}return{base64:!0,data:e}},Fm=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Lm=String.fromCharCode(30);function Dm(){return new TransformStream({transform(e,t){!function(e,t){_m&&e.data instanceof Blob?e.data.arrayBuffer().then(Nm).then(t):Em&&(e.data instanceof ArrayBuffer||Cm(e.data))?t(Nm(e.data)):zm(e,!1,e=>{Tm||(Tm=new TextEncoder),t(Tm.encode(e))})}(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Rm;function Um(e){return e.reduce((e,t)=>e+t.length,0)}function Bm(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function $m(e){if(e)return function(e){for(var t in $m.prototype)e[t]=$m.prototype[t];return e}(e)}$m.prototype.on=$m.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},$m.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},$m.prototype.off=$m.prototype.removeListener=$m.prototype.removeAllListeners=$m.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},$m.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},$m.prototype.emitReserved=$m.prototype.emit,$m.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},$m.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Hm="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Vm="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function qm(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const Wm=Vm.setTimeout,Zm=Vm.clearTimeout;function Qm(e,t){t.useNativeTimers?(e.setTimeoutFn=Wm.bind(Vm),e.clearTimeoutFn=Zm.bind(Vm)):(e.setTimeoutFn=Vm.setTimeout.bind(Vm),e.clearTimeoutFn=Vm.clearTimeout.bind(Vm))}function Km(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}function Gm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class Ym extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Jm extends $m{constructor(e){super(),this.writable=!1,Qm(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new Ym(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Mm(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class Xm extends Jm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(Lm),r=[];for(let o=0;o<n.length;o++){const e=Mm(n[o],t);if(r.push(e),"error"===e.type)break}return r})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((e,i)=>{zm(e,!1,e=>{r[i]=e,++o===n&&t(r.join(Lm))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Gm()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let eg=!1;try{eg="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Yy){}const tg=eg;function ng(){}class rg extends Xm{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class og extends $m{constructor(e,t,n){super(),this.createRequest=e,Qm(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=qm(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(ky){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(ky){}try{n.setRequestHeader("Accept","*/*")}catch(ky){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof n.status?n.status:0)},0))},n.send(this._data)}catch(ky){return void this.setTimeoutFn(()=>{this._onError(ky)},0)}"undefined"!=typeof document&&(this._index=og.requestsCount++,og.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=ng,e)try{this._xhr.abort()}catch(ky){}"undefined"!=typeof document&&delete og.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(og.requestsCount=0,og.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",ig);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Vm?"pagehide":"unload",ig,!1)}function ig(){for(let e in og.requests)og.requests.hasOwnProperty(e)&&og.requests[e].abort()}const ag=function(){const e=sg({xdomain:!1});return e&&null!==e.responseType}();function sg(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||tg))return new XMLHttpRequest}catch(ky){}if(!t)try{return new(Vm[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(ky){}}const lg="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class cg extends Jm{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=lg?{}:qm(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(Yy){return this.emitReserved("error",Yy)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;zm(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch(ky){}r&&Hm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Gm()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const ug=Vm.WebSocket||Vm.MozWebSocket;const dg={websocket:class extends cg{createSocket(e,t,n){return lg?new ug(e,t,n):t?new ug(e,t):new ug(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Jm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(Yy){return this.emitReserved("error",Yy)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){Rm||(Rm=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(0===r){if(Um(n)<1)break;const e=Bm(n,1);i=!(128&~e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(Um(n)<2)break;const e=Bm(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(Um(n)<8)break;const e=Bm(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){s.enqueue(Sm);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(Um(n)<o)break;const e=Bm(n,o);s.enqueue(Mm(i?e:Rm.decode(e),t)),r=0}if(0===o||o>e){s.enqueue(Sm);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=Dm();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const o=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),o())}).catch(e=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&Hm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends rg{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ag&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new og(sg,this.uri(),e)}}},fg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,pg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function hg(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=fg.exec(e||""),i={},a=14;for(;a--;)i[pg[a]]=o[a]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}(0,i.query),i}const mg="function"==typeof addEventListener&&"function"==typeof removeEventListener,gg=[];mg&&addEventListener("offline",()=>{gg.forEach(e=>e())},!1);class yg extends $m{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const n=hg(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=hg(t.host).host);Qm(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}(this.opts.query)),mg&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},gg.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&yg.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",yg.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=Km(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Hm(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(yg.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),mg&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=gg.indexOf(this._offlineEventListener);-1!==e&&gg.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}yg.protocol=4;class bg extends yg{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;yg.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;yg.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let vg=class extends bg{constructor(e,t={}){const n="object"==typeof e?e:t;(!n.transports||n.transports&&"string"==typeof n.transports[0])&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(e=>dg[e]).filter(e=>!!e)),super(e,n)}};const wg="function"==typeof ArrayBuffer,kg=Object.prototype.toString,xg="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===kg.call(Blob),Sg="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===kg.call(File);function _g(e){return wg&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||xg&&e instanceof Blob||Sg&&e instanceof File}function Eg(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Eg(e[t]))return!0;return!1}if(_g(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Eg(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Eg(e[n]))return!0;return!1}function Cg(e){const t=[],n=e.data,r=e;return r.data=zg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function zg(e,t){if(!e)return e;if(_g(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=zg(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=zg(e[r],t));return n}return e}function Ag(e,t){return e.data=Ng(e.data,t),delete e.attachments,e}function Ng(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ng(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ng(e[n],t));return e}const Tg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Og,Pg;(Pg=Og||(Og={}))[Pg.CONNECT=0]="CONNECT",Pg[Pg.DISCONNECT=1]="DISCONNECT",Pg[Pg.EVENT=2]="EVENT",Pg[Pg.ACK=3]="ACK",Pg[Pg.CONNECT_ERROR=4]="CONNECT_ERROR",Pg[Pg.BINARY_EVENT=5]="BINARY_EVENT",Pg[Pg.BINARY_ACK=6]="BINARY_ACK";class jg extends $m{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===Og.BINARY_EVENT;n||t.type===Og.BINARY_ACK?(t.type=n?Og.EVENT:Og.ACK,this.reconstructor=new Mg(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!_g(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===Og[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Og.BINARY_EVENT||n.type===Og.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!jg.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(ky){return!1}}static isPayloadValid(e,t){switch(e){case Og.CONNECT:return Fg(t);case Og.DISCONNECT:return void 0===t;case Og.CONNECT_ERROR:return"string"==typeof t||Fg(t);case Og.EVENT:case Og.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Tg.indexOf(t[0]));case Og.ACK:case Og.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Mg{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Ag(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ig=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function Fg(e){return"[object Object]"===Object.prototype.toString.call(e)}const Lg=Object.freeze(Object.defineProperty({__proto__:null,Decoder:jg,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Og.EVENT&&e.type!==Og.ACK||!Eg(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Og.EVENT?Og.BINARY_EVENT:Og.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Og.BINARY_EVENT&&e.type!==Og.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Cg(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return Og},isPacketValid:function(e){return"string"==typeof e.nsp&&(void 0===(t=e.id)||Ig(t))&&function(e,t){switch(e){case Og.CONNECT:return void 0===t||Fg(t);case Og.DISCONNECT:return void 0===t;case Og.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Tg.indexOf(t[0]));case Og.ACK:return Array.isArray(t);case Og.CONNECT_ERROR:return"string"==typeof t||Fg(t);default:return!1}}(e.type,e.data);var t},protocol:5},Symbol.toStringTag,{value:"Module"}));function Dg(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Rg=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ug extends $m{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Dg(e,"open",this.onopen.bind(this)),Dg(e,"packet",this.onpacket.bind(this)),Dg(e,"error",this.onerror.bind(this)),Dg(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,o;if(Rg.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:Og.EVENT,data:t,options:{}};if(i.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),i.id=e}const a=null===(r=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===r?void 0:r.writable,s=this.connected&&!(null===(o=this.io.engine)||void 0===o?void 0:o._hasPingExpired());return this.flags.volatile&&!a||(s?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},r),i=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{const o=(e,t)=>e?r(e):n(t);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>{this._queue[0];return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Og.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Og.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Og.EVENT:case Og.BINARY_EVENT:this.onevent(e);break;case Og.ACK:case Og.BINARY_ACK:this.onack(e);break;case Og.DISCONNECT:this.ondisconnect();break;case Og.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Og.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Og.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Bg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Bg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Bg.prototype.reset=function(){this.attempts=0},Bg.prototype.setMin=function(e){this.ms=e},Bg.prototype.setMax=function(e){this.max=e},Bg.prototype.setJitter=function(e){this.jitter=e};class $g extends $m{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,Qm(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Bg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Lg;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new vg(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Dg(t,"open",function(){n.onopen(),e&&e()}),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=Dg(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),o(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Dg(e,"ping",this.onping.bind(this)),Dg(e,"data",this.ondata.bind(this)),Dg(e,"error",this.onerror.bind(this)),Dg(e,"close",this.onclose.bind(this)),Dg(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(ky){this.onclose("parse error",ky)}}ondecoded(e){Hm(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ug(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Hg={};function Vg(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=hg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=Hg[o]&&i in Hg[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new $g(r,t):(Hg[o]||(Hg[o]=new $g(r,t)),s=Hg[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}Object.assign(Vg,{Manager:$g,Socket:Ug,io:Vg,connect:Vg});const qg="chat_device_id";function Wg(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const Zg=function(e,t){const n={type:"object",shape:e??{},..._u(t)};return new nm(n)}({id:Ch().optional(),type:am(["text","image","audio","location","system"]).default("text"),content:Ch().optional(),imageUrl:Ch().url().optional(),audioUrl:Ch().url().optional(),latitude:Qh().optional(),longitude:Qh().optional(),timestamp:Ch().optional(),sender:am(["bot","user","system"]).optional(),emotion:Ep(Yh).optional()});function Qg(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,userContext:o}=e,i=E.useRef(e);E.useEffect(()=>{i.current=e},[e]);const a=E.useRef(null),[s,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(function(){try{const e=localStorage.getItem(qg);if(e)return e;const t=Wg();return localStorage.setItem(qg,t),t}catch{return Qt("localStorage not available, using session-only device ID"),Wg()}}()),f=E.useRef(r);E.useEffect(()=>{f.current=r},[r]);const p=E.useCallback(e=>{const t=Zg.safeParse(e),n=t.success&&t.data.id?t.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,r=t.success&&t.data.sender?t.data.sender:"bot",o=t.success&&t.data.timestamp?new Date(t.data.timestamp):new Date,i=t.success?t.data:{type:"text"};switch(i.type){case"image":return{id:n,type:"image",sender:r,timestamp:o,imageUrl:i.imageUrl||i.content||"",altText:"Imagen enviada"};case"audio":return{id:n,type:"audio",sender:r,timestamp:o,content:i.audioUrl||i.content||""};case"location":return{id:n,type:"location",sender:r,timestamp:o,latitude:Number(i.latitude||0),longitude:Number(i.longitude||0),name:i.content||"Ubicación compartida"};case"system":return{id:n,type:"system",sender:"system",timestamp:o,content:String(i.content||"")};default:return{id:n,type:"text",sender:r,timestamp:o,content:String(i.content||"Sin contenido"),emotion:i.emotion}}},[]),h=E.useCallback(()=>{if(!t||!n)return;if(a.current?.connected)return;l(!0);const e=Vg(`${n}/webchat`,{auth:{apiKey:t,deviceId:d.current,token:o?.token,metadata:o?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});e.on("connect",()=>{l(!1),u(!0),i.current.onConnected(`temp-${Date.now()}`,void 0)}),e.on("disconnect",e=>{l(!1),u(!1),i.current.onDisconnected()}),e.on("connect_error",e=>{l(!1),i.current.onError(`Error de conexión: ${e.message}`)}),e.on("connection_ack",e=>{i.current.onConnected(e.sessionId,e.config)}),e.on("bot_message",e=>{try{i.current.onMessage(p(e))}catch(ky){Kt("ChatSocket Error processing bot_message:",ky)}}),e.on("chat_history",e=>{e.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{try{i.current.onMessage(p(e))}catch(ky){Gt("Error processing history message:",ky)}}),i.current.onEvent&&i.current.onEvent("history_loaded",e)}),e.on("bot_typing",e=>i.current.onTyping(e)),e.on("auth_success",e=>{i.current.onLogin&&i.current.onLogin(e),e.theme&&i.current.onThemeUpdate&&i.current.onThemeUpdate(e.theme)}),a.current=e},[t,n]),m=E.useCallback(()=>{a.current&&(a.current.disconnect(),a.current=null,u(!1))},[]),g=E.useRef(h);g.current=h,E.useEffect(()=>(g.current(),()=>{a.current&&(a.current.disconnect(),a.current=null)}),[]);const y=E.useRef([]),b=E.useRef([]),v=E.useCallback(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),w=E.useCallback(()=>{if(a.current?.connected)for(;y.current.length>0;){const e=y.current.shift();a.current.emit("user_message",e)}},[]);E.useEffect(()=>{c&&w()},[c,w]),E.useEffect(()=>{if(!c)return;const e=setInterval(()=>{const e=Date.now();b.current=b.current.filter(t=>e<t.nextRetryAt||(t.attempts>=t.maxAttempts?(i.current.onEvent?.("message_failed",{id:t.id,payload:t.payload}),Kt("Message failed after max retries:",t.id),!1):!a.current?.connected||(a.current.emit("user_message",t.payload,e=>{e?.success&&i.current.onEvent?.("message_sent",{id:t.id})}),t.attempts++,t.nextRetryAt=e+1e3*Math.pow(2,t.attempts),t.attempts<t.maxAttempts)))},500);return()=>clearInterval(e)},[c]);const k=E.useCallback((e,t="text")=>{const n=v(),r={...f.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:(new Date).toISOString(),deviceId:d.current},o={id:n,content:e.trim(),type:t,metadata:r};return a.current?.connected?(a.current.emit("user_message",o,e=>{!1!==e?.success&&e?i.current.onEvent?.("message_sent",{id:n}):(b.current.push({id:n,payload:o,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),i.current.onEvent?.("message_retry_queued",{id:n}))}),n):(y.current.push(o),i.current.onEvent?.("queued_message",{id:n,payload:o}),n)},[v]),x=E.useMemo(()=>yc(e=>{a.current?.emit("typing",e)},250),[]);return{isConnected:c,isConnecting:s,sendMessage:k,sendTyping:x,requestHistory:E.useCallback(()=>{a.current?.emit("request_history")},[]),reconnect:h,disconnect:m}}function Kg(e=!1){const t="undefined"!=typeof window?window.location.pathname:"",n=E.useMemo(()=>t,[t]),[r,o]=E.useState({});return E.useEffect(()=>{if(!e)return void o({});const t=setTimeout(()=>{const e=function(){if("undefined"==typeof window)return{};const e={};e.title=document.title,document.querySelectorAll("meta").forEach(t=>{const n=t.getAttribute("name"),r=t.getAttribute("property"),o=t.getAttribute("content");if(o){if(n)switch(n){case"description":e.description=o;break;case"keywords":e.keywords=o.split(",").map(e=>e.trim());break;case"author":e.author=o}if(r){if(r.startsWith("og:")){const t=r.replace("og:","og_");e[t]=o}if(r.startsWith("twitter:")){const t=r.replace("twitter:","twitter_");e[t]=o}}}});try{const t=document.querySelectorAll('script[type="application/ld+json"]');if(t.length>0){const n=[];t.forEach(e=>{try{const t=JSON.parse(e.textContent||"");n.push(t)}catch{}}),n.length>0&&(e.structuredData=n)}}catch{}return e}();o(e)},100);return()=>clearTimeout(t)},[n,e]),e&&Object.keys(r).length>0?r:void 0}class Gg{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(e,t){this.endpoint=e,this.apiKey=t,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(e){this.track("message_sent",{type:e})}trackMessageReceived(e,t){this.track("message_received",{type:e,latency:t})}trackError(e,t){this.track("error",{error:e,context:t})}trackConnectionStatus(e){this.track("connection_status",{isConnected:e})}trackFeatureUsed(e){this.track("feature_used",{feature:e})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(e,t){this.track("attachment_sent",{type:e,size:t})}track(e,t){this.isDisabled||(this.queue.push({event:e,properties:{...t,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),Qt("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const e=[...this.queue];this.queue=[];try{const t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:e}),keepalive:!0});t.ok?Gt(`Analytics: Flushed ${e.length} events`):(this.isDisabled=!0,this.queue=[],Gt(`Analytics disabled: endpoint returned ${t.status}`))}catch(t){this.isDisabled=!0,this.queue=[],Gt("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let Yg=null,Jg=null;function Xg(e){Yg=e}function ey(e){Jg=e}const ty=E.createContext(null);const ny=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)});function ry(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o=!1,theme:i,userContext:a,onLogin:s,onNavigate:l,onEvent:c,onStateChange:u,onThemeUpdate:d}=e,[f,p]=E.useState(0),h=E.useRef(0),{t:m}=D(),g=function(e,t,n=!0){const r=E.useRef(null);return E.useEffect(()=>{if(!n||!e||!t)return;const o=`${e}/analytics`;r.current=new Gg(o,t);const i=()=>r.current?.flush(),a=()=>{"hidden"===document.visibilityState&&r.current?.flush()};return window.addEventListener("beforeunload",i),window.addEventListener("visibilitychange",a),()=>{window.removeEventListener("beforeunload",i),window.removeEventListener("visibilitychange",a),r.current?.destroy()}},[e,t,n]),{trackOpen:E.useCallback(()=>{r.current?.trackOpen()},[]),trackClose:E.useCallback(()=>{r.current?.trackClose()},[]),trackMessageSent:E.useCallback(e=>{r.current?.trackMessageSent(e)},[]),trackMessageReceived:E.useCallback((e,t)=>{r.current?.trackMessageReceived(e,t)},[]),trackError:E.useCallback((e,t)=>{r.current?.trackError(e,t)},[]),trackConnectionStatus:E.useCallback(e=>{r.current?.trackConnectionStatus(e)},[]),trackFeatureUsed:E.useCallback(e=>{r.current?.trackFeatureUsed(e)},[])}}(n,t,!0),y=function({enabled:e=!0,soundEnabled:t=!0,desktopEnabled:n=!0,botName:r="Asistente",logoUrl:o,notificationSoundUrl:i}={}){const[a,s]=E.useState("default"),l=E.useRef(null),c=o||Jt,u=i||Xt;E.useEffect(()=>{t&&"undefined"!=typeof window&&(l.current=new Audio(u),l.current.volume=.3)},[t,u]),E.useEffect(()=>{"undefined"!=typeof window&&"Notification"in window&&s(Notification.permission)},[]);const d=E.useCallback(async()=>{if("undefined"==typeof window||!("Notification"in window))return Qt("Notifications API not available"),!1;try{const e=await Notification.requestPermission();return s(e),Yt("Notification permission:",e),"granted"===e}catch(e){return Kt("Error requesting notification permission:",e),!1}},[]),f=E.useCallback(t=>{if(e&&n&&"granted"===a&&("undefined"==typeof document||!document.hasFocus()))try{const e=`Nuevo mensaje de ${r}`;let n="Mensaje recibido";"text"===t.type&&"content"in t?n=t.content?.slice(0,100)||"Mensaje recibido":"image"===t.type?n="📷 Imagen":"audio"===t.type?n="🎵 Audio":"location"===t.type&&(n="📍 Ubicación");const o=new Notification(e,{body:n,icon:c,tag:"chat-message",requireInteraction:!1,silent:!1});o.onclick=()=>{window.focus(),o.close()},setTimeout(()=>o.close(),5e3)}catch(o){Kt("Error showing notification:",o)}},[e,n,a,r,c]),p=E.useCallback(()=>{if(e&&t&&("undefined"==typeof document||!document.hasFocus()))try{l.current?.play().catch(e=>{Gt("Audio playback blocked:",e)})}catch(n){Kt("Error playing sound:",n)}},[e,t]),h=E.useCallback(e=>{f(e),p()},[f,p]);return{permission:a,requestPermission:d,notify:f,playSound:p,notifyWithSound:h}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:i?.botName||"Asistente",logoUrl:i?.logoUrl}),b=function(e=10,t=6e4){const n=E.useRef([]);return{isAllowed:E.useCallback(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),!(n.current.length>=e||(n.current.push(r),0))},[e,t]),getRemainingAttempts:E.useCallback(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),Math.max(0,e-n.current.length)},[e,t]),getTimeUntilReset:E.useCallback(()=>{if(0===n.current.length)return 0;const e=Date.now(),r=n.current[0],o=t-(e-r);return Math.max(0,o)},[t]),reset:E.useCallback(()=>{n.current=[]},[])}}(10,6e4),{state:v,actions:w}=function(){const[e,t]=E.useReducer(eu,Xc),[n,r]=E.useState(!1);E.useEffect(()=>{"undefined"==typeof window||n||(async()=>{try{await Yc.migrateFromLocalStorage();const e=await Yc.getMessages(100),n=await Yc.getMetadata();if(e.length>0||n){const r={messages:e.map(e=>({...e,timestamp:new Date(e.timestamp)})),sessionId:n?.sessionId||null,isOpen:n?.isOpen||!1};t({type:"RESTORE_SESSION",payload:r})}}catch(ky){Qt("Chat: Error rehydrating from IndexedDB",ky);try{const e=localStorage.getItem(Jc);if(e){const n=JSON.parse(e);n.messages&&(n.messages=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))),t({type:"RESTORE_SESSION",payload:n})}}catch(e){Kt("Chat: Fallback rehydration failed",e)}}finally{r(!0)}})()},[n]),E.useEffect(()=>{if(!n)return;const t=setTimeout(async()=>{try{await Yc.saveMessages(e.messages),await Yc.setMetadata({isOpen:e.isOpen,sessionId:e.sessionId})}catch(ky){Kt("Chat Persistence Error:",ky);try{const t={isOpen:e.isOpen,messages:e.messages,sessionId:e.sessionId};localStorage.setItem(Jc,JSON.stringify(t))}catch(t){Kt("Chat: Fallback persistence failed",t)}}},500);return()=>clearTimeout(t)},[e.isOpen,e.messages,e.sessionId,n]);const o=E.useCallback(e=>{t({type:"ADD_MESSAGE",payload:e})},[]),i=E.useCallback(()=>t({type:"TOGGLE_WINDOW"}),[]),a=E.useCallback(()=>t({type:"OPEN_WINDOW"}),[]),s=E.useCallback(()=>t({type:"CLOSE_WINDOW"}),[]),l=E.useCallback(e=>t({type:"SET_CONNECTED",payload:e}),[]),c=E.useCallback(e=>t({type:"SET_TYPING",payload:e}),[]),u=E.useCallback(e=>t({type:"SET_MESSAGES",payload:e}),[]),d=E.useCallback(e=>t({type:"SET_ERROR",payload:e}),[]),f=E.useCallback(e=>t({type:"SET_SESSION_ID",payload:e}),[]),p=E.useCallback(()=>{localStorage.removeItem(Jc),t({type:"CLEAR_CHAT"})},[]),h=E.useCallback(()=>{t({type:"SET_MESSAGES",payload:[]})},[]);return{state:e,isHydrated:n,actions:{toggleWindow:i,openWindow:a,closeWindow:s,setConnected:l,setTyping:c,addMessage:o,setMessages:u,setError:d,setSessionId:f,clearChat:p,clearMessages:h}}}(),k=Kg(o),x=Qg({apiKey:t,apiBaseUrl:n,pageContext:E.useMemo(()=>k?{...r||{},seo:{...k||{}}}:r,[r,k]),userContext:a,onMessage:E.useCallback(e=>{const t=Date.now(),n=h.current>0?t-h.current:void 0;h.current=t,w.addMessage(e),g.trackMessageReceived(e.type,n),v.isOpen||"bot"!==e.sender||(p(e=>e+1),y.notifyWithSound(e))},[w,v.isOpen,g,y]),onConnected:E.useCallback((e,t)=>{w.setConnected(!0),w.setSessionId(e),g.trackConnectionStatus(!0),t&&c&&c("backend_config",t)},[w,c,g]),onDisconnected:E.useCallback(()=>{w.setConnected(!1),g.trackConnectionStatus(!1)},[w,g]),onTyping:E.useCallback(e=>w.setTyping(e),[w]),onError:E.useCallback(e=>{w.setError(e),g.trackError(e)},[w,g]),onLogin:s,onNavigate:l,onEvent:c,onThemeUpdate:d}),S=E.useCallback(()=>{Gt("ChatWidget handleToggle called, current isOpen:",v.isOpen),v.isOpen?(w.closeWindow(),g.trackClose(),u?.(!1),Gt("ChatWidget Closing window")):(w.openWindow(),p(0),g.trackOpen(),u?.(!0),Gt("ChatWidget Opening window"))},[v.isOpen,w,u,g]),_=E.useCallback(e=>{if(!b.isAllowed()){const e=b.getTimeUntilReset(),t=Math.ceil(e/1e3);return void w.setError(m("rate_limit_exceeded")+` Espera ${t}s.`)}const t={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:new Date,content:e};w.addMessage(t),g.trackMessageSent("text"),x.sendMessage(e,"text")},[w,x,b,g,m]),C=E.useCallback(async(e,t)=>{let n;n="audio"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:new Date,content:URL.createObjectURL(e)}:"image"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:new Date,imageUrl:URL.createObjectURL(e)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:new Date,content:`📎 ${e.name}`},w.addMessage(n);const r=await ny(e);x.sendMessage(r,t)},[w,x]),z=E.useCallback(e=>{const t={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:new Date,latitude:e.latitude,longitude:e.longitude,name:"Mi ubicación"};w.addMessage(t),x.sendMessage(JSON.stringify(e),"location")},[w,x]);E.useEffect(()=>{const e=()=>{v.isOpen||w.openWindow()},t=()=>{v.isOpen&&w.closeWindow()},n=()=>{v.isOpen?w.closeWindow():w.openWindow()},r=e=>{e.detail?.message&&_(e.detail.message)};return window.addEventListener("botuyo-chat:open",e),window.addEventListener("botuyo-chat:close",t),window.addEventListener("botuyo-chat:toggle",n),window.addEventListener("botuyo-chat:send-message",r),()=>{window.removeEventListener("botuyo-chat:open",e),window.removeEventListener("botuyo-chat:close",t),window.removeEventListener("botuyo-chat:toggle",n),window.removeEventListener("botuyo-chat:send-message",r)}},[v.isOpen,w,_]),E.useEffect(()=>(Xg(_),()=>Xg(null)),[_]);const A=E.useCallback(()=>{w.clearMessages(),Yt("Chat history cleared")},[w]);E.useEffect(()=>(ey(A),()=>ey(null)),[A]);const N=E.useMemo(()=>{if(v.isTyping)return"thinking";const e=[...v.messages].reverse().find(e=>"bot"===e.sender&&"text"===e.type);return"text"===e?.type&&e.emotion?e.emotion:"default"},[v.isTyping,v.messages]);return{state:v,actions:w,unreadCount:f,currentBotEmotion:N,isConnected:x.isConnected,handleToggle:S,handleSendText:_,handleSendAttachment:C,handleSendLocation:z}}function oy(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o=!1,theme:i,mediaConfig:a,userContext:s,onLogin:l,onNavigate:c,onEvent:u,onStateChange:d,onVoiceCall:f}=e,p=E.useRef(null),h=bc();!function(e){const[t,n]=E.useState(!1);E.useEffect(()=>{let t=null;const r=()=>{if(!e.current)return;const t=!!e.current.parentElement?.closest(".dark"),r=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),o=document.getElementById("botuyo-chat-widget-root"),i=!!o?.parentElement?.closest(".dark"),a=document.documentElement.classList.contains("dark"),s=document.body.classList.contains("dark"),l=window.matchMedia("(prefers-color-scheme: dark)").matches,c=t||r||i||a||s||l;e.current&&(c?e.current.classList.add("dark"):e.current.classList.remove("dark")),n(c)};r();const o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>r();o.addEventListener("change",i);const a=new MutationObserver(()=>{r()}),s=document.getElementById("botuyo-chat-widget-root");s&&(a.observe(s,{attributes:!0,attributeFilter:["class"]}),s.parentElement&&(a.observe(s.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=s.parentElement)),a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),a.observe(document.body,{attributes:!0,attributeFilter:["class"]});let l=e.current?.parentElement;for(;l;)a.observe(l,{attributes:!0,attributeFilter:["class"]}),l=l.parentElement;const c=setInterval(()=>{const e=document.getElementById("botuyo-chat-widget-root");e&&e.parentElement!==t&&(t&&e.parentElement&&(a.observe(e.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=e.parentElement),r())},100);return()=>{a.disconnect(),o.removeEventListener("change",i),clearInterval(c)}},[e])}(p);const[m,g]=E.useState(),{mergedTheme:y,mergedStyles:b,getContainerStyle:v}=zc(i,m),{state:w,actions:k,unreadCount:x,currentBotEmotion:S,isConnected:_,handleToggle:C,handleSendText:z,handleSendAttachment:A,handleSendLocation:N}=ry({apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o,theme:i,userContext:s,onLogin:l,onNavigate:c,onEvent:u,onStateChange:d,onThemeUpdate:g}),T=E.useCallback(e=>{e.stopPropagation()},[]),P=v(w.isOpen,h,i?.position),j=E.useMemo(()=>{if(!y.cssVariables)return{};const e={},t=y.cssVariables;return t.background&&(e["--background"]=t.background),t.foreground&&(e["--foreground"]=t.foreground),t.card&&(e["--card"]=t.card),t.cardForeground&&(e["--card-foreground"]=t.cardForeground),t.primary&&(e["--primary"]=t.primary),t.primaryForeground&&(e["--primary-foreground"]=t.primaryForeground),t.muted&&(e["--muted"]=t.muted),t.mutedForeground&&(e["--muted-foreground"]=t.mutedForeground),t.border&&(e["--border"]=t.border),t.destructive&&(e["--destructive"]=t.destructive),t.radius&&(e["--radius"]=t.radius),t.spacing1&&(e["--spacing-1"]=t.spacing1),t.spacing2&&(e["--spacing-2"]=t.spacing2),t.spacing3&&(e["--spacing-3"]=t.spacing3),t.spacing4&&(e["--spacing-4"]=t.spacing4),t.spacing5&&(e["--spacing-5"]=t.spacing5),t.spacing6&&(e["--spacing-6"]=t.spacing6),t.spacing8&&(e["--spacing-8"]=t.spacing8),e},[y.cssVariables]);return O.jsx(Wt,{animations:i?.animations,effects:i?.effects,children:O.jsxs("div",{ref:p,id:"botuyo-chat-widget",className:jt("botuyo-chat-widget flex flex-col",!h&&("bottom-left"===i?.position?"items-start":"items-end")),style:{...P,...j,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===i?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===i?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===i?.effects?.softShadows?"false":void 0,children:[O.jsx("div",{className:jt("transition-all duration-400 ease-[cubic-bezier(0.34,1.56,0.64,1)]",h?"bottom-left"===i?.position?"origin-bottom-left":"origin-bottom-right":"origin-bottom",w.isOpen?"opacity-100 scale-100 h-full w-full translate-y-0 pointer-events-auto":"opacity-0 scale-[0.85] pointer-events-none translate-y-8 h-0 w-0"),style:{pointerEvents:w.isOpen?"auto":"none"},onMouseDown:T,onTouchStart:T,children:O.jsx(Sc,{children:O.jsx(xc,{isOpen:w.isOpen,isConnected:_,isTyping:w.isTyping,messages:w.messages,onClose:()=>k.closeWindow(),onSendMessage:z,onSendAttachment:A,onSendLocation:N,botName:i?.botName,logoUrl:i?.logoUrl,welcomeMessage:i?.welcomeMessage,inputPlaceholder:i?.inputPlaceholder,primaryColor:i?.primaryColor,position:i?.position,bubbleStyles:b,avatars:i?.avatars,mediaConfig:a,theme:y,onVoiceCall:f})})}),O.jsx("div",{className:jt(w.isOpen?"hidden":"block",!h&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:T,onTouchStart:T,children:O.jsx(tn,{isOpen:w.isOpen,onClick:C,unreadCount:x,position:i?.position||"bottom-right",primaryColor:i?.primaryColor,logoUrl:i?.logoUrl,starterPrompt:i?.starterPrompt,avatars:i?.avatars,emotion:S,styles:b,promptPersistence:i?.promptPersistence,avatarScale:i?.avatarScale})})]})})}const iy=Object.freeze(Object.defineProperty({__proto__:null,ChatWidget:oy},Symbol.toStringTag,{value:"Module"})),ay=E.lazy(()=>Promise.resolve().then(()=>iy).then(e=>({default:e.ChatWidget})));class sy{root=null;container=null;config=null;init(e){return this.config=e,this.render(),this}render(){if(!this.config)return void console.error("[BotUyoChat] No configuration provided");if(this.container||(this.container=document.createElement("div"),this.container.id="botuyo-chat-widget-root",this.container.style.position="fixed",this.container.style.zIndex="999999",document.body.appendChild(this.container)),this.config.theme?.cssVariables){const e=this.config.theme.cssVariables,t={background:e.background,foreground:e.foreground,card:e.card,cardForeground:e.cardForeground,primary:e.primary,primaryForeground:e.primaryForeground,muted:e.muted,mutedForeground:e.mutedForeground,border:e.border,destructive:e.destructive,radius:e.radius,spacing1:e.spacing1,spacing2:e.spacing2,spacing3:e.spacing3,spacing4:e.spacing4,spacing5:e.spacing5,spacing6:e.spacing6,spacing8:e.spacing8};Object.entries(t).forEach(([e,t])=>{void 0!==t&&this.container.style.setProperty(`--${e}`,t)})}this.root||(this.root=_.createRoot(this.container));const e={apiKey:this.config.apiKey,apiBaseUrl:this.config.apiBaseUrl,theme:{primaryColor:"#10b981",botName:"Asistente Virtual",position:"bottom-right",welcomeMessage:"¡Hola! 👋 ¿En qué puedo ayudarte?",inputPlaceholder:"Escribe tu mensaje...",borderRadius:"0.75rem",launcherBorderRadius:"50%",...this.config.theme},userContext:this.config.userContext,pageContext:this.config.pageContext,includeSEOMetadata:this.config.includeSEOMetadata??!1,mediaConfig:this.config.mediaConfig,onNavigate:this.config.onNavigate,onLogin:this.config.onLogin,onEvent:this.config.onEvent,onStateChange:this.config.onStateChange,onVoiceCall:this.config.onVoiceCall},t=C.createElement(E.Suspense,{fallback:C.createElement("div",{style:{position:"fixed",bottom:"24px",right:"24px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:e.theme?.primaryColor||"#10b981",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",cursor:"wait"}},C.createElement("div",{style:{width:"24px",height:"24px",border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},C.createElement(ay,e));this.root.render(C.createElement(F,{defaultLocale:this.config.theme?.defaultLocale,children:t})),console.log("[BotUyoChat] Widget initialized",e)}update(e){this.config?(this.config={...this.config,...e,theme:{...this.config.theme,...e.theme}},this.render()):console.error("[BotUyoChat] Widget not initialized")}destroy(){this.root&&(this.root.unmount(),this.root=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null),this.config=null,console.log("[BotUyoChat] Widget destroyed")}open(){window.dispatchEvent(new CustomEvent("botuyo-chat:open"))}close(){window.dispatchEvent(new CustomEvent("botuyo-chat:close"))}sendMessage(e){window.dispatchEvent(new CustomEvent("botuyo-chat:send-message",{detail:{message:e}}))}getState(){return null}}const ly=new sy;window.BotUyoChat=ly;const cy=E.memo(function({url:e,isBot:t,primaryColor:n}){const[r,o]=E.useState(!1),[i,a]=E.useState(0),[s,l]=E.useState(0),[c,u]=E.useState(!0),[d,f]=E.useState(null),p=E.useRef(null),h=E.useMemo(()=>Bt({primaryColor:n}),[n]),m=E.useCallback(()=>{d||(r?p.current?.pause():p.current?.play().catch(e=>{console.error("[AudioPlayer] Play error:",e),f("Error al reproducir")}),o(!r))},[r,d]),g=E.useCallback(()=>{a(p.current?.duration||0)},[]),y=E.useCallback(()=>{u(!1),f(null)},[]),b=E.useCallback(()=>{console.error("[AudioPlayer] Failed to load audio:",e),u(!1),f("No se pudo cargar")},[e]),v=E.useCallback(()=>{u(!0),f(null),p.current&&p.current.load()},[]);return O.jsxs("div",{className:jt("flex items-center gap-3 py-1 min-w-[200px]",t?"text-foreground":"text-primary-foreground"),children:[O.jsx("audio",{ref:p,src:e,preload:"metadata",onLoadedMetadata:g,onCanPlayThrough:y,onTimeUpdate:()=>l(p.current?.currentTime||0),onEnded:()=>o(!1),onError:b}),d?O.jsx("button",{onClick:v,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors",title:"Reintentar",children:O.jsx(de,{className:"w-4 h-4"})}):O.jsx("button",{onClick:m,disabled:c,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity",style:{backgroundColor:t?h:"hsl(var(--card))",color:t?"white":h,opacity:c?.6:1},children:c?O.jsx(te,{className:"w-4 h-4 animate-spin"}):r?O.jsx(ae,{className:"w-4 h-4 fill-current"}):O.jsx(ce,{className:"w-4 h-4 fill-current ml-0.5"})}),O.jsx("div",{className:"flex-1 space-y-1",children:d?O.jsxs("div",{className:"flex items-center gap-1.5 text-red-500",children:[O.jsx(K,{className:"w-3 h-3"}),O.jsx("span",{className:"text-[9px] font-bold",children:d})]}):O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"relative h-1 w-full bg-current/20 rounded-full overflow-hidden",children:O.jsx("div",{className:"absolute h-full bg-current rounded-full transition-all",style:{width:`${s/i*100||0}%`}})}),O.jsxs("div",{className:"flex justify-between text-[9px] font-bold opacity-60",children:[O.jsxs("span",{children:[Math.floor(s/60),":",Math.floor(s%60).toString().padStart(2,"0")]}),O.jsx("span",{children:c?"--:--":`${Math.floor(i/60)}:${Math.floor(i%60).toString().padStart(2,"0")}`})]})]})})]})}),uy=Object.freeze(Object.defineProperty({__proto__:null,AudioPlayer:cy},Symbol.toStringTag,{value:"Module"})),dy=E.memo(function({images:e,radius:t="rounded-lg"}){const{t:n}=D("extracted"),[r,o]=E.useState(0),[i,a]=E.useState(!1),s=()=>{o(t=>(t+1)%e.length)},l=()=>{o(t=>(t-1+e.length)%e.length)},c=e=>{o(e),a(!0)},[u,d]=E.useState(new Set),f=e=>{d(t=>new Set(t).add(e))};return 1===e.length?O.jsx("div",{className:"my-3 relative group",children:u.has(0)?O.jsxs("div",{className:jt("w-full h-48 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),style:{borderColor:"hsl(var(--border))"},children:[O.jsx("svg",{className:"w-12 h-12 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),O.jsx("span",{className:"text-sm",children:"Imagen no disponible"})]}):O.jsxs(O.Fragment,{children:[O.jsx("img",{src:e[0].src,alt:e[0].alt||"Imagen",className:jt("w-full h-auto object-cover cursor-pointer transition-all duration-300","border shadow-soft-md hover:shadow-soft-lg hover:scale-[1.02]",t),style:{borderColor:"hsl(var(--border))"},loading:"lazy",onClick:()=>c(0),onError:()=>f(0)}),O.jsx("div",{className:"absolute top-2 right-2 bg-black/50 backdrop-blur-sm p-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:O.jsx(ye,{size:16,className:"text-white"})})]})}):e.length<=3?O.jsxs("div",{className:jt("my-3 grid gap-2",2===e.length?"grid-cols-2":"grid-cols-3"),children:[e.map((n,r)=>O.jsx("div",{className:"relative group overflow-hidden",children:u.has(r)?O.jsx("div",{className:jt("w-full h-32 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),children:O.jsx("svg",{className:"w-8 h-8 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}):O.jsxs(O.Fragment,{children:[O.jsx("img",{src:n.src,alt:n.alt||`Imagen ${r+1}`,className:jt("w-full h-32 object-cover cursor-pointer transition-all duration-300","border border-border shadow-soft-md hover:shadow-soft-lg hover:scale-110",t),loading:"lazy",onClick:()=>c(r),onError:()=>f(r)}),O.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-end p-2",children:O.jsxs("span",{className:"text-white text-xs font-bold bg-black/50 backdrop-blur-sm px-2 py-1 rounded-full",children:[r+1,"/",e.length]})})]})},r)),i&&O.jsx(fy,{images:e,currentIndex:r,onClose:()=>a(!1),onNext:s,onPrev:l})]}):O.jsxs("div",{className:"my-3 space-y-2",children:[O.jsx("div",{className:"relative group",children:u.has(r)?O.jsxs("div",{className:jt("w-full h-56 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),style:{borderColor:"hsl(var(--border))"},children:[O.jsx("svg",{className:"w-12 h-12 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),O.jsx("span",{className:"text-sm",children:"Imagen no disponible"})]}):O.jsxs(O.Fragment,{children:[O.jsx("img",{src:e[r].src,alt:e[r].alt||`Imagen ${r+1}`,className:jt("w-full h-56 object-cover cursor-pointer transition-all duration-300","border shadow-soft-md",t),style:{borderColor:"hsl(var(--border))"},loading:"lazy",onClick:()=>c(r),onError:()=>f(r)}),O.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-black/20 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-between px-3",children:[O.jsx("button",{onClick:l,className:"p-2 rounded-full shadow-soft-lg transition-all hover:scale-110 active:scale-95",style:{backgroundColor:"hsl(var(--card) / 0.9)",color:"hsl(var(--foreground))"},"aria-label":n("anterior"),children:O.jsx(Z,{size:20})}),O.jsx("button",{onClick:s,className:"p-2 rounded-full shadow-soft-lg transition-all hover:scale-110 active:scale-95",style:{backgroundColor:"hsl(var(--card) / 0.9)",color:"hsl(var(--foreground))"},"aria-label":n("siguiente"),children:O.jsx(Q,{size:20})})]}),O.jsx("div",{className:"absolute top-3 right-3 bg-black/70 backdrop-blur-sm px-3 py-1 rounded-full",children:O.jsxs("span",{className:"text-white text-xs font-bold",children:[r+1," / ",e.length]})}),O.jsx("div",{className:"absolute bottom-3 right-3 bg-black/70 backdrop-blur-sm p-2 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:O.jsx(ye,{size:16,className:"text-white"})})]})}),O.jsx("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",children:e.map((e,n)=>O.jsx("button",{onClick:()=>o(n),className:jt("flex-shrink-0 w-16 h-16 overflow-hidden transition-all duration-300 relative","border-2 hover:scale-110",t,r===n?"border-[hsl(210,90%,50%)] ring-2 ring-[hsl(210,90%,50%)]/30 scale-105":"border-border hover:border-[hsl(210,90%,70%)] opacity-70 hover:opacity-100"),children:u.has(n)?O.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:O.jsx("svg",{className:"w-6 h-6 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}):O.jsx("img",{src:e.src,alt:e.alt||`Thumbnail ${n+1}`,className:"w-full h-full object-cover",loading:"lazy",onError:()=>f(n)})},n))}),i&&O.jsx(fy,{images:e,currentIndex:r,onClose:()=>a(!1),onNext:s,onPrev:l})]})});function fy({images:e,currentIndex:t,onClose:n,onNext:r,onPrev:o}){const{t:i}=D("extracted");return O.jsxs("div",{className:"fixed inset-0 z-[100000] bg-black/95 backdrop-blur-sm flex items-center justify-center animate-in fade-in duration-200",onClick:n,children:[O.jsx("button",{onClick:n,className:"absolute top-4 right-4 bg-white/10 hover:bg-white/20 p-2 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":i("cerrar"),children:O.jsx(ge,{size:24,className:"text-white"})}),O.jsx("div",{className:"absolute top-4 left-4 bg-white/10 backdrop-blur-sm px-4 py-2 rounded-full z-10",children:O.jsxs("span",{className:"text-white text-sm font-bold",children:[t+1," / ",e.length]})}),e.length>1&&O.jsxs(O.Fragment,{children:[O.jsx("button",{onClick:e=>{e.stopPropagation(),o()},className:"absolute left-4 bg-white/10 hover:bg-white/20 p-3 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":"Anterior",children:O.jsx(Z,{size:32,className:"text-white"})}),O.jsx("button",{onClick:e=>{e.stopPropagation(),r()},className:"absolute right-4 bg-white/10 hover:bg-white/20 p-3 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":"Siguiente",children:O.jsx(Q,{size:32,className:"text-white"})})]}),O.jsx("img",{src:e[t].src,alt:e[t].alt||`Imagen ${t+1}`,className:"max-w-[90%] max-h-[90vh] object-contain",onClick:e=>e.stopPropagation()})]})}const py=Object.freeze(Object.defineProperty({__proto__:null,Gallery:dy},Symbol.toStringTag,{value:"Module"}));function hy(e,t){return new Promise(function(n,r){let o;return my(e).then(function(e){try{return o=e,n(new Blob([t.slice(0,2),o,t.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}},r)})}const my=e=>new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",({target:{result:e}})=>{const r=new DataView(e);let o=0;if(65496!==r.getUint16(o))return n("not a valid JPEG");for(o+=2;;){const i=r.getUint16(o);if(65498===i)break;const a=r.getUint16(o+2);if(65505===i&&1165519206===r.getUint32(o+4)){const i=o+10;let s;switch(r.getUint16(i)){case 18761:s=!0;break;case 19789:s=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==r.getUint16(i+2,s))return n("TIFF header contains invalid version");const l=r.getUint32(i+4,s),c=i+l+2+12*r.getUint16(i+l,s);for(let e=i+l+2;e<c;e+=12)if(274==r.getUint16(e,s)){if(3!==r.getUint16(e+2,s))return n("Orientation data type is invalid");if(1!==r.getUint32(e+4,s))return n("Orientation data count is invalid");r.setUint16(e+8,1,s);break}return t(e.slice(o,o+2+a))}o+=2+a}return t(new Blob)}),r.readAsArrayBuffer(e)});var gy,yy,by,vy={},wy={get exports(){return vy},set exports(e){vy=e}};by={},wy.exports=by,by.parse=function(e,t){for(var n=by.bin.readUshort,r=by.bin.readUint,o=0,i={},a=new Uint8Array(e),s=a.length-4;101010256!=r(a,s);)s--;o=s,o+=4;var l=n(a,o+=4);n(a,o+=2);var c=r(a,o+=2),u=r(a,o+=4);o+=4,o=u;for(var d=0;d<l;d++){r(a,o),o+=4,o+=4,o+=4,r(a,o+=4),c=r(a,o+=4);var f=r(a,o+=4),p=n(a,o+=4),h=n(a,o+2),m=n(a,o+4);o+=6;var g=r(a,o+=8);o+=4,o+=p+h+m,by._readLocal(a,g,i,c,f,t)}return i},by._readLocal=function(e,t,n,r,o,i){var a=by.bin.readUshort,s=by.bin.readUint;s(e,t),a(e,t+=4),a(e,t+=2);var l=a(e,t+=2);s(e,t+=2),s(e,t+=4),t+=4;var c=a(e,t+=8),u=a(e,t+=2);t+=2;var d=by.bin.readUTF8(e,t,c);if(t+=c,t+=u,i)n[d]={size:o,csize:r};else{var f=new Uint8Array(e.buffer,t);if(0==l)n[d]=new Uint8Array(f.buffer.slice(t,t+r));else{if(8!=l)throw"unknown compression method: "+l;var p=new Uint8Array(o);by.inflateRaw(f,p),n[d]=p}}},by.inflateRaw=function(e,t){return by.F.inflate(e,t)},by.inflate=function(e,t){return e[0],e[1],by.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},by.deflate=function(e,t){null==t&&(t={level:6});var n=0,r=new Uint8Array(50+Math.floor(1.1*e.length));r[n]=120,r[n+1]=156,n+=2,n=by.F.deflateRaw(e,r,n,t.level);var o=by.adler(e,0,e.length);return r[n+0]=o>>>24&255,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o>>>0&255,new Uint8Array(r.buffer,0,n+4)},by.deflateRaw=function(e,t){null==t&&(t={level:6});var n=new Uint8Array(50+Math.floor(1.1*e.length)),r=by.F.deflateRaw(e,n,r,t.level);return new Uint8Array(n.buffer,0,r)},by.encode=function(e,t){null==t&&(t=!1);var n=0,r=by.bin.writeUint,o=by.bin.writeUshort,i={};for(var a in e){var s=!by._noNeed(a)&&!t,l=e[a],c=by.crc.crc(l,0,l.length);i[a]={cpr:s,usize:l.length,crc:c,file:s?by.deflateRaw(l):l}}for(var a in i)n+=i[a].file.length+30+46+2*by.bin.sizeUTF8(a);n+=22;var u=new Uint8Array(n),d=0,f=[];for(var a in i){var p=i[a];f.push(d),d=by._writeHeader(u,d,a,p,0)}var h=0,m=d;for(var a in i)p=i[a],f.push(d),d=by._writeHeader(u,d,a,p,1,f[h++]);var g=d-m;return r(u,d,101010256),d+=4,o(u,d+=4,h),o(u,d+=2,h),r(u,d+=2,g),r(u,d+=4,m),d+=4,d+=2,u.buffer},by._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},by._writeHeader=function(e,t,n,r,o,i){var a=by.bin.writeUint,s=by.bin.writeUshort,l=r.file;return a(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),s(e,t,20),s(e,t+=2,0),s(e,t+=2,r.cpr?8:0),a(e,t+=2,0),a(e,t+=4,r.crc),a(e,t+=4,l.length),a(e,t+=4,r.usize),s(e,t+=4,by.bin.sizeUTF8(n)),s(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,a(e,t+=6,i),t+=4),t+=by.bin.writeUTF8(e,t,n),0==o&&(e.set(l,t),t+=l.length),t},by.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update:function(e,t,n,r){for(var o=0;o<r;o++)e=by.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^by.crc.update(4294967295,e,t,n)}},by.adler=function(e,t,n){for(var r=1,o=0,i=t,a=t+n;i<a;){for(var s=Math.min(i+5552,a);i<s;)o+=r+=e[i++];r%=65521,o%=65521}return o<<16|r},by.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r="",o=0;o<n;o++)r+=String.fromCharCode(e[t+o]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var r,o="",i=0;i<n;i++)o+="%"+by.bin.pad(e[t+i].toString(16));try{r=decodeURIComponent(o)}catch(a){return by.bin.readASCII(e,t,n)}return r},writeUTF8:function(e,t,n){for(var r=n.length,o=0,i=0;i<r;i++){var a=n.charCodeAt(i);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+o]=240|a>>18,e[t+o+1]=128|a>>12&63,e[t+o+2]=128|a>>6&63,e[t+o+3]=128|63&a,o+=4}else e[t+o]=224|a>>12,e[t+o+1]=128|a>>6&63,e[t+o+2]=128|63&a,o+=3;else e[t+o]=192|a>>6,e[t+o+1]=128|63&a,o+=2;else e[t+o]=a,o++}return o},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var o=e.charCodeAt(r);if(4294967168&o)if(4294965248&o)if(4294901760&o){if(4292870144&o)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},by.F={},by.F.deflateRaw=function(e,t,n,r){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][r],i=by.F.U,a=by.F._goodIndex;by.F._hash;var s=by.F._putsE,l=0,c=n<<3,u=0,d=e.length;if(0==r){for(;l<d;)s(t,c,l+(S=Math.min(65535,d-l))==d?1:0),c=by.F._copyExact(e,l,S,t,c+8),l+=S;return c>>>3}var f=i.lits,p=i.strt,h=i.prev,m=0,g=0,y=0,b=0,v=0,w=0;for(d>2&&(p[w=by.F._hash(e,0)]=0),l=0;l<d;l++){if(v=w,l+1<d-2){w=by.F._hash(e,l+1);var k=l+1&32767;h[k]=p[w],p[w]=k}if(u<=l){(m>14e3||g>26697)&&d-l>100&&(u<l&&(f[m]=l-u,m+=2,u=l),c=by.F._writeBlock(l==d-1||u==d?1:0,f,m,b,e,y,l-y,t,c),m=g=b=0,y=l);var x=0;l<d-2&&(x=by.F._bestMatch(e,l,h,v,Math.min(o[2],d-l),o[3]));var S=x>>>16,_=65535&x;if(0!=x){_=65535&x;var E=a(S=x>>>16,i.of0);i.lhst[257+E]++;var C=a(_,i.df0);i.dhst[C]++,b+=i.exb[E]+i.dxb[C],f[m]=S<<23|l-u,f[m+1]=_<<16|E<<8|C,m+=2,u=l+S}else i.lhst[e[l]]++;g++}}for(y==l&&0!=e.length||(u<l&&(f[m]=l-u,m+=2,u=l),c=by.F._writeBlock(1,f,m,b,e,y,l-y,t,c),m=0,g=0,m=g=b=0,y=l);7&c;)c++;return c>>>3},by.F._bestMatch=function(e,t,n,r,o,i){var a=32767&t,s=n[a],l=a-s+32768&32767;if(s==a||r!=by.F._hash(e,t-l))return 0;for(var c=0,u=0,d=Math.min(32767,t);l<=d&&0!=--i&&s!=a;){if(0==c||e[t+c]==e[t+c-l]){var f=by.F._howLong(e,t,l);if(f>c){if(u=l,(c=f)>=o)break;l+2<f&&(f=l+2);for(var p=0,h=0;h<f-2;h++){var m=t-l+h+32768&32767,g=m-n[m]+32768&32767;g>p&&(p=g,s=m)}}}l+=(a=s)-(s=n[a])+32768&32767}return c<<16|u},by.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,o=Math.min(e.length,t+258);for(t+=3;t<o&&e[t]==e[t-n];)t++;return t-r},by.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},by.saved=0,by.F._writeBlock=function(e,t,n,r,o,i,a,s,l){var c,u,d,f,p,h,m,g,y,b=by.F.U,v=by.F._putsF,w=by.F._putsE;b.lhst[256]++,u=(c=by.F.getTrees())[0],d=c[1],f=c[2],p=c[3],h=c[4],m=c[5],g=c[6],y=c[7];var k=32+(l+3&7?8-(l+3&7):0)+(a<<3),x=r+by.F.contSize(b.fltree,b.lhst)+by.F.contSize(b.fdtree,b.dhst),S=r+by.F.contSize(b.ltree,b.lhst)+by.F.contSize(b.dtree,b.dhst);S+=14+3*m+by.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var _=0;_<286;_++)b.lhst[_]=0;for(_=0;_<30;_++)b.dhst[_]=0;for(_=0;_<19;_++)b.ihst[_]=0;var E=k<x&&k<S?0:x<S?1:2;if(v(s,l,e),v(s,l+1,E),l+=3,0==E){for(;7&l;)l++;l=by.F._copyExact(o,i,a,s,l)}else{var C,z;if(1==E&&(C=b.fltree,z=b.fdtree),2==E){by.F.makeCodes(b.ltree,u),by.F.revCodes(b.ltree,u),by.F.makeCodes(b.dtree,d),by.F.revCodes(b.dtree,d),by.F.makeCodes(b.itree,f),by.F.revCodes(b.itree,f),C=b.ltree,z=b.dtree,w(s,l,p-257),w(s,l+=5,h-1),w(s,l+=5,m-4),l+=4;for(var A=0;A<m;A++)w(s,l+3*A,b.itree[1+(b.ordr[A]<<1)]);l+=3*m,l=by.F._codeTiny(g,b.itree,s,l),l=by.F._codeTiny(y,b.itree,s,l)}for(var N=i,T=0;T<n;T+=2){for(var O=t[T],P=O>>>23,j=N+(8388607&O);N<j;)l=by.F._writeLit(o[N++],C,s,l);if(0!=P){var M=t[T+1],I=M>>16,F=M>>8&255,L=255&M;w(s,l=by.F._writeLit(257+F,C,s,l),P-b.of0[F]),l+=b.exb[F],v(s,l=by.F._writeLit(L,z,s,l),I-b.df0[L]),l+=b.dxb[L],N+=P}}l=by.F._writeLit(256,C,s,l)}return l},by.F._copyExact=function(e,t,n,r,o){var i=o>>>3;return r[i]=n,r[i+1]=n>>>8,r[i+2]=255-r[i],r[i+3]=255-r[i+1],i+=4,r.set(new Uint8Array(e.buffer,t,n),i),o+(n+4<<3)},by.F.getTrees=function(){for(var e=by.F.U,t=by.F._hufTree(e.lhst,e.ltree,15),n=by.F._hufTree(e.dhst,e.dtree,15),r=[],o=by.F._lenCodes(e.ltree,r),i=[],a=by.F._lenCodes(e.dtree,i),s=0;s<r.length;s+=2)e.ihst[r[s]]++;for(s=0;s<i.length;s+=2)e.ihst[i[s]]++;for(var l=by.F._hufTree(e.ihst,e.itree,7),c=19;c>4&&0==e.itree[1+(e.ordr[c-1]<<1)];)c--;return[t,n,l,o,a,c,r,i]},by.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},by.F.nonZero=function(e){for(var t="",n=0;n<e.length;n+=2)0!=e[n+1]&&(t+=(n>>1)+",");return t},by.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},by.F._codeTiny=function(e,t,n,r){for(var o=0;o<e.length;o+=2){var i=e[o],a=e[o+1];r=by.F._writeLit(i,t,n,r);var s=16==i?2:17==i?3:7;i>15&&(by.F._putsE(n,r,a,s),r+=s)}return r},by.F._lenCodes=function(e,t){for(var n=e.length;2!=n&&0==e[n-1];)n-=2;for(var r=0;r<n;r+=2){var o=e[r+1],i=r+3<n?e[r+3]:-1,a=r+5<n?e[r+5]:-1,s=0==r?-1:e[r-1];if(0==o&&i==o&&a==o){for(var l=r+5;l+2<n&&e[l+2]==o;)l+=2;(c=Math.min(l+1-r>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),r+=2*c-2}else if(o==s&&i==o&&a==o){for(l=r+5;l+2<n&&e[l+2]==o;)l+=2;var c=Math.min(l+1-r>>>1,6);t.push(16,c-3),r+=2*c-2}else t.push(o,0)}return n>>>1},by.F._hufTree=function(e,t,n){var r=[],o=e.length,i=t.length,a=0;for(a=0;a<i;a+=2)t[a]=0,t[a+1]=0;for(a=0;a<o;a++)0!=e[a]&&r.push({lit:a,f:e[a]});var s=r.length,l=r.slice(0);if(0==s)return 0;if(1==s){var c=r[0].lit;return l=0==c?1:0,t[1+(c<<1)]=1,t[1+(l<<1)]=1,1}r.sort(function(e,t){return e.f-t.f});var u=r[0],d=r[1],f=0,p=1,h=2;for(r[0]={lit:-1,f:u.f+d.f,l:u,r:d,d:0};p!=s-1;)u=f!=p&&(h==s||r[f].f<r[h].f)?r[f++]:r[h++],d=f!=p&&(h==s||r[f].f<r[h].f)?r[f++]:r[h++],r[p++]={lit:-1,f:u.f+d.f,l:u,r:d};var m=by.F.setDepth(r[p-1],0);for(m>n&&(by.F.restrictDepth(l,n,m),m=n),a=0;a<s;a++)t[1+(l[a].lit<<1)]=l[a].d;return m},by.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(by.F.setDepth(e.l,t+1),by.F.setDepth(e.r,t+1))},by.F.restrictDepth=function(e,t,n){var r=0,o=1<<n-t,i=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),r=0;r<e.length&&e[r].d>t;r++){var a=e[r].d;e[r].d=t,i+=o-(1<<n-a)}for(i>>>=n-t;i>0;)(a=e[r].d)<t?(e[r].d++,i-=1<<t-a-1):r++;for(;r>=0;r--)e[r].d==t&&i<0&&(e[r].d--,i++);0!=i&&console.log("debt left")},by.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},by.F._writeLit=function(e,t,n,r){return by.F._putsF(n,r,t[e<<1]),r+t[1+(e<<1)]},by.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var r=by.F,o=r._bitsF,i=r._bitsE,a=r._decodeTiny,s=r.makeCodes,l=r.codes2map,c=r._get17,u=r.U,d=null==t;d&&(t=new n(e.length>>>2<<3));for(var f,p,h=0,m=0,g=0,y=0,b=0,v=0,w=0,k=0,x=0;0==h;)if(h=o(e,x,1),m=o(e,x+1,2),x+=3,0!=m){if(d&&(t=by.F._check(t,k+(1<<17))),1==m&&(f=u.flmap,p=u.fdmap,v=511,w=31),2==m){g=i(e,x,5)+257,y=i(e,x+5,5)+1,b=i(e,x+10,4)+4,x+=14;for(var S=0;S<38;S+=2)u.itree[S]=0,u.itree[S+1]=0;var _=1;for(S=0;S<b;S++){var E=i(e,x+3*S,3);u.itree[1+(u.ordr[S]<<1)]=E,E>_&&(_=E)}x+=3*b,s(u.itree,_),l(u.itree,_,u.imap),f=u.lmap,p=u.dmap,x=a(u.imap,(1<<_)-1,g+y,e,x,u.ttree);var C=r._copyOut(u.ttree,0,g,u.ltree);v=(1<<C)-1;var z=r._copyOut(u.ttree,g,y,u.dtree);w=(1<<z)-1,s(u.ltree,C),l(u.ltree,C,f),s(u.dtree,z),l(u.dtree,z,p)}for(;;){var A=f[c(e,x)&v];x+=15&A;var N=A>>>4;if(N>>>8==0)t[k++]=N;else{if(256==N)break;var T=k+N-254;if(N>264){var O=u.ldef[N-257];T=k+(O>>>3)+i(e,x,7&O),x+=7&O}var P=p[c(e,x)&w];x+=15&P;var j=P>>>4,M=u.ddef[j],I=(M>>>4)+o(e,x,15&M);for(x+=15&M,d&&(t=by.F._check(t,k+(1<<17)));k<T;)t[k]=t[k++-I],t[k]=t[k++-I],t[k]=t[k++-I],t[k]=t[k++-I];k=T}}}else{7&x&&(x+=8-(7&x));var F=4+(x>>>3),L=e[F-4]|e[F-3]<<8;d&&(t=by.F._check(t,k+L)),t.set(new n(e.buffer,e.byteOffset+F,L),k),x=F+L<<3,k+=L}return t.length==k?t:t.slice(0,k)},by.F._check=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(Math.max(n<<1,t));return r.set(e,0),r},by.F._decodeTiny=function(e,t,n,r,o,i){for(var a=by.F._bitsE,s=by.F._get17,l=0;l<n;){var c=e[s(r,o)&t];o+=15&c;var u=c>>>4;if(u<=15)i[l]=u,l++;else{var d=0,f=0;16==u?(f=3+a(r,o,2),o+=2,d=i[l-1]):17==u?(f=3+a(r,o,3),o+=3):18==u&&(f=11+a(r,o,7),o+=7);for(var p=l+f;l<p;)i[l]=d,l++}}return o},by.F._copyOut=function(e,t,n,r){for(var o=0,i=0,a=r.length>>>1;i<n;){var s=e[i+t];r[i<<1]=0,r[1+(i<<1)]=s,s>o&&(o=s),i++}for(;i<a;)r[i<<1]=0,r[1+(i<<1)]=0,i++;return o},by.F.makeCodes=function(e,t){for(var n,r,o,i,a=by.F.U,s=e.length,l=a.bl_count,c=0;c<=t;c++)l[c]=0;for(c=1;c<s;c+=2)l[e[c]]++;var u=a.next_code;for(n=0,l[0]=0,r=1;r<=t;r++)n=n+l[r-1]<<1,u[r]=n;for(o=0;o<s;o+=2)0!=(i=e[o+1])&&(e[o]=u[i],u[i]++)},by.F.codes2map=function(e,t,n){for(var r=e.length,o=by.F.U.rev15,i=0;i<r;i+=2)if(0!=e[i+1])for(var a=i>>1,s=e[i+1],l=a<<4|s,c=t-s,u=e[i]<<c,d=u+(1<<c);u!=d;)n[o[u]>>>15-t]=l,u++},by.F.revCodes=function(e,t){for(var n=by.F.U.rev15,r=15-t,o=0;o<e.length;o+=2){var i=e[o]<<t-e[o+1];e[o]=n[i]>>>r}},by.F._putsE=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},by.F._putsF=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},by.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},by.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},by.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},by.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},by.F.U=(gy=Uint16Array,yy=Uint32Array,{next_code:new gy(16),bl_count:new gy(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new gy(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new yy(32),flmap:new gy(512),fltree:[],fdmap:new gy(32),fdtree:[],lmap:new gy(32768),ltree:[],ttree:[],dmap:new gy(32768),dtree:[],imap:new gy(512),itree:[],rev15:new gy(32768),lhst:new yy(286),dhst:new yy(30),ihst:new yy(19),lits:new yy(15e3),strt:new gy(65536),prev:new gy(32768)}),function(){for(var e=by.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];r(e.fltree,144,8),r(e.fltree,112,9),r(e.fltree,24,7),r(e.fltree,8,8),by.F.makeCodes(e.fltree,9),by.F.codes2map(e.fltree,9,e.flmap),by.F.revCodes(e.fltree,9),r(e.fdtree,32,5),by.F.makeCodes(e.fdtree,5),by.F.codes2map(e.fdtree,5,e.fdmap),by.F.revCodes(e.fdtree,5),r(e.itree,19,0),r(e.ltree,286,0),r(e.dtree,30,0),r(e.ttree,320,0)}();var ky,xy=(ky={__proto__:null,default:vy},[vy].forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(t){if("default"!==t&&!(t in ky)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(ky,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})}),Object.freeze(ky));const Sy=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII(e,t,n){let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(e[t+o]);return r},writeASCII(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes(e,t,n){const r=[];for(let o=0;o<n;o++)r.push(e[t+o]);return r},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,n,r){let o,i="";for(let s=0;s<r;s++)i+=`%${e.pad(t[n+s].toString(16))}`;try{o=decodeURIComponent(i)}catch(a){return e.readASCII(t,n,r)}return o}};function t(t,n,r,o){const a=n*r,s=i(o),l=Math.ceil(n*s/8),c=new Uint8Array(4*a),u=new Uint32Array(c.buffer),{ctype:d}=o,{depth:f}=o,p=e.readUshort;if(6==d){const e=a<<2;if(8==f)for(var h=0;h<e;h+=4)c[h]=t[h],c[h+1]=t[h+1],c[h+2]=t[h+2],c[h+3]=t[h+3];if(16==f)for(h=0;h<e;h++)c[h]=t[h<<1]}else if(2==d){const e=o.tabs.tRNS;if(null==e){if(8==f)for(h=0;h<a;h++){var m=3*h;u[h]=255<<24|t[m+2]<<16|t[m+1]<<8|t[m]}if(16==f)for(h=0;h<a;h++)m=6*h,u[h]=255<<24|t[m+4]<<16|t[m+2]<<8|t[m]}else{var g=e[0];const n=e[1],r=e[2];if(8==f)for(h=0;h<a;h++){var y=h<<2;m=3*h,u[h]=255<<24|t[m+2]<<16|t[m+1]<<8|t[m],t[m]==g&&t[m+1]==n&&t[m+2]==r&&(c[y+3]=0)}if(16==f)for(h=0;h<a;h++)y=h<<2,m=6*h,u[h]=255<<24|t[m+4]<<16|t[m+2]<<8|t[m],p(t,m)==g&&p(t,m+2)==n&&p(t,m+4)==r&&(c[y+3]=0)}}else if(3==d){const e=o.tabs.PLTE,i=o.tabs.tRNS,s=i?i.length:0;if(1==f)for(var b=0;b<r;b++){var v=b*l,w=b*n;for(h=0;h<n;h++){y=w+h<<2;var k=3*(x=t[v+(h>>3)]>>7-(7&h)&1);c[y]=e[k],c[y+1]=e[k+1],c[y+2]=e[k+2],c[y+3]=x<s?i[x]:255}}if(2==f)for(b=0;b<r;b++)for(v=b*l,w=b*n,h=0;h<n;h++)y=w+h<<2,k=3*(x=t[v+(h>>2)]>>6-((3&h)<<1)&3),c[y]=e[k],c[y+1]=e[k+1],c[y+2]=e[k+2],c[y+3]=x<s?i[x]:255;if(4==f)for(b=0;b<r;b++)for(v=b*l,w=b*n,h=0;h<n;h++)y=w+h<<2,k=3*(x=t[v+(h>>1)]>>4-((1&h)<<2)&15),c[y]=e[k],c[y+1]=e[k+1],c[y+2]=e[k+2],c[y+3]=x<s?i[x]:255;if(8==f)for(h=0;h<a;h++){var x;y=h<<2,k=3*(x=t[h]),c[y]=e[k],c[y+1]=e[k+1],c[y+2]=e[k+2],c[y+3]=x<s?i[x]:255}}else if(4==d){if(8==f)for(h=0;h<a;h++){y=h<<2;var S=t[_=h<<1];c[y]=S,c[y+1]=S,c[y+2]=S,c[y+3]=t[_+1]}if(16==f)for(h=0;h<a;h++){var _;y=h<<2,S=t[_=h<<2],c[y]=S,c[y+1]=S,c[y+2]=S,c[y+3]=t[_+2]}}else if(0==d)for(g=o.tabs.tRNS?o.tabs.tRNS:-1,b=0;b<r;b++){const e=b*l,r=b*n;if(1==f)for(var E=0;E<n;E++){var C=(S=255*(t[e+(E>>>3)]>>>7-(7&E)&1))==255*g?0:255;u[r+E]=C<<24|S<<16|S<<8|S}else if(2==f)for(E=0;E<n;E++)C=(S=85*(t[e+(E>>>2)]>>>6-((3&E)<<1)&3))==85*g?0:255,u[r+E]=C<<24|S<<16|S<<8|S;else if(4==f)for(E=0;E<n;E++)C=(S=17*(t[e+(E>>>1)]>>>4-((1&E)<<2)&15))==17*g?0:255,u[r+E]=C<<24|S<<16|S<<8|S;else if(8==f)for(E=0;E<n;E++)C=(S=t[e+E])==g?0:255,u[r+E]=C<<24|S<<16|S<<8|S;else if(16==f)for(E=0;E<n;E++)S=t[e+(E<<1)],C=p(t,e+(E<<1))==g?0:255,u[r+E]=C<<24|S<<16|S<<8|S}return c}function n(e,t,n,s){const l=i(e),c=Math.ceil(n*l/8),u=new Uint8Array((c+1+e.interlace)*s);return t=e.tabs.CgBI?o(t,u):r(t,u),0==e.interlace?t=a(t,e,0,n,s):1==e.interlace&&(t=function(e,t){const n=t.width,r=t.height,o=i(t),s=o>>3,l=Math.ceil(n*o/8),c=new Uint8Array(r*l);let u=0;const d=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],p=[8,8,8,4,4,2,2],h=[8,8,4,4,2,2,1];let m=0;for(;m<7;){const i=p[m],y=h[m];let b=0,v=0,w=d[m];for(;w<r;)w+=i,v++;let k=f[m];for(;k<n;)k+=y,b++;const x=Math.ceil(b*o/8);a(e,t,u,b,v);let S=0,_=d[m];for(;_<r;){let t=f[m],r=u+S*x<<3;for(;t<n;){var g;if(1==o&&(g=(g=e[r>>3])>>7-(7&r)&1,c[_*l+(t>>3)]|=g<<7-(7&t)),2==o&&(g=(g=e[r>>3])>>6-(7&r)&3,c[_*l+(t>>2)]|=g<<6-((3&t)<<1)),4==o&&(g=(g=e[r>>3])>>4-(7&r)&15,c[_*l+(t>>1)]|=g<<4-((1&t)<<2)),o>=8){const n=_*l+t*s;for(let t=0;t<s;t++)c[n+t]=e[(r>>3)+t]}r+=o,t+=y}S++,_+=i}b*v!=0&&(u+=v*(1+x)),m+=1}return c}(t,e)),t}function r(e,t){return o(new Uint8Array(e.buffer,2,e.length-6),t)}var o=function(){const e={H:{}};return e.H.N=function(t,n){const r=Uint8Array;let o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,p=0,h=0;if(3==t[0]&&0==t[1])return n||new r(0);const m=e.H,g=m.b,y=m.e,b=m.R,v=m.n,w=m.A,k=m.Z,x=m.m,S=null==n;for(S&&(n=new r(t.length>>>2<<5));0==a;)if(a=g(t,h,1),s=g(t,h+1,2),h+=3,0!=s){if(S&&(n=e.H.W(n,p+(1<<17))),1==s&&(o=x.J,i=x.h,d=511,f=31),2==s){l=y(t,h,5)+257,c=y(t,h+5,5)+1,u=y(t,h+10,4)+4,h+=14;let e=1;for(var _=0;_<38;_+=2)x.Q[_]=0,x.Q[_+1]=0;for(_=0;_<u;_++){const n=y(t,h+3*_,3);x.Q[1+(x.X[_]<<1)]=n,n>e&&(e=n)}h+=3*u,v(x.Q,e),w(x.Q,e,x.u),o=x.w,i=x.d,h=b(x.u,(1<<e)-1,l+c,t,h,x.v);const n=m.V(x.v,0,l,x.C);d=(1<<n)-1;const r=m.V(x.v,l,c,x.D);f=(1<<r)-1,v(x.C,n),w(x.C,n,o),v(x.D,r),w(x.D,r,i)}for(;;){const e=o[k(t,h)&d];h+=15&e;const r=e>>>4;if(r>>>8==0)n[p++]=r;else{if(256==r)break;{let e=p+r-254;if(r>264){const n=x.q[r-257];e=p+(n>>>3)+y(t,h,7&n),h+=7&n}const o=i[k(t,h)&f];h+=15&o;const a=o>>>4,s=x.c[a],l=(s>>>4)+g(t,h,15&s);for(h+=15&s;p<e;)n[p]=n[p++-l],n[p]=n[p++-l],n[p]=n[p++-l],n[p]=n[p++-l];p=e}}}}else{7&h&&(h+=8-(7&h));const o=4+(h>>>3),i=t[o-4]|t[o-3]<<8;S&&(n=e.H.W(n,p+i)),n.set(new r(t.buffer,t.byteOffset+o,i),p),h=o+i<<3,p+=i}return n.length==p?n:n.slice(0,p)},e.H.W=function(e,t){const n=e.length;if(t<=n)return e;const r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,o,i,a){const s=e.H.e,l=e.H.Z;let c=0;for(;c<r;){const e=t[l(o,i)&n];i+=15&e;const r=e>>>4;if(r<=15)a[c]=r,c++;else{let e=0,t=0;16==r?(t=3+s(o,i,2),i+=2,e=a[c-1]):17==r?(t=3+s(o,i,3),i+=3):18==r&&(t=11+s(o,i,7),i+=7);const n=c+t;for(;c<n;)a[c]=e,c++}}return i},e.H.V=function(e,t,n,r){let o=0,i=0;const a=r.length>>>1;for(;i<n;){const n=e[i+t];r[i<<1]=0,r[1+(i<<1)]=n,n>o&&(o=n),i++}for(;i<a;)r[i<<1]=0,r[1+(i<<1)]=0,i++;return o},e.H.n=function(t,n){const r=e.H.m,o=t.length;let i,a,s,l;const c=r.j;for(var u=0;u<=n;u++)c[u]=0;for(u=1;u<o;u+=2)c[t[u]]++;const d=r.K;for(i=0,c[0]=0,a=1;a<=n;a++)i=i+c[a-1]<<1,d[a]=i;for(s=0;s<o;s+=2)l=t[s+1],0!=l&&(t[s]=d[l],d[l]++)},e.H.A=function(t,n,r){const o=t.length,i=e.H.m.r;for(let e=0;e<o;e+=2)if(0!=t[e+1]){const o=e>>1,a=t[e+1],s=o<<4|a,l=n-a;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)r[i[c]>>>15-n]=s,c++}},e.H.l=function(t,n){const r=e.H.m.r,o=15-n;for(let e=0;e<t.length;e+=2){const i=t[e]<<n-t[e+1];t[e]=r[i]>>>o}},e.H.M=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var n=0;n<32768;n++){let e=n;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[n]=(e>>>16|e<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];r(t._,144,8),r(t._,112,9),r(t._,24,7),r(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),r(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),r(t.Q,19,0),r(t.C,286,0),r(t.D,30,0),r(t.v,320,0)}(),e.H.N}();function i(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,n,r,o){let a=i(t);const l=Math.ceil(r*a/8);let c,u;a=Math.ceil(a/8);let d=e[n],f=0;if(d>1&&(e[n]=[0,0,1][d-2]),3==d)for(f=a;f<l;f++)e[f+1]=e[f+1]+(e[f+1-a]>>>1)&255;for(let i=0;i<o;i++)if(c=n+i*l,u=c+i+1,d=e[u-1],f=0,0==d)for(;f<l;f++)e[c+f]=e[u+f];else if(1==d){for(;f<a;f++)e[c+f]=e[u+f];for(;f<l;f++)e[c+f]=e[u+f]+e[c+f-a]}else if(2==d)for(;f<l;f++)e[c+f]=e[u+f]+e[c+f-l];else if(3==d){for(;f<a;f++)e[c+f]=e[u+f]+(e[c+f-l]>>>1);for(;f<l;f++)e[c+f]=e[u+f]+(e[c+f-l]+e[c+f-a]>>>1)}else{for(;f<a;f++)e[c+f]=e[u+f]+s(0,e[c+f-l],0);for(;f<l;f++)e[c+f]=e[u+f]+s(e[c+f-a],e[c+f-l],e[c+f-a-l])}return e}function s(e,t,n){const r=e+t-n,o=r-e,i=r-t,a=r-n;return o*o<=i*i&&o*o<=a*a?e:i*i<=a*a?t:n}function l(t,n,r){r.width=e.readUint(t,n),n+=4,r.height=e.readUint(t,n),n+=4,r.depth=t[n],n++,r.ctype=t[n],n++,r.compress=t[n],n++,r.filter=t[n],n++,r.interlace=t[n],n++}function c(e,t,n,r,o,i,a,s,l){const c=Math.min(t,o),u=Math.min(n,i);let d=0,f=0;for(let k=0;k<u;k++)for(let n=0;n<c;n++)if(a>=0&&s>=0?(d=k*t+n<<2,f=(s+k)*o+a+n<<2):(d=(-s+k)*t-a+n<<2,f=k*o+n<<2),0==l)r[f]=e[d],r[f+1]=e[d+1],r[f+2]=e[d+2],r[f+3]=e[d+3];else if(1==l){var p=e[d+3]*(1/255),h=e[d]*p,m=e[d+1]*p,g=e[d+2]*p,y=r[f+3]*(1/255),b=r[f]*y,v=r[f+1]*y,w=r[f+2]*y;const t=1-p,n=p+y*t,o=0==n?0:1/n;r[f+3]=255*n,r[f+0]=(h+b*t)*o,r[f+1]=(m+v*t)*o,r[f+2]=(g+w*t)*o}else if(2==l)p=e[d+3],h=e[d],m=e[d+1],g=e[d+2],y=r[f+3],b=r[f],v=r[f+1],w=r[f+2],p==y&&h==b&&m==v&&g==w?(r[f]=0,r[f+1]=0,r[f+2]=0,r[f+3]=0):(r[f]=h,r[f+1]=m,r[f+2]=g,r[f+3]=p);else if(3==l){if(p=e[d+3],h=e[d],m=e[d+1],g=e[d+2],y=r[f+3],b=r[f],v=r[f+1],w=r[f+2],p==y&&h==b&&m==v&&g==w)continue;if(p<220&&y>20)return!1}return!0}return{decode:function(t){const i=new Uint8Array(t);let a=8;const s=e,c=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},f=new Uint8Array(i.length);let p,h=0,m=0;const g=[137,80,78,71,13,10,26,10];for(var y=0;y<8;y++)if(i[y]!=g[y])throw"The input is not a PNG file!";for(;a<i.length;){const e=s.readUint(i,a);a+=4;const t=s.readASCII(i,a,4);if(a+=4,"IHDR"==t)l(i,a,d);else if("iCCP"==t){for(var b=a;0!=i[b];)b++;s.readASCII(i,a,b-a),i[b+1];const n=i.slice(b+2,a+e);let l=null;try{l=r(n)}catch(E){l=o(n)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=i.slice(a,a+4);else if("IDAT"==t){for(y=0;y<e;y++)f[h+y]=i[a+y];h+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(i,a),num_plays:u(i,a+4)},p=new Uint8Array(i.length);else if("fcTL"==t){0!=m&&((_=d.frames[d.frames.length-1]).data=n(d,p.slice(0,m),_.rect.width,_.rect.height),m=0);const e={x:u(i,a+12),y:u(i,a+16),width:u(i,a+4),height:u(i,a+8)};let t=c(i,a+22);t=c(i,a+20)/(0==t?100:t);const r={rect:e,delay:Math.round(1e3*t),dispose:i[a+24],blend:i[a+25]};d.frames.push(r)}else if("fdAT"==t){for(y=0;y<e-4;y++)p[m+y]=i[a+y+4];m+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(i,a),s.readUint(i,a+4),i[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],y=0;y<8;y++)d.tabs[t].push(s.readUint(i,a+4*y));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var v=s.nextZero(i,a),w=s.readASCII(i,a,v-a),k=a+e-v-1;if("tEXt"==t)S=s.readASCII(i,v+1,k);else{var x=r(i.slice(v+2,v+2+k));S=s.readUTF8(x,0,x.length)}d.tabs[t][w]=S}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),v=0,b=a,v=s.nextZero(i,b),w=s.readASCII(i,b,v-b);const n=i[b=v+1];var S;i[b+1],b+=2,v=s.nextZero(i,b),s.readASCII(i,b,v-b),b=v+1,v=s.nextZero(i,b),s.readUTF8(i,b,v-b),k=e-((b=v+1)-a),0==n?S=s.readUTF8(i,b,k):(x=r(i.slice(b,b+k)),S=s.readUTF8(x,0,x.length)),d.tabs[t][w]=S}else if("PLTE"==t)d.tabs[t]=s.readBytes(i,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],y=0;y<e;y++)d.tabs[t].push(c(i,a+2*y))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(i,a,e):0==d.ctype?d.tabs[t]=c(i,a):2==d.ctype&&(d.tabs[t]=[c(i,a),c(i,a+2),c(i,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(i,a)/1e5;else if("sRGB"==t)d.tabs[t]=i[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(i,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(i,a),c(i,a+2),c(i,a+4)]:3==d.ctype&&(d.tabs[t]=i[a]);else if("IEND"==t)break;a+=e,s.readUint(i,a),a+=4}var _;return 0!=m&&((_=d.frames[d.frames.length-1]).data=n(d,p.slice(0,m),_.rect.width,_.rect.height)),d.data=n(d,f,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const n=e.width,r=e.height;if(null==e.tabs.acTL)return[t(e.data,n,r,e).buffer];const o=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const i=n*r*4,a=new Uint8Array(i),s=new Uint8Array(i),l=new Uint8Array(i);for(let d=0;d<e.frames.length;d++){const f=e.frames[d],p=f.rect.x,h=f.rect.y,m=f.rect.width,g=f.rect.height,y=t(f.data,m,g,e);if(0!=d)for(var u=0;u<i;u++)l[u]=a[u];if(0==f.blend?c(y,m,g,a,n,r,p,h,0):1==f.blend&&c(y,m,g,a,n,r,p,h,1),o.push(a.buffer.slice(0)),0==f.dispose);else if(1==f.dispose)c(s,m,g,a,n,r,p,h,0);else if(2==f.dispose)for(u=0;u<i;u++)a[u]=l[u]}return o},_paeth:s,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=Sy,{_bin:t}=Sy,n=Sy._paeth;var r={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update(e,t,n,o){for(let i=0;i<o;i++)e=r.table[255&(e^t[n+i])]^e>>>8;return e},crc:(e,t,n)=>4294967295^r.update(4294967295,e,t,n)};function o(e,t,n,r){t[n]+=e[0]*r>>4,t[n+1]+=e[1]*r>>4,t[n+2]+=e[2]*r>>4,t[n+3]+=e[3]*r>>4}function i(e){return Math.max(0,Math.min(255,e))}function a(e,t){const n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],i=e[3]-t[3];return n*n+r*r+o*o+i*i}function s(e,t,n,r,s,l,c){null==c&&(c=1);const u=r.length,d=[];for(var f=0;f<u;f++){const e=r[f];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(f=0;f<u;f++){let e=4294967295;for(var p=0,h=0;h<u;h++){var m=a(d[f],d[h]);h!=f&&m<e&&(e=m,p=h)}}const g=new Uint32Array(s.buffer),y=new Int16Array(t*n*4),b=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<b.length;f++)b[f]=255*((b[f]+.5)/16-.5);for(let w=0;w<n;w++)for(let s=0;s<t;s++){var v;f=4*(w*t+s),2!=c?v=[i(e[f]+y[f]),i(e[f+1]+y[f+1]),i(e[f+2]+y[f+2]),i(e[f+3]+y[f+3])]:(m=b[4*(3&w)+(3&s)],v=[i(e[f]+m),i(e[f+1]+m),i(e[f+2]+m),i(e[f+3]+m)]),p=0;let k=16777215;for(h=0;h<u;h++){const e=a(v,d[h]);e<k&&(k=e,p=h)}const x=d[p],S=[v[0]-x[0],v[1]-x[1],v[2]-x[2],v[3]-x[3]];1==c&&(s!=t-1&&o(S,y,f+4,7),w!=n-1&&(0!=s&&o(S,y,f+4*t-4,3),o(S,y,f+4*t,5),s!=t-1&&o(S,y,f+4*t+4,1))),l[f>>2]=p,g[f>>2]=r[p]}}function l(e,n,o,i,a){null==a&&(a={});const{crc:s}=r,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const f=e.frames.length>1;let p,h=!1,m=33+(f?20:0);if(null!=a.sRGB&&(m+=13),null!=a.pHYs&&(m+=21),null!=a.iCCP&&(p=pako.deflate(a.iCCP),m+=21+p.length+4),3==e.ctype){for(var g=e.plte.length,y=0;y<g;y++)e.plte[y]>>>24!=255&&(h=!0);m+=8+3*g+4+(h?8+1*g+4:0)}for(var b=0;b<e.frames.length;b++)f&&(m+=38),m+=(x=e.frames[b]).cimg.length+12,0!=b&&(m+=4);m+=12;const v=new Uint8Array(m),w=[137,80,78,71,13,10,26,10];for(y=0;y<8;y++)v[y]=w[y];if(l(v,d,13),d+=4,u(v,d,"IHDR"),d+=4,l(v,d,n),d+=4,l(v,d,o),d+=4,v[d]=e.depth,d++,v[d]=e.ctype,d++,v[d]=0,d++,v[d]=0,d++,v[d]=0,d++,l(v,d,s(v,d-17,17)),d+=4,null!=a.sRGB&&(l(v,d,1),d+=4,u(v,d,"sRGB"),d+=4,v[d]=a.sRGB,d++,l(v,d,s(v,d-5,5)),d+=4),null!=a.iCCP){const e=13+p.length;l(v,d,e),d+=4,u(v,d,"iCCP"),d+=4,u(v,d,"ICC profile"),d+=11,d+=2,v.set(p,d),d+=p.length,l(v,d,s(v,d-(e+4),e+4)),d+=4}if(null!=a.pHYs&&(l(v,d,9),d+=4,u(v,d,"pHYs"),d+=4,l(v,d,a.pHYs[0]),d+=4,l(v,d,a.pHYs[1]),d+=4,v[d]=a.pHYs[2],d++,l(v,d,s(v,d-13,13)),d+=4),f&&(l(v,d,8),d+=4,u(v,d,"acTL"),d+=4,l(v,d,e.frames.length),d+=4,l(v,d,null!=a.loop?a.loop:0),d+=4,l(v,d,s(v,d-12,12)),d+=4),3==e.ctype){for(l(v,d,3*(g=e.plte.length)),d+=4,u(v,d,"PLTE"),d+=4,y=0;y<g;y++){const t=3*y,n=e.plte[y],r=255&n,o=n>>>8&255,i=n>>>16&255;v[d+t+0]=r,v[d+t+1]=o,v[d+t+2]=i}if(d+=3*g,l(v,d,s(v,d-3*g-4,3*g+4)),d+=4,h){for(l(v,d,g),d+=4,u(v,d,"tRNS"),d+=4,y=0;y<g;y++)v[d+y]=e.plte[y]>>>24&255;d+=g,l(v,d,s(v,d-g-4,g+4)),d+=4}}let k=0;for(b=0;b<e.frames.length;b++){var x=e.frames[b];f&&(l(v,d,26),d+=4,u(v,d,"fcTL"),d+=4,l(v,d,k++),d+=4,l(v,d,x.rect.width),d+=4,l(v,d,x.rect.height),d+=4,l(v,d,x.rect.x),d+=4,l(v,d,x.rect.y),d+=4,c(v,d,i[b]),d+=2,c(v,d,1e3),d+=2,v[d]=x.dispose,d++,v[d]=x.blend,d++,l(v,d,s(v,d-30,30)),d+=4);const t=x.cimg;l(v,d,(g=t.length)+(0==b?0:4)),d+=4;const n=d;u(v,d,0==b?"IDAT":"fdAT"),d+=4,0!=b&&(l(v,d,k++),d+=4),v.set(t,d),d+=g,l(v,d,s(v,n,d-n)),d+=4}return l(v,d,0),d+=4,u(v,d,"IEND"),d+=4,l(v,d,s(v,d-4,4)),d+=4,v.buffer}function c(e,t,n){for(let r=0;r<e.frames.length;r++){const o=e.frames[r];o.rect.width;const i=o.rect.height,a=new Uint8Array(i*o.bpl+i);o.cimg=p(o.img,i,o.bpp,o.bpl,a,t,n)}}function u(t,n,r,o,i){const a=i[0],l=i[1],c=i[2],u=i[3],p=i[4],h=i[5];let g=6,y=8,b=255;for(var v=0;v<t.length;v++){const e=new Uint8Array(t[v]);for(var w=e.length,k=0;k<w;k+=4)b&=e[k+3]}const x=255!=b,S=function(t,n,r,o,i,a){const s=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),p=new Uint32Array(d.buffer);var c;let m=0,g=0,y=n,b=r,v=o?1:0;if(0!=l){const w=a||o||1==l||0!=s[l-2].dispose?1:2;let k=0,x=1e9;for(let e=0;e<w;e++){var u=new Uint8Array(t[l-1-e]);const o=new Uint32Array(t[l-1-e]);let a=n,s=r,c=-1,d=-1;for(let e=0;e<r;e++)for(let t=0;t<n;t++)p[h=e*n+t]!=o[h]&&(t<a&&(a=t),t>c&&(c=t),e<s&&(s=e),e>d&&(d=e));-1==c&&(a=s=c=d=0),i&&(!(1&~a)&&a--,!(1&~s)&&s--);const f=(c-a+1)*(d-s+1);f<x&&(x=f,k=e,m=a,g=s,y=c-a+1,b=d-s+1)}u=new Uint8Array(t[l-1-k]),1==k&&(s[l-1].dispose=2),c=new Uint8Array(y*b*4),e(u,n,r,c,y,b,-m,-g,0),v=e(d,n,r,c,y,b,-m,-g,3)?1:0,1==v?f(d,n,r,c,{x:m,y:g,width:y,height:b}):e(d,n,r,c,y,b,-m,-g,0)}else c=d.slice(0);s.push({rect:{x:m,y:g,width:y,height:b},img:c,blend:v,dispose:0})}if(o)for(l=0;l<s.length;l++){if(1==(m=s[l]).blend)continue;const e=m.rect,o=s[l-1].rect,a=Math.min(e.x,o.x),c=Math.min(e.y,o.y),u={x:a,y:c,width:Math.max(e.x+e.width,o.x+o.width)-a,height:Math.max(e.y+e.height,o.y+o.height)-c};s[l-1].dispose=1,l-1!=0&&d(t,n,r,s,l-1,u,i),d(t,n,r,s,l,u,i)}let p=0;if(1!=t.length)for(var h=0;h<s.length;h++){var m;p+=(m=s[h]).rect.width*m.rect.height}return s}(t,n,r,a,l,c),_={},E=[],C=[];if(0!=o){const e=[];for(k=0;k<S.length;k++)e.push(S[k].img.buffer);const t=m(function(e){let t=0;for(var n=0;n<e.length;n++)t+=e[n].byteLength;const r=new Uint8Array(t);let o=0;for(n=0;n<e.length;n++){const t=new Uint8Array(e[n]),i=t.length;for(let e=0;e<i;e+=4){let n=t[e],i=t[e+1],a=t[e+2];const s=t[e+3];0==s&&(n=i=a=0),r[o+e]=n,r[o+e+1]=i,r[o+e+2]=a,r[o+e+3]=s}o+=i}return r.buffer}(e),o);for(k=0;k<t.plte.length;k++)E.push(t.plte[k].est.rgba);let n=0;for(k=0;k<S.length;k++){const e=(A=S[k]).img.length;var z=new Uint8Array(t.inds.buffer,n>>2,e>>2);C.push(z);const r=new Uint8Array(t.abuf,n,e);h&&s(A.img,A.rect.width,A.rect.height,E,r,z),A.img.set(r),n+=e}}else for(v=0;v<S.length;v++){var A=S[v];const e=new Uint32Array(A.img.buffer);var N=A.rect.width;for(w=e.length,z=new Uint8Array(w),C.push(z),k=0;k<w;k++){const t=e[k];if(0!=k&&t==e[k-1])z[k]=z[k-1];else if(k>N&&t==e[k-N])z[k]=z[k-N];else{let e=_[t];if(null==e&&(_[t]=e=E.length,E.push(t),E.length>=300))break;z[k]=e}}}const T=E.length;for(T<=256&&0==p&&(y=T<=2?1:T<=4?2:T<=16?4:8,y=Math.max(y,u)),v=0;v<S.length;v++){(A=S[v]).rect.x,A.rect.y,N=A.rect.width;const e=A.rect.height;let t=A.img;new Uint32Array(t.buffer);let n=4*N,r=4;if(T<=256&&0==p){n=Math.ceil(y*N/8);var O=new Uint8Array(n*e);const o=C[v];for(let t=0;t<e;t++){k=t*n;const e=t*N;if(8==y)for(var P=0;P<N;P++)O[k+P]=o[e+P];else if(4==y)for(P=0;P<N;P++)O[k+(P>>1)]|=o[e+P]<<4-4*(1&P);else if(2==y)for(P=0;P<N;P++)O[k+(P>>2)]|=o[e+P]<<6-2*(3&P);else if(1==y)for(P=0;P<N;P++)O[k+(P>>3)]|=o[e+P]<<7-1*(7&P)}t=O,g=3,r=1}else if(0==x&&1==S.length){O=new Uint8Array(N*e*3);const o=N*e;for(k=0;k<o;k++){const e=3*k,n=4*k;O[e]=t[n],O[e+1]=t[n+1],O[e+2]=t[n+2]}t=O,g=2,r=3,n=3*N}A.img=t,A.bpl=n,A.bpp=r}return{ctype:g,depth:y,plte:E,frames:S}}function d(t,n,r,o,i,a,s){const l=Uint8Array,c=Uint32Array,u=new l(t[i-1]),d=new c(t[i-1]),p=i+1<t.length?new l(t[i+1]):null,h=new l(t[i]),m=new c(h.buffer);let g=n,y=r,b=-1,v=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const r=a.x+t,s=a.y+e,l=s*n+r,c=m[l];0==c||0==o[i-1].dispose&&d[l]==c&&(null==p||0!=p[4*l+3])||(r<g&&(g=r),r>b&&(b=r),s<y&&(y=s),s>v&&(v=s))}-1==b&&(g=y=b=v=0),s&&(!(1&~g)&&g--,!(1&~y)&&y--),a={x:g,y:y,width:b-g+1,height:v-y+1};const w=o[i];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),0==o[i-1].dispose?(e(u,n,r,w.img,a.width,a.height,-a.x,-a.y,0),f(h,n,r,w.img,a)):e(h,n,r,w.img,a.width,a.height,-a.x,-a.y,0)}function f(t,n,r,o,i){e(t,n,r,o,i.width,i.height,-i.x,-i.y,2)}function p(e,t,n,r,o,i,a){const s=[];let l,c=[0,1,2,3,4];-1!=i?c=[i]:(t*r>5e5||1==n)&&(c=[0]),a&&(l={level:0});const u=xy;for(var d=0;d<c.length;d++){for(let i=0;i<t;i++)h(o,e,i,r,n,c[d]);s.push(u.deflate(o,l))}let f,p=1e9;for(d=0;d<s.length;d++)s[d].length<p&&(f=d,p=s[d].length);return s[f]}function h(e,t,r,o,i,a){const s=r*o;let l=s+r;if(e[l]=a,l++,0==a)if(o<500)for(var c=0;c<o;c++)e[l+c]=t[s+c];else e.set(new Uint8Array(t.buffer,s,o),l);else if(1==a){for(c=0;c<i;c++)e[l+c]=t[s+c];for(c=i;c<o;c++)e[l+c]=t[s+c]-t[s+c-i]+256&255}else if(0==r){for(c=0;c<i;c++)e[l+c]=t[s+c];if(2==a)for(c=i;c<o;c++)e[l+c]=t[s+c];if(3==a)for(c=i;c<o;c++)e[l+c]=t[s+c]-(t[s+c-i]>>1)+256&255;if(4==a)for(c=i;c<o;c++)e[l+c]=t[s+c]-n(t[s+c-i],0,0)+256&255}else{if(2==a)for(c=0;c<o;c++)e[l+c]=t[s+c]+256-t[s+c-o]&255;if(3==a){for(c=0;c<i;c++)e[l+c]=t[s+c]+256-(t[s+c-o]>>1)&255;for(c=i;c<o;c++)e[l+c]=t[s+c]+256-(t[s+c-o]+t[s+c-i]>>1)&255}if(4==a){for(c=0;c<i;c++)e[l+c]=t[s+c]+256-n(0,t[s+c-o],0)&255;for(c=i;c<o;c++)e[l+c]=t[s+c]+256-n(t[s+c-i],t[s+c-o],t[s+c-i-o])&255}}}function m(e,t){const n=new Uint8Array(e),r=n.slice(0),o=new Uint32Array(r.buffer),i=g(r,t),a=i[0],s=i[1],l=n.length,c=new Uint8Array(l>>2);let u;if(n.length<2e7)for(var d=0;d<l;d+=4)u=y(a,f=n[d]*(1/255),p=n[d+1]*(1/255),h=n[d+2]*(1/255),m=n[d+3]*(1/255)),c[d>>2]=u.ind,o[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var f=n[d]*(1/255),p=n[d+1]*(1/255),h=n[d+2]*(1/255),m=n[d+3]*(1/255);for(u=a;u.left;)u=b(u.est,f,p,h,m)<=0?u.left:u.right;c[d>>2]=u.ind,o[d>>2]=u.est.rgba}return{abuf:r.buffer,inds:c,plte:s}}function g(e,t,n){null==n&&(n=1e-4);const r=new Uint32Array(e.buffer),o={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};o.bst=k(e,o.i0,o.i1),o.est=x(o.bst);const i=[o];for(;i.length<t;){let t=0,o=0;for(var a=0;a<i.length;a++)i[a].est.L>t&&(t=i[a].est.L,o=a);if(t<n)break;const s=i[o],l=v(e,r,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=l||s.i1<=l){s.est.L=0;continue}const c={i0:s.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=k(e,c.i0,c.i1),c.est=x(c.bst);const u={i0:l,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-c.bst.N},a=0;a<16;a++)u.bst.R[a]=s.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)u.bst.m[a]=s.bst.m[a]-c.bst.m[a];u.est=x(u.bst),s.left=c,s.right=u,i[o]=c,i.push(u)}for(i.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<i.length;a++)i[a].ind=a;return[o,i]}function y(e,t,n,r,o){if(null==e.left)return e.tdst=function(e,t,n,r,o){const i=t-e[0],a=n-e[1],s=r-e[2],l=o-e[3];return i*i+a*a+s*s+l*l}(e.est.q,t,n,r,o),e;const i=b(e.est,t,n,r,o);let a=e.left,s=e.right;i>0&&(a=e.right,s=e.left);const l=y(a,t,n,r,o);if(l.tdst<=i*i)return l;const c=y(s,t,n,r,o);return c.tdst<l.tdst?c:l}function b(e,t,n,r,o){const{e:i}=e;return i[0]*t+i[1]*n+i[2]*r+i[3]*o-e.eMq}function v(e,t,n,r,o,i){for(r-=4;n<r;){for(;w(e,n,o)<=i;)n+=4;for(;w(e,r,o)>i;)r-=4;if(n>=r)break;const a=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=a,n+=4,r-=4}for(;w(e,n,o)>i;)n-=4;return n+4}function w(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]}function k(e,t,n){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=[0,0,0,0],i=n-t>>2;for(let a=t;a<n;a+=4){const t=e[a]*(1/255),n=e[a+1]*(1/255),i=e[a+2]*(1/255),s=e[a+3]*(1/255);o[0]+=t,o[1]+=n,o[2]+=i,o[3]+=s,r[0]+=t*t,r[1]+=t*n,r[2]+=t*i,r[3]+=t*s,r[5]+=n*n,r[6]+=n*i,r[7]+=n*s,r[10]+=i*i,r[11]+=i*s,r[15]+=s*s}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:o,N:i}}function x(e){const{R:t}=e,{m:n}=e,{N:r}=e,o=n[0],i=n[1],a=n[2],s=n[3],l=0==r?0:1/r,c=[t[0]-o*o*l,t[1]-o*i*l,t[2]-o*a*l,t[3]-o*s*l,t[4]-i*o*l,t[5]-i*i*l,t[6]-i*a*l,t[7]-i*s*l,t[8]-a*o*l,t[9]-a*i*l,t[10]-a*a*l,t[11]-a*s*l,t[12]-s*o*l,t[13]-s*i*l,t[14]-s*a*l,t[15]-s*s*l],u=c,d=S;let f=[Math.random(),Math.random(),Math.random(),Math.random()],p=0,h=0;if(0!=r)for(let g=0;g<16&&(f=d.multVec(u,f),h=Math.sqrt(d.dot(f,f)),f=d.sml(1/h,f),!(0!=g&&Math.abs(h-p)<1e-9));g++)p=h;const m=[o*l,i*l,a*l,s*l];return{Cov:c,q:m,e:f,L:p,eMq255:d.dot(d.sml(255,m),f),eMq:d.dot(f,m),rgba:(Math.round(255*m[3])<<24|Math.round(255*m[2])<<16|Math.round(255*m[1])<<8|Math.round(255*m[0]))>>>0}}var S={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};Sy.encode=function(e,t,n,r,o,i,a){null==r&&(r=0),null==a&&(a=!1);const s=u(e,t,n,r,[!1,!1,!1,0,a,!1]);return c(s,-1),l(s,t,n,o,i)},Sy.encodeLL=function(e,t,n,r,o,i,a,s){const u={ctype:0+(1==r?0:2)+(0==o?0:4),depth:i,frames:[]},d=(r+o)*i,f=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(f/8)});return c(u,0,!0),l(u,t,n,a,s)},Sy.encode.compress=u,Sy.encode.dither=s,Sy.quantize=m,Sy.quantize.getKDtree=g,Sy.quantize.getNearest=y}();const _y={toArrayBuffer(e,t){const n=e.width,r=e.height,o=n<<2,i=e.getContext("2d").getImageData(0,0,n,r),a=new Uint32Array(i.data.buffer),s=(32*n+31)/32<<2,l=s*r,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),f=1<<20;let p,h,m,g,y=f,b=0,v=0,w=0;function k(e){d.setUint16(v,e,!0),v+=2}function x(e){d.setUint32(v,e,!0),v+=4}function S(e){v+=e}k(19778),x(c),S(4),x(122),x(108),x(n),x(-r>>>0),k(1),k(32),x(3),x(l),x(2835),x(2835),S(8),x(16711680),x(65280),x(255),x(4278190080),x(1466527264),function e(){for(;b<r&&y>0;){for(g=122+b*s,p=0;p<o;)y--,h=a[w++],m=h>>>24,d.setUint32(g+p,h<<8|m),p+=4;b++}w<a.length?(y=f,setTimeout(e,_y._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var Ey={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Cy={[Ey.CHROME]:16384,[Ey.FIREFOX]:11180,[Ey.DESKTOP_SAFARI]:16384,[Ey.IE]:8192,[Ey.IOS]:4096,[Ey.ETC]:8192};const zy="undefined"!=typeof window,Ay="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Ny=zy&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Ty=(zy||Ay)&&(Ny&&Ny.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Oy=(zy||Ay)&&(Ny&&Ny.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Py(e,t,n=Date.now()){return new Promise(r=>{const o=e.split(","),i=o[0].match(/:(.*?);/)[1],a=globalThis.atob(o[1]);let s=a.length;const l=new Uint8Array(s);for(;s--;)l[s]=a.charCodeAt(s);const c=new Blob([l],{type:i});c.name=t,c.lastModified=n,r(c)})}function jy(e){return new Promise((t,n)=>{const r=new Oy;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}function My(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e})}function Iy(){if(void 0!==Iy.cachedResult)return Iy.cachedResult;let e=Ey.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Ey.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Ey.IOS:/Safari/i.test(t)?e=Ey.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Ey.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=Ey.IE),Iy.cachedResult=e,Iy.cachedResult}function Fy(e,t){const n=Iy(),r=Cy[n];let o=e,i=t,a=o*i;const s=o>i?i/o:o/i;for(;a>r*r;){const e=(r+o)/2,t=(r+i)/2;e<t?(i=t,o=t*s):(i=e*s,o=e),a=o*i}return{width:o,height:i}}function Ly(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),null===r)throw new Error("getContext of OffscreenCanvas returns null")}catch(o){n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function Dy(e,t){const{width:n,height:r}=Fy(e.width,e.height),[o,i]=Ly(n,r);return t&&/jpe?g/.test(t)&&(i.fillStyle="white",i.fillRect(0,0,o.width,o.height)),i.drawImage(e,0,0,o.width,o.height),o}function Ry(){return void 0!==Ry.cachedResult||(Ry.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Ry.cachedResult}function Uy(e,t={}){return new Promise(function(n,r){let o,i;var a=function(){try{return i=Dy(o,t.fileType||e.type),n([o,i])}catch(a){return r(a)}},s=function(t){try{var n=function(e){try{throw e}catch(t){return r(t)}};try{let t;return jy(e).then(function(e){try{return t=e,My(t).then(function(e){try{return o=e,function(){try{return a()}catch(e){return r(e)}}()}catch(t){return n(t)}},n)}catch(i){return n(i)}},n)}catch(i){n(i)}}catch(i){return r(i)}};try{if(Ry()||[Ey.DESKTOP_SAFARI,Ey.MOBILE_SAFARI].includes(Iy()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return o=e,a()}catch(t){return s()}},s)}catch(l){s()}})}function By(e,t,n,r,o=1){return new Promise(function(i,a){let s;if("image/png"===t){let i,a,c;return i=e.getContext("2d"),({data:a}=i.getImageData(0,0,e.width,e.height)),c=Sy.encode([a.buffer],e.width,e.height,4096*o),s=new Blob([c],{type:t}),s.name=n,s.lastModified=r,l.call(this)}{let i=function(){return l.call(this)};if("image/bmp"===t)return new Promise(t=>_y.toBlob(e,t)).then(function(e){try{return s=e,s.name=n,s.lastModified=r,i.call(this)}catch(t){return a(t)}}.bind(this),a);{let l=function(){return i.call(this)};if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:o}).then(function(e){try{return s=e,s.name=n,s.lastModified=r,l.call(this)}catch(t){return a(t)}}.bind(this),a);{let i;return i=e.toDataURL(t,o),Py(i,n,r).then(function(e){try{return s=e,l.call(this)}catch(t){return a(t)}}.bind(this),a)}}}function l(){return i(s)}})}function $y(e){e.width=0,e.height=0}function Hy(){return new Promise(function(e,t){let n,r,o,i;return void 0!==Hy.cachedResult?e(Hy.cachedResult):Py("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return n=a,Uy(n).then(function(a){try{return r=a[1],By(r,n.type,n.name,n.lastModified).then(function(n){try{return o=n,$y(r),Uy(o).then(function(n){try{return i=n[0],Hy.cachedResult=1===i.width&&2===i.height,e(Hy.cachedResult)}catch(r){return t(r)}},t)}catch(a){return t(a)}},t)}catch(s){return t(s)}},t)}catch(s){return t(s)}},t)})}function Vy(e){return new Promise((t,n)=>{const r=new Oy;r.onload=e=>{const n=new DataView(e.target.result);if(65496!=n.getUint16(0,!1))return t(-2);const r=n.byteLength;let o=2;for(;o<r;){if(n.getUint16(o+2,!1)<=8)return t(-1);const e=n.getUint16(o,!1);if(o+=2,65505==e){if(1165519206!=n.getUint32(o+=2,!1))return t(-1);const e=18761==n.getUint16(o+=6,!1);o+=n.getUint32(o+4,e);const r=n.getUint16(o,e);o+=2;for(let i=0;i<r;i++)if(274==n.getUint16(o+12*i,e))return t(n.getUint16(o+12*i+8,e))}else{if(65280&~e)break;o+=n.getUint16(o,!1)}}return t(-1)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}function qy(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:o}=t;let i,a=e;return isFinite(o)&&(n>o||r>o)&&([a,i]=Ly(n,r),n>r?(a.width=o,a.height=r/n*o):(a.width=n/r*o,a.height=o),i.drawImage(e,0,0,a.width,a.height),$y(e)),a}function Wy(e,t){const{width:n}=e,{height:r}=e,[o,i]=Ly(n,r);switch(t>4&&t<9?(o.width=r,o.height=n):(o.width=n,o.height=r),t){case 2:i.transform(-1,0,0,1,n,0);break;case 3:i.transform(-1,0,0,-1,n,r);break;case 4:i.transform(1,0,0,-1,0,r);break;case 5:i.transform(0,1,1,0,0,0);break;case 6:i.transform(0,1,-1,0,r,0);break;case 7:i.transform(0,-1,-1,0,r,n);break;case 8:i.transform(0,-1,1,0,0,n)}return i.drawImage(e,0,0,n,r),$y(e),o}function Zy(e,t,n=0){return new Promise(function(r,o){let i,a,s,l,c,u,d,f,p,h,m,g,y,b,v,w,k,x,S,_;function E(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;i+=e,t.onProgress(Math.min(i,100))}function C(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;i=Math.min(Math.max(e,i),100),t.onProgress(i)}return i=n,a=t.maxIteration||10,s=1024*t.maxSizeMB*1024,E(),Uy(e,t).then(function(n){try{return[,l]=n,E(),c=qy(l,t),E(),new Promise(function(n,r){var o;if(!(o=t.exifOrientation))return Vy(e).then(function(e){try{return o=e,i.call(this)}catch(t){return r(t)}}.bind(this),r);function i(){return n(o)}return i.call(this)}).then(function(n){try{return u=n,E(),Hy().then(function(n){try{return d=n?c:Wy(c,u),E(),f=t.initialQuality||1,p=t.fileType||e.type,By(d,p,e.name,e.lastModified,f).then(function(n){try{{let u=function(){if(a--&&(v>s||v>y)){let t,n;return t=_?.95*S.width:S.width,n=_?.95*S.height:S.height,[k,x]=Ly(t,n),x.drawImage(S,0,0,t,n),f*="image/png"===p?.85:.95,By(k,p,e.name,e.lastModified,f).then(function(e){try{return w=e,$y(S),S=k,v=w.size,C(Math.min(99,Math.floor((b-v)/(b-s)*100))),u}catch(t){return o(t)}},o)}return[1]},z=function(){return $y(S),$y(k),$y(c),$y(d),$y(l),C(100),r(w)};return h=n,E(),m=h.size>s,g=h.size>e.size,m||g?(y=e.size,b=h.size,v=b,S=d,_=!t.alwaysKeepResolution&&m,(i=function(e){for(;e;){if(e.then)return void e.then(i,o);try{if(e.pop){if(e.length)return e.pop()?z.call(this):e;e=u}else e=e.call(this)}catch(t){return o(t)}}}.bind(this))(u)):(C(100),r(h));var i}}catch(u){return o(u)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)})}let Qy;function Ky(e,t){return new Promise(function(n,r){let o,i,a,s,l,c;if(o={...t},a=0,({onProgress:s}=o),o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof o.useWebWorker||o.useWebWorker,delete o.useWebWorker,o.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof Ty))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return Zy(e,o).then(function(e){try{return i=e,f.call(this)}catch(t){return r(t)}}.bind(this),r);var u=function(){try{return f.call(this)}catch(e){return r(e)}}.bind(this),d=function(t){try{return Zy(e,o).then(function(e){try{return i=e,u()}catch(t){return r(t)}},r)}catch(n){return r(n)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",function(e,t){return new Promise((n,r)=>{Qy||(Qy=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"));const o=new Worker(Qy);o.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)o.terminate();else if(void 0===e.data.progress){if(e.data.error)return r(new Error(e.data.error)),void o.terminate();n(e.data.file),o.terminate()}else t.onProgress(e.data.progress)}),o.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",()=>{r(t.signal.reason),o.terminate()}),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}(e,o).then(function(e){try{return i=e,u()}catch(t){return d()}},d)}catch(p){d()}function f(){try{i.name=e.name,i.lastModified=e.lastModified}catch(p){}try{o.preserveExif&&"image/jpeg"===e.type&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(i=hy(e,i))}catch(p){}return n(i)}})}Ky.getDataUrlFromFile=jy,Ky.getFilefromDataUrl=Py,Ky.loadImage=My,Ky.drawImageInCanvas=Dy,Ky.drawFileInCanvas=Uy,Ky.canvasToFile=By,Ky.getExifOrientation=Vy,Ky.handleMaxWidthOrHeight=qy,Ky.followExifOrientation=Wy,Ky.cleanupCanvasMemory=$y,Ky.isAutoOrientationInBrowser=Hy,Ky.approximateBelowMaximumCanvasSizeOfBrowser=Fy,Ky.copyExifWithoutOrientation=hy,Ky.getBrowserName=Iy,Ky.version="2.0.2";const Gy=Object.freeze(Object.defineProperty({__proto__:null,default:Ky},Symbol.toStringTag,{value:"Module"}));e.BotUyoChatWidget=sy,e.ChatWidget=oy,e.ChatWidgetProvider=function({children:e,defaultLocale:t,initialState:n,onStateChange:r,...o}){const[i,a]=E.useState(n?.isOpen??!1),[s,l]=E.useState(0),c=E.useCallback(()=>{a(!0),l(0),r?.(!0)},[r]),u=E.useCallback(()=>{a(!1),r?.(!1)},[r]),d=E.useCallback(()=>{a(e=>{const t=!e;return t&&l(0),r?.(t),t})},[r]),f=E.useCallback(e=>{Yg?(Yg(e),Gt("ChatWidgetProvider sendMessage:",e)):Qt("sendMessage called but no handler registered")},[]),p=E.useCallback(()=>{Jg?(Jg(),Gt("ChatWidgetProvider clearMessages called")):Qt("clearMessages called but no handler registered")},[]),h={isOpen:i,open:c,close:u,toggle:d,sendMessage:f,clearMessages:p,unreadCount:s},m=E.useCallback((e,t)=>{"message:received"!==e||i||l(e=>e+1),o.onEvent?.(e,t)},[i,o]);return O.jsx(F,{defaultLocale:t,children:O.jsxs(ty.Provider,{value:h,children:[e,O.jsx(oy,{...o,onStateChange:e=>{a(e),e&&l(0),r?.(e)},onEvent:m})]})})},e.LanguageProvider=F,e.default=ly,e.useChatWidget=function(){const e=E.useContext(ty);if(!e)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return e},e.useLanguage=L,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BotUyoChat={})}(this,function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r,o={},i={exports:{}},a={},s={exports:{}},l={};function c(){if(n)return l;n=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): 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")},b.prototype=y.prototype;var w=v.prototype=new b;w.constructor=v,m(w,y.prototype),w.isPureReactComponent=!0;var x=Array.isArray,k=Object.prototype.hasOwnProperty,S={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function C(t,n,r){var o,i={},a=null,s=null;if(null!=n)for(o in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)k.call(n,o)&&!_.hasOwnProperty(o)&&(i[o]=n[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(o in l=t.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:e,type:t,key:a,ref:s,props:i,_owner:S.current}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var z=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function N(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===i?"."+A(l,0):i,x(a)?(o="",null!=n&&(o=n.replace(z,"$&/")+"/"),N(a,r,o,"",function(e){return e})):null!=a&&(E(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(z,"$&/")+"/")+n)),r.push(a)),1;if(l=0,i=""===i?".":i+":",x(n))for(var c=0;c<n.length;c++){var u=i+A(s=n[c],c);l+=N(s,r,o,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(n),"function"==typeof u)for(n=u.call(n),c=0;!(s=n.next()).done;)l+=N(s=s.value,r,o,u=i+A(s,c++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function T(e,t,n){if(null==e)return e;var r=[],o=0;return N(e,r,"","",function(e){return t.call(n,e,o++)}),r}function O(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},j={transition:null},M={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:j,ReactCurrentOwner:S};function P(){throw Error("act(...) is not supported in production builds of React.")}return l.Children={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},l.Component=y,l.Fragment=r,l.Profiler=i,l.PureComponent=v,l.StrictMode=o,l.Suspense=u,l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,l.act=P,l.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=m({},t.props),i=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=S.current),void 0!==n.key&&(i=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in n)k.call(n,c)&&!_.hasOwnProperty(c)&&(o[c]=void 0===n[c]&&void 0!==l?l[c]:n[c])}var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];o.children=l}return{$$typeof:e,type:t.type,key:i,ref:a,props:o,_owner:s}},l.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},l.createElement=C,l.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},l.createRef=function(){return{current:null}},l.forwardRef=function(e){return{$$typeof:c,render:e}},l.isValidElement=E,l.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:O}},l.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},l.startTransition=function(e){var t=j.transition;j.transition={};try{e()}finally{j.transition=t}},l.unstable_act=P,l.useCallback=function(e,t){return I.current.useCallback(e,t)},l.useContext=function(e){return I.current.useContext(e)},l.useDebugValue=function(){},l.useDeferredValue=function(e){return I.current.useDeferredValue(e)},l.useEffect=function(e,t){return I.current.useEffect(e,t)},l.useId=function(){return I.current.useId()},l.useImperativeHandle=function(e,t,n){return I.current.useImperativeHandle(e,t,n)},l.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},l.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},l.useMemo=function(e,t){return I.current.useMemo(e,t)},l.useReducer=function(e,t,n){return I.current.useReducer(e,t,n)},l.useRef=function(e){return I.current.useRef(e)},l.useState=function(e){return I.current.useState(e)},l.useSyncExternalStore=function(e,t,n){return I.current.useSyncExternalStore(e,t,n)},l.useTransition=function(){return I.current.useTransition()},l.version="18.3.1",l}function u(){return r||(r=1,s.exports=c()),s.exports}var d,f,h,p,m,g={exports:{}},y={};function b(){return f||(f=1,g.exports=(d||(d=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>o(l,n))c<i&&0>o(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(l,o)}o=n(c)}}function w(e){if(m=!1,v(e),!p)if(null!==n(l))p=!0,I(x);else{var t=n(c);null!==t&&j(w,t.startTime-e)}}function x(t,o){p=!1,m&&(m=!1,y(C),C=-1),h=!0;var i=f;try{for(v(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!A());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),v(o)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&j(w,g.startTime-o),u=!1}return u}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,S=!1,_=null,C=-1,E=5,z=-1;function A(){return!(e.unstable_now()-z<E)}function N(){if(null!==_){var t=e.unstable_now();z=t;var n=!0;try{n=_(!0,t)}finally{n?k():(S=!1,_=null)}}else S=!1}if("function"==typeof b)k=function(){b(N)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,O=T.port2;T.port1.onmessage=N,k=function(){O.postMessage(null)}}else k=function(){g(N,0)};function I(e){_=e,S||(S=!0,k())}function j(t,n){C=g(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_continueExecution=function(){p||h||(p=!0,I(x))},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"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},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_pauseExecution=function(){},e.unstable_requestPaint=function(){},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,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,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 r={id:u++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(c,r),null===n(l)&&r===n(c)&&(m?(y(C),C=-1):m=!0,j(w,i-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,I(x))),r},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(y)),y)),g.exports}function v(){if(h)return a;h=1;var e=u(),t=b();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var r=new Set,o={};function i(e,t){s(e,t),s(e+"Capture",t)}function s(e,t){for(o[e]=t,e=0;e<t.length;e++)r.add(t[e])}var l=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),c=Object.prototype.hasOwnProperty,d=/^[: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]*$/,f={},p={};function m(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new m(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new m(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new m(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new m(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new m(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function w(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!c.call(p,e)||!c.call(f,e)&&(d.test(e)?p[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(y,v);g[t]=new m(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(y,v);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(y,v);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)});var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),A=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),P=Symbol.iterator;function F(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=P&&e[P]||e["@@iterator"])?e:null}var L,R=Object.assign;function D(e){if(void 0===L)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var U=!1;function B(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"==typeof c.stack){for(var o=c.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function $(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case _:return"Fragment";case S:return"Portal";case E:return"Profiler";case C:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case z:return(e._context.displayName||"Context")+".Provider";case N:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case I:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case j:t=e._payload,e=e._init;try{return V(e(t))}catch(n){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Z(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function K(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function G(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function X(e,t){G(e,t);var n=W(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?te(e,t.type,n):t.hasOwnProperty("defaultValue")&&te(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ee(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function te(e,t,n){"number"===t&&K(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ne=Array.isArray;function re(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+W(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function oe(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return R({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(ne(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:W(r)}}function ae(e,t){var n=W(t.value),r=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ce(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,de,fe=(de=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return de(e,t)})}:de);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},me=["Webkit","ms","Moz","O"];function ge(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ye(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=ge(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach(function(e){me.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]})});var be=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(be[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function we(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 xe=null;function ke(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,_e=null,Ce=null;function Ee(e){if(e=xo(e)){if("function"!=typeof Se)throw Error(n(280));var t=e.stateNode;t&&(t=So(t),Se(e.stateNode,e.type,t))}}function ze(e){_e?Ce?Ce.push(e):Ce=[e]:_e=e}function Ae(){if(_e){var e=_e,t=Ce;if(Ce=_e=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Ne(e,t){return e(t)}function Te(){}var Oe=!1;function Ie(e,t,n){if(Oe)return e(t,n);Oe=!0;try{return Ne(e,t,n)}finally{Oe=!1,(null!==_e||null!==Ce)&&(Te(),Ae())}}function je(e,t){var r=e.stateNode;if(null===r)return null;var o=So(r);if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Me=!1;if(l)try{var Pe={};Object.defineProperty(Pe,"passive",{get:function(){Me=!0}}),window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(de){Me=!1}function Fe(e,t,n,r,o,i,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Le=!1,Re=null,De=!1,Ue=null,Be={onError:function(e){Le=!0,Re=e}};function $e(e,t,n,r,o,i,a,s,l){Le=!1,Re=null,Fe.apply(Be,arguments)}function Ve(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function He(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function We(e){if(Ve(e)!==e)throw Error(n(188))}function qe(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ve(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(o=i.return)){r=o;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return We(i),e;if(a===o)return We(i),t;a=a.sibling}throw Error(n(188))}if(r.return!==o.return)r=i,o=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,o=a;break}if(l===o){s=!0,o=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,o=i;break}if(l===o){s=!0,o=a,r=i;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e))?Ze(e):null}function Ze(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ze(e);if(null!==t)return t;e=e.sibling}return null}var Qe=t.unstable_scheduleCallback,Ke=t.unstable_cancelCallback,Je=t.unstable_shouldYield,Ye=t.unstable_requestPaint,Ge=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,et=t.unstable_ImmediatePriority,tt=t.unstable_UserBlockingPriority,nt=t.unstable_NormalPriority,rt=t.unstable_LowPriority,ot=t.unstable_IdlePriority,it=null,at=null;var st=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(lt(e)/ct|0)|0},lt=Math.log,ct=Math.LN2;var ut=64,dt=4194304;function ft(e){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: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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=ft(s):0!==(i&=a)&&(r=ft(i))}else 0!==(a=n&~o)?r=ft(a):0!==i&&(r=ft(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-st(t)),r|=e[n],t&=~o;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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;default:return-1}}function mt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function gt(){var e=ut;return!(4194240&(ut<<=1))&&(ut=64),e}function yt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var wt=0;function xt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var kt,St,_t,Ct,Et,zt=!1,At=[],Nt=null,Tt=null,Ot=null,It=new Map,jt=new Map,Mt=[],Pt="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 submit".split(" ");function Ft(e,t){switch(e){case"focusin":case"focusout":Nt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":Ot=null;break;case"pointerover":case"pointerout":It.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jt.delete(t.pointerId)}}function Lt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=xo(t))&&St(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Rt(e){var t=wo(e.target);if(null!==t){var n=Ve(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=He(n)))return e.blockedOn=t,void Et(e.priority,function(){_t(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Dt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=xo(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);xe=r,n.target.dispatchEvent(r),xe=null,t.shift()}return!0}function Ut(e,t,n){Dt(e)&&n.delete(t)}function Bt(){zt=!1,null!==Nt&&Dt(Nt)&&(Nt=null),null!==Tt&&Dt(Tt)&&(Tt=null),null!==Ot&&Dt(Ot)&&(Ot=null),It.forEach(Ut),jt.forEach(Ut)}function $t(e,n){e.blockedOn===n&&(e.blockedOn=null,zt||(zt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bt)))}function Vt(e){function t(t){return $t(t,e)}if(0<At.length){$t(At[0],e);for(var n=1;n<At.length;n++){var r=At[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Nt&&$t(Nt,e),null!==Tt&&$t(Tt,e),null!==Ot&&$t(Ot,e),It.forEach(t),jt.forEach(t),n=0;n<Mt.length;n++)(r=Mt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Mt.length&&null===(n=Mt[0]).blockedOn;)Rt(n),null===n.blockedOn&&Mt.shift()}var Ht=x.ReactCurrentBatchConfig,Wt=!0;function qt(e,t,n,r){var o=wt,i=Ht.transition;Ht.transition=null;try{wt=1,Qt(e,t,n,r)}finally{wt=o,Ht.transition=i}}function Zt(e,t,n,r){var o=wt,i=Ht.transition;Ht.transition=null;try{wt=4,Qt(e,t,n,r)}finally{wt=o,Ht.transition=i}}function Qt(e,t,n,r){if(Wt){var o=Jt(e,t,n,r);if(null===o)Wr(e,t,r,Kt,n),Ft(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Nt=Lt(Nt,e,t,n,r,o),!0;case"dragenter":return Tt=Lt(Tt,e,t,n,r,o),!0;case"mouseover":return Ot=Lt(Ot,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return It.set(i,Lt(It.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,jt.set(i,Lt(jt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Ft(e,r),4&t&&-1<Pt.indexOf(e)){for(;null!==o;){var i=xo(o);if(null!==i&&kt(i),null===(i=Jt(e,t,n,r))&&Wr(e,t,r,Kt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Wr(e,t,r,null,n)}}var Kt=null;function Jt(e,t,n,r){if(Kt=null,null!==(e=wo(e=ke(r))))if(null===(t=Ve(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=He(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kt=e,null}function Yt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case et:return 1;case tt:return 4;case nt:case rt:return 16;case ot:return 536870912;default:return 16}default:return 16}}var Gt=null,Xt=null,en=null;function tn(){if(en)return en;var e,t,n=Xt,r=n.length,o="value"in Gt?Gt.value:Gt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return en=o.slice(e,1<t?1-t:void 0)}function nn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rn(){return!0}function on(){return!1}function an(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?rn:on,this.isPropagationStopped=on,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var sn,ln,cn,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=an(un),fn=R({},un,{view:0,detail:0}),hn=an(fn),pn=R({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cn&&(cn&&"mousemove"===e.type?(sn=e.screenX-cn.screenX,ln=e.screenY-cn.screenY):ln=sn=0,cn=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),mn=an(pn),gn=an(R({},pn,{dataTransfer:0})),yn=an(R({},fn,{relatedTarget:0})),bn=an(R({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=R({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wn=an(vn),xn=an(R({},un,{data:0})),kn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={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"},_n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function En(){return Cn}var zn=R({},fn,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=nn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?nn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?nn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),An=an(zn),Nn=an(R({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=an(R({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),On=an(R({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=R({},pn,{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}),jn=an(In),Mn=[9,13,27,32],Pn=l&&"CompositionEvent"in window,Fn=null;l&&"documentMode"in document&&(Fn=document.documentMode);var Ln=l&&"TextEvent"in window&&!Fn,Rn=l&&(!Pn||Fn&&8<Fn&&11>=Fn),Dn=String.fromCharCode(32),Un=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $n(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vn=!1;var Hn={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 Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hn[e.type]:"textarea"===t}function qn(e,t,n,r){ze(r),0<(t=Zr(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Zn=null,Qn=null;function Kn(e){Dr(e,0)}function Jn(e){if(Q(ko(e)))return e}function Yn(e,t){if("change"===e)return t}var Gn=!1;if(l){var Xn;if(l){var er="oninput"in document;if(!er){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),er="function"==typeof tr.oninput}Xn=er}else Xn=!1;Gn=Xn&&(!document.documentMode||9<document.documentMode)}function nr(){Zn&&(Zn.detachEvent("onpropertychange",rr),Qn=Zn=null)}function rr(e){if("value"===e.propertyName&&Jn(Qn)){var t=[];qn(t,Qn,e,ke(e)),Ie(Kn,t)}}function or(e,t,n){"focusin"===e?(nr(),Qn=n,(Zn=t).attachEvent("onpropertychange",rr)):"focusout"===e&&nr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Jn(Qn)}function ar(e,t){if("click"===e)return Jn(t)}function sr(e,t){if("input"===e||"change"===e)return Jn(t)}var lr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function cr(e,t){if(lr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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 o=n[r];if(!c.call(t,o)||!lr(e[o],t[o]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=K();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=K((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function mr(e){var t=hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=dr(n,i);var a=dr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gr=l&&"documentMode"in document&&11>=document.documentMode,yr=null,br=null,vr=null,wr=!1;function xr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;wr||null==yr||yr!==K(r)||("selectionStart"in(r=yr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&cr(vr,r)||(vr=r,0<(r=Zr(br,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:kr("Animation","AnimationEnd"),animationiteration:kr("Animation","AnimationIteration"),animationstart:kr("Animation","AnimationStart"),transitionend:kr("Transition","TransitionEnd")},_r={},Cr={};function Er(e){if(_r[e])return _r[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Cr)return _r[e]=n[t];return e}l&&(Cr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var zr=Er("animationend"),Ar=Er("animationiteration"),Nr=Er("animationstart"),Tr=Er("transitionend"),Or=new Map,Ir="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function jr(e,t){Or.set(e,t),i(t,[e])}for(var Mr=0;Mr<Ir.length;Mr++){var Pr=Ir[Mr];jr(Pr.toLowerCase(),"on"+(Pr[0].toUpperCase()+Pr.slice(1)))}jr(zr,"onAnimationEnd"),jr(Ar,"onAnimationIteration"),jr(Nr,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(Tr,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fr="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(" "),Lr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fr));function Rr(e,t,r){var o=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,o,i,a,s,l,c){if($e.apply(this,arguments),Le){if(!Le)throw Error(n(198));var u=Re;Le=!1,Re=null,De||(De=!0,Ue=u)}}(o,t,void 0,e),e.currentTarget=null}function Dr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Rr(o,s,c),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Rr(o,s,c),i=l}}}if(De)throw e=Ue,De=!1,Ue=null,e}function Ur(e,t){var n=t[yo];void 0===n&&(n=t[yo]=new Set);var r=e+"__bubble";n.has(r)||(Hr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),Hr(n,e,r,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function Vr(e){if(!e[$r]){e[$r]=!0,r.forEach(function(t){"selectionchange"!==t&&(Lr.has(t)||Br(t,!1,e),Br(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[$r]||(t[$r]=!0,Br("selectionchange",!1,t))}}function Hr(e,t,n,r){switch(Yt(t)){case 1:var o=qt;break;case 4:o=Zt;break;default:o=Qt}n=o.bind(null,t,n,e),o=void 0,!Me||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Wr(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=wo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}Ie(function(){var r=i,o=ke(n),a=[];e:{var s=Or.get(e);if(void 0!==s){var l=dn,c=e;switch(e){case"keypress":if(0===nn(n))break e;case"keydown":case"keyup":l=An;break;case"focusin":c="focus",l=yn;break;case"focusout":c="blur",l=yn;break;case"beforeblur":case"afterblur":l=yn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=mn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Tn;break;case zr:case Ar:case Nr:l=bn;break;case Tr:l=On;break;case"scroll":l=hn;break;case"wheel":l=jn;break;case"copy":case"cut":case"paste":l=wn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Nn}var u=!!(4&t),d=!u&&"scroll"===e,f=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=je(p,f))&&u.push(qr(p,m,h)))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,o),a.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===xe||!(c=n.relatedTarget||n.fromElement)||!wo(c)&&!c[go])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?wo(c):null)&&(c!==(d=Ve(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=mn,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=Nn,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:ko(l),h=null==c?s:ko(c),(s=new u(m,p+"leave",l,n,o)).target=d,s.relatedTarget=h,m=null,wo(o)===r&&((u=new u(f,p+"enter",c,n,o)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=Qr(h))p++;for(h=0,m=f;m;m=Qr(m))h++;for(;0<p-h;)u=Qr(u),p--;for(;0<h-p;)f=Qr(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=Qr(u),f=Qr(f)}u=null}else u=null;null!==l&&Kr(a,s,l,u,!1),null!==c&&null!==d&&Kr(a,d,c,u,!0)}if("select"===(l=(s=r?ko(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Yn;else if(Wn(s))if(Gn)g=sr;else{g=ir;var y=or}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ar);switch(g&&(g=g(e,r))?qn(a,g,n,o):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&te(s,"number",s.value)),y=r?ko(r):window,e){case"focusin":(Wn(y)||"true"===y.contentEditable)&&(yr=y,br=r,vr=null);break;case"focusout":vr=br=yr=null;break;case"mousedown":wr=!0;break;case"contextmenu":case"mouseup":case"dragend":wr=!1,xr(a,n,o);break;case"selectionchange":if(gr)break;case"keydown":case"keyup":xr(a,n,o)}var b;if(Pn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Vn?Bn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(Rn&&"ko"!==n.locale&&(Vn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Vn&&(b=tn()):(Xt="value"in(Gt=o)?Gt.value:Gt.textContent,Vn=!0)),0<(y=Zr(r,v)).length&&(v=new xn(v,e,null,n,o),a.push({event:v,listeners:y}),b?v.data=b:null!==(b=$n(n))&&(v.data=b))),(b=Ln?function(e,t){switch(e){case"compositionend":return $n(t);case"keypress":return 32!==t.which?null:(Un=!0,Dn);case"textInput":return(e=t.data)===Dn&&Un?null:e;default:return null}}(e,n):function(e,t){if(Vn)return"compositionend"===e||!Pn&&Bn(e,t)?(e=tn(),en=Xt=Gt=null,Vn=!1,e):null;switch(e){case"paste":default: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 Rn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Zr(r,"onBeforeInput")).length&&(o=new xn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=b))}Dr(a,t)})}function qr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=je(e,n))&&r.unshift(qr(e,i,o)),null!=(i=je(e,t))&&r.push(qr(e,i,o))),e=e.return}return r}function Qr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Kr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(l=je(n,i))&&a.unshift(qr(n,l,s)):o||null!=(l=je(n,i))&&a.push(qr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Jr=/\r\n?/g,Yr=/\u0000|\uFFFD/g;function Gr(e){return("string"==typeof e?e:""+e).replace(Jr,"\n").replace(Yr,"")}function Xr(e,t,r){if(t=Gr(t),Gr(e)!==t&&r)throw Error(n(425))}function eo(){}var to=null,no=null;function ro(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var oo="function"==typeof setTimeout?setTimeout:void 0,io="function"==typeof clearTimeout?clearTimeout:void 0,ao="function"==typeof Promise?Promise:void 0,so="function"==typeof queueMicrotask?queueMicrotask:void 0!==ao?function(e){return ao.resolve(null).then(e).catch(lo)}:oo;function lo(e){setTimeout(function(){throw e})}function co(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Vt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Vt(t)}function uo(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function fo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var ho=Math.random().toString(36).slice(2),po="__reactFiber$"+ho,mo="__reactProps$"+ho,go="__reactContainer$"+ho,yo="__reactEvents$"+ho,bo="__reactListeners$"+ho,vo="__reactHandles$"+ho;function wo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[go]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=fo(e);null!==e;){if(n=e[po])return n;e=fo(e)}return t}n=(e=n).parentNode}return null}function xo(e){return!(e=e[po]||e[go])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ko(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function So(e){return e[mo]||null}var _o=[],Co=-1;function Eo(e){return{current:e}}function zo(e){0>Co||(e.current=_o[Co],_o[Co]=null,Co--)}function Ao(e,t){Co++,_o[Co]=e.current,e.current=t}var No={},To=Eo(No),Oo=Eo(!1),Io=No;function jo(e,t){var n=e.type.contextTypes;if(!n)return No;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Mo(e){return null!=(e=e.childContextTypes)}function Po(){zo(Oo),zo(To)}function Fo(e,t,r){if(To.current!==No)throw Error(n(168));Ao(To,t),Ao(Oo,r)}function Lo(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return r;for(var i in o=o.getChildContext())if(!(i in t))throw Error(n(108,H(e)||"Unknown",i));return R({},r,o)}function Ro(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||No,Io=To.current,Ao(To,e),Ao(Oo,Oo.current),!0}function Do(e,t,r){var o=e.stateNode;if(!o)throw Error(n(169));r?(e=Lo(e,t,Io),o.__reactInternalMemoizedMergedChildContext=e,zo(Oo),zo(To),Ao(To,e)):zo(Oo),Ao(Oo,r)}var Uo=null,Bo=!1,$o=!1;function Vo(e){null===Uo?Uo=[e]:Uo.push(e)}function Ho(){if(!$o&&null!==Uo){$o=!0;var e=0,t=wt;try{var n=Uo;for(wt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Uo=null,Bo=!1}catch(gy){throw null!==Uo&&(Uo=Uo.slice(e+1)),Qe(et,Ho),gy}finally{wt=t,$o=!1}}return null}var Wo=[],qo=0,Zo=null,Qo=0,Ko=[],Jo=0,Yo=null,Go=1,Xo="";function ei(e,t){Wo[qo++]=Qo,Wo[qo++]=Zo,Zo=e,Qo=t}function ti(e,t,n){Ko[Jo++]=Go,Ko[Jo++]=Xo,Ko[Jo++]=Yo,Yo=e;var r=Go;e=Xo;var o=32-st(r)-1;r&=~(1<<o),n+=1;var i=32-st(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Go=1<<32-st(t)+o|n<<o|r,Xo=i+e}else Go=1<<i|n<<o|r,Xo=e}function ni(e){null!==e.return&&(ei(e,1),ti(e,1,0))}function ri(e){for(;e===Zo;)Zo=Wo[--qo],Wo[qo]=null,Qo=Wo[--qo],Wo[qo]=null;for(;e===Yo;)Yo=Ko[--Jo],Ko[Jo]=null,Xo=Ko[--Jo],Ko[Jo]=null,Go=Ko[--Jo],Ko[Jo]=null}var oi=null,ii=null,ai=!1,si=null;function li(e,t){var n=Ic(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ci(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,oi=e,ii=uo(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,oi=e,ii=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yo?{id:Go,overflow:Xo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ic(18,null,null,0)).stateNode=t,n.return=e,e.child=n,oi=e,ii=null,!0);default:return!1}}function ui(e){return!(!(1&e.mode)||128&e.flags)}function di(e){if(ai){var t=ii;if(t){var r=t;if(!ci(e,t)){if(ui(e))throw Error(n(418));t=uo(r.nextSibling);var o=oi;t&&ci(e,t)?li(o,r):(e.flags=-4097&e.flags|2,ai=!1,oi=e)}}else{if(ui(e))throw Error(n(418));e.flags=-4097&e.flags|2,ai=!1,oi=e}}}function fi(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;oi=e}function hi(e){if(e!==oi)return!1;if(!ai)return fi(e),ai=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ro(e.type,e.memoizedProps)),t&&(t=ii)){if(ui(e))throw pi(),Error(n(418));for(;t;)li(e,t),t=uo(t.nextSibling)}if(fi(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){ii=uo(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}ii=null}}else ii=oi?uo(e.stateNode.nextSibling):null;return!0}function pi(){for(var e=ii;e;)e=uo(e.nextSibling)}function mi(){ii=oi=null,ai=!1}function gi(e){null===si?si=[e]:si.push(e)}var yi=x.ReactCurrentBatchConfig;function bi(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var o=r.stateNode}if(!o)throw Error(n(147,e));var i=o,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=i.refs;null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function vi(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wi(e){return(0,e._init)(e._payload)}function xi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Mc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Rc(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){var o=n.type;return o===_?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===j&&wi(o)===t.type)?((r=i(t,n.props)).ref=bi(e,t,n),r.return=e,r):((r=Pc(n.type,n.key,n.props,null,e.mode,r)).ref=bi(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Dc(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Fc(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Rc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=Pc(t.type,t.key,t.props,null,e.mode,n)).ref=bi(e,null,t),n.return=e,n;case S:return(t=Dc(t,e.mode,n)).return=e,t;case j:return f(e,(0,t._init)(t._payload),n)}if(ne(t)||F(t))return(t=Fc(t,e.mode,n,null)).return=e,t;vi(e,t)}return null}function h(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===o?c(e,t,n,r):null;case S:return n.key===o?u(e,t,n,r):null;case j:return h(e,t,(o=n._init)(n._payload),r)}if(ne(n)||F(n))return null!==o?null:d(e,t,n,r,null);vi(e,n)}return null}function p(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case j:return p(e,t,n,(0,r._init)(r._payload),o)}if(ne(r)||F(r))return d(t,e=e.get(n)||null,r,o,null);vi(t,r)}return null}return function l(c,u,d,m){if("object"==typeof d&&null!==d&&d.type===_&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case k:e:{for(var g=d.key,y=u;null!==y;){if(y.key===g){if((g=d.type)===_){if(7===y.tag){r(c,y.sibling),(u=i(y,d.props.children)).return=c,c=u;break e}}else if(y.elementType===g||"object"==typeof g&&null!==g&&g.$$typeof===j&&wi(g)===y.type){r(c,y.sibling),(u=i(y,d.props)).ref=bi(c,y,d),u.return=c,c=u;break e}r(c,y);break}t(c,y),y=y.sibling}d.type===_?((u=Fc(d.props.children,c.mode,m,d.key)).return=c,c=u):((m=Pc(d.type,d.key,d.props,null,c.mode,m)).ref=bi(c,u,d),m.return=c,c=m)}return s(c);case S:e:{for(y=d.key;null!==u;){if(u.key===y){if(4===u.tag&&u.stateNode.containerInfo===d.containerInfo&&u.stateNode.implementation===d.implementation){r(c,u.sibling),(u=i(u,d.children||[])).return=c,c=u;break e}r(c,u);break}t(c,u),u=u.sibling}(u=Dc(d,c.mode,m)).return=c,c=u}return s(c);case j:return l(c,u,(y=d._init)(d._payload),m)}if(ne(d))return function(n,i,s,l){for(var c=null,u=null,d=i,m=i=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=h(n,d,s[m],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(n,d),i=a(y,i,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===s.length)return r(n,d),ai&&ei(n,m),c;if(null===d){for(;m<s.length;m++)null!==(d=f(n,s[m],l))&&(i=a(d,i,m),null===u?c=d:u.sibling=d,u=d);return ai&&ei(n,m),c}for(d=o(n,d);m<s.length;m++)null!==(g=p(d,n,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),i=a(g,i,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(n,e)}),ai&&ei(n,m),c}(c,u,d,m);if(F(d))return function(i,s,l,c){var u=F(l);if("function"!=typeof u)throw Error(n(150));if(null==(l=u.call(l)))throw Error(n(151));for(var d=u=null,m=s,g=s=0,y=null,b=l.next();null!==m&&!b.done;g++,b=l.next()){m.index>g?(y=m,m=null):y=m.sibling;var v=h(i,m,b.value,c);if(null===v){null===m&&(m=y);break}e&&m&&null===v.alternate&&t(i,m),s=a(v,s,g),null===d?u=v:d.sibling=v,d=v,m=y}if(b.done)return r(i,m),ai&&ei(i,g),u;if(null===m){for(;!b.done;g++,b=l.next())null!==(b=f(i,b.value,c))&&(s=a(b,s,g),null===d?u=b:d.sibling=b,d=b);return ai&&ei(i,g),u}for(m=o(i,m);!b.done;g++,b=l.next())null!==(b=p(m,i,g,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),s=a(b,s,g),null===d?u=b:d.sibling=b,d=b);return e&&m.forEach(function(e){return t(i,e)}),ai&&ei(i,g),u}(c,u,d,m);vi(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d?(d=""+d,null!==u&&6===u.tag?(r(c,u.sibling),(u=i(u,d)).return=c,c=u):(r(c,u),(u=Rc(d,c.mode,m)).return=c,c=u),s(c)):r(c,u)}}var ki=xi(!0),Si=xi(!1),_i=Eo(null),Ci=null,Ei=null,zi=null;function Ai(){zi=Ei=Ci=null}function Ni(e){var t=_i.current;zo(_i),e._currentValue=t}function Ti(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Oi(e,t){Ci=e,zi=Ei=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ws=!0),e.firstContext=null)}function Ii(e){var t=e._currentValue;if(zi!==e)if(e={context:e,memoizedValue:t,next:null},null===Ei){if(null===Ci)throw Error(n(308));Ei=e,Ci.dependencies={lanes:0,firstContext:e}}else Ei=Ei.next=e;return t}var ji=null;function Mi(e){null===ji?ji=[e]:ji.push(e)}function Pi(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Mi(t)):(n.next=o.next,o.next=n),t.interleaved=n,Fi(e,r)}function Fi(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Li=!1;function Ri(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Di(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ui(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Nl){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Fi(e,n)}return null===(o=r.interleaved)?(t.next=t,Mi(r)):(t.next=o.next,o.next=t),r.interleaved=t,Fi(e,n)}function $i(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Vi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hi(e,t,n,r){var o=e.updateQueue;Li=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?i=c:a.next=c,a=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==i){var d=o.baseState;for(a=0,u=c=l=null,s=i;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=m.payload)?p.call(h,d,f):p))break e;d=R({},d,f);break e;case 2:Li=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,a|=f;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(f=s).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===u&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Ll|=a,e.lanes=a,e.memoizedState=d}}function Wi(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],i=o.callback;if(null!==i){if(o.callback=null,o=r,"function"!=typeof i)throw Error(n(191,i));i.call(o)}}}var qi={},Zi=Eo(qi),Qi=Eo(qi),Ki=Eo(qi);function Ji(e){if(e===qi)throw Error(n(174));return e}function Yi(e,t){switch(Ao(Ki,t),Ao(Qi,e),Ao(Zi,qi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ce(null,"");break;default:t=ce(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}zo(Zi),Ao(Zi,t)}function Gi(){zo(Zi),zo(Qi),zo(Ki)}function Xi(e){Ji(Ki.current);var t=Ji(Zi.current),n=ce(t,e.type);t!==n&&(Ao(Qi,e),Ao(Zi,n))}function ea(e){Qi.current===e&&(zo(Zi),zo(Qi))}var ta=Eo(0);function na(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ra=[];function oa(){for(var e=0;e<ra.length;e++)ra[e]._workInProgressVersionPrimary=null;ra.length=0}var ia=x.ReactCurrentDispatcher,aa=x.ReactCurrentBatchConfig,sa=0,la=null,ca=null,ua=null,da=!1,fa=!1,ha=0,pa=0;function ma(){throw Error(n(321))}function ga(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function ya(e,t,r,o,i,a){if(sa=a,la=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ia.current=null===e||null===e.memoizedState?es:ts,e=r(o,i),fa){a=0;do{if(fa=!1,ha=0,25<=a)throw Error(n(301));a+=1,ua=ca=null,t.updateQueue=null,ia.current=ns,e=r(o,i)}while(fa)}if(ia.current=Xa,t=null!==ca&&null!==ca.next,sa=0,ua=ca=la=null,da=!1,t)throw Error(n(300));return e}function ba(){var e=0!==ha;return ha=0,e}function va(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ua?la.memoizedState=ua=e:ua=ua.next=e,ua}function wa(){if(null===ca){var e=la.alternate;e=null!==e?e.memoizedState:null}else e=ca.next;var t=null===ua?la.memoizedState:ua.next;if(null!==t)ua=t,ca=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ca=e).memoizedState,baseState:ca.baseState,baseQueue:ca.baseQueue,queue:ca.queue,next:null},null===ua?la.memoizedState=ua=e:ua=ua.next=e}return ua}function xa(e,t){return"function"==typeof t?t(e):t}function ka(e){var t=wa(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=ca,i=o.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}o.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,o=o.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((sa&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),o=u.hasEagerState?u.eagerState:e(o,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=f,s=o):c=c.next=f,la.lanes|=d,Ll|=d}u=u.next}while(null!==u&&u!==a);null===c?s=o:c.next=l,lr(o,t.memoizedState)||(ws=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=c,r.lastRenderedState=o}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,la.lanes|=a,Ll|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Sa(e){var t=wa(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);lr(a,t.memoizedState)||(ws=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,o]}function _a(){}function Ca(e,t){var r=la,o=wa(),i=t(),a=!lr(o.memoizedState,i);if(a&&(o.memoizedState=i,ws=!0),o=o.queue,La(Aa.bind(null,r,o,e),[e]),o.getSnapshot!==t||a||null!==ua&&1&ua.memoizedState.tag){if(r.flags|=2048,Ia(9,za.bind(null,r,o,i,t),void 0,null),null===Tl)throw Error(n(349));30&sa||Ea(r,t,i)}return i}function Ea(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=la.updateQueue)?(t={lastEffect:null,stores:null},la.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function za(e,t,n,r){t.value=n,t.getSnapshot=r,Na(t)&&Ta(e)}function Aa(e,t,n){return n(function(){Na(t)&&Ta(e)})}function Na(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch(r){return!0}}function Ta(e){var t=Fi(e,1);null!==t&&rc(t,e,1,-1)}function Oa(e){var t=va();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},t.queue=e,e=e.dispatch=Ka.bind(null,la,e),[t.memoizedState,e]}function Ia(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=la.updateQueue)?(t={lastEffect:null,stores:null},la.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ja(){return wa().memoizedState}function Ma(e,t,n,r){var o=va();la.flags|=e,o.memoizedState=Ia(1|t,n,void 0,void 0===r?null:r)}function Pa(e,t,n,r){var o=wa();r=void 0===r?null:r;var i=void 0;if(null!==ca){var a=ca.memoizedState;if(i=a.destroy,null!==r&&ga(r,a.deps))return void(o.memoizedState=Ia(t,n,i,r))}la.flags|=e,o.memoizedState=Ia(1|t,n,i,r)}function Fa(e,t){return Ma(8390656,8,e,t)}function La(e,t){return Pa(2048,8,e,t)}function Ra(e,t){return Pa(4,2,e,t)}function Da(e,t){return Pa(4,4,e,t)}function Ua(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ba(e,t,n){return n=null!=n?n.concat([e]):null,Pa(4,4,Ua.bind(null,t,e),n)}function $a(){}function Va(e,t){var n=wa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ga(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ha(e,t){var n=wa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ga(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Wa(e,t,n){return 21&sa?(lr(n,t)||(n=gt(),la.lanes|=n,Ll|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ws=!0),e.memoizedState=n)}function qa(e,t){var n=wt;wt=0!==n&&4>n?n:4,e(!0);var r=aa.transition;aa.transition={};try{e(!1),t()}finally{wt=n,aa.transition=r}}function Za(){return wa().memoizedState}function Qa(e,t,n){var r=nc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ja(e))Ya(t,n);else if(null!==(n=Pi(e,t,n,r))){rc(n,e,r,tc()),Ga(n,t,r)}}function Ka(e,t,n){var r=nc(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ja(e))Ya(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,lr(s,a)){var l=t.interleaved;return null===l?(o.next=o,Mi(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(n=Pi(e,t,o,r))&&(rc(n,e,r,o=tc()),Ga(n,t,r))}}function Ja(e){var t=e.alternate;return e===la||null!==t&&t===la}function Ya(e,t){fa=da=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ga(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var Xa={readContext:Ii,useCallback:ma,useContext:ma,useEffect:ma,useImperativeHandle:ma,useInsertionEffect:ma,useLayoutEffect:ma,useMemo:ma,useReducer:ma,useRef:ma,useState:ma,useDebugValue:ma,useDeferredValue:ma,useTransition:ma,useMutableSource:ma,useSyncExternalStore:ma,useId:ma,unstable_isNewReconciler:!1},es={readContext:Ii,useCallback:function(e,t){return va().memoizedState=[e,void 0===t?null:t],e},useContext:Ii,useEffect:Fa,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ma(4194308,4,Ua.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ma(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ma(4,2,e,t)},useMemo:function(e,t){var n=va();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=va();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Qa.bind(null,la,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},va().memoizedState=e},useState:Oa,useDebugValue:$a,useDeferredValue:function(e){return va().memoizedState=e},useTransition:function(){var e=Oa(!1),t=e[0];return e=qa.bind(null,e[1]),va().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=la,i=va();if(ai){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Tl)throw Error(n(349));30&sa||Ea(o,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Fa(Aa.bind(null,o,a,e),[e]),o.flags|=2048,Ia(9,za.bind(null,o,a,r,t),void 0,null),r},useId:function(){var e=va(),t=Tl.identifierPrefix;if(ai){var n=Xo;t=":"+t+"R"+(n=(Go&~(1<<32-st(Go)-1)).toString(32)+n),0<(n=ha++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=pa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ts={readContext:Ii,useCallback:Va,useContext:Ii,useEffect:La,useImperativeHandle:Ba,useInsertionEffect:Ra,useLayoutEffect:Da,useMemo:Ha,useReducer:ka,useRef:ja,useState:function(){return ka(xa)},useDebugValue:$a,useDeferredValue:function(e){return Wa(wa(),ca.memoizedState,e)},useTransition:function(){return[ka(xa)[0],wa().memoizedState]},useMutableSource:_a,useSyncExternalStore:Ca,useId:Za,unstable_isNewReconciler:!1},ns={readContext:Ii,useCallback:Va,useContext:Ii,useEffect:La,useImperativeHandle:Ba,useInsertionEffect:Ra,useLayoutEffect:Da,useMemo:Ha,useReducer:Sa,useRef:ja,useState:function(){return Sa(xa)},useDebugValue:$a,useDeferredValue:function(e){var t=wa();return null===ca?t.memoizedState=e:Wa(t,ca.memoizedState,e)},useTransition:function(){return[Sa(xa)[0],wa().memoizedState]},useMutableSource:_a,useSyncExternalStore:Ca,useId:Za,unstable_isNewReconciler:!1};function rs(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function os(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:R({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var is={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tc(),o=nc(e),i=Ui(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=Bi(e,i,o))&&(rc(t,e,o,r),$i(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tc(),o=nc(e),i=Ui(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Bi(e,i,o))&&(rc(t,e,o,r),$i(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tc(),r=nc(e),o=Ui(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Bi(e,o,r))&&(rc(t,e,r,n),$i(t,e,r))}};function as(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!cr(n,r)||!cr(o,i))}function ss(e,t,n){var r=!1,o=No,i=t.contextType;return"object"==typeof i&&null!==i?i=Ii(i):(o=Mo(t)?Io:To.current,i=(r=null!=(r=t.contextTypes))?jo(e,o):No),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=is,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ls(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&is.enqueueReplaceState(t,t.state,null)}function cs(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ri(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=Ii(i):(i=Mo(t)?Io:To.current,o.context=jo(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(os(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&is.enqueueReplaceState(o,o.state,null),Hi(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function us(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function fs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hs="function"==typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=Ui(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wl||(Wl=!0,ql=r),fs(0,t)},n}function ms(e,t,n){(n=Ui(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){fs(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){fs(0,t),"function"!=typeof r&&(null===Zl?Zl=new Set([this]):Zl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function gs(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ec.bind(null,e,t,n),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function bs(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ui(-1,1)).tag=2,Bi(n,t,1))),n.lanes|=1),e)}var vs=x.ReactCurrentOwner,ws=!1;function xs(e,t,n,r){t.child=null===e?Si(t,null,n,r):ki(t,e.child,n,r)}function ks(e,t,n,r,o){n=n.render;var i=t.ref;return Oi(t,o),r=ya(e,t,n,r,i,o),n=ba(),null===e||ws?(ai&&n&&ni(t),t.flags|=1,xs(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ws(e,t,o))}function Ss(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||jc(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Pc(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,_s(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:cr)(a,r)&&e.ref===t.ref)return Ws(e,t,o)}return t.flags|=1,(e=Mc(i,r)).ref=t.ref,e.return=t,t.child=e}function _s(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(cr(i,r)&&e.ref===t.ref){if(ws=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,Ws(e,t,o);131072&e.flags&&(ws=!0)}}return zs(e,t,n,r,o)}function Cs(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ao(Ml,jl),jl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Ao(Ml,jl),jl|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ao(Ml,jl),jl|=n;else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ao(Ml,jl),jl|=r;return xs(e,t,o,n),t.child}function Es(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zs(e,t,n,r,o){var i=Mo(n)?Io:To.current;return i=jo(t,i),Oi(t,o),n=ya(e,t,n,r,i,o),r=ba(),null===e||ws?(ai&&r&&ni(t),t.flags|=1,xs(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ws(e,t,o))}function As(e,t,n,r,o){if(Mo(n)){var i=!0;Ro(t)}else i=!1;if(Oi(t,o),null===t.stateNode)Hs(e,t),ss(t,n,r),cs(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Ii(c):c=jo(t,c=Mo(n)?Io:To.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&ls(t,a,r,c),Li=!1;var f=t.memoizedState;a.state=f,Hi(t,r,a,o),l=t.memoizedState,s!==r||f!==l||Oo.current||Li?("function"==typeof u&&(os(t,n,u,r),l=t.memoizedState),(s=Li||as(t,n,s,r,f,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Di(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:rs(t.type,s),a.props=c,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Ii(l):l=jo(t,l=Mo(n)?Io:To.current);var h=n.getDerivedStateFromProps;(u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&ls(t,a,r,l),Li=!1,f=t.memoizedState,a.state=f,Hi(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||Oo.current||Li?("function"==typeof h&&(os(t,n,h,r),p=t.memoizedState),(c=Li||as(t,n,c,r,f,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ns(e,t,n,r,i,o)}function Ns(e,t,n,r,o,i){Es(e,t);var a=!!(128&t.flags);if(!r&&!a)return o&&Do(t,n,!1),Ws(e,t,i);r=t.stateNode,vs.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=ki(t,e.child,null,i),t.child=ki(t,null,s,i)):xs(e,t,s,i),t.memoizedState=r.state,o&&Do(t,n,!0),t.child}function Ts(e){var t=e.stateNode;t.pendingContext?Fo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Fo(0,t.context,!1),Yi(e,t.containerInfo)}function Os(e,t,n,r,o){return mi(),gi(o),t.flags|=256,xs(e,t,n,r),t.child}var Is,js,Ms,Ps,Fs={dehydrated:null,treeContext:null,retryLane:0};function Ls(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rs(e,t,r){var o,i=t.pendingProps,a=ta.current,s=!1,l=!!(128&t.flags);if((o=l)||(o=(null===e||null!==e.memoizedState)&&!!(2&a)),o?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Ao(ta,1&a),null===e)return di(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},1&i||null===s?s=Lc(l,i,0,null):(s.childLanes=0,s.pendingProps=l),e=Fc(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ls(r),t.memoizedState=Fs,e):Ds(t,l));if(null!==(a=e.memoizedState)&&null!==(o=a.dehydrated))return function(e,t,r,o,i,a,s){if(r)return 256&t.flags?(t.flags&=-257,Us(e,t,s,o=ds(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=o.fallback,i=t.mode,o=Lc({mode:"visible",children:o.children},i,0,null),(a=Fc(a,i,s,null)).flags|=2,o.return=t,a.return=t,o.sibling=a,t.child=o,1&t.mode&&ki(t,e.child,null,s),t.child.memoizedState=Ls(s),t.memoizedState=Fs,a);if(!(1&t.mode))return Us(e,t,s,null);if("$!"===i.data){if(o=i.nextSibling&&i.nextSibling.dataset)var l=o.dgst;return o=l,Us(e,t,s,o=ds(a=Error(n(419)),o,void 0))}if(l=0!==(s&e.childLanes),ws||l){if(null!==(o=Tl)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(o.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,Fi(e,i),rc(o,e,i,-1))}return gc(),Us(e,t,s,o=ds(Error(n(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Ac.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,ii=uo(i.nextSibling),oi=t,ai=!0,si=null,null!==e&&(Ko[Jo++]=Go,Ko[Jo++]=Xo,Ko[Jo++]=Yo,Go=e.id,Xo=e.overflow,Yo=t),t=Ds(t,o.children),t.flags|=4096,t)}(e,t,l,i,o,a,r);if(s){s=i.fallback,l=t.mode,o=(a=e.child).sibling;var c={mode:"hidden",children:i.children};return 1&l||t.child===a?(i=Mc(a,c)).subtreeFlags=14680064&a.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null),null!==o?s=Mc(o,s):(s=Fc(s,l,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Ls(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Fs,i}return e=(s=e.child).sibling,i=Mc(s,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Ds(e,t){return(t=Lc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Us(e,t,n,r){return null!==r&&gi(r),ki(t,e.child,null,n),(e=Ds(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ti(e.return,t,n)}function $s(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Vs(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xs(e,t,r.children,n),2&(r=ta.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bs(e,n,t);else if(19===e.tag)Bs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ao(ta,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===na(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),$s(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===na(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}$s(t,!0,n,null,i);break;case"together":$s(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Hs(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ws(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Ll|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Mc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Mc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function qs(e,t){if(!ai)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Zs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Qs(e,t,r){var i=t.pendingProps;switch(ri(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zs(t),null;case 1:case 17:return Mo(t.type)&&Po(),Zs(t),null;case 3:return i=t.stateNode,Gi(),zo(Oo),zo(To),oa(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(hi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==si&&(sc(si),si=null))),js(e,t),Zs(t),null;case 5:ea(t);var a=Ji(Ki.current);if(r=t.type,null!==e&&null!=t.stateNode)Ms(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(n(166));return Zs(t),null}if(e=Ji(Zi.current),hi(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[po]=t,i[mo]=s,e=!!(1&t.mode),r){case"dialog":Ur("cancel",i),Ur("close",i);break;case"iframe":case"object":case"embed":Ur("load",i);break;case"video":case"audio":for(a=0;a<Fr.length;a++)Ur(Fr[a],i);break;case"source":Ur("error",i);break;case"img":case"image":case"link":Ur("error",i),Ur("load",i);break;case"details":Ur("toggle",i);break;case"input":Y(i,s),Ur("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Ur("invalid",i);break;case"textarea":ie(i,s),Ur("invalid",i)}for(var l in ve(r,s),a=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?i.textContent!==c&&(!0!==s.suppressHydrationWarning&&Xr(i.textContent,c,e),a=["children",c]):"number"==typeof c&&i.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Xr(i.textContent,c,e),a=["children",""+c]):o.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Ur("scroll",i)}switch(r){case"input":Z(i),ee(i,s,!0);break;case"textarea":Z(i),se(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=eo)}i=a,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=le(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=l.createElement(r,{is:i.is}):(e=l.createElement(r),"select"===r&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,r),e[po]=t,e[mo]=i,Is(e,t,!1,!1),t.stateNode=e;e:{switch(l=we(r,i),r){case"dialog":Ur("cancel",e),Ur("close",e),a=i;break;case"iframe":case"object":case"embed":Ur("load",e),a=i;break;case"video":case"audio":for(a=0;a<Fr.length;a++)Ur(Fr[a],e);a=i;break;case"source":Ur("error",e),a=i;break;case"img":case"image":case"link":Ur("error",e),Ur("load",e),a=i;break;case"details":Ur("toggle",e),a=i;break;case"input":Y(e,i),a=J(e,i),Ur("invalid",e);break;case"option":default:a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=R({},i,{value:void 0}),Ur("invalid",e);break;case"textarea":ie(e,i),a=oe(e,i),Ur("invalid",e)}for(s in ve(r,a),c=a)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?ye(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&fe(e,u):"children"===s?"string"==typeof u?("textarea"!==r||""!==u)&&he(e,u):"number"==typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Ur("scroll",e):null!=u&&w(e,s,u,l))}switch(r){case"input":Z(e),ee(e,i,!1);break;case"textarea":Z(e),se(e);break;case"option":null!=i.value&&e.setAttribute("value",""+W(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?re(e,!!i.multiple,s,!1):null!=i.defaultValue&&re(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=eo)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Zs(t),null;case 6:if(e&&null!=t.stateNode)Ps(e,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(n(166));if(r=Ji(Ki.current),Ji(Zi.current),hi(t)){if(i=t.stateNode,r=t.memoizedProps,i[po]=t,(s=i.nodeValue!==r)&&null!==(e=oi))switch(e.tag){case 3:Xr(i.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(i.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(i=(9===r.nodeType?r:r.ownerDocument).createTextNode(i))[po]=t,t.stateNode=i}return Zs(t),null;case 13:if(zo(ta),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ai&&null!==ii&&1&t.mode&&!(128&t.flags))pi(),mi(),t.flags|=98560,s=!1;else if(s=hi(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[po]=t}else mi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Zs(t),s=!1}else null!==si&&(sc(si),si=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((i=null!==i)!==(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ta.current?0===Pl&&(Pl=3):gc())),null!==t.updateQueue&&(t.flags|=4),Zs(t),null);case 4:return Gi(),js(e,t),null===e&&Vr(t.stateNode.containerInfo),Zs(t),null;case 10:return Ni(t.type._context),Zs(t),null;case 19:if(zo(ta),null===(s=t.memoizedState))return Zs(t),null;if(i=!!(128&t.flags),null===(l=s.rendering))if(i)qs(s,!1);else{if(0!==Pl||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=na(e))){for(t.flags|=128,qs(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;null!==r;)e=i,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ao(ta,1&ta.current|2),t.child}e=e.sibling}null!==s.tail&&Ge()>Vl&&(t.flags|=128,i=!0,qs(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=na(l))){if(t.flags|=128,i=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),qs(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ai)return Zs(t),null}else 2*Ge()-s.renderingStartTime>Vl&&1073741824!==r&&(t.flags|=128,i=!0,qs(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ge(),t.sibling=null,r=ta.current,Ao(ta,i?1&r|2:1&r),t):(Zs(t),null);case 22:case 23:return fc(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&1&t.mode?!!(1073741824&jl)&&(Zs(t),6&t.subtreeFlags&&(t.flags|=8192)):Zs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Ks(e,t){switch(ri(t),t.tag){case 1:return Mo(t.type)&&Po(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Gi(),zo(Oo),zo(To),oa(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ea(t),null;case 13:if(zo(ta),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));mi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return zo(ta),null;case 4:return Gi(),null;case 10:return Ni(t.type._context),null;case 22:case 23:return fc(),null;default:return null}}Is=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},js=function(){},Ms=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ji(Zi.current);var a,s=null;switch(n){case"input":i=J(e,i),r=J(e,r),s=[];break;case"select":i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),s=[];break;case"textarea":i=oe(e,i),r=oe(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=eo)}for(u in ve(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(o.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(o.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Ur("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Ps=function(e,t,n,r){n!==r&&(t.flags|=4)};var Js=!1,Ys=!1,Gs="function"==typeof WeakSet?WeakSet:Set,Xs=null;function el(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){Cc(e,t,r)}else n.current=null}function tl(e,t,n){try{n()}catch(r){Cc(e,t,r)}}var nl=!1;function rl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&tl(t,n,i)}o=o.next}while(o!==r)}}function ol(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function il(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[po],delete t[mo],delete t[yo],delete t[bo],delete t[vo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sl(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=eo));else if(4!==r&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}function ul(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ul(e,t,n),e=e.sibling;null!==e;)ul(e,t,n),e=e.sibling}var dl=null,fl=!1;function hl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(at&&"function"==typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(it,n)}catch(s){}switch(n.tag){case 5:Ys||el(n,t);case 6:var r=dl,o=fl;dl=null,hl(e,t,n),fl=o,null!==(dl=r)&&(fl?(e=dl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):dl.removeChild(n.stateNode));break;case 18:null!==dl&&(fl?(e=dl,n=n.stateNode,8===e.nodeType?co(e.parentNode,n):1===e.nodeType&&co(e,n),Vt(e)):co(dl,n.stateNode));break;case 4:r=dl,o=fl,dl=n.stateNode.containerInfo,fl=!0,hl(e,t,n),dl=r,fl=o;break;case 0:case 11:case 14:case 15:if(!Ys&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(2&i||4&i)&&tl(n,t,a),o=o.next}while(o!==r)}hl(e,t,n);break;case 1:if(!Ys&&(el(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Cc(n,t,s)}hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:1&n.mode?(Ys=(r=Ys)||null!==n.memoizedState,hl(e,t,n),Ys=r):hl(e,t,n);break;default:hl(e,t,n)}}function ml(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Gs),t.forEach(function(t){var r=Nc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function gl(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var i=r[o];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:dl=l.stateNode,fl=!1;break e;case 3:case 4:dl=l.stateNode.containerInfo,fl=!0;break e}l=l.return}if(null===dl)throw Error(n(160));pl(a,s,i),dl=null,fl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(u){Cc(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)yl(t,e),t=t.sibling}function yl(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gl(t,e),bl(e),4&o){try{rl(3,e,e.return),ol(3,e)}catch(g){Cc(e,e.return,g)}try{rl(5,e,e.return)}catch(g){Cc(e,e.return,g)}}break;case 1:gl(t,e),bl(e),512&o&&null!==r&&el(r,r.return);break;case 5:if(gl(t,e),bl(e),512&o&&null!==r&&el(r,r.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(g){Cc(e,e.return,g)}}if(4&o&&null!=(i=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&G(i,a),we(l,s);var u=we(l,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];"style"===d?ye(i,f):"dangerouslySetInnerHTML"===d?fe(i,f):"children"===d?he(i,f):w(i,d,f,u)}switch(l){case"input":X(i,a);break;case"textarea":ae(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?re(i,!!a.multiple,p,!1):h!==!!a.multiple&&(null!=a.defaultValue?re(i,!!a.multiple,a.defaultValue,!0):re(i,!!a.multiple,a.multiple?[]:"",!1))}i[mo]=a}catch(g){Cc(e,e.return,g)}}break;case 6:if(gl(t,e),bl(e),4&o){if(null===e.stateNode)throw Error(n(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){Cc(e,e.return,g)}}break;case 3:if(gl(t,e),bl(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Vt(t.containerInfo)}catch(g){Cc(e,e.return,g)}break;case 4:default:gl(t,e),bl(e);break;case 13:gl(t,e),bl(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||($l=Ge())),4&o&&ml(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ys=(u=Ys)||d,gl(t,e),Ys=u):gl(t,e),bl(e),8192&o){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&1&e.mode)for(Xs=e,d=e.child;null!==d;){for(f=Xs=d;null!==Xs;){switch(p=(h=Xs).child,h.tag){case 0:case 11:case 14:case 15:rl(4,h,h.return);break;case 1:el(h,h.return);var m=h.stateNode;if("function"==typeof m.componentWillUnmount){o=h,r=h.return;try{t=o,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Cc(o,r,g)}}break;case 5:el(h,h.return);break;case 22:if(null!==h.memoizedState){kl(f);continue}}null!==p?(p.return=h,Xs=p):kl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{i=f.stateNode,u?"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=f.stateNode,s=null!=(c=f.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=ge("display",s))}catch(g){Cc(e,e.return,g)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Cc(e,e.return,g)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:gl(t,e),bl(e),4&o&&ml(e);case 21:}}function bl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(sl(r)){var o=r;break e}r=r.return}throw Error(n(160))}switch(o.tag){case 5:var i=o.stateNode;32&o.flags&&(he(i,""),o.flags&=-33),ul(e,ll(e),i);break;case 3:case 4:var a=o.stateNode.containerInfo;cl(e,ll(e),a);break;default:throw Error(n(161))}}catch(s){Cc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,n){Xs=e,wl(e)}function wl(e,t,n){for(var r=!!(1&e.mode);null!==Xs;){var o=Xs,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Js;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Ys;s=Js;var c=Ys;if(Js=a,(Ys=l)&&!c)for(Xs=o;null!==Xs;)l=(a=Xs).child,22===a.tag&&null!==a.memoizedState?Sl(o):null!==l?(l.return=a,Xs=l):Sl(o);for(;null!==i;)Xs=i,wl(i),i=i.sibling;Xs=o,Js=s,Ys=c}xl(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Xs=i):xl(e)}}function xl(e){for(;null!==Xs;){var t=Xs;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ys||ol(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!Ys)if(null===r)o.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:rs(t.type,r.memoizedProps);o.componentDidUpdate(i,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Wi(t,a,o);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Wi(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Vt(f)}}}break;default:throw Error(n(163))}Ys||512&t.flags&&il(t)}catch(dy){Cc(t,t.return,dy)}}if(t===e){Xs=null;break}if(null!==(r=t.sibling)){r.return=t.return,Xs=r;break}Xs=t.return}}function kl(e){for(;null!==Xs;){var t=Xs;if(t===e){Xs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Xs=n;break}Xs=t.return}}function Sl(e){for(;null!==Xs;){var t=Xs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ol(4,t)}catch(l){Cc(t,n,l)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){Cc(t,o,l)}}var i=t.return;try{il(t)}catch(l){Cc(t,i,l)}break;case 5:var a=t.return;try{il(t)}catch(l){Cc(t,a,l)}}}catch(l){Cc(t,t.return,l)}if(t===e){Xs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Xs=s;break}Xs=t.return}}var _l,Cl=Math.ceil,El=x.ReactCurrentDispatcher,zl=x.ReactCurrentOwner,Al=x.ReactCurrentBatchConfig,Nl=0,Tl=null,Ol=null,Il=0,jl=0,Ml=Eo(0),Pl=0,Fl=null,Ll=0,Rl=0,Dl=0,Ul=null,Bl=null,$l=0,Vl=1/0,Hl=null,Wl=!1,ql=null,Zl=null,Ql=!1,Kl=null,Jl=0,Yl=0,Gl=null,Xl=-1,ec=0;function tc(){return 6&Nl?Ge():-1!==Xl?Xl:Xl=Ge()}function nc(e){return 1&e.mode?2&Nl&&0!==Il?Il&-Il:null!==yi.transition?(0===ec&&(ec=gt()),ec):0!==(e=wt)?e:e=void 0===(e=window.event)?16:Yt(e.type):1}function rc(e,t,r,o){if(50<Yl)throw Yl=0,Gl=null,Error(n(185));bt(e,r,o),2&Nl&&e===Tl||(e===Tl&&(!(2&Nl)&&(Rl|=r),4===Pl&&lc(e,Il)),oc(e,o),1===r&&0===Nl&&!(1&t.mode)&&(Vl=Ge()+500,Bo&&Ho()))}function oc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-st(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=pt(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ht(e,e===Tl?Il:0);if(0===r)null!==n&&Ke(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ke(n),1===t)0===e.tag?function(e){Bo=!0,Vo(e)}(cc.bind(null,e)):Vo(cc.bind(null,e)),so(function(){!(6&Nl)&&Ho()}),n=null;else{switch(xt(r)){case 1:n=et;break;case 4:n=tt;break;case 16:default:n=nt;break;case 536870912:n=ot}n=Tc(n,ic.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ic(e,t){if(Xl=-1,ec=0,6&Nl)throw Error(n(327));var r=e.callbackNode;if(Sc()&&e.callbackNode!==r)return null;var o=ht(e,e===Tl?Il:0);if(0===o)return null;if(30&o||0!==(o&e.expiredLanes)||t)t=yc(e,o);else{t=o;var i=Nl;Nl|=2;var a=mc();for(Tl===e&&Il===t||(Hl=null,Vl=Ge()+500,hc(e,t));;)try{vc();break}catch(l){pc(e,l)}Ai(),El.current=a,Nl=i,null!==Ol?t=0:(Tl=null,Il=0,t=Pl)}if(0!==t){if(2===t&&(0!==(i=mt(e))&&(o=i,t=ac(e,i))),1===t)throw r=Fl,hc(e,0),lc(e,o),oc(e,Ge()),r;if(6===t)lc(e,o);else{if(i=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!lr(i(),o))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=yc(e,o),2===t&&(a=mt(e),0!==a&&(o=a,t=ac(e,a))),1!==t)))throw r=Fl,hc(e,0),lc(e,o),oc(e,Ge()),r;switch(e.finishedWork=i,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:case 5:kc(e,Bl,Hl);break;case 3:if(lc(e,o),(130023424&o)===o&&10<(t=$l+500-Ge())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&o)!==o){tc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=oo(kc.bind(null,e,Bl,Hl),t);break}kc(e,Bl,Hl);break;case 4:if(lc(e,o),(4194240&o)===o)break;for(t=e.eventTimes,i=-1;0<o;){var s=31-st(o);a=1<<s,(s=t[s])>i&&(i=s),o&=~a}if(o=i,10<(o=(120>(o=Ge()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Cl(o/1960))-o)){e.timeoutHandle=oo(kc.bind(null,e,Bl,Hl),o);break}kc(e,Bl,Hl);break;default:throw Error(n(329))}}}return oc(e,Ge()),e.callbackNode===r?ic.bind(null,e):null}function ac(e,t){var n=Ul;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),2!==(e=yc(e,t))&&(t=Bl,Bl=n,null!==t&&sc(t)),e}function sc(e){null===Bl?Bl=e:Bl.push.apply(Bl,e)}function lc(e,t){for(t&=~Dl,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),r=1<<n;e[n]=-1,t&=~r}}function cc(e){if(6&Nl)throw Error(n(327));Sc();var t=ht(e,0);if(!(1&t))return oc(e,Ge()),null;var r=yc(e,t);if(0!==e.tag&&2===r){var o=mt(e);0!==o&&(t=o,r=ac(e,o))}if(1===r)throw r=Fl,hc(e,0),lc(e,t),oc(e,Ge()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,kc(e,Bl,Hl),oc(e,Ge()),null}function uc(e,t){var n=Nl;Nl|=1;try{return e(t)}finally{0===(Nl=n)&&(Vl=Ge()+500,Bo&&Ho())}}function dc(e){null!==Kl&&0===Kl.tag&&!(6&Nl)&&Sc();var t=Nl;Nl|=1;var n=Al.transition,r=wt;try{if(Al.transition=null,wt=1,e)return e()}finally{wt=r,Al.transition=n,!(6&(Nl=t))&&Ho()}}function fc(){jl=Ml.current,zo(Ml)}function hc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,io(n)),null!==Ol)for(n=Ol.return;null!==n;){var r=n;switch(ri(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Po();break;case 3:Gi(),zo(Oo),zo(To),oa();break;case 5:ea(r);break;case 4:Gi();break;case 13:case 19:zo(ta);break;case 10:Ni(r.type._context);break;case 22:case 23:fc()}n=n.return}if(Tl=e,Ol=e=Mc(e.current,null),Il=jl=t,Pl=0,Fl=null,Dl=Rl=Ll=0,Bl=Ul=null,null!==ji){for(t=0;t<ji.length;t++)if(null!==(r=(n=ji[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}ji=null}return e}function pc(e,t){for(;;){var r=Ol;try{if(Ai(),ia.current=Xa,da){for(var o=la.memoizedState;null!==o;){var i=o.queue;null!==i&&(i.pending=null),o=o.next}da=!1}if(sa=0,ua=ca=la=null,fa=!1,ha=0,zl.current=null,null===r||null===r.return){Pl=1,Fl=t,Ol=null;break}e:{var a=e,s=r.return,l=r,c=t;if(t=Il,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=ys(s);if(null!==p){p.flags&=-257,bs(p,s,l,0,t),1&p.mode&&gs(a,u,t),c=u;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(!(1&t)){gs(a,u,t),gc();break e}c=Error(n(426))}else if(ai&&1&l.mode){var y=ys(s);if(null!==y){!(65536&y.flags)&&(y.flags|=256),bs(y,s,l,0,t),gi(us(c,l));break e}}a=c=us(c,l),4!==Pl&&(Pl=2),null===Ul?Ul=[a]:Ul.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Vi(a,ps(0,c,t));break e;case 1:l=c;var b=a.type,v=a.stateNode;if(!(128&a.flags||"function"!=typeof b.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==Zl&&Zl.has(v)))){a.flags|=65536,t&=-t,a.lanes|=t,Vi(a,ms(a,l,t));break e}}a=a.return}while(null!==a)}xc(r)}catch(w){t=w,Ol===r&&null!==r&&(Ol=r=r.return);continue}break}}function mc(){var e=El.current;return El.current=Xa,null===e?Xa:e}function gc(){0!==Pl&&3!==Pl&&2!==Pl||(Pl=4),null===Tl||!(268435455&Ll)&&!(268435455&Rl)||lc(Tl,Il)}function yc(e,t){var r=Nl;Nl|=2;var o=mc();for(Tl===e&&Il===t||(Hl=null,hc(e,t));;)try{bc();break}catch(gy){pc(e,gy)}if(Ai(),Nl=r,El.current=o,null!==Ol)throw Error(n(261));return Tl=null,Il=0,Pl}function bc(){for(;null!==Ol;)wc(Ol)}function vc(){for(;null!==Ol&&!Je();)wc(Ol)}function wc(e){var t=_l(e.alternate,e,jl);e.memoizedProps=e.pendingProps,null===t?xc(e):Ol=t,zl.current=null}function xc(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Ks(n,t)))return n.flags&=32767,void(Ol=n);if(null===e)return Pl=6,void(Ol=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Qs(n,t,jl)))return void(Ol=n);if(null!==(t=t.sibling))return void(Ol=t);Ol=t=e}while(null!==t);0===Pl&&(Pl=5)}function kc(e,t,r){var o=wt,i=Al.transition;try{Al.transition=null,wt=1,function(e,t,r,o){do{Sc()}while(null!==Kl);if(6&Nl)throw Error(n(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-st(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Tl&&(Ol=Tl=null,Il=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Ql||(Ql=!0,Tc(nt,function(){return Sc(),null})),a=!!(15990&r.flags),!!(15990&r.subtreeFlags)||a){a=Al.transition,Al.transition=null;var s=wt;wt=1;var l=Nl;Nl|=4,zl.current=null,function(e,t){if(to=Wt,pr(e=hr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{r.nodeType,a.nodeType}catch(x){r=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||0!==i&&3!==f.nodeType||(l=s+i),f!==a||0!==o&&3!==f.nodeType||(c=s+o),3===f.nodeType&&(s+=f.nodeValue.length),null!==(p=f.firstChild);)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===i&&(l=s),h===a&&++d===o&&(c=s),null!==(p=f.nextSibling))break;h=(f=h).parentNode}f=p}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(no={focusedElem:e,selectionRange:r},Wt=!1,Xs=t;null!==Xs;)if(e=(t=Xs).child,1028&t.subtreeFlags&&null!==e)e.return=t,Xs=e;else for(;null!==Xs;){t=Xs;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,y=m.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:rs(t.type,g),y);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(n(163))}}catch(x){Cc(t,t.return,x)}if(null!==(e=t.sibling)){e.return=t.return,Xs=e;break}Xs=t.return}m=nl,nl=!1}(e,r),yl(r,e),mr(no),Wt=!!to,no=to=null,e.current=r,vl(r),Ye(),Nl=l,wt=s,Al.transition=a}else e.current=r;if(Ql&&(Ql=!1,Kl=e,Jl=i),a=e.pendingLanes,0===a&&(Zl=null),function(e){if(at&&"function"==typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(it,e,void 0,!(128&~e.current.flags))}catch(t){}}(r.stateNode),oc(e,Ge()),null!==t)for(o=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],o(i.value,{componentStack:i.stack,digest:i.digest});if(Wl)throw Wl=!1,e=ql,ql=null,e;!!(1&Jl)&&0!==e.tag&&Sc(),a=e.pendingLanes,1&a?e===Gl?Yl++:(Yl=0,Gl=e):Yl=0,Ho()}(e,t,r,o)}finally{Al.transition=i,wt=o}return null}function Sc(){if(null!==Kl){var e=xt(Jl),t=Al.transition,r=wt;try{if(Al.transition=null,wt=16>e?16:e,null===Kl)var o=!1;else{if(e=Kl,Kl=null,Jl=0,6&Nl)throw Error(n(331));var i=Nl;for(Nl|=4,Xs=e.current;null!==Xs;){var a=Xs,s=a.child;if(16&Xs.flags){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Xs=u;null!==Xs;){var d=Xs;switch(d.tag){case 0:case 11:case 15:rl(8,d,a)}var f=d.child;if(null!==f)f.return=d,Xs=f;else for(;null!==Xs;){var h=(d=Xs).sibling,p=d.return;if(al(d),d===u){Xs=null;break}if(null!==h){h.return=p,Xs=h;break}Xs=p}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}Xs=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Xs=s;else e:for(;null!==Xs;){if(2048&(a=Xs).flags)switch(a.tag){case 0:case 11:case 15:rl(9,a,a.return)}var b=a.sibling;if(null!==b){b.return=a.return,Xs=b;break e}Xs=a.return}}var v=e.current;for(Xs=v;null!==Xs;){var w=(s=Xs).child;if(2064&s.subtreeFlags&&null!==w)w.return=s,Xs=w;else e:for(s=v;null!==Xs;){if(2048&(l=Xs).flags)try{switch(l.tag){case 0:case 11:case 15:ol(9,l)}}catch(k){Cc(l,l.return,k)}if(l===s){Xs=null;break e}var x=l.sibling;if(null!==x){x.return=l.return,Xs=x;break e}Xs=l.return}}if(Nl=i,Ho(),at&&"function"==typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(it,e)}catch(k){}o=!0}return o}finally{wt=r,Al.transition=t}}return!1}function _c(e,t,n){e=Bi(e,t=ps(0,t=us(n,t),1),1),t=tc(),null!==e&&(bt(e,1,t),oc(e,t))}function Cc(e,t,n){if(3===e.tag)_c(e,e,n);else for(;null!==t;){if(3===t.tag){_c(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Zl||!Zl.has(r))){t=Bi(t,e=ms(t,e=us(n,e),1),1),e=tc(),null!==t&&(bt(t,1,e),oc(t,e));break}}t=t.return}}function Ec(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=tc(),e.pingedLanes|=e.suspendedLanes&n,Tl===e&&(Il&n)===n&&(4===Pl||3===Pl&&(130023424&Il)===Il&&500>Ge()-$l?hc(e,0):Dl|=n),oc(e,t)}function zc(e,t){0===t&&(1&e.mode?(t=dt,!(130023424&(dt<<=1))&&(dt=4194304)):t=1);var n=tc();null!==(e=Fi(e,t))&&(bt(e,t,n),oc(e,n))}function Ac(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),zc(e,n)}function Nc(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}null!==o&&o.delete(t),zc(e,r)}function Tc(e,t){return Qe(e,t)}function Oc(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.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 Ic(e,t,n,r){return new Oc(e,t,n,r)}function jc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Mc(e,t){var n=e.alternate;return null===n?((n=Ic(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pc(e,t,r,o,i,a){var s=2;if(o=e,"function"==typeof e)jc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case _:return Fc(r.children,i,a,t);case C:s=8,i|=8;break;case E:return(e=Ic(12,r,t,2|i)).elementType=E,e.lanes=a,e;case T:return(e=Ic(13,r,t,i)).elementType=T,e.lanes=a,e;case O:return(e=Ic(19,r,t,i)).elementType=O,e.lanes=a,e;case M:return Lc(r,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case z:s=10;break e;case A:s=9;break e;case N:s=11;break e;case I:s=14;break e;case j:s=16,o=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Ic(s,r,t,i)).elementType=e,t.type=o,t.lanes=a,t}function Fc(e,t,n,r){return(e=Ic(7,e,r,t)).lanes=n,e}function Lc(e,t,n,r){return(e=Ic(22,e,r,t)).elementType=M,e.lanes=n,e.stateNode={isHidden:!1},e}function Rc(e,t,n){return(e=Ic(6,e,null,t)).lanes=n,e}function Dc(e,t,n){return(t=Ic(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uc(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yt(0),this.expirationTimes=yt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Bc(e,t,n,r,o,i,a,s,l){return e=new Uc(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Ic(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ri(i),e}function $c(e){if(!e)return No;e:{if(Ve(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Mo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Mo(r))return Lo(e,r,t)}return t}function Vc(e,t,n,r,o,i,a,s,l){return(e=Bc(n,r,!0,e,0,i,0,s,l)).context=$c(null),n=e.current,(i=Ui(r=tc(),o=nc(n))).callback=null!=t?t:null,Bi(n,i,o),e.current.lanes=o,bt(e,o,r),oc(e,r),e}function Hc(e,t,n,r){var o=t.current,i=tc(),a=nc(o);return n=$c(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ui(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Bi(o,t,a))&&(rc(e,o,a,i),$i(e,o,a)),a}function Wc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Zc(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}_l=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Oo.current)ws=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return ws=!1,function(e,t,n){switch(t.tag){case 3:Ts(t),mi();break;case 5:Xi(t);break;case 1:Mo(t.type)&&Ro(t);break;case 4:Yi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ao(_i,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ao(ta,1&ta.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Rs(e,t,n):(Ao(ta,1&ta.current),null!==(e=Ws(e,t,n))?e.sibling:null);Ao(ta,1&ta.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Vs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ao(ta,ta.current),r)break;return null;case 22:case 23:return t.lanes=0,Cs(e,t,n)}return Ws(e,t,n)}(e,t,r);ws=!!(131072&e.flags)}else ws=!1,ai&&1048576&t.flags&&ti(t,Qo,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Hs(e,t),e=t.pendingProps;var i=jo(t,To.current);Oi(t,r),i=ya(null,t,o,e,i,r);var a=ba();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Mo(o)?(a=!0,Ro(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ri(t),i.updater=is,t.stateNode=i,i._reactInternals=t,cs(t,o,e,r),t=Ns(null,t,o,!0,a,r)):(t.tag=0,ai&&a&&ni(t),xs(null,t,i,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Hs(e,t),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return jc(e)?1:0;if(null!=e){if((e=e.$$typeof)===N)return 11;if(e===I)return 14}return 2}(o),e=rs(o,e),i){case 0:t=zs(null,t,o,e,r);break e;case 1:t=As(null,t,o,e,r);break e;case 11:t=ks(null,t,o,e,r);break e;case 14:t=Ss(null,t,o,rs(o.type,e),r);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,i=t.pendingProps,zs(e,t,o,i=t.elementType===o?i:rs(o,i),r);case 1:return o=t.type,i=t.pendingProps,As(e,t,o,i=t.elementType===o?i:rs(o,i),r);case 3:e:{if(Ts(t),null===e)throw Error(n(387));o=t.pendingProps,i=(a=t.memoizedState).element,Di(e,t),Hi(t,o,null,r);var s=t.memoizedState;if(o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Os(e,t,o,r,i=us(Error(n(423)),t));break e}if(o!==i){t=Os(e,t,o,r,i=us(Error(n(424)),t));break e}for(ii=uo(t.stateNode.containerInfo.firstChild),oi=t,ai=!0,si=null,r=Si(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(mi(),o===i){t=Ws(e,t,r);break e}xs(e,t,o,r)}t=t.child}return t;case 5:return Xi(t),null===e&&di(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,ro(o,i)?s=null:null!==a&&ro(o,a)&&(t.flags|=32),Es(e,t),xs(e,t,s,r),t.child;case 6:return null===e&&di(t),null;case 13:return Rs(e,t,r);case 4:return Yi(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=ki(t,null,o,r):xs(e,t,o,r),t.child;case 11:return o=t.type,i=t.pendingProps,ks(e,t,o,i=t.elementType===o?i:rs(o,i),r);case 7:return xs(e,t,t.pendingProps,r),t.child;case 8:case 12:return xs(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Ao(_i,o._currentValue),o._currentValue=s,null!==a)if(lr(a.value,s)){if(a.children===i.children&&!Oo.current){t=Ws(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===o){if(1===a.tag){(c=Ui(-1,r&-r)).tag=2;var u=a.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),Ti(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),Ti(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}xs(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps.children,Oi(t,r),o=o(i=Ii(i)),t.flags|=1,xs(e,t,o,r),t.child;case 14:return i=rs(o=t.type,t.pendingProps),Ss(e,t,o,i=rs(o.type,i),r);case 15:return _s(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:rs(o,i),Hs(e,t),t.tag=1,Mo(o)?(e=!0,Ro(t)):e=!1,Oi(t,r),ss(t,o,i),cs(t,o,i,r),Ns(null,t,o,!0,e,r);case 19:return Vs(e,t,r);case 22:return Cs(e,t,r)}throw Error(n(156,t.tag))};var Qc="function"==typeof reportError?reportError:function(e){console.error(e)};function Kc(e){this._internalRoot=e}function Jc(e){this._internalRoot=e}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Gc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xc(){}function eu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Wc(a);s.call(e)}}Hc(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Wc(a);i.call(e)}}var a=Vc(t,r,e,0,null,!1,0,"",Xc);return e._reactRootContainer=a,e[go]=a.current,Vr(8===e.nodeType?e.parentNode:e),dc(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Wc(l);s.call(e)}}var l=Bc(e,0,!1,null,0,!1,0,"",Xc);return e._reactRootContainer=l,e[go]=l.current,Vr(8===e.nodeType?e.parentNode:e),dc(function(){Hc(t,l,n,r)}),l}(n,t,e,o,r);return Wc(a)}Jc.prototype.render=Kc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));Hc(e,t,null,null)},Jc.prototype.unmount=Kc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;dc(function(){Hc(null,e,null,null)}),t[go]=null}},Jc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mt.length&&0!==t&&t<Mt[n].priority;n++);Mt.splice(n,0,e),0===n&&Rt(e)}},kt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ft(t.pendingLanes);0!==n&&(vt(t,1|n),oc(t,Ge()),!(6&Nl)&&(Vl=Ge()+500,Ho()))}break;case 13:dc(function(){var t=Fi(e,1);if(null!==t){var n=tc();rc(t,e,1,n)}}),Zc(e,1)}},St=function(e){if(13===e.tag){var t=Fi(e,134217728);if(null!==t)rc(t,e,134217728,tc());Zc(e,134217728)}},_t=function(e){if(13===e.tag){var t=nc(e),n=Fi(e,t);if(null!==n)rc(n,e,t,tc());Zc(e,t)}},Ct=function(){return wt},Et=function(e,t){var n=wt;try{return wt=e,t()}finally{wt=n}},Se=function(e,t,r){switch(t){case"input":if(X(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var i=So(o);if(!i)throw Error(n(90));Q(o),X(o,i)}}}break;case"textarea":ae(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Ne=uc,Te=dc;var tu={usingClientEntryPoint:!1,Events:[xo,ko,So,ze,Ae,uc]},nu={findFiberByHostInstance:wo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ru={bundleType:nu.bundleType,version:nu.version,rendererPackageName:nu.rendererPackageName,rendererConfig:nu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qe(e))?null:e.stateNode},findFiberByHostInstance:nu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{it=ou.inject(ru),at=ou}catch(de){}}return a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tu,a.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yc(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},a.createRoot=function(e,t){if(!Yc(e))throw Error(n(299));var r=!1,o="",i=Qc;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Bc(e,1,!1,null,0,r,0,o,i),e[go]=t.current,Vr(8===e.nodeType?e.parentNode:e),new Kc(t)},a.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=qe(t))?null:e.stateNode},a.flushSync=function(e){return dc(e)},a.hydrate=function(e,t,r){if(!Gc(t))throw Error(n(200));return eu(null,e,t,!0,r)},a.hydrateRoot=function(e,t,r){if(!Yc(e))throw Error(n(405));var o=null!=r&&r.hydratedSources||null,i=!1,a="",s=Qc;if(null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=Vc(t,null,e,1,null!=r?r:null,i,0,a,s),e[go]=t.current,Vr(e),o)for(e=0;e<o.length;e++)i=(i=(r=o[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Jc(t)},a.render=function(e,t,r){if(!Gc(t))throw Error(n(200));return eu(null,e,t,!1,r)},a.unmountComponentAtNode=function(e){if(!Gc(e))throw Error(n(40));return!!e._reactRootContainer&&(dc(function(){eu(null,null,e,!1,function(){e._reactRootContainer=null,e[go]=null})}),!0)},a.unstable_batchedUpdates=uc,a.unstable_renderSubtreeIntoContainer=function(e,t,r,o){if(!Gc(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return eu(e,t,r,!1,o)},a.version="18.3.1-next-f1338f8080-20240426",a}function w(){if(p)return i.exports;return p=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),i.exports=v(),i.exports}var x=function(){if(m)return o;m=1;var e=w();return o.createRoot=e.createRoot,o.hydrateRoot=e.hydrateRoot,o}(),k=u();const S=t(k);var _,C,E={exports:{}},z={};var A=(C||(C=1,E.exports=function(){if(_)return z;_=1;var e=u(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:o.current}}return z.Fragment=n,z.jsx=a,z.jsxs=a,z}()),E.exports);const N={es:{online:"En línea",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Con ❤️ por BotUyo",preview:"Vista previa",fotos:"Fotos",ubicacion:"Ubicación",input_placeholder:"Escribe un mensaje...",send:"Enviar",attach_photo:"Adjuntar foto",attach_location:"Compartir ubicación",recording:"Grabando...",rate_limit_exceeded:"Has enviado demasiados mensajes. Espera un momento.",connection_error:"Error de conexión",file_too_large:"Archivo demasiado grande",invalid_file:"Tipo de archivo no válido",extracted:{assistant:"Asistente",anterior:"Anterior",siguiente:"Siguiente",cerrar:"Cerrar",cerrar_chat:"Cerrar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver ubicación"},accessibility:{closeChat:"Cerrar ventana de chat",closeChatHint:"Presiona Escape para cerrar",chatMessages:"Mensajes del chat",messageHistory:"Historial de mensajes",dialogDescription:"Ventana de chat con {{botName}}. Presiona Escape para cerrar. Usa Ctrl+Enter para enviar mensajes.",sendMessage:"Enviar mensaje",sendMessageHint:"Presiona Enter o Ctrl+Enter para enviar",typeMessage:"Escribe tu mensaje aquí",botMessage:"Mensaje del asistente",userMessage:"Tu mensaje",messageFrom:"Mensaje de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nuevo mensaje recibido"}},en:{online:"Online",offline:"Offline",connecting:"Connecting...",con_amor_paseo_libre:"With ❤️ by BotUyo",preview:"Preview",fotos:"Photos",ubicacion:"Location",input_placeholder:"Type a message...",send:"Send",attach_photo:"Attach photo",attach_location:"Share location",recording:"Recording...",rate_limit_exceeded:"You have sent too many messages. Please wait.",connection_error:"Connection error",file_too_large:"File too large",invalid_file:"Invalid file type",extracted:{assistant:"Assistant",anterior:"Previous",siguiente:"Next",cerrar:"Close",cerrar_chat:"Close chat",abrir_chat:"Open chat",ver_ubicacion:"View location"},accessibility:{closeChat:"Close chat window",closeChatHint:"Press Escape to close",chatMessages:"Chat messages",messageHistory:"Message history",dialogDescription:"Chat window with {{botName}}. Press Escape to close. Use Ctrl+Enter to send messages.",sendMessage:"Send message",sendMessageHint:"Press Enter or Ctrl+Enter to send",typeMessage:"Type your message here",botMessage:"Assistant message",userMessage:"Your message",messageFrom:"Message from {{sender}}",messageTime:"Sent {{time}}",newMessage:"New message received"}},pt:{online:"Online",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Com ❤️ por BotUyo",preview:"Visualizar",fotos:"Fotos",ubicacion:"Localização",input_placeholder:"Digite uma mensagem...",send:"Enviar",attach_photo:"Anexar foto",attach_location:"Compartilhar localização",recording:"Gravando...",rate_limit_exceeded:"Você enviou muitas mensagens. Aguarde um momento.",connection_error:"Erro de conexão",file_too_large:"Arquivo muito grande",invalid_file:"Tipo de arquivo inválido",extracted:{assistant:"Assistente",anterior:"Anterior",siguiente:"Próximo",cerrar:"Fechar",cerrar_chat:"Fechar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver localização"},accessibility:{closeChat:"Fechar janela de chat",closeChatHint:"Pressione Escape para fechar",chatMessages:"Mensagens do chat",messageHistory:"Histórico de mensagens",dialogDescription:"Janela de chat com {{botName}}. Pressione Escape para fechar. Use Ctrl+Enter para enviar mensagens.",sendMessage:"Enviar mensagem",sendMessageHint:"Pressione Enter ou Ctrl+Enter para enviar",typeMessage:"Digite sua mensagem aqui",botMessage:"Mensagem do assistente",userMessage:"Sua mensagem",messageFrom:"Mensagem de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nova mensagem recebida"}},fr:{online:"En ligne",offline:"Déconnecté",connecting:"Connexion...",con_amor_paseo_libre:"Avec ❤️ par BotUyo",preview:"Aperçu",fotos:"Photos",ubicacion:"Emplacement",input_placeholder:"Tapez un message...",send:"Envoyer",attach_photo:"Joindre une photo",attach_location:"Partager la localisation",recording:"Enregistrement...",rate_limit_exceeded:"Vous avez envoyé trop de messages. Veuillez patienter.",connection_error:"Erreur de connexion",file_too_large:"Fichier trop volumineux",invalid_file:"Type de fichier invalide",extracted:{assistant:"Assistant",anterior:"Précédent",siguiente:"Suivant",cerrar:"Fermer",cerrar_chat:"Fermer le chat",abrir_chat:"Ouvrir le chat",ver_ubicacion:"Voir l'emplacement"},accessibility:{closeChat:"Fermer la fenêtre de chat",closeChatHint:"Appuyez sur Échap pour fermer",chatMessages:"Messages du chat",messageHistory:"Historique des messages",dialogDescription:"Fenêtre de chat avec {{botName}}. Appuyez sur Échap pour fermer. Utilisez Ctrl+Entrée pour envoyer des messages.",sendMessage:"Envoyer un message",sendMessageHint:"Appuyez sur Entrée ou Ctrl+Entrée pour envoyer",typeMessage:"Tapez votre message ici",botMessage:"Message de l'assistant",userMessage:"Votre message",messageFrom:"Message de {{sender}}",messageTime:"Envoyé {{time}}",newMessage:"Nouveau message reçu"}}};function T(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return N[e]?e:"es"}const O=k.createContext(void 0),I="botuyo-chat-locale";function j({children:e,defaultLocale:t}){const[n,r]=k.useState(()=>{if(t)return t;if("undefined"!=typeof window){const e=localStorage.getItem(I);if(e)return e}return T()});return k.useEffect(()=>{if("undefined"==typeof window||t)return;const e=()=>{localStorage.getItem(I)||r(T())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[t]),A.jsx(O.Provider,{value:{locale:n,setLocale:e=>{["es","en","pt","fr"].includes(e)?(r(e),"undefined"!=typeof window&&localStorage.setItem(I,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${n}"`)}},children:e})}function M(){const e=k.useContext(O);if(void 0===e)throw new Error("useLanguage debe usarse dentro de un LanguageProvider");return e}function P(e){const{locale:t,setLocale:n}=M();return{t:k.useCallback(n=>{const r=e?`${e}.${n}`:n,o=(i=N[t],(a=r).split(".").reduce((e,t)=>e?.[t],i)||a);var i,a;return o||n},[t,e]),setLocale:n,currentLocale:t}}const F=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var L={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const R=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>k.createElement("svg",{ref:l,...L,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:F("lucide",o),...s},[...a.map(([e,t])=>k.createElement(e,t)),...Array.isArray(i)?i:[i]])),D=(e,t)=>{const n=k.forwardRef(({className:n,...r},o)=>{return k.createElement(R,{ref:o,iconNode:t,className:F(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i});return n.displayName=`${e}`,n},U=D("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),B=D("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),$=D("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),V=D("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),H=D("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),W=D("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),q=D("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Z=D("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),Q=D("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),K=D("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),J=D("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Y=D("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),G=D("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),X=D("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),ee=D("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),te=D("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),ne=D("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]),re=D("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),oe=D("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),ie=D("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ae=D("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),se=D("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),le=D("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ce=D("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),ue=D("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]),de=D("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fe=D("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function he(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=he(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const pe=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),me="-",ge=[],ye=e=>{const t=we(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return ve(e);const n=e.split(me),r=""===n[0]&&n.length>1?1:0;return be(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],o=n[e];return t?o?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(o,t):t:o||ge}return n[e]||ge}}},be=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const n=be(e,t+1,o);if(n)return n}const i=n.validators;if(null===i)return;const a=0===t?e.join(me):e.slice(t).join(me),s=i.length;for(let l=0;l<s;l++){const e=i[l];if(e.validator(a))return e.classGroupId}},ve=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),we=e=>{const{theme:t,classGroups:n}=e;return xe(n,t)},xe=(e,t)=>{const n=pe();for(const r in e){const o=e[r];ke(o,n,r,t)}return n},ke=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];Se(o,t,n,r)}},Se=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?Ee(e,t,n,r):Ce(e,t,n,r):_e(e,t,n)},_e=(e,t,n)=>{(""===e?t:ze(t,e)).classGroupId=n},Ce=(e,t,n,r)=>{Ae(e)?ke(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},Ee=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let a=0;a<i;a++){const[e,i]=o[a];ke(i,ze(t,e),n,r)}},ze=(e,t)=>{let n=e;const r=t.split(me),o=r.length;for(let i=0;i<o;i++){const e=r[i];let t=n.nextPart.get(e);t||(t=pe(),n.nextPart.set(e,t)),n=t}return n},Ae=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Ne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}},Te=[],Oe=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Ie=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,i=0;const a=e.length;for(let u=0;u<a;u++){const a=e[u];if(0===r&&0===o){if(":"===a){t.push(e.slice(i,u)),i=u+1;continue}if("/"===a){n=u;continue}}"["===a?r++:"]"===a?r--:"("===a?o++:")"===a&&o--}const s=0===t.length?e:e.slice(i);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return Oe(t,c,l,n&&n>i?n-i:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Oe(Te,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},je=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let o=0;o<e.length;o++){const i=e[o],a="["===i[0],s=t.has(i);a||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},Me=/\s+/,Pe=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Pe(e[r]))&&(n&&(n+=" "),n+=t);return n},Fe=(e,...t)=>{let n,r,o,i;const a=e=>{const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(Me);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!h,m=r(p?f.substring(0,h):f);if(!m){if(!p){l=e+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=e+(l.length>0?" "+l:l);continue}p=!1}const g=0===u.length?"":1===u.length?u[0]:i(u).join(":"),y=d?g+"!":g,b=y+m;if(a.indexOf(b)>-1)continue;a.push(b);const v=o(m,p);for(let n=0;n<v.length;++n){const e=v[n];a.push(y+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return o(e,i),i};return i=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Ne(e.cacheSize),parseClassName:Ie(e),sortModifiers:je(e),...ye(e)}))(l),r=n.cache.get,o=n.cache.set,i=a,a(s)},(...e)=>i(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=Pe(t))&&(o&&(o+=" "),o+=n);return o})(...e))},Le=[],Re=e=>{const t=t=>t[e]||Le;return t.isThemeGetter=!0,t},De=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ue=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Be=/^\d+\/\d+$/,$e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ve=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,He=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,We=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ze=e=>Be.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Ke=e=>!!e&&Number.isInteger(Number(e)),Je=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Ye=e=>$e.test(e),Ge=()=>!0,Xe=e=>Ve.test(e)&&!He.test(e),et=()=>!1,tt=e=>We.test(e),nt=e=>qe.test(e),rt=e=>!it(e)&&!dt(e),ot=e=>bt(e,kt,et),it=e=>De.test(e),at=e=>bt(e,St,Xe),st=e=>bt(e,_t,Qe),lt=e=>bt(e,wt,et),ct=e=>bt(e,xt,nt),ut=e=>bt(e,Et,tt),dt=e=>Ue.test(e),ft=e=>vt(e,St),ht=e=>vt(e,Ct),pt=e=>vt(e,wt),mt=e=>vt(e,kt),gt=e=>vt(e,xt),yt=e=>vt(e,Et,!0),bt=(e,t,n)=>{const r=De.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},vt=(e,t,n=!1)=>{const r=Ue.exec(e);return!!r&&(r[1]?t(r[1]):n)},wt=e=>"position"===e||"percentage"===e,xt=e=>"image"===e||"url"===e,kt=e=>"length"===e||"size"===e||"bg-size"===e,St=e=>"length"===e,_t=e=>"number"===e,Ct=e=>"family-name"===e,Et=e=>"shadow"===e,zt=Fe(()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),o=Re("tracking"),i=Re("leading"),a=Re("breakpoint"),s=Re("container"),l=Re("spacing"),c=Re("radius"),u=Re("shadow"),d=Re("inset-shadow"),f=Re("text-shadow"),h=Re("drop-shadow"),p=Re("blur"),m=Re("perspective"),g=Re("aspect"),y=Re("ease"),b=Re("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",dt,it],w=()=>[dt,it,l],x=()=>[Ze,"full","auto",...w()],k=()=>[Ke,"none","subgrid",dt,it],S=()=>["auto",{span:["full",Ke,dt,it]},Ke,dt,it],_=()=>[Ke,"auto",dt,it],C=()=>["auto","min","max","fr",dt,it],E=()=>["auto",...w()],z=()=>[Ze,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],A=()=>[e,dt,it],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",pt,lt,{position:[dt,it]}],T=()=>["auto","cover","contain",mt,ot,{size:[dt,it]}],O=()=>[Je,ft,at],I=()=>["","none","full",c,dt,it],j=()=>["",Qe,ft,at],M=()=>[Qe,Je,pt,lt],P=()=>["","none",p,dt,it],F=()=>["none",Qe,dt,it],L=()=>["none",Qe,dt,it],R=()=>[Qe,dt,it],D=()=>[Ze,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Ge],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[rt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",Qe],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ze,it,dt,g]}],container:["container"],columns:[{columns:[Qe,it,dt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Ke,"auto",dt,it]}],basis:[{basis:[Ze,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Ze,"auto","initial","none",it]}],grow:[{grow:["",Qe,dt,it]}],shrink:[{shrink:["",Qe,dt,it]}],order:[{order:[Ke,"first","last","none",dt,it]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[s,"screen",...z()]}],"min-w":[{"min-w":[s,"screen","none",...z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,ft,at]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,dt,st]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Je,it]}],"font-family":[{font:[ht,it,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,dt,it]}],"line-clamp":[{"line-clamp":[Qe,"none",dt,st]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",dt,it]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",dt,it]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",dt,at]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Qe,"auto",dt,it]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",dt,it]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",dt,it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ke,dt,it],radial:["",dt,it],conic:[Ke,dt,it]},gt,ct]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":j()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,dt,it]}],"outline-w":[{outline:["",Qe,ft,at]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,yt,ut]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",d,yt,ut]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Qe,at]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",f,yt,ut]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Qe,dt,it]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[dt,it]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",dt,it]}],filter:[{filter:["","none",dt,it]}],blur:[{blur:P()}],brightness:[{brightness:[Qe,dt,it]}],contrast:[{contrast:[Qe,dt,it]}],"drop-shadow":[{"drop-shadow":["","none",h,yt,ut]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Qe,dt,it]}],"hue-rotate":[{"hue-rotate":[Qe,dt,it]}],invert:[{invert:["",Qe,dt,it]}],saturate:[{saturate:[Qe,dt,it]}],sepia:[{sepia:["",Qe,dt,it]}],"backdrop-filter":[{"backdrop-filter":["","none",dt,it]}],"backdrop-blur":[{"backdrop-blur":P()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,dt,it]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,dt,it]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,dt,it]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,dt,it]}],"backdrop-invert":[{"backdrop-invert":["",Qe,dt,it]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,dt,it]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,dt,it]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,dt,it]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",dt,it]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",dt,it]}],ease:[{ease:["linear","initial",y,dt,it]}],delay:[{delay:[Qe,dt,it]}],animate:[{animate:["none",b,dt,it]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,dt,it]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[dt,it,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:D()}],"translate-x":[{"translate-x":D()}],"translate-y":[{"translate-y":D()}],"translate-z":[{"translate-z":D()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",dt,it]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",dt,it]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Qe,ft,at,st]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function At(...e){return zt(function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=he(e))&&(r&&(r+=" "),r+=t);return r}(e))}const Nt={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",primary:"160 84% 39%",primaryForeground:"0 0% 100%",muted:"240 4.8% 95.9%",mutedForeground:"240 3.8% 46.1%",border:"240 5.9% 90%",destructive:"0 84.2% 60.2%",radius:"0.5rem",spacing1:"0.25rem",spacing2:"0.5rem",spacing3:"0.75rem",spacing4:"1rem",spacing5:"0.75rem",spacing6:"1.5rem",spacing8:"2rem"},Tt="hsl(160, 84%, 39%)",Ot="Asistente",It="",jt="bottom-right",Mt="¡Hola! ¿En qué puedo ayudarte?",Pt="Escribe un mensaje...";function Ft(e){return e.primaryColor||Tt}const Lt={enabled:!0,messageEntry:"spring",typingIndicator:"wave",buttonEffects:!0,smoothScroll:!0,speedMultiplier:1,staggerDelay:50,windowTransitions:!0,launcherPulse:!0},Rt={glassmorphism:!0,gradients:!0,softShadows:!0,glowEffects:!0,particles:!1,soundEffects:!1,hapticFeedback:!0,shimmerLoading:!0,hoverLift:!0},Dt=k.createContext(Lt),Ut=k.createContext(Rt);function Bt({children:e,animations:t,effects:n}){const r=k.useMemo(()=>({...Lt,...t}),[t]),o=k.useMemo(()=>({...Rt,...n}),[n]);return A.jsx(Dt.Provider,{value:r,children:A.jsx(Ut.Provider,{value:o,children:e})})}function $t(){return"undefined"!=typeof window&&!!window.DEBUG}const Vt=(e,...t)=>{$t()&&console.warn(`[BotUyo] ${e}`,...t)},Ht=(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},Wt=(e,...t)=>{$t()&&console.debug(`[BotUyo] ${e}`,...t)},qt=(e,...t)=>{$t()&&console.info(`[BotUyo] ${e}`,...t)},Zt=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,Qt=function(){const e=8e3,t=Math.floor(1200),n=2*t,r=44+n,o=new ArrayBuffer(r),i=new DataView(o);Kt(i,0,"RIFF"),i.setUint32(4,r-8,!0),Kt(i,8,"WAVE"),Kt(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,e,!0),i.setUint32(28,16e3,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),Kt(i,36,"data"),i.setUint32(40,n,!0);for(let l=0;l<t;l++){const n=l/e,r=1-l/t,o=Math.sin(2*Math.PI*880*n)*r*.5*32767;i.setInt16(44+2*l,o,!0)}const a=new Uint8Array(o);let s="";for(let l=0;l<a.length;l++)s+=String.fromCharCode(a[l]);return`data:audio/wav;base64,${btoa(s)}`}();function Kt(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}function Jt({isOpen:e,onClick:t,unreadCount:n=0,primaryColor:r,logoUrl:o,starterPrompt:i,position:a="bottom-right",emotion:s="default",avatars:l={},styles:c,promptPersistence:u="session",avatarScale:d=1}){const{t:f}=P("extracted"),h=Ft({primaryColor:r}),p=c?.launcher?.bg,m=k.useContext(Dt),{triggerHaptic:g,getGlowClass:y}=function(){const e=k.useContext(Ut);return{getGlassClass:()=>e.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>e.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>e.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>e.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>e.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>e.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{e.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:t=>{e.soundEffects&&console.log(`[Sound] ${t}`)},triggerParticles:t=>{e.particles&&console.log("[Particles] triggered on",t)}}}(),b=m.launcherPulse&&!1!==c?.launcher?.pulse,[v,w]=k.useState(!1),[x,S]=k.useState(!1),[_,C]=k.useState(!1),[E,z]=k.useState(!1),N="bottom-right"===a,T="chat_launcher_prompt_state",O=k.useMemo(()=>l[s]||l.default||o||Zt,[s,l,o]);k.useEffect(()=>{z(!1)},[O]),k.useEffect(()=>{const e=Object.values(l).filter(e=>!!e);o&&e.push(o),e.forEach(e=>{(new Image).src=e})},[l,o]),k.useEffect(()=>{"forever"===u&&"dismissed"===localStorage.getItem(T)&&C(!0)},[u]);const I=k.useCallback(()=>{S(!0),setTimeout(()=>w(!1),500),"always"!==u&&(C(!0),"forever"===u&&localStorage.setItem(T,"dismissed"))},[u]);k.useEffect(()=>{if("always"!==u&&_||!i||e)return void w(!1);const t=setTimeout(()=>{w(!0),S(!1)},2e3),n=setTimeout(()=>I(),12e3);return()=>{clearTimeout(t),clearTimeout(n)}},[i,e,_,u,I]);return A.jsxs("div",{className:At("flex items-center w-fit transition-all duration-500",N?"flex-row ml-auto":"flex-row-reverse mr-auto"),children:[A.jsx("div",{className:At("transition-all duration-700 ease-in-out flex items-center",v?At("opacity-100 translate-x-0 w-auto max-w-[350px]",N?"mr-4":"ml-4"):"opacity-0 translate-x-8 w-0 max-w-0 overflow-hidden"),children:A.jsxs("div",{className:At("relative px-5 py-3.5 shadow-soft-xl border flex items-center gap-3",c?.radius?.card||"rounded-[20px]",x&&"opacity-0 scale-95 transition-all duration-300",!v&&"hidden"),style:{width:"max-content",maxWidth:"280px",backgroundColor:"hsl(var(--background))",color:"hsl(var(--foreground))",borderColor:"hsl(var(--border))"},children:[A.jsx("span",{className:"text-sm font-semibold leading-tight tracking-tight whitespace-nowrap",children:i}),A.jsx("button",{onClick:e=>{e.stopPropagation(),I()},className:"text-muted-foreground hover:text-foreground transition-colors p-1 rounded-full hover:bg-muted shrink-0",children:A.jsx(de,{className:"h-3.5 w-3.5 stroke-[2.5]"})}),A.jsx("div",{className:At("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent",N?"right-[-14px] border-l-background":"left-[-14px] border-r-background")}),A.jsx("div",{className:At("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent -z-10",N?"right-[-15px] border-l-border":"left-[-15px] border-r-border")})]})}),A.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[!e&&b&&A.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:A.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-20",style:{backgroundColor:h}})}),A.jsxs("button",{type:"button",onClick:()=>{Wt("Launcher handleMainAction called, isOpen:",e),g(),C(!0),"forever"===u&&localStorage.setItem(T,"dismissed"),t()},className:At("relative z-10 h-14 w-14 sm:h-16 sm:w-16","flex items-center justify-center text-white transition-all duration-500","hover:scale-110 active:scale-95 shadow-soft-xl cursor-pointer",!e&&"hover:rotate-6",!e&&m.enabled&&"animate-glow-pulse",c?.radius?.button||"rounded-full",p,y()),style:{backgroundColor:h||"hsl(160, 84%, 39%)","--primary-glow":`${h}66`},"aria-label":e?"Cerrar chat":"Abrir chat",children:[A.jsxs("div",{className:"relative h-full w-full flex items-center justify-center overflow-hidden rounded-inherit",children:[A.jsx("div",{className:At("absolute inset-0 transition-all duration-500 flex items-center justify-center",e?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:O&&!E?A.jsx("img",{src:O,alt:f("assistant"),className:"w-full h-full object-cover",style:{transform:`scale(${d})`},onError:()=>z(!0)},O):A.jsx(G,{className:"h-7 w-7 sm:h-8 sm:w-8 fill-current"})}),A.jsx("div",{className:At("absolute inset-0 transition-all duration-500 flex items-center justify-center bg-black/5 dark:bg-white/10",e?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 -rotate-90"),children:A.jsx(de,{className:"h-7 w-7 sm:h-8 sm:w-8 stroke-[2.5]"})})]}),!e&&n>0&&A.jsx("div",{className:"absolute -top-1 -right-1 z-20 flex h-6 w-6 items-center justify-center bg-destructive text-destructive-foreground rounded-full border-2 border-background text-[10px] font-black shadow-soft-md tabular-nums",children:n>9?"9+":n})]})]})]})}var Yt=w();function Gt(e,t,n){let r,o=n.initialDeps??[],i=!0;function a(){var a,s,l;let c;n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(c=Date.now());const u=e();if(!(u.length!==o.length||u.some((e,t)=>o[t]!==e)))return r;let d;if(o=u,n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(d=Date.now()),r=t(...u),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-d))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(r),i=!1,r}return a.updateDeps=e=>{o=e},a}function Xt(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const en=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},tn=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},nn=e=>e,rn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},on=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(tn(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(tn(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},an={passive:!0},sn="undefined"==typeof window||"onscrollend"in window,ln=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&sn?()=>{}:en(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),a=r=>()=>{const{horizontal:a,isRtl:s}=e.options;o=a?n.scrollLeft*(s?-1:1):n.scrollTop,i(),t(o,r)},s=a(!0),l=a(!1);n.addEventListener("scroll",s,an);const c=e.options.useScrollendEvent&&sn;return c&&n.addEventListener("scrollend",l,an),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},cn=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},un=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const a=e+t;null==(i=null==(o=r.scrollElement)?void 0:o.scrollTo)||i.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class dn{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{void 0===n&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:nn,rangeExtractor:rn,onChange:()=>{},measureElement:cn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=Gt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Gt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,o,i)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i}),{key:!1}),this.getMeasurements=Gt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const u of this.laneAssignments.keys())u>=e&&this.laneAssignments.delete(u);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,s),c=new Array(i).fill(void 0);for(let u=0;u<s;u++){const e=l[u];e&&(c[e.lane]=u)}for(let u=s;u<e;u++){const e=r(u),o=this.laneAssignments.get(u);let i,s;if(void 0!==o&&this.options.lanes>1){i=o;const e=c[i],r=void 0!==e?l[e]:void 0;s=r?r.end+this.options.gap:t+n}else{const e=1===this.options.lanes?l[u-1]:this.getFurthestMeasurement(l,u);s=e?e.end+this.options.gap:t+n,i=e?e.lane:u%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(u,i)}const d=a.get(e),f="number"==typeof d?d:this.options.estimateSize(u),h=s+f;l[u]={index:u,start:s,size:f,end:h,key:e,lane:i},c[i]=u}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Gt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:o};let a=fn(0,o,i,n),s=a;if(1===r)for(;s<o&&e[s].end<n+t;)s++;else if(r>1){const i=Array(r).fill(0);for(;s<o&&i.some(e=>e<n+t);){const t=e[s];i[t.lane]=t.end,s++}const l=Array(r).fill(n+t);for(;a>=0&&l.some(e=>e>=n);){const t=e[a];l[t.lane]=t.start,a--}a=Math.max(0,a-a%r),s=Math.min(o,s+(r-1-s%r))}return{startIndex:a,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Gt(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,o)=>null===r||null===o?[]:e({startIndex:r,endIndex:o,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const o=r.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=Gt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Xt(t[fn(0,t.length-1,e=>Xt(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(n.end>=o+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0;const o=t=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);const[o,a]=r;this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),n=this.getOffsetForIndex(e,a);var r,o;n?(r=n[0],o=t,Math.abs(r-o)<1.01||i(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},i=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(r++,r<10?this.targetWindow.requestAnimationFrame(()=>o(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};o(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some(e=>null===e);){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const fn=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else{if(!(i>r))return o;t=o-1}}return e>0?e-1:0};const hn="undefined"!=typeof document?k.useLayoutEffect:k.useEffect;function pn(e){return function({useFlushSync:e=!0,...t}){const n=k.useReducer(()=>({}),{})[1],r={...t,onChange:(r,o)=>{var i;e&&o?Yt.flushSync(n):n(),null==(i=t.onChange)||i.call(t,r,o)}},[o]=k.useState(()=>new dn(r));return o.setOptions(r),hn(()=>o._didMount(),[]),hn(()=>o._willUpdate()),o}({observeElementRect:on,observeElementOffset:ln,scrollToFn:un,...e})}function mn(){}function gn(){}const yn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vn={};function wn(e,t){return(vn.jsx?bn:yn).test(e)}const xn=/[ \t\n\f\r]/g;function kn(e){return""===e.replace(xn,"")}class Sn{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function _n(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Sn(n,r,t)}function Cn(e){return e.toLowerCase()}Sn.prototype.normal={},Sn.prototype.property={},Sn.prototype.space=void 0;class En{constructor(e,t){this.attribute=t,this.property=e}}En.prototype.attribute="",En.prototype.booleanish=!1,En.prototype.boolean=!1,En.prototype.commaOrSpaceSeparated=!1,En.prototype.commaSeparated=!1,En.prototype.defined=!1,En.prototype.mustUseProperty=!1,En.prototype.number=!1,En.prototype.overloadedBoolean=!1,En.prototype.property="",En.prototype.spaceSeparated=!1,En.prototype.space=void 0;let zn=0;const An=Pn(),Nn=Pn(),Tn=Pn(),On=Pn(),In=Pn(),jn=Pn(),Mn=Pn();function Pn(){return 2**++zn}const Fn=Object.freeze(Object.defineProperty({__proto__:null,boolean:An,booleanish:Nn,commaOrSpaceSeparated:Mn,commaSeparated:jn,number:On,overloadedBoolean:Tn,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),Ln=Object.keys(Fn);class Rn extends En{constructor(e,t,n,r){let o=-1;if(super(e,t),Dn(this,"space",r),"number"==typeof n)for(;++o<Ln.length;){const e=Ln[o];Dn(this,Ln[o],(n&Fn[e])===Fn[e])}}}function Dn(e,t,n){n&&(e[t]=n)}function Un(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Rn(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Cn(r)]=r,n[Cn(i.attribute)]=r}return new Sn(t,n,e.space)}Rn.prototype.defined=!0;const Bn=Un({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:On,ariaColIndex:On,ariaColSpan:On,ariaControls:In,ariaCurrent:null,ariaDescribedBy:In,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:In,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:In,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:In,ariaLevel:On,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:In,ariaPlaceholder:null,ariaPosInSet:On,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:In,ariaRowCount:On,ariaRowIndex:On,ariaRowSpan:On,ariaSelected:Nn,ariaSetSize:On,ariaSort:null,ariaValueMax:On,ariaValueMin:On,ariaValueNow:On,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function $n(e,t){return t in e?e[t]:t}function Vn(e,t){return $n(e,t.toLowerCase())}const Hn=Un({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jn,acceptCharset:In,accessKey:In,action:null,allow:null,allowFullScreen:An,allowPaymentRequest:An,allowUserMedia:An,alt:null,as:null,async:An,autoCapitalize:null,autoComplete:In,autoFocus:An,autoPlay:An,blocking:In,capture:null,charSet:null,checked:An,cite:null,className:In,cols:On,colSpan:null,content:null,contentEditable:Nn,controls:An,controlsList:In,coords:On|jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:An,defer:An,dir:null,dirName:null,disabled:An,download:Tn,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:An,formTarget:null,headers:In,height:On,hidden:Tn,high:On,href:null,hrefLang:null,htmlFor:In,httpEquiv:In,id:null,imageSizes:null,imageSrcSet:null,inert:An,inputMode:null,integrity:null,is:null,isMap:An,itemId:null,itemProp:In,itemRef:In,itemScope:An,itemType:In,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:An,low:On,manifest:null,max:null,maxLength:On,media:null,method:null,min:null,minLength:On,multiple:An,muted:An,name:null,nonce:null,noModule:An,noValidate:An,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:An,optimum:On,pattern:null,ping:In,placeholder:null,playsInline:An,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:An,referrerPolicy:null,rel:In,required:An,reversed:An,rows:On,rowSpan:On,sandbox:In,scope:null,scoped:An,seamless:An,selected:An,shadowRootClonable:An,shadowRootDelegatesFocus:An,shadowRootMode:null,shape:null,size:On,sizes:null,slot:null,span:On,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:On,step:null,style:null,tabIndex:On,target:null,title:null,translate:null,type:null,typeMustMatch:An,useMap:null,value:Nn,width:On,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:In,axis:null,background:null,bgColor:null,border:On,borderColor:null,bottomMargin:On,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:An,declare:An,event:null,face:null,frame:null,frameBorder:null,hSpace:On,leftMargin:On,link:null,longDesc:null,lowSrc:null,marginHeight:On,marginWidth:On,noResize:An,noHref:An,noShade:An,noWrap:An,object:null,profile:null,prompt:null,rev:null,rightMargin:On,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:On,valueType:null,version:null,vAlign:null,vLink:null,vSpace:On,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:An,disableRemotePlayback:An,prefix:null,property:null,results:On,security:null,unselectable:null},space:"html",transform:Vn}),Wn=Un({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Mn,accentHeight:On,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:On,amplitude:On,arabicForm:null,ascent:On,attributeName:null,attributeType:null,azimuth:On,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:On,by:null,calcMode:null,capHeight:On,className:In,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:On,diffuseConstant:On,direction:null,display:null,dur:null,divisor:On,dominantBaseline:null,download:An,dx:null,dy:null,edgeMode:null,editable:null,elevation:On,enableBackground:null,end:null,event:null,exponent:On,externalResourcesRequired:null,fill:null,fillOpacity:On,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jn,g2:jn,glyphName:jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:On,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:On,horizOriginX:On,horizOriginY:On,id:null,ideographic:On,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:On,k:On,k1:On,k2:On,k3:On,k4:On,kernelMatrix:Mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:On,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:On,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:On,overlineThickness:On,paintOrder:null,panose1:null,path:null,pathLength:On,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:In,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:On,pointsAtY:On,pointsAtZ:On,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mn,rev:Mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mn,requiredFeatures:Mn,requiredFonts:Mn,requiredFormats:Mn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:On,specularExponent:On,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:On,strikethroughThickness:On,string:null,stroke:null,strokeDashArray:Mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:On,strokeOpacity:On,strokeWidth:null,style:null,surfaceScale:On,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mn,tabIndex:On,tableValues:null,target:null,targetX:On,targetY:On,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:On,underlineThickness:On,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:On,values:null,vAlphabetic:On,vMathematical:On,vectorEffect:null,vHanging:On,vIdeographic:On,version:null,vertAdvY:On,vertOriginX:On,vertOriginY:On,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:On,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$n}),qn=Un({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Zn=Un({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Vn}),Qn=Un({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Kn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Jn=/[A-Z]/g,Yn=/-[a-z]/g,Gn=/^data[-\w.:]+$/i;function Xn(e){return"-"+e.toLowerCase()}function er(e){return e.charAt(1).toUpperCase()}const tr=_n([Bn,Hn,qn,Zn,Qn],"html"),nr=_n([Bn,Wn,qn,Zn,Qn],"svg");var rr,or,ir,ar={};function sr(){if(ir)return ar;ir=1;var e=ar&&ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ar,"__esModule",{value:!0}),ar.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(or)return rr;or=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(s,l):l}return rr=function(s,u){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];u=u||{};var d=1,f=1;function h(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function p(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+f+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=f,t.source=s,!u.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return h(n),s=s.slice(n.length),t}}function b(){y(n)}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=p();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return f+=2,h(n),s=s.slice(t),f+=2,e({type:"comment",comment:n})}}function x(){var t=p(),n=y(r);if(n){if(w(),!y(o))return g("property missing ':'");var s=y(i),u=t({type:"declaration",property:c(n[0].replace(e,l)),value:s?c(s[0].replace(e,l)):l});return y(a),u}}return m.prototype.content=s,b(),function(){var e,t=[];for(v(t);e=x();)!1!==e&&(t.push(e),v(t));return t}()}}());return ar}var lr,cr,ur,dr={};function fr(){if(lr)return dr;lr=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return dr.camelCase=function(s,l){return void 0===l&&(l={}),function(t){return!t||n.test(t)||e.test(t)}(s)?s:(s=s.toLowerCase(),(s=l.reactCompat?s.replace(o,a):s.replace(r,a)).replace(t,i))},dr}const hr=t(function(){if(ur)return cr;ur=1;var e=(cr&&cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(sr()),t=fr();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,cr=n}()),pr=gr("end"),mr=gr("start");function gr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function yr(e){const t=mr(e),n=pr(e);if(t&&n)return{start:t,end:n}}function br(e){return e&&"object"==typeof e?"position"in e||"type"in e?wr(e.position):"start"in e||"end"in e?wr(e):"line"in e||"column"in e?vr(e):"":""}function vr(e){return xr(e&&e.line)+":"+xr(e&&e.column)}function wr(e){return vr(e&&e.start)+"-"+vr(e&&e.end)}function xr(e){return e&&"number"==typeof e?e:1}class kr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=br(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}kr.prototype.file="",kr.prototype.name="",kr.prototype.reason="",kr.prototype.message="",kr.prototype.stack="",kr.prototype.column=void 0,kr.prototype.line=void 0,kr.prototype.ancestors=void 0,kr.prototype.cause=void 0,kr.prototype.fatal=void 0,kr.prototype.place=void 0,kr.prototype.ruleId=void 0,kr.prototype.source=void 0;const Sr={}.hasOwnProperty,_r=new Map,Cr=/[A-Z]/g,Er=new Set(["table","tbody","thead","tfoot","tr"]),zr=new Set(["td","th"]),Ar="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Nr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=mr(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?nr:tr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Tr(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Tr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=nr,e.schema=o);e.ancestors.push(t);const i=Pr(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Sr.call(t.properties,o)){const i=Mr(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&zr.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=jr(e,t);Er.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&kn(t.value):kn(t));var t}));return Or(e,a,i,t),Ir(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Fr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=nr,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:Pr(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];mn(t.type);const o=t.expression;mn(o.type);const i=o.properties[0];mn(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Fr(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];mn(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Fr(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=jr(e,t);return Or(e,a,i,t),Ir(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Ir(r,jr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Or(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ir(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:_r;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=Tr(e,i,a);void 0!==s&&n.push(s)}return n}function Mr(e,t,n){const r=function(e,t){const n=Cn(t);let r=t,o=En;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Gn.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Yn,er);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Yn.test(e)){let n=e.replace(Jn,Xn);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Rn}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return hr(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const t=n,r=new kr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ar+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Sr.call(e,n)&&(t[Lr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Kn[r.property]||r.property:r.attribute,n]}}function Pr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=wn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=wn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Sr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fr(e)}function Fr(e,t){const n=new kr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ar+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Lr(e){let t=e.replace(Cr,Rr);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Rr(e){return"-"+e.toLowerCase()}const Dr={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Ur={};function Br(e,t){return $r(e,"boolean"!=typeof Ur.includeImageAlt||Ur.includeImageAlt,"boolean"!=typeof Ur.includeHtml||Ur.includeHtml)}function $r(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Vr(e.children,t,n)}return Array.isArray(e)?Vr(e,t,n):""}function Vr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=$r(e[o],t,n);return r.join("")}const Hr=document.createElement("i");function Wr(e){const t="&"+e+";";Hr.innerHTML=t;const n=Hr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function qr(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function Zr(e,t){return e.length>0?(qr(e,e.length,0,t),e):t}const Qr={}.hasOwnProperty;function Kr(e){const t={};let n=-1;for(;++n<e.length;)Jr(t,e[n]);return t}function Jr(e,t){let n;for(n in t){const r=(Qr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Qr.call(r,i)||(r[i]=[]);const e=o[i];Yr(r[i],Array.isArray(e)?e:e?[e]:[])}}}function Yr(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);qr(e,0,0,r)}function Gr(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function Xr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const eo=ho(/[A-Za-z]/),to=ho(/[\dA-Za-z]/),no=ho(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return null!==e&&(e<32||127===e)}const oo=ho(/\d/),io=ho(/[\dA-Fa-f]/),ao=ho(/[!-/:-@[-`{-~]/);function so(e){return null!==e&&e<-2}function lo(e){return null!==e&&(e<0||32===e)}function co(e){return-2===e||-1===e||32===e}const uo=ho(new RegExp("\\p{P}|\\p{S}","u")),fo=ho(/\s/);function ho(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function po(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&to(e.charCodeAt(n+1))&&to(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function mo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(co(r))return e.enter(n),a(r);return t(r)};function a(r){return co(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const go={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mo(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):so(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const yo={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&b();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return qr(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bo,u,d)(o)}function u(e){return r&&b(),y(a),f(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,p(e)}function f(n){return t.containerState={},e.attempt(bo,h,p)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),f(e)}function p(n){return null===n?(r&&b(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):so(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;qr(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},bo={tokenize:function(e,t,n){return mo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function vo(e){return null===e||lo(e)||fo(e)?1:uo(e)?2:void 0}function wo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const xo={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[u][1].start};ko(d,-s),ko(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Zr(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Zr(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=Zr(l,wo(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Zr(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Zr(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,qr(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=vo(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=vo(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}};function ko(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const So={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return eo(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||to(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||to(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||ro(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):no(t)?(e.consume(t),l):n(t)}function c(e){return to(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||to(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const _o={partial:!0,tokenize:function(e,t,n){return function(t){return co(t)?mo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||so(e)?t(e):n(e)}}};const Co={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(co(t))return mo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(Co,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return co(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Eo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return ao(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const zo={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=to,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=io,c):(e.enter("characterReferenceValue"),o=7,i=oo,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==to||Wr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}};const Ao={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},No={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),co(t)?mo(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===i?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===i?(o++,e.consume(t),u):o>=s?(e.exit("codeFencedFenceSequence"),co(t)?mo(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||so(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),co(t)?mo(e,c,"whitespace")(t):c(t))}function c(n){return null===n||so(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Ao,h,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||so(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):co(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mo(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||so(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||so(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),f)}function h(t){return e.attempt(o,b,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&co(t)?mo(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||so(t)?e.check(Ao,h,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||so(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}};const To={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),mo(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):so(t)?e.attempt(Oo,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||so(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},Oo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):so(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):mo(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):so(e)?o(e):n(e)}}};const Io={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):so(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||so(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class jo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Mo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Mo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Mo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Mo(this.left,t.reverse())}}}function Mo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Po(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new jo(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Fo(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return qr(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Fo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,f=-1,h=n,p=0,m=0;const g=[m];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<s.length;)"exit"===s[f][0]&&"enter"===s[f-1][0]&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(m=f+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){const t=s.slice(g[f],g[f+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),f=-1;++f<l.length;)c[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return c}const Lo={resolve:function(e){return Po(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):so(t)?e.check(Ro,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Ro={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,o,"linePrefix")};function o(o){if(null===o||so(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Do(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||ro(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||so(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(o){return u||null!==o&&41!==o&&!lo(o)?u<c&&40===o?(e.consume(o),u++,p):41===o?(e.consume(o),u--,p):null===o||32===o||40===o||ro(o)?n(o):(e.consume(o),92===o?m:p):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function Uo(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):so(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||so(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!co(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Bo(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):so(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||so(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function $o(e,t){let n;return function r(o){if(so(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(co(o))return mo(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const Vo={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Uo.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return lo(t)?$o(e,s)(t):s(t)}function s(t){return Do(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Ho,c,c)(t)}function c(t){return co(t)?mo(e,u,"whitespace")(t):u(t)}function u(i){return null===i||so(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Ho={partial:!0,tokenize:function(e,t,n){return function(t){return lo(t)?$o(e,r)(t):n(t)};function r(t){return Bo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return co(t)?mo(e,i,"whitespace")(t):i(t)}function i(e){return null===e||so(e)?t(e):n(e)}}};const Wo={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return so(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const qo={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},qr(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||lo(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||so(n)?(e.exit("atxHeading"),t(n)):co(n)?mo(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||lo(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Zo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qo=["pre","script","style","textarea"],Ko={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,h):63===s?(e.consume(s),o=3,r.interrupt?t:M):eo(s)?(e.consume(s),a=String.fromCharCode(s),p):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,f):eo(i)?(e.consume(i),o=4,r.interrupt?t:M):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:M):n(o)}function f(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:E:f):n(o)}function h(t){return eo(t)?(e.consume(t),a=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||lo(s)){const l=47===s,c=a.toLowerCase();return l||i||!Qo.includes(c)?Zo.includes(a.toLowerCase())?(o=6,l?(e.consume(s),m):r.interrupt?t(s):E(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):y(s)):(o=1,r.interrupt?t(s):E(s))}return 45===s||to(s)?(e.consume(s),a+=String.fromCharCode(s),p):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:E):n(o)}function g(t){return co(t)?(e.consume(t),g):_(t)}function y(t){return 47===t?(e.consume(t),_):58===t||95===t||eo(t)?(e.consume(t),b):co(t)?(e.consume(t),y):_(t)}function b(t){return 45===t||46===t||58===t||95===t||to(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),w):co(t)?(e.consume(t),v):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):co(t)?(e.consume(t),w):k(t)}function x(t){return t===l?(e.consume(t),l=null,S):null===t||so(t)?n(t):(e.consume(t),x)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||lo(t)?v(t):(e.consume(t),k)}function S(e){return 47===e||62===e||co(e)?y(e):n(e)}function _(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||so(t)?E(t):co(t)?(e.consume(t),C):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),O):62===t&&4===o?(e.consume(t),P):63===t&&3===o?(e.consume(t),M):93===t&&5===o?(e.consume(t),j):!so(t)||6!==o&&7!==o?null===t||so(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),E):(e.exit("htmlFlowData"),e.check(Jo,F,z)(t))}function z(t){return e.check(Yo,A,F)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||so(t)?z(t):(e.enter("htmlFlowData"),E(t))}function T(t){return 45===t?(e.consume(t),M):E(t)}function O(t){return 47===t?(e.consume(t),a="",I):E(t)}function I(t){if(62===t){const n=a.toLowerCase();return Qo.includes(n)?(e.consume(t),P):E(t)}return eo(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):E(t)}function j(t){return 93===t?(e.consume(t),M):E(t)}function M(t){return 62===t?(e.consume(t),P):45===t&&2===o?(e.consume(t),M):E(t)}function P(t){return null===t||so(t)?(e.exit("htmlFlowData"),F(t)):(e.consume(t),P)}function F(n){return e.exit("htmlFlow"),t(n)}}},Jo={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(_o,t,n)}}},Yo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(so(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const Go={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),b):eo(t)?(e.consume(t),S):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,h):eo(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):so(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?O(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):so(t)?(a=p,I(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):p(t)}function y(t){return null===t||62===t?O(t):so(t)?(a=y,I(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),v):so(t)?(a=b,I(t)):(e.consume(t),b)}function v(e){return 62===e?O(e):b(e)}function w(t){return eo(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||to(t)?(e.consume(t),x):k(t)}function k(t){return so(t)?(a=k,I(t)):co(t)?(e.consume(t),k):O(t)}function S(t){return 45===t||to(t)?(e.consume(t),S):47===t||62===t||lo(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),O):58===t||95===t||eo(t)?(e.consume(t),C):so(t)?(a=_,I(t)):co(t)?(e.consume(t),_):O(t)}function C(t){return 45===t||46===t||58===t||95===t||to(t)?(e.consume(t),C):E(t)}function E(t){return 61===t?(e.consume(t),z):so(t)?(a=E,I(t)):co(t)?(e.consume(t),E):_(t)}function z(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,A):so(t)?(a=z,I(t)):co(t)?(e.consume(t),z):(e.consume(t),N)}function A(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):so(t)?(a=A,I(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||lo(t)?_(t):(e.consume(t),N)}function T(e){return 47===e||62===e||lo(e)?_(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),j}function j(t){return co(t)?mo(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):M(t)}function M(t){return e.enter("htmlTextData"),a(t)}}};const Xo={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&qr(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=Zr(i,e.slice(r+1,r+s+3)),i=Zr(i,[["enter",u,t]]),i=Zr(i,wo(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=Zr(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=Zr(i,e.slice(o+1)),i=Zr(i,[["exit",l,t]]),qr(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(Xr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(ei,c,i?c:u)(t):91===t?e.attempt(ti,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(ni,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},ei={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return lo(t)?$o(e,o)(t):o(t)}function o(t){return 41===t?c(t):Do(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return lo(t)?$o(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Bo(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return lo(t)?$o(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ti={tokenize:function(e,t,n){const r=this;return function(t){return Uo.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},ni={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const ri={name:"labelStartImage",resolveAll:Xo.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const oi={name:"labelStartLink",resolveAll:Xo.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const ii={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mo(e,t,"linePrefix")}}};const ai={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||so(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),co(t)?mo(e,i,"whitespace")(t):i(t))}}};const si={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_o,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!co(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ci,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,mo(e,e.attempt(si,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:oo(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(ai,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return oo(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(_o,r.interrupt?n:c,e.attempt(li,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return co(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},li={partial:!0,tokenize:function(e,t,n){const r=this;return mo(e,function(e){const o=r.events[r.events.length-1];return!co(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ci={partial:!0,tokenize:function(e,t,n){const r=this;return mo(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const ui={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),co(t)?mo(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||so(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const di={tokenize:function(e){const t=this,n=e.attempt(_o,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,mo(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Lo,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const fi={resolveAll:gi()},hi=mi("string"),pi=mi("text");function mi(e){return{resolveAll:gi("text"===e?yi:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function gi(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function yi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const bi={42:si,43:si,45:si,48:si,49:si,50:si,51:si,52:si,53:si,54:si,55:si,56:si,57:si,62:Co},vi={91:Vo},wi={[-2]:To,[-1]:To,32:To},xi={35:qo,42:ai,45:[ui,ai],60:Ko,61:ui,95:ai,96:No,126:No},ki={38:zo,92:Eo},Si={[-5]:ii,[-4]:ii,[-3]:ii,33:ri,38:zo,42:xo,60:[So,Go],91:oi,92:[Wo,Eo],93:Xo,95:xo,96:Io},_i={null:[xo,fi]},Ci=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:vi,disable:{null:[]},document:bi,flow:xi,flowInitial:wi,insideSpan:_i,string:ki,text:Si},Symbol.toStringTag,{value:"Module"}));function Ei(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:g(function(e,t){y(e,t.from)}),check:g(m),consume:function(e){so(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,b()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=Zr(a,e),h(),null!==a[a.length-1])return[];return y(t,0),c.events=wo(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}function p(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,h;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){h=function(){const e=f(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,b()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,y)(n)}}function g(t){return e(d,h),o}function y(e){return h.restore(),++u<a.length?m(a[u]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&qr(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const zi=/[\0\t\n\r]/g;const Ai=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ni(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Gr(n.slice(t?2:1),t?16:10)}return Wr(n)||e}const Ti={}.hasOwnProperty;function Oi(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(Y),blockQuote:i(q),characterEscape:C,characterReference:C,codeFenced:i(Z),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Z,a),codeText:i(Q,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(K),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(J),hardBreakEscape:i(G),hardBreakTrailing:i(G),htmlFlow:i(X,a),htmlFlowData:C,htmlText:i(X,a),htmlTextData:C,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:f,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:D,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Y),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:W,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:$,characterReference:V,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:E,codeIndented:l(y),codeText:l(O),codeTextData:E,data:E,definition:l(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(N),htmlFlowData:E,htmlText:l(T),htmlTextData:E,image:l(j),label:P,labelText:M,lineEnding:z,link:l(I),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:F,resourceTitleString:L,resource:R,setextHeading:l(_),setextHeadingLineSequence:S,setextHeadingText:k,strong:l(),thematicBreak:l()}};ji(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];Ti.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Pi).call(i,void 0,e[0])}for(r.position={start:Ii(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ii(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Ii(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Pi).call(this,e,r[0])}n.position.end=Ii(e.end)}function u(){return Br(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function h(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function b(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function x(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function S(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:Ii(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ii(e.end)}function z(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=Ii(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),E.call(this,e))}function A(){this.data.atHardBreak=!0}function N(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Ai,Ni)}(t),n.identifier=Xr(t).toLowerCase()}function P(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function F(){const e=this.resume();this.stack[this.stack.length-1].url=e}function L(){const e=this.resume();this.stack[this.stack.length-1].title=e}function R(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function U(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function B(e){this.data.characterReferenceType=e.type}function $(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=Gr(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Wr(t)}this.stack[this.stack.length-1].value+=r}function V(e){this.stack.pop().position.end=Ii(e.end)}function H(e){E.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function W(e){E.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function q(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function G(){return{type:"break"}}function X(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Po(e););return e}(function(e){const t={constructs:Kr([Ci,...(e||{}).extensions||[]]),content:n(go),defined:[],document:n(yo),flow:n(di),lazy:{},string:n(hi),text:n(pi)};return t;function n(e){return function(n){return Ei(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,f;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(zi.lastIndex=u,l=zi.exec(o),d=l&&void 0!==l.index?l.index:o.length,f=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===f&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),f){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function Ii(e){return{line:e.line,column:e.column,offset:e.offset}}function ji(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ji(e,r):Mi(e,r)}}function Mi(e,t){let n;for(n in t)if(Ti.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Pi(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is still open")}function Fi(e){const t=this;t.parser=function(n){return Oi(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Li(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function Ri(e){const t=e.spread;return null==t?e.children.length>1:t}function Di(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Ui(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Ui(t.slice(o),o>0,!1)),i.join("")}function Ui(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const Bi={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=po(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Li(e,t);const o={src:po(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:po(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Li(e,t);const o={href:po(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:po(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ri(n[r])}return t}(n):Ri(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=mr(t.children[1]),a=pr(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Di(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:$i,yaml:$i,definition:$i,footnoteDefinition:$i};function $i(){}const Vi="object"==typeof self?self:globalThis,Hi=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new Vi[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new Vi[i](a),o)};return r})(new Map,e)(0),Wi="",{toString:qi}={},{keys:Zi}=Object,Qi=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=qi.call(e).slice(8,-1);switch(n){case"Array":return[1,Wi];case"Object":return[2,Wi];case"Date":return[3,Wi];case"RegExp":return[4,Wi];case"Map":return[5,Wi];case"Set":return[6,Wi];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Ki=([e,t])=>0===e&&("function"===t||"symbol"===t),Ji=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=Qi(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const n of r)e.push(i(n));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of Zi(r))!e&&Ki(Qi(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[o,a]of r)(e||!Ki(Qi(o))&&!Ki(Qi(a)))&&t.push([i(o),i(a)]);return n}case 6:{const t=[],n=o([a,t],r);for(const o of r)!e&&Ki(Qi(o))||t.push(i(o));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},Yi="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Hi(Ji(e,t)):structuredClone(e):(e,t)=>Hi(Ji(e,t));function Gi(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Xi(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const ea=function(e){if(null==e)return na;if("function"==typeof e)return ta(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ea(e[n]);return ta(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return ta(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return ta(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function ta(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function na(){return!0}const ra=[],oa=!0,ia=!1;function aa(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=ea(o),a=r?-1:1;!function e(o,s,l){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,f=ra;if((!t||i(o,s,l[l.length-1]||void 0))&&(f=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[oa,e];return null==e?ra:[e]}(n(o,l)),f[0]===ia))return f;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==f[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===ia)return c;u="number"==typeof c[1]?c[1]:u+a}}return f}}(e,void 0,[])()}function sa(e,t,n,r){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=r),aa(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}const la={}.hasOwnProperty,ca={};function ua(e,t){e.position&&(t.position=yr(e))}function da(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,Yi(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function fa(e,t){const n=t.data||{},r=!("value"in t)||la.call(n,"hProperties")||la.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function ha(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function pa(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ma(e,t){const n=function(e,t){const n=t||ca,r=new Map,o=new Map,i=new Map,a={...Bi,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=pa(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=pa(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:da,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(la.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=Yi(n);return r.children=s.all(e),r}return Yi(e)}return(s.options.unknownHandler||fa)(s,e,t)},options:n,patch:ua,wrap:ha};return sa(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Gi,r=e.options.footnoteBackLabel||Xi,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),c=po(a.toLowerCase());let u=0;const d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Yi(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function ga(e,t){return e&&"run"in e?async function(n,r){const o=ma(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ma(n,{file:r,...e||t})}}function ya(e){if(e)throw e}var ba,va;var wa=function(){if(va)return ba;va=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return ba=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(i(l)||(c=o(l)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&i(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},ba}();const xa=t(wa);function ka(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Sa(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let s;r&&t.push(o);try{s=e.apply(this,t)}catch(i){if(r&&n)throw i;return o(i)}r||(s&&s.then&&"function"==typeof s.then?s.then(a,o):s instanceof Error?o(s):a(s))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const _a={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Ca(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(Ca(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Ca(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Ca(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Ca(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Ca(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ea={cwd:function(){return"/"}};function za(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Aa(e){if("string"==typeof e)e=new URL(e);else if(!za(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Na=["history","path","basename","stem","extname","dirname"];class Ta{constructor(e){let t;t=e?za(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":Ea.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Na.length;){const e=Na[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Na.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?_a.basename(this.path):void 0}set basename(e){Ia(e,"basename"),Oa(e,"basename"),this.path=_a.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?_a.dirname(this.path):void 0}set dirname(e){ja(this.basename,"dirname"),this.path=_a.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?_a.extname(this.path):void 0}set extname(e){if(Oa(e,"extname"),ja(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_a.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){za(e)&&(e=Aa(e)),Ia(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?_a.basename(this.path,this.extname):void 0}set stem(e){Ia(e,"stem"),Oa(e,"stem"),this.path=_a.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new kr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Oa(e,t){if(e&&e.includes(_a.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_a.sep+"`")}function Ia(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ja(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ma=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Pa={}.hasOwnProperty;class Fa extends Ma{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sa()}copy(){const e=new Fa;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(xa(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(Ua("data",this.frozen),this.namespace[e]=t,this):Pa.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ua("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Va(e),n=this.parser||this.Parser;return Ra("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ra("process",this.parser||this.Parser),Da("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Va(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ra("processSync",this.parser||this.Parser),Da("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,ya(e),t=r}),$a("processSync","process",n),t}run(e,t,n){Ba(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=Va(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){ya(e),n=t,r=!0}),$a("runSync","run",r),n}stringify(e,t){this.freeze();const n=Va(t),r=this.compiler||this.Compiler;return Da("stringify",r),Ba(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(Ua("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=xa(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];ka(a)&&ka(r)&&(r=xa(!0,a,r)),n[o]=[e,r,...i]}}}}const La=(new Fa).freeze();function Ra(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Da(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ua(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ba(e){if(!ka(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function $a(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Va(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ta(e)}const Ha=[],Wa={allowDangerousHtml:!0},qa=/^(https?|ircs?|mailto|xmpp)$/i,Za=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Qa(e){const t=function(e){const t=e.rehypePlugins||Ha,n=e.remarkPlugins||Ha,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Wa}:Wa,o=La().use(Fi).use(n).use(ga,r).use(t);return o}(e),n=function(e){const t=e.children||"",n=new Ta;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Ka;for(const u of Za)Object.hasOwn(t,u.from)&&gn((u.from,u.to&&u.to,u.id));return sa(e,c),Nr(e,{Fragment:A.Fragment,components:o,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function c(e,t,o){if("raw"===e.type&&o&&"number"==typeof t)return a?o.children.splice(t,1):o.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Dr)if(Object.hasOwn(Dr,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Dr[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,o)),a&&o&&"number"==typeof t)return s&&e.children?o.children.splice(t,1,...e.children):o.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function Ka(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||qa.test(e.slice(0,t))?e:""}function Ja(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function Ya(e,t,n){const r=ea((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([Ga(e[0]),Xa(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)aa(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],a=o[i][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,o={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function Ga(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function Xa(e){return"function"==typeof e?e:function(){return e}}const es="phrasing",ts=["autolink","link","image","label"];function ns(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rs(e){this.config.enter.autolinkProtocol.call(this,e)}function os(e){this.config.exit.autolinkProtocol.call(this,e)}function is(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function as(e){this.config.exit.autolinkEmail.call(this,e)}function ss(e){this.exit(e)}function ls(e){Ya(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cs],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),us]],{ignore:["link","linkReference"]})}function cs(e,t,n,r,o){let i="";if(!ds(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=Ja(e,"(");let i=Ja(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function us(e,t,n,r){return!(!ds(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ds(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||fo(n)||uo(n))&&(!t||47!==n)}function fs(){this.buffer()}function hs(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ps(){this.buffer()}function ms(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gs(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ys(e){this.exit(e)}function bs(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vs(e){this.exit(e)}function ws(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function xs(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let a=i.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?Ss:ks)));return s(),a},footnoteReference:ws},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function ks(e,t,n){return 0===t?e:Ss(e,t,n)}function Ss(e,t,n){return(n?"":" ")+e}ws.peek=function(){return"["};const _s=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Cs(e){this.enter({type:"delete",children:[]},e)}function Es(e){this.exit(e)}function zs(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function As(e){return e.length}function Ns(e){return null==e?"":String(e)}function Ts(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Os(e,t,n){return">"+(n?"":" ")+e}function Is(e,t){return js(e,t.inConstruct,!0)&&!js(e,t.notInConstruct,!1)}function js(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Ms(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&Is(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function Ps(e,t,n){return(n?"":" ")+e}function Fs(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ls(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rs(e,t,n){const r=vo(e),o=vo(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Ds(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=Rs(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=Ls(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Rs(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+Ls(d));const h=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+h}function Us(e){return e.value||""}function Bs(e,t,n,r){const o=Fs(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function $s(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function Vs(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function Hs(e,t){const n=Br(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function Ws(e,t,n,r){const o=Fs(n),i='"'===o?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Hs(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function qs(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function Zs(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Qs(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}zs.peek=function(){return"~"},Ds.peek=function(e,t,n){return n.options.emphasis||"*"},Us.peek=function(){return"<"},Bs.peek=function(){return"!"},$s.peek=function(){return"!"},Vs.peek=function(){return"`"},Ws.peek=function(e,t,n){return Hs(e,n)?"<":"["},qs.peek=function(){return"["};const Ks=ea(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Js(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=Rs(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=Ls(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Rs(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+Ls(d));const h=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+h}Js.peek=function(e,t,n){return n.options.strong||"*"};const Ys={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),Os);return o(),a},break:Ms,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Ps);return e(),t}const s=n.createTracker(r),l=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),i&&(u+=s.move(i+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const o=Fs(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c},emphasis:Ds,hardBreak:Ms,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return sa(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,ia}),Boolean((!e.depth||e.depth<3)&&Br(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===o?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=Ls(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:Us,image:Bs,imageReference:$s,inlineCode:Vs,link:Ws,linkReference:qs,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):Zs(n);const s=e.ordered?"."===a?")":".":function(e){const t=Zs(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),Qs(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||Zs(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?i:i+" ".repeat(a-i.length))+e});return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a},root:function(e,t,n,r){return(e.children.some(function(e){return Ks(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:Js,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(Qs(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function Gs(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function Xs(e){this.exit(e),this.data.inTable=void 0}function el(e){this.enter({type:"tableRow",children:[]},e)}function tl(e){this.exit(e)}function nl(e){this.enter({type:"tableCell",children:[]},e)}function rl(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ol));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ol(e,t){return"|"===t?t:e}function il(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=Ys.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const o=s([l(e,n,r)]);return o.slice(0,o.indexOf("\n"))}}};function a(e,t,n,r){const o=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return a(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||As,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=Ns(e[u][i]);if(!1!==n.alignDelimiters){const e=o(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)i[d]=Ts(r[d]);else{const e=Ts(r);for(;++d<c;)i[d]=e}d=-1;const f=[],h=[];for(;++d<c;){const e=i[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const a=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>l[d]&&(l[d]=o),h[d]=o),f[d]=a}a.splice(1,0,f),s.splice(1,0,h),u=-1;const p=[];for(;++u<a.length;){const e=a[u],t=s[u];d=-1;const r=[];for(;++d<c;){const o=e[d]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=i[d];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}p.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return p.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=a(r[o],0,t,n);return s(),i}}function al(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function sl(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ll(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=Ys.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),l}const cl={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},ul={tokenize:function(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(fl,l,s)(t):null===t||lo(t)||fo(t)||45!==t&&uo(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},dl={tokenize:function(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(fl,t,i)(a):null===a||lo(a)||fo(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},fl={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||lo(a)||fo(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||lo(e)||fo(e)?t(e):r(e)}function i(e){return eo(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):eo(t)?(e.consume(t),a):n(t)}},partial:!0},hl={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return to(e)?n(e):t(e)}},partial:!0},pl={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!vl.call(r,r.previous)||Sl(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(cl,e.attempt(ul,e.attempt(dl,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:vl},ml={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&wl.call(r,r.previous)&&!Sl(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(eo(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||ro(t)||lo(t)||fo(t)||uo(t)?n(t):e.attempt(ul,e.attempt(dl,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:wl},gl={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!kl(t)||!xl.call(r,r.previous)||Sl(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return kl(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(hl,c,l)(t):45===t||95===t||to(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&eo(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:xl},yl={};let bl=48;for(;bl<123;)yl[bl]=gl,bl++,58===bl?bl=65:91===bl&&(bl=97);function vl(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||lo(e)}function wl(e){return!eo(e)}function xl(e){return!(47===e||kl(e))}function kl(e){return 43===e||45===e||46===e||95===e||to(e)}function Sl(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}yl[43]=gl,yl[45]=gl,yl[46]=gl,yl[95]=gl,yl[72]=[gl,ml],yl[104]=[gl,ml],yl[87]=[gl,pl],yl[119]=[gl,pl];const _l={tokenize:function(e,t,n){const r=this;return mo(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function Cl(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=Xr(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function El(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function zl(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||lo(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(Xr(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return lo(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function Al(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||lo(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=Xr(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return lo(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),mo(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function Nl(e,t,n){return e.check(_o,t,e.attempt(_l,t,n))}function Tl(e){e.exit("gfmFootnoteDefinition")}function Ol(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let a=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const l=vo(o);if(126===i)return a>1?r(i):(e.consume(i),a++,s);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=vo(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&qr(a,a.length,0,wo(s,e.slice(r+1,n),t)),qr(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),qr(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class Il{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function jl(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function Ml(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):so(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):co(t)?mo(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||lo(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,co(t)?mo(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t))}function f(t){return 45===t||58===t?p(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return co(t)?mo(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||so(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return co(t)?mo(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?f(n):(null===n||so(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function w(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||so(n)?(e.exit("tableRow"),t(n)):co(n)?mo(e,x,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||lo(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?S:k)}function S(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function Pl(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const f=new Il;for(;++i<e.length;){const h=e[i],p=h[1];"enter"===h[0]?"tableHead"===p.type?(u=!1,0!==d&&(Ll(f,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(i,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===p.type?2:r?3:1):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type?"tableCellDivider"===p.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=Fl(f,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=Fl(f,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===p.type?(u=!0,d=i):"tableRow"===p.type||"tableDelimiterRow"===p.type?(d=i,0!==l[1]?(c[0]=c[1],o=Fl(f,t,l,s,i,o)):0!==c[1]&&(o=Fl(f,t,c,s,i,o)),s=0):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type||(c[3]=i)}for(0!==d&&Ll(f,t,d,n,r),f.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=jl(t.events,i))}return e}function Fl(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},Rl(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=Rl(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=Rl(t.events,n[2]),i=Rl(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},Rl(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Ll(e,t,n,r,o){const i=[],a=Rl(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function Rl(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Dl={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return lo(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return so(r)?t(r):co(r)?e.check({tokenize:Ul},t,n)(r):n(r)}}};function Ul(e,t,n){return mo(e,function(e){return null===e?n(e):t(e)},"whitespace")}const Bl={};function $l(e){const t=e||Bl,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return Kr([{text:yl},{document:{91:{name:"gfmFootnoteDefinition",tokenize:Al,continuation:{tokenize:Nl},exit:Tl}},text:{91:{name:"gfmFootnoteCall",tokenize:zl},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Cl,resolveTo:El}}},Ol(e),{flow:{null:{name:"table",tokenize:Ml,resolveAll:Pl}}},{text:{91:Dl}}])}(t)),o.push([{transforms:[ls],enter:{literalAutolink:ns,literalAutolinkEmail:rs,literalAutolinkHttp:rs,literalAutolinkWww:rs},exit:{literalAutolink:ss,literalAutolinkEmail:as,literalAutolinkHttp:os,literalAutolinkWww:is}},{enter:{gfmFootnoteCallString:fs,gfmFootnoteCall:hs,gfmFootnoteDefinitionLabelString:ps,gfmFootnoteDefinition:ms},exit:{gfmFootnoteCallString:gs,gfmFootnoteCall:ys,gfmFootnoteDefinitionLabelString:bs,gfmFootnoteDefinition:vs}},{canContainEols:["delete"],enter:{strikethrough:Cs},exit:{strikethrough:Es}},{enter:{table:Gs,tableData:nl,tableHeader:nl,tableRow:el},exit:{codeText:rl,table:Xs,tableData:tl,tableHeader:tl,tableRow:tl}},{exit:{taskListCheckValueChecked:al,taskListCheckValueUnchecked:al,paragraph:sl}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:es,notInConstruct:ts},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:es,notInConstruct:ts},{character:":",before:"[ps]",after:"\\/",inConstruct:es,notInConstruct:ts}]},xs(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_s}],handlers:{delete:zs}},il(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ll}}]}}(t))}const Vl=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Hl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Vl,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Vl],h2:[["className","sr-only"]],img:[...Vl,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Vl,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Vl],table:[...Vl],ul:[...Vl,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Wl={}.hasOwnProperty;function ql(e,t){if(t&&"object"==typeof t){const n=t;switch("string"==typeof n.type?n.type:""){case"comment":return function(e,t){if(e.schema.allowComments){const e="string"==typeof t.value?t.value:"",n=e.indexOf("--\x3e"),r={type:"comment",value:n<0?e:e.slice(0,n)};return Jl(r,t),r}}(e,n);case"doctype":return function(e,t){if(e.schema.allowDoctypes){const e={type:"doctype"};return Jl(e,t),e}}(e,n);case"element":return function(e,t){const n="string"==typeof t.tagName?t.tagName:"";e.stack.push(n);const r=Zl(e,t.children),o=function(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,o=e.schema.required,i=r&&Wl.call(r,n)?r[n]:void 0,a=r&&Wl.call(r,"*")?r["*"]:void 0,s=t&&"object"==typeof t?t:{},l={};let c;for(c in s)if(Wl.call(s,c)){const t=s[c];let n=Ql(e,Yl(i,c),c,t);null==n&&(n=Ql(e,Yl(a,c),c,t)),null!=n&&(l[c]=n)}if(o&&Wl.call(o,n)){const e=o[n];for(c in e)Wl.call(e,c)&&!Wl.call(l,c)&&(l[c]=e[c])}return l}(e,t.properties);e.stack.pop();let i=!1;if(n&&"*"!==n&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&Wl.call(e.schema.ancestors,n))){const t=e.schema.ancestors[n];let r=-1;for(i=!1;++r<t.length;)e.stack.includes(t[r])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:o,children:r};return Jl(a,t),a}(e,n);case"root":return function(e,t){const n=Zl(e,t.children),r={type:"root",children:n};return Jl(r,t),r}(e,n);case"text":return function(e,t){const n="string"==typeof t.value?t.value:"",r={type:"text",value:n};return Jl(r,t),r}(0,n)}}}function Zl(e,t){const n=[];if(Array.isArray(t)){const r=t;let o=-1;for(;++o<r.length;){const t=ql(e,r[o]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Ql(e,t,n,r){return t?Array.isArray(r)?function(e,t,n,r){let o=-1;const i=[];for(;++o<r.length;){const a=Kl(e,t,n,r[o]);"number"!=typeof a&&"string"!=typeof a||i.push(a)}return i}(e,t,n,r):Kl(e,t,n,r):void 0}function Kl(e,t,n,r){if(("boolean"==typeof r||"number"==typeof r||"string"==typeof r)&&function(e,t,n){const r=e.schema.protocols&&Wl.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||0===r.length)return!0;const o=String(n),i=o.indexOf(":"),a=o.indexOf("?"),s=o.indexOf("#"),l=o.indexOf("/");if(i<0||l>-1&&i>l||a>-1&&i>a||s>-1&&i>s)return!0;let c=-1;for(;++c<r.length;){const e=r[c];if(i===e.length&&o.slice(0,e.length)===e)return!0}return!1}(e,n,r)){if("object"==typeof t&&t.length>1){let e=!1,n=0;for(;++n<t.length;){const o=t[n];if(o&&"object"==typeof o&&"flags"in o){if(o.test(String(r))){e=!0;break}}else if(o===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Jl(e,t){const n=yr(t);t.data&&(e.data=Yi(t.data)),n&&(e.position=n)}function Yl(e,t){let n,r=-1;if(e)for(;++r<e.length;){const o=e[r],i="string"==typeof o?o:o[0];if(i===t)return o;"data*"===i&&(n=o)}if(t.length>4&&"data"===t.slice(0,4).toLowerCase())return n}function Gl(e){return function(t){const n=function(e,t){let n={type:"root",children:[]};const r=ql({schema:t?{...Hl,...t}:Hl,stack:[]},e);return r&&(Array.isArray(r)?1===r.length?n=r[0]:n.children=r:n=r),n}(t,e);return n}}const Xl=k.lazy(()=>Promise.resolve().then(()=>iy).then(e=>({default:e.AudioPlayer}))),ec=k.lazy(()=>Promise.resolve().then(()=>ly).then(e=>({default:e.Gallery}))),tc=k.memo(function({message:e,primaryColor:t,botAvatar:n,botName:r="Mar",avatars:o,isFirst:i=!0,isLast:a=!0,index:s=0}){const{t:l}=P("extracted"),c="user"===e.sender,u="system"===e.type||"system"===e.sender,d=!c&&!u,f=Ft({primaryColor:t}),h=function(){const e=k.useContext(Dt);return e.enabled&&"none"!==e.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[e.messageEntry]||"animate-message-spring":""}(),p=k.useMemo(()=>{if(c)return null;if("text"===e.type){const t=e;if(t.emotion&&o?.[t.emotion])return o[t.emotion]}return n},[e,o,n,c]),m=({href:e,children:t})=>{if(!e)return null;const n=String(t).toLowerCase(),r=n.includes("reservar")||n.includes("ver")||n.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?A.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:A.jsxs("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[A.jsx("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${f}1a`,color:f},children:A.jsx(Y,{size:16,strokeWidth:2.5})}),A.jsx("span",{className:"flex flex-col min-w-0 flex-1 text-[11px] font-bold text-foreground leading-tight uppercase tracking-tight",children:l("ver_ubicacion")}),A.jsx(q,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):r?A.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 mt-2 text-[11px] font-black w-full sm:w-auto rounded-xl shadow-md uppercase tracking-widest transition-transform active:scale-95 text-white",style:{backgroundColor:f},children:[t," ",A.jsx(U,{size:14})]}):A.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-bold underline decoration-primary/30 hover:decoration-primary transition-all",style:{color:c?"inherit":f},children:t})},g=({src:e,alt:t})=>e?A.jsx(k.Suspense,{fallback:A.jsx("div",{className:"my-3 animate-pulse",children:A.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:A.jsx(ec,{images:[{src:e,alt:t}],radius:"rounded-xl"})}):null;return u?A.jsx("div",{className:"flex justify-center my-4 animate-in fade-in zoom-in-95 w-full",children:A.jsx("span",{className:"px-3 py-1 border rounded-full text-[9px] font-black uppercase tracking-widest",style:{backgroundColor:"hsl(var(--muted))",borderColor:"hsl(var(--border))",color:"hsl(var(--muted-foreground))"},children:e.content})}):A.jsxs("div",{className:At("flex w-full mb-0.5 group",h,c?"justify-end":"justify-start gap-3",i&&"mt-3",a&&"mb-3"),style:{animationDelay:50*s+"ms"},children:[!c&&A.jsx("div",{className:"w-9 shrink-0 flex flex-col justify-end pb-1",children:a?A.jsx("div",{className:"h-9 w-9 rounded-full overflow-hidden border shadow-sm",style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--background))"},children:p?A.jsx("img",{src:p,alt:r,className:"h-full w-full object-cover"}):A.jsx("div",{className:"h-full w-full flex items-center justify-center text-white text-[10px] font-black uppercase",style:{backgroundColor:f},children:r.charAt(0)})}):A.jsx("div",{className:"w-9"})}),A.jsxs("div",{className:At("max-w-[85%] shadow-sm transition-all duration-300 relative",c?"text-primary-foreground":"border",c?At("rounded-[18px]",i&&"rounded-tr-[4px]",!a&&"rounded-br-[4px]",!i&&!a&&"rounded-r-[4px]"):At("rounded-[18px]",i&&"rounded-tl-[4px]",!a&&"rounded-bl-[4px]",!i&&!a&&"rounded-l-[4px]")),style:c?{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:f,boxShadow:a?`0 8px 20px -6px ${f}33`:"none"}:{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border) / 0.6)",color:"hsl(var(--foreground))"},children:[(()=>{switch(e.type){case"audio":return A.jsx(k.Suspense,{fallback:A.jsxs("div",{className:"flex items-center gap-3 py-1 min-w-[200px] animate-pulse",children:[A.jsx("div",{className:"w-8 h-8 rounded-full bg-muted"}),A.jsx("div",{className:"flex-1 space-y-1",children:A.jsx("div",{className:"h-1 w-full bg-muted rounded-full"})})]}),children:A.jsx(Xl,{url:e.content,isBot:d,primaryColor:t})});case"image":{const t=e;return A.jsx(k.Suspense,{fallback:A.jsx("div",{className:"my-3 animate-pulse",children:A.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:A.jsx(ec,{images:[{src:t.imageUrl||t.content,alt:t.altText||"Imagen"}],radius:"rounded-xl"})})}case"location":{const t=e;return A.jsx(m,{href:`https://www.google.com/maps/search/?api=1&query=${t.latitude},${t.longitude}`,children:"Ver ubicación"})}case"file":{const t=e,n=t.fileName?.split(".").pop()?.toLowerCase()||"",r=t.fileSize?`${(t.fileSize/1024/1024).toFixed(2)} MB`:"";return A.jsxs("a",{href:t.fileUrl,download:t.fileName,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 border rounded-xl transition-all hover:scale-[1.02] group",style:{backgroundColor:c?"rgba(255,255,255,0.1)":"hsl(var(--muted))",borderColor:c?"rgba(255,255,255,0.2)":"hsl(var(--border))"},children:[A.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg shrink-0",style:{backgroundColor:c?"rgba(255,255,255,0.2)":`${f}1a`,color:c?"white":f},children:A.jsx(Z,{size:20,strokeWidth:2.5})}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("p",{className:"text-sm font-bold truncate",children:t.fileName}),r&&A.jsxs("p",{className:"text-xs opacity-60 mt-0.5",children:[n?.toUpperCase()," • ",r]})]}),A.jsx(W,{size:18,className:"shrink-0 opacity-60 group-hover:opacity-100 transition-opacity"})]})}default:return A.jsx("div",{className:At("prose prose-sm max-w-none break-words leading-relaxed dark:prose-invert",c?"text-primary-foreground prose-p:text-white":"text-foreground"),children:A.jsx(Qa,{remarkPlugins:[$l],rehypePlugins:[[Gl,{tagNames:["p","a","img","strong","em","ul","ol","li","br","span"],attributes:{a:["href","target","rel"],img:["src","alt"],span:["className"]},protocols:{a:{href:["http","https","mailto","tel"]},img:{src:["http","https","data"]}}}]],components:{a:m,img:g,p:({children:e})=>A.jsx("p",{className:"mb-0 last:mb-0",children:e})},children:e.content||""})})}})(),a&&A.jsxs("div",{className:At("flex items-center gap-1 mt-1.5 opacity-50 select-none text-[9px]",c?"justify-end":"justify-start"),children:[A.jsx("span",{className:"font-bold tabular-nums uppercase tracking-tighter",children:(e=>{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})(e.timestamp)}),c&&A.jsx(B,{className:"h-2.5 w-2.5"})]})]})]})},(e,t)=>e.message.id===t.message.id&&(e.message.timestamp===t.message.timestamp&&(e.primaryColor===t.primaryColor&&(e.botAvatar===t.botAvatar&&(e.botName===t.botName&&(e.isFirst===t.isFirst&&(e.isLast===t.isLast&&JSON.stringify(e.styles)===JSON.stringify(t.styles)))))))),nc=k.memo(function(){return A.jsx("div",{className:At("flex items-center self-start animate-in fade-in duration-200","max-w-[85%] sm:max-w-[75%]"),children:A.jsx("div",{className:"border rounded-[18px] rounded-tl-[4px] px-4 py-3 shadow-soft-sm",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:A.jsx("div",{className:"flex items-center gap-1.5",children:[0,1,2].map(e=>A.jsx("span",{className:"h-1.5 w-1.5 rounded-full animate-bounce",style:{backgroundColor:"hsl(var(--primary) / 0.4)",animationDelay:150*e+"ms",animationDuration:"800ms"}},e))})})})});function rc(e,t){const n=e.getTime()-t.getTime();return Math.floor(n/1e3/60)}function oc(e){return new Intl.DateTimeFormat("es-ES",{hour:"2-digit",minute:"2-digit"}).format(e)}function ic(e){return function(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Hoy, ${oc(e)}`:function(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Ayer, ${oc(e)}`:function(e){return new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}).format(e)}(e)}const ac=k.memo(function({messages:e,isTyping:t,welcomeMessage:n="¡Hola! ¿En qué puedo ayudarte?",primaryColor:r,logoUrl:o,botName:i="Mar",bubbleStyles:a,avatars:s}){const l=k.useRef(null),c=k.useRef(null),[u,d]=k.useState(!1),[f,h]=k.useState(!1),p=Ft({primaryColor:r}),m=e.length>100,g=pn({count:e.length,getScrollElement:()=>c.current,estimateSize:()=>80,overscan:5,enabled:m});k.useEffect(()=>{d(!0)},[]),k.useEffect(()=>{if(u&&(e.length>0||t)){const t=setTimeout(()=>{m?g.scrollToIndex(e.length-1,{align:"end",behavior:e.length<=1?"auto":"smooth"}):l.current?.scrollIntoView({behavior:e.length<=1?"auto":"smooth",block:"end"})},100);return()=>clearTimeout(t)}},[e.length,t,u,m,g]);const y=e=>{const t=new Date(e);return isNaN(t.getTime())?"":ic(t)};return u?m?A.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto scroll-smooth bg-background/50 scrollbar-none",style:{padding:"var(--spacing-5)"},children:[A.jsx("div",{style:{height:`${g.getTotalSize()}px`,width:"100%",position:"relative"},children:g.getVirtualItems().map(t=>{const n=e[t.index],l=t.index,c=e[l-1],u=e[l+1],d=c&&rc(new Date(n.timestamp),new Date(c.timestamp))>15,f=c&&c.sender===n.sender&&rc(new Date(n.timestamp),new Date(c.timestamp))<5&&!d,h=u&&u.sender===n.sender&&rc(new Date(u.timestamp),new Date(n.timestamp))<5;return A.jsxs("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${t.start}px)`},children:[d&&A.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:A.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:y(n.timestamp)})}),A.jsx(tc,{message:n,primaryColor:r,botAvatar:o,botName:i,styles:a,avatars:s,isFirst:!f,isLast:!h})]},t.key)})}),t&&A.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[A.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:A.jsxs("div",{className:"flex gap-[2px]",children:[A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),A.jsx(nc,{})]})]}):A.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto scroll-smooth p-4 bg-background/50 scrollbar-none",children:[A.jsxs("div",{className:"min-h-full flex flex-col justify-end",children:[0===e.length&&A.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-16 text-center animate-in fade-in zoom-in-95 duration-1000",children:[A.jsxs("div",{className:"relative h-24 w-24 mb-6",children:[A.jsx("div",{className:"absolute inset-0 bg-primary/20 rounded-full animate-pulse blur-2xl"}),A.jsx("div",{className:"relative h-full w-full rounded-[28px] border-2 border-primary/20 overflow-hidden bg-card shadow-soft-2xl transition-transform hover:scale-105 duration-500",children:f?A.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:p},children:"👋"}):o?A.jsx("img",{src:o,className:"object-cover h-full w-full",alt:i,onError:()=>h(!0)}):A.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:p},children:"👋"})})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx("h3",{className:"font-black text-xl text-foreground uppercase tracking-tighter italic",children:i}),A.jsxs("p",{className:"text-[12px] font-bold text-muted-foreground italic px-10 leading-relaxed opacity-60",children:['"',n,'"']})]})]}),A.jsx("div",{className:"flex flex-col",style:{gap:"var(--spacing-3)"},children:e.map((t,n)=>{const l=e[n-1],c=e[n+1],u=l&&rc(new Date(t.timestamp),new Date(l.timestamp))>15,d=l&&l.sender===t.sender&&rc(new Date(t.timestamp),new Date(l.timestamp))<5&&!u,f=c&&c.sender===t.sender&&rc(new Date(c.timestamp),new Date(t.timestamp))<5;return A.jsxs(S.Fragment,{children:[u&&A.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:A.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:y(t.timestamp)})}),A.jsx(tc,{message:t,primaryColor:r,botAvatar:o,botName:i,styles:a,avatars:s,isFirst:!d,isLast:!f})]},t.id||`msg-${n}`)})}),A.jsx("div",{ref:l,className:"h-6 shrink-0"})]}),t&&A.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[A.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:A.jsxs("div",{className:"flex gap-[2px]",children:[A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),A.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),A.jsx(nc,{})]})]}):A.jsx("div",{className:"flex-1 bg-background"})},(e,t)=>{if(e.messages.length!==t.messages.length)return!1;if(e.isTyping!==t.isTyping)return!1;if(e.primaryColor!==t.primaryColor)return!1;if(e.botName!==t.botName)return!1;if(e.logoUrl!==t.logoUrl)return!1;const n=e.messages[e.messages.length-1],r=t.messages[t.messages.length-1];return n?.id===r?.id}),sc={"image/jpeg":[255,216,255],"image/png":[137,80,78,71,13,10,26,10],"image/webp":[82,73,70,70],"image/gif":[71,73,70,56],"audio/mpeg":[255,251],"audio/wav":[82,73,70,70],"audio/webm":[26,69,223,163],"audio/ogg":[79,103,103,83]};async function lc(e,t={}){const{maxSizeMB:n=10,allowedExtensions:r,checkMagicBytes:o=!0}=t;if(!function(e,t=10){const n=1024*t*1024;return e.size<=n}(e,n))return{valid:!1,error:`El archivo es demasiado grande. Máximo ${n}MB`};if(r&&!function(e,t){const n=e.name.split(".").pop()?.toLowerCase();return!!n&&t.includes(n)}(e,r))return{valid:!1,error:`Extensión no permitida. Solo: ${r.join(", ")}`};if(o){const t=await async function(e){try{const t=sc[e.type];if(!t)return!0;const n=await e.slice(0,12).arrayBuffer(),r=new Uint8Array(n);return t.every((e,t)=>r[t]===e)}catch(t){return console.error("File validation error:",t),!1}}(e);if(!t)return{valid:!1,error:"El archivo está corrupto o no es del tipo indicado"}}return{valid:!0}}const cc=1e3,uc={enableImages:!0,enableAudio:!0,enableFiles:!0,enableLocation:!0,allowedFileTypes:["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],maxFileSizeMB:10};function dc({isConnected:e,placeholder:t="Escribe un mensaje...",primaryColor:n,mediaConfig:r,onSendMessage:o,onSendAttachment:i,onSendLocation:a,onVoiceCall:s}){const{t:l}=P(),[c,u]=k.useState(""),[d,f]=k.useState(!1),[h,p]=k.useState(!1),[m,g]=k.useState(0),[y,b]=k.useState(null),[v,w]=k.useState(!1),[x,S]=k.useState(!1),_=k.useRef(null),C=k.useRef(null),E=k.useRef(null),z=k.useRef(null),N=k.useRef([]),T=k.useRef(null),O=Ft({primaryColor:n}),I=k.useMemo(()=>({...uc,...r}),[r]),j=k.useMemo(()=>I.enableImages||I.enableAudio||I.enableFiles||I.enableLocation,[I]),M=()=>{const t=c.trim();y?(i?.(y.file,y.type),b(null),u("")):t&&e&&(o(t),u("")),_.current&&(_.current.style.height="40px")},F=async e=>{const t=e.target.files?.[0];if(!t)return;f(!1);const n=await lc(t,{maxSizeMB:I.maxFileSizeMB||10,allowedExtensions:I.allowedFileTypes||["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],checkMagicBytes:!0});if(n.valid)if(t.type.startsWith("image/")&&I.enableImages){w(!0);try{const{default:e}=await Promise.resolve().then(()=>Wy),n={maxSizeMB:.8,maxWidthOrHeight:1200,useWebWorker:!0},r=await e(t,n);b({type:"image",file:r,previewUrl:URL.createObjectURL(r)})}catch(r){Ht("Image compression failed:",r),b({type:"image",file:t,previewUrl:URL.createObjectURL(t)})}finally{w(!1)}}else b({type:"file",file:t,previewUrl:""});else alert(n.error||"Archivo no válido")},L=async e=>{if(z.current&&(e||(z.current.onstop=null),z.current.stop(),z.current.stream.getTracks().forEach(e=>e.stop())),T.current&&clearInterval(T.current),p(!1),g(0),e&&N.current.length>0){const e=new Blob(N.current,{type:"audio/webm"}),t=new File([e],`audio-${Date.now()}.webm`,{type:"audio/webm"}),n=await lc(t,{maxSizeMB:10});if(!n.valid)return Ht("Audio validation failed:",n.error),alert(n.error),void(N.current=[]);i?.(t,"audio"),N.current=[]}};return A.jsxs("div",{className:"relative",children:[(y||v)&&A.jsx("div",{className:"absolute bottom-full left-0 mb-2 p-2 rounded-2xl border shadow-soft-2xl animate-in slide-in-from-bottom-2 z-50",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:A.jsx("div",{className:"relative w-16 h-16",children:v?A.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl",children:A.jsx(J,{className:"animate-spin text-primary h-5 w-5"})}):"image"===y?.type?A.jsxs(A.Fragment,{children:[A.jsx("img",{src:y?.previewUrl,className:"w-full h-full object-cover rounded-xl border",alt:l("preview")}),A.jsx("button",{onClick:()=>b(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:A.jsx(de,{size:10,strokeWidth:3})})]}):A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl border",children:[A.jsx(Z,{className:"text-primary h-6 w-6"}),A.jsx("span",{className:"text-[8px] mt-1 font-bold truncate max-w-[60px]",children:y?.file.name})]}),A.jsx("button",{onClick:()=>b(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:A.jsx(de,{size:10,strokeWidth:3})})]})})}),A.jsx("input",{type:"file",accept:"image/*",className:"hidden",ref:E,onChange:F}),A.jsx("input",{type:"file",accept:I.allowedFileTypes?.map(e=>`.${e}`).join(","),className:"hidden",ref:C,onChange:F}),A.jsxs("div",{className:"flex items-center max-w-full",style:{gap:"var(--spacing-3)"},children:[j&&i&&A.jsxs("div",{className:"relative shrink-0",children:[d&&A.jsxs("div",{className:"absolute bottom-full left-0 flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300 z-[60]",style:{marginBottom:"var(--spacing-2)",gap:"var(--spacing-2)"},children:[I.enableImages&&A.jsxs("button",{onClick:()=>E.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[A.jsx(K,{size:18,className:"text-blue-500"})," ",l("fotos")]}),I.enableFiles&&A.jsxs("button",{onClick:()=>C.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[A.jsx(Z,{size:18,className:"text-purple-500"})," Archivos"]}),I.enableLocation&&a&&A.jsxs("button",{onClick:()=>{S(!0),navigator.geolocation.getCurrentPosition(e=>{a?.({latitude:e.coords.latitude,longitude:e.coords.longitude}),S(!1),f(!1)},()=>S(!1))},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[x?A.jsx(J,{size:18,className:"animate-spin"}):A.jsx(Y,{size:18,className:"text-emerald-500"})," ",l("ubicacion")]}),I.enableVoice&&s&&A.jsxs("button",{onClick:()=>{s?.(),f(!1)},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[A.jsx(re,{size:18,className:"text-amber-500"})," Llamar"]})]}),A.jsx("button",{onClick:()=>f(!d),className:At("h-10 w-10 rounded-full flex items-center justify-center transition-all shadow-sm z-10",d?"bg-muted text-foreground rotate-45":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:A.jsx(ie,{size:22,strokeWidth:2.5})})]}),A.jsx("div",{className:At("flex-1 relative flex items-center min-w-0 rounded-[24px] border px-4 transition-all shadow-inner",h?"h-[44px]":"min-h-[40px] max-h-[120px]"),style:{backgroundColor:h?"hsl(var(--destructive) / 0.05)":"hsl(var(--muted))",borderColor:h?"hsl(var(--destructive))":"hsl(var(--border))"},children:h?A.jsxs("div",{className:"flex items-center w-full animate-in zoom-in-95",style:{gap:"var(--spacing-4)"},children:[A.jsx("button",{onClick:()=>L(!1),className:"text-destructive/50 hover:text-destructive",children:A.jsx(ce,{size:18})}),A.jsxs("div",{className:"flex-1 flex items-center",style:{gap:"var(--spacing-2)"},children:[A.jsx("div",{className:"flex gap-[3px]",children:[1,2,3,4].map(e=>A.jsx("span",{className:"w-[3px] h-3 bg-destructive/60 rounded-full animate-pulse",style:{animationDelay:.15*e+"s"}},e))}),A.jsxs("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(m/60),":",(m%60).toString().padStart(2,"0")]})]}),A.jsx("button",{onClick:()=>L(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:A.jsx(se,{size:12,fill:"currentColor"})})]}):A.jsxs("div",{className:"w-full relative flex items-center",children:[A.jsx("textarea",{ref:_,rows:1,value:c,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey?"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),M()):(e.preventDefault(),M())},onChange:e=>{const t=e.target.value.slice(0,cc);u(t),_.current&&(_.current.style.height="40px",_.current.style.height=`${Math.min(_.current.scrollHeight,120)}px`)},onFocus:()=>f(!1),placeholder:t,"aria-label":l("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":c.length>cc,disabled:!e,className:"w-full bg-transparent text-sm py-2.5 outline-none resize-none overflow-hidden leading-tight pr-8 scrollbar-none disabled:opacity-50",style:{scrollbarWidth:"none",msOverflowStyle:"none",color:"hsl(var(--foreground))"}}),A.jsx("span",{id:"send-message-hint",className:"sr-only",children:l("accessibility.sendMessageHint")}),c.length>800&&A.jsx("span",{className:At("absolute right-0 text-[9px] font-bold tabular-nums",c.length>=cc?"text-destructive":"text-muted-foreground/40"),children:cc-c.length})]})}),!h&&A.jsx(A.Fragment,{children:c.trim()||y?A.jsx("button",{onClick:M,disabled:!e||v&&!!y,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:O},children:A.jsx(se,{size:18,className:"text-white ml-0.5 fill-current"})}):I.enableAudio&&i?A.jsx("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);z.current=t,N.current=[],t.ondataavailable=e=>N.current.push(e.data),t.onstop=()=>{const e=new File([new Blob(N.current)],"voice.webm",{type:"audio/webm"});i?.(e,"audio")},t.start(),p(!0),T.current=setInterval(()=>g(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:O},children:A.jsx(ee,{size:20,strokeWidth:2.5,className:"text-white"})}):A.jsx("button",{onClick:M,disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:O},children:A.jsx(se,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function fc(e,t){let n=0,r=null;return function(...o){const i=Date.now(),a=i-n,s=()=>{n=i,e(...o)};a>=t?(r&&(clearTimeout(r),r=null),s()):r||(r=setTimeout(()=>{s(),r=null},t-a))}}function hc(e=640){const[t,n]=k.useState(()=>"undefined"!=typeof window&&window.innerWidth<e);return k.useEffect(()=>{const t=fc(()=>{n(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const pc="24px";const mc=["¡Hola! Gracias por llamar. ¿En qué puedo ayudarte hoy?","Entendido. Déjame revisar esa información para ti.","Claro, puedo ayudarte con eso. ¿Necesitas algo más?","Perfecto. Tu solicitud ha sido registrada.","No hay problema. ¿Tienes alguna otra consulta?"];function gc({isOpen:e,onClose:t,primaryColor:n="#10b981"}){const[r,o]=k.useState("idle"),[i,a]=k.useState(0),[s,l]=k.useState(0),[c,u]=k.useState(null),[d,f]=k.useState([.15,.15,.15,.15,.15,.15,.15]),[h,p]=k.useState(""),[m,g]=k.useState(0),[y,b]=k.useState(!1),v=k.useRef(null),w=k.useRef(null),x=k.useRef(null),S=k.useRef(null),_=k.useRef(null),C=k.useRef(null),E=k.useRef(0),z=k.useCallback(()=>{const e=mc[m%mc.length];p(e),g(e=>e+1),o("speaking"),b(!1);const t=Math.max(2500,60*e.length);C.current=setTimeout(()=>{o("listening"),p(""),E.current=0},t)},[m]),N=k.useCallback(async()=>{try{o("connecting"),u(null);const e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}});v.current=e;const t=new(window.AudioContext||window.webkitAudioContext);w.current=t,"suspended"===t.state&&await t.resume();const n=t.createAnalyser();n.fftSize=256,n.smoothingTimeConstant=.3,x.current=n;t.createMediaStreamSource(e).connect(n);const r=new Uint8Array(n.frequencyBinCount),i=7,s=()=>{if(!x.current)return;x.current.getByteTimeDomainData(r);let e=0;for(let i=0;i<r.length;i++){const t=(r[i]-128)/128;e+=t*t}const t=Math.sqrt(e/r.length),n=Math.min(15*t,1);l(n);const o=Array.from({length:i},(e,t)=>{const r=Math.abs(t-Math.floor(i/2)),o=.05+.1*Math.random(),a=n*(1-.12*r);return Math.max(.12,Math.min(1,a+o))});f(o),S.current=requestAnimationFrame(s)};s(),_.current=setInterval(()=>{a(e=>e+1)},1e3),o("speaking"),p(mc[0]),g(1),C.current=setTimeout(()=>{o("listening"),p("")},3500)}catch(e){console.error("[VoiceCallDemo] Microphone error:",e),u("No se pudo acceder al micrófono"),o("idle")}},[]);k.useEffect(()=>{if("listening"===r){if(s>.08)b(!0),E.current=0;else if(y&&s<.05)if(0===E.current)E.current=Date.now();else{(Date.now()-E.current)/1e3>=1&&z()}}else E.current=0},[s,r,y,z]);const T=k.useCallback(()=>{S.current&&(cancelAnimationFrame(S.current),S.current=null),_.current&&(clearInterval(_.current),_.current=null),C.current&&(clearTimeout(C.current),C.current=null),v.current&&(v.current.getTracks().forEach(e=>e.stop()),v.current=null),w.current&&(w.current.close(),w.current=null),x.current=null,l(0),a(0),f([.15,.15,.15,.15,.15,.15,.15]),o("idle"),p(""),b(!1),E.current=0},[]),O=k.useCallback(()=>{if(!v.current)return;const e=v.current.getAudioTracks()[0];e&&(e.enabled=!e.enabled,o(e.enabled?"listening":"muted"))},[]),I=k.useCallback(()=>{T(),t()},[T,t]);if(k.useEffect(()=>(e&&"idle"===r&&N(),()=>{e||T()}),[e,r,N,T]),k.useEffect(()=>()=>{T()},[T]),!e)return null;const j=Array.from({length:7},(e,t)=>{const n=(Date.now()/120+.6*t)%(2*Math.PI);return.25+.5*Math.sin(n)});return A.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-2xl overflow-hidden",style:{background:"hsl(var(--background) / 0.98)",backdropFilter:"blur(10px)"},children:[A.jsxs("div",{className:"absolute top-0 left-0 right-0 flex items-center justify-between p-4 border-b border-border/50",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(re,{className:"h-4 w-4",style:{color:n}}),A.jsx("span",{className:"text-sm font-medium",children:"Llamada"})]}),A.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:(e=>{const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`})(i)})]}),A.jsxs("div",{className:"flex flex-col items-center gap-5 px-4",children:[A.jsxs("div",{className:At("h-20 w-20 rounded-full flex items-center justify-center transition-all duration-150","connecting"===r&&"animate-pulse"),style:{backgroundColor:"muted"===r?"hsl(var(--muted))":"speaking"===r?"#3b82f620":`${n}20`,boxShadow:"listening"===r?`0 0 ${15+35*s}px ${n}50`:"speaking"===r?"0 0 25px #3b82f650":"none",transform:"listening"===r?`scale(${1+.08*s})`:"scale(1)"},children:["connecting"===r&&A.jsx(re,{className:"h-8 w-8 animate-bounce",style:{color:n}}),"listening"===r&&A.jsx(ee,{className:"h-8 w-8",style:{color:n}}),"muted"===r&&A.jsx(X,{className:"h-8 w-8 text-muted-foreground"}),"speaking"===r&&A.jsx(ue,{className:"h-8 w-8 text-blue-500"})]}),("listening"===r||"muted"===r||"speaking"===r)&&A.jsx("div",{className:"flex items-center gap-1.5 h-12",children:("speaking"===r?j:d).map((e,t)=>A.jsx("div",{className:"w-2 rounded-full",style:{height:`${Math.max(5,45*e)}px`,backgroundColor:"muted"===r?"hsl(var(--muted-foreground))":"speaking"===r?"#3b82f6":n,opacity:"muted"===r?.3:.85,transition:"height 60ms ease-out"}},t))}),"speaking"===r&&h&&A.jsx("div",{className:"max-w-[280px] p-3 rounded-xl text-center text-sm leading-relaxed",style:{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--foreground))"},children:h}),c&&A.jsx("p",{className:"text-sm text-red-500 text-center px-4",children:c})]}),A.jsxs("div",{className:"absolute bottom-6 flex items-center gap-4",children:[A.jsx("button",{type:"button",onClick:O,disabled:"connecting"===r||"speaking"===r,className:At("h-12 w-12 rounded-full flex items-center justify-center","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2","disabled:opacity-50","muted"===r?"bg-amber-500 hover:bg-amber-600 text-white focus:ring-amber-500":"bg-muted hover:bg-muted/80 text-foreground focus:ring-primary"),"aria-label":"muted"===r?"Activar micrófono":"Silenciar",children:"muted"===r?A.jsx(X,{className:"h-5 w-5"}):A.jsx(ee,{className:"h-5 w-5"})}),A.jsx("button",{type:"button",onClick:I,className:At("h-14 w-14 rounded-full flex items-center justify-center","bg-red-500 hover:bg-red-600 text-white","shadow-lg transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2","active:scale-95"),"aria-label":"Terminar llamada",children:A.jsx(ne,{className:"h-6 w-6"})})]})]})}function yc({isOpen:e,isConnected:t,isTyping:n,messages:r,botName:o="Mar",logoUrl:i,welcomeMessage:a,inputPlaceholder:s,primaryColor:l,mediaConfig:c,onClose:u,onSendMessage:d,bubbleStyles:f,avatars:h,onSendAttachment:p,onSendLocation:m,onVoiceCall:g,theme:y}){const[b,v]=k.useState(!1),[w,x]=k.useState(!1),{t:S}=P(),_=hc(),C=Ft({primaryColor:l}),E=function({isOpen:e,height:t,bottom:n}){const r=hc(),[o,i]=k.useState({}),a=k.useCallback(()=>{if(r){const e=()=>{window.visualViewport?i({height:`${window.visualViewport.height}px`,width:"100%",top:`${window.visualViewport.offsetTop}px`,left:"0px",bottom:"auto",right:"auto",transform:"none"}):i({height:"100dvh",width:"100%",top:"0px",left:"0px"})};return e(),window.visualViewport?.addEventListener("resize",e),window.visualViewport?.addEventListener("scroll",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.visualViewport?.removeEventListener("scroll",e)}}{const e=parseFloat(n||pc)||24,r=window.innerHeight-64-e;if(t){const e=parseFloat(t)||700,o=Math.min(e,r);i({height:`${o}px`,maxHeight:`${r}px`,bottom:n||pc})}else{const e=Math.min(700,Math.max(500,r));i({height:`${e}px`,maxHeight:`${r}px`,bottom:n||pc})}}},[r,t,n]);return k.useEffect(()=>{if(!e)return;const t=a();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),t&&t()}},[e,a]),o}({isOpen:e,height:y?.height,bottom:y?.bottom}),z=function({enabled:e,returnFocusRef:t,onEscape:n}){const r=k.useRef(null),o=k.useRef(null);return k.useEffect(()=>{if(!e)return;o.current=document.activeElement;const i=t?.current,a=r.current;if(!a)return;const s=setTimeout(()=>{const e=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():a.focus()},100),l=e=>{if(a)if("Escape"!==e.key){if("Tab"===e.key){const t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus())}}else n?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(s),document.removeEventListener("keydown",l);const e=i||o.current;e&&"function"==typeof e.focus&&e.focus()}},[e,n,t]),r}({enabled:e,onEscape:u});if(k.useEffect(()=>{if(e)return _&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width=""}},[e,_]),!e)return null;const N="bottom-left"===y?.position;return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:"chat-window-description",className:"sr-only",children:S("accessibility.dialogDescription")}),A.jsxs("div",{ref:z,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:At("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!_&&["fixed",N?"left-6":"right-6","w-[350px] min-w-[350px] max-w-[350px]","rounded-[32px] border shadow-soft-2xl","animate-in fade-in zoom-in-95","slide-in-from-bottom-10"],_&&["fixed inset-0 w-full"]),style:{...E,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[A.jsx("header",{className:"relative shrink-0 border-b z-20",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--background) / 0.9)",borderColor:"hsl(var(--border))",backdropFilter:"blur(24px)"},children:A.jsxs("div",{className:"flex items-center justify-between",children:[A.jsxs("div",{className:"flex items-center gap-3",children:[A.jsxs("div",{className:"relative",children:[A.jsx("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:b?A.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:A.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}):A.jsx("img",{src:i||Zt,alt:o,className:"h-full w-full object-cover",onError:()=>v(!0)})}),A.jsx("div",{className:At("absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full border-2 border-background",t?"bg-emerald-500":"bg-amber-500 animate-pulse")})]}),A.jsxs("div",{className:"flex flex-col",children:[A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx("span",{id:"chat-window-title",className:"font-black text-xs uppercase tracking-tight text-foreground",children:o}),A.jsx(le,{className:"h-3 w-3 text-primary fill-primary/10"})]}),A.jsxs("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[A.jsx("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),A.jsx("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:S(t?"online":"offline")})]})]})]}),A.jsxs("div",{className:"flex items-center gap-2",children:[g&&A.jsx("button",{onClick:()=>x(!0),"aria-label":"Iniciar llamada de voz",title:"Llamar",className:"h-8 w-8 flex items-center justify-center rounded-full bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-600 transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2",children:A.jsx(re,{className:"h-4 w-4","aria-hidden":"true"})}),A.jsx("button",{onClick:u,"aria-label":S("accessibility.closeChat"),title:"Esc",className:"h-8 w-8 flex items-center justify-center rounded-full bg-muted/60 hover:bg-muted text-foreground transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:A.jsx(de,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),A.jsxs("main",{role:"region","aria-label":S("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[A.jsx(ac,{messages:r,isTyping:n,welcomeMessage:a,primaryColor:l,logoUrl:i,botName:o,bubbleStyles:f,avatars:h}),A.jsx("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),A.jsxs("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:_?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[A.jsx(dc,{isConnected:t,placeholder:s,primaryColor:C,mediaConfig:c,onSendMessage:d,onSendAttachment:p,onSendLocation:m,onVoiceCall:g}),A.jsxs("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[A.jsx(Q,{className:"h-2 w-2 text-primary fill-primary"}),A.jsx("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:S("con_amor_paseo_libre")})]})]}),A.jsx(gc,{isOpen:w,onClose:()=>x(!1),primaryColor:C})]})]})}class bc extends k.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){Ht("ErrorBoundary caught error:",e,t),this.props.onError?.(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:A.jsxs("div",{className:"flex flex-col items-center justify-center p-8 bg-background text-center",children:[A.jsx("div",{className:"text-6xl mb-4",children:"⚠️"}),A.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Algo salió mal"}),A.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-md",children:this.state.error?.message||"Ocurrió un error inesperado"}),A.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const vc={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},wc={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},xc={text:"text-primary-foreground"};function kc(e,t){const n=function(){const[e,t]=k.useState(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return k.useEffect(()=>{const e=window.matchMedia("(prefers-contrast: high)"),n=window.matchMedia("(prefers-contrast: more)"),r=e=>{t(e.matches)};return e.addEventListener("change",r),n.addEventListener("change",r),()=>{e.removeEventListener("change",r),n.removeEventListener("change",r)}},[]),e}(),r=k.useMemo(()=>{const r=function(e,t){const n={...Nt,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||Tt,botName:e?.botName||t?.botName||Ot,logoUrl:e?.logoUrl||t?.logoUrl||It,position:e?.position||t?.position||jt,welcomeMessage:e?.welcomeMessage||t?.welcomeMessage||Mt,inputPlaceholder:e?.inputPlaceholder||t?.inputPlaceholder||Pt,cssVariables:n}}(e,t);return n?{...r,primaryColor:"#000000",cssVariables:{...r.cssVariables,background:"#FFFFFF",foreground:"#000000",card:"#FFFFFF",cardForeground:"#000000",primary:"#000000",primaryForeground:"#FFFFFF",muted:"#F5F5F5",mutedForeground:"#000000",border:"#000000"}}:r},[e,t,n]),o=k.useMemo(()=>({radius:{...vc,...e?.bubbleStyles?.radius},bot:{...wc,...e?.bubbleStyles?.bot},user:{...xc,...e?.bubbleStyles?.user},launcher:{...e?.bubbleStyles?.launcher},mapCard:{...e?.bubbleStyles?.mapCard}}),[e?.bubbleStyles]);return{mergedTheme:r,mergedStyles:o,getContainerStyle:(e,t,n)=>({"--chat-primary":r.primaryColor,zIndex:e?2147483647:9999,position:"fixed",top:t&&e?0:"auto",left:t&&e?0:"bottom-left"===n?"24px":"auto",right:t&&e?0:"bottom-right"!==n&&n?"auto":"24px",bottom:t&&e?0:"100px",width:t&&e?"100%":"auto",height:t&&e?"100%":"auto"})}}const Sc=(e,t)=>t.some(t=>e instanceof t);let _c,Cc;const Ec=new WeakMap,zc=new WeakMap,Ac=new WeakMap;let Nc={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Ec.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return jc(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Tc(e){Nc=e(Nc)}function Oc(e){return(Cc||(Cc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Mc(this),t),jc(this.request)}:function(...t){return jc(e.apply(Mc(this),t))}}function Ic(e){return"function"==typeof e?Oc(e):(e instanceof IDBTransaction&&function(e){if(Ec.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});Ec.set(e,t)}(e),Sc(e,_c||(_c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Nc):e)}function jc(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(jc(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return Ac.set(t,e),t}(e);if(zc.has(e))return zc.get(e);const t=Ic(e);return t!==e&&(zc.set(e,t),Ac.set(t,e)),t}const Mc=e=>Ac.get(e);const Pc=["get","getKey","getAll","getAllKeys","count"],Fc=["put","add","delete","clear"],Lc=new Map;function Rc(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Lc.get(t))return Lc.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=Fc.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!Pc.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]};return Lc.set(t,i),i}Tc(e=>({...e,get:(t,n,r)=>Rc(t,n)||e.get(t,n,r),has:(t,n)=>!!Rc(t,n)||e.has(t,n)}));const Dc=["continue","continuePrimaryKey","advance"],Uc={},Bc=new WeakMap,$c=new WeakMap,Vc={get(e,t){if(!Dc.includes(t))return e[t];let n=Uc[t];return n||(n=Uc[t]=function(...e){Bc.set(this,$c.get(this)[t](...e))}),n}};async function*Hc(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,Vc);for($c.set(n,t),Ac.set(n,Mc(t));t;)yield n,t=await(Bc.get(n)||t.continue()),Bc.delete(n)}function Wc(e,t){return t===Symbol.asyncIterator&&Sc(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Sc(e,[IDBIndex,IDBObjectStore])}Tc(e=>({...e,get:(t,n,r)=>Wc(t,n)?Hc:e.get(t,n,r),has:(t,n)=>Wc(t,n)||e.has(t,n)}));const qc=new class{db=null;DB_NAME="botuyo-chat";DB_VERSION=1;async init(){try{this.db=await function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=jc(a);return r&&a.addEventListener("upgradeneeded",e=>{r(jc(a.result),e.oldVersion,e.newVersion,jc(a.transaction),e)}),n&&a.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(this.DB_NAME,this.DB_VERSION,{upgrade(e){if(!e.objectStoreNames.contains("messages")){e.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp")}e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata")}}),qt("IndexedDB initialized")}catch(e){throw Ht("Failed to initialize IndexedDB:",e),e}}async saveMessage(e){this.db||await this.init();try{await this.db.put("messages",e)}catch(t){Ht("Failed to save message:",t)}}async saveMessages(e){this.db||await this.init();try{const t=this.db.transaction("messages","readwrite");await Promise.all([...e.map(e=>t.store.put(e)),t.done])}catch(t){Ht("Failed to save messages:",t)}}async getMessages(e=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-e)}catch(t){return Ht("Failed to get messages:",t),[]}}async getMessage(e){this.db||await this.init();try{return await this.db.get("messages",e)}catch(t){return void Ht("Failed to get message:",t)}}async deleteMessage(e){this.db||await this.init();try{await this.db.delete("messages",e)}catch(t){Ht("Failed to delete message:",t)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),qt("Messages cleared from IndexedDB")}catch(e){Ht("Failed to clear messages:",e)}}async setMetadata(e){this.db||await this.init();try{await this.db.put("metadata",e,"chat-metadata")}catch(t){Ht("Failed to set metadata:",t)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(e){return Ht("Failed to get metadata:",e),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),qt("All data cleared from IndexedDB")}catch(e){Ht("Failed to clear all data:",e)}}async migrateFromLocalStorage(){try{const e="botuyo_chat_v1",t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(n.messages&&Array.isArray(n.messages)){const e=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}));await this.saveMessages(e),qt(`Migrated ${e.length} messages from localStorage`)}n.sessionId&&await this.setMetadata({sessionId:n.sessionId}),localStorage.removeItem(e),qt("Migration from localStorage completed")}catch(e){Ht("Failed to migrate from localStorage:",e)}}},Zc="botuyo_chat_v1",Qc={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function Kc(e,t){switch(t.type){case"TOGGLE_WINDOW":return{...e,isOpen:!e.isOpen};case"OPEN_WINDOW":return{...e,isOpen:!0};case"CLOSE_WINDOW":return{...e,isOpen:!1};case"SET_CONNECTED":return{...e,isConnected:t.payload};case"SET_TYPING":return{...e,isTyping:t.payload};case"ADD_MESSAGE":{if(e.messages.some(e=>e.id===t.payload.id))return e;const n=[...e.messages,t.payload],r="bot"===t.payload.sender;return{...e,messages:n,isTyping:!r&&e.isTyping}}case"SET_MESSAGES":return{...e,messages:[...t.payload]};case"SET_ERROR":return{...e,error:t.payload};case"SET_SESSION_ID":return{...e,sessionId:t.payload};case"CLEAR_CHAT":return{...Qc,isOpen:e.isOpen};case"RESTORE_SESSION":return{...e,...t.payload,isConnected:!1,isTyping:!1,error:null};default:return e}}function Jc(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=a.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function a(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class Yc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Gc extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Xc={};function eu(e){return Xc}function tu(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function nu(e,t){return"bigint"==typeof t?t.toString():t}function ru(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ou(e){return null==e}function iu(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const au=Symbol("evaluating");function su(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==au)return void 0===r&&(r=au,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function lu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function cu(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function uu(e){return JSON.stringify(e)}const du="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fu(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const hu=ru(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function pu(e){if(!1===fu(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==fu(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function mu(e){return pu(e)?{...e}:Array.isArray(e)?[...e]:e}const gu=new Set(["string","number","symbol"]);function yu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bu(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function vu(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const wu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function xu(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ku(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Su(e){return"string"==typeof e?e:e?.message}function _u(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Su(e.inst?._zod.def?.error?.(e))??Su(t?.error?.(e))??Su(n.customError?.(e))??Su(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Cu(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Eu(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const zu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,nu,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Au=Jc("$ZodError",zu),Nu=Jc("$ZodError",zu,{Parent:Error});const Tu=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Yc;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map(e=>_u(e,i,eu())));throw du(t,o?.callee),t}return a.value},Ou=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(o?.Err??e)(a.issues.map(e=>_u(e,i,eu())));throw du(t,o?.callee),t}return a.value},Iu=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Yc;return i.issues.length?{success:!1,error:new(e??Au)(i.issues.map(e=>_u(e,o,eu())))}:{success:!0,data:i.value}},ju=Iu(Nu),Mu=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>_u(e,o,eu())))}:{success:!0,data:i.value}},Pu=Mu(Nu),Fu=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Tu(e)(t,n,o)},Lu=e=>(t,n,r)=>Tu(e)(t,n,r),Ru=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ou(e)(t,n,o)},Du=e=>async(t,n,r)=>Ou(e)(t,n,r),Uu=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Iu(e)(t,n,o)},Bu=e=>(t,n,r)=>Iu(e)(t,n,r),$u=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mu(e)(t,n,o)},Vu=e=>async(t,n,r)=>Mu(e)(t,n,r),Hu=/^[cC][^\s-]{8,}$/,Wu=/^[0-9a-z]+$/,qu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zu=/^[0-9a-vA-V]{20}$/,Qu=/^[A-Za-z0-9]{27}$/,Ku=/^[a-zA-Z0-9_-]{21}$/,Ju=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Yu=/^([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})$/,Gu=e=>e?new 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)$/,Xu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ed=/^(?:(?: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])$/,td=/^(([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}|:))$/,nd=/^((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])$/,rd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,od=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,id=/^[A-Za-z0-9_-]*$/,ad=/^\+[1-9]\d{6,14}$/,sd="(?:(?:\\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])))",ld=new RegExp(`^${sd}$`);function cd(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ud=/^-?\d+$/,dd=/^-?\d+(?:\.\d+)?$/,fd=/^[^A-Z]*$/,hd=/^[^a-z]*$/,pd=Jc("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),md={number:"number",bigint:"bigint",object:"date"},gd=Jc("$ZodCheckLessThan",(e,t)=>{pd.init(e,t);const n=md[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),yd=Jc("$ZodCheckGreaterThan",(e,t)=>{pd.init(e,t);const n=md[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bd=Jc("$ZodCheckMultipleOf",(e,t)=>{pd.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),vd=Jc("$ZodCheckNumberFormat",(e,t)=>{pd.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=wu[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=ud)}),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),wd=Jc("$ZodCheckMaxLength",(e,t)=>{var n;pd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ou(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=Cu(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xd=Jc("$ZodCheckMinLength",(e,t)=>{var n;pd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ou(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=Cu(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kd=Jc("$ZodCheckLengthEquals",(e,t)=>{var n;pd.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ou(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=Cu(r),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Sd=Jc("$ZodCheckStringFormat",(e,t)=>{var n,r;pd.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),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=()=>{})}),_d=Jc("$ZodCheckRegex",(e,t)=>{Sd.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})}}),Cd=Jc("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fd),Sd.init(e,t)}),Ed=Jc("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hd),Sd.init(e,t)}),zd=Jc("$ZodCheckIncludes",(e,t)=>{pd.init(e,t);const n=yu(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),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})}}),Ad=Jc("$ZodCheckStartsWith",(e,t)=>{pd.init(e,t);const n=new RegExp(`^${yu(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Nd=Jc("$ZodCheckEndsWith",(e,t)=>{pd.init(e,t);const n=new RegExp(`.*${yu(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Td=Jc("$ZodCheckOverwrite",(e,t)=>{pd.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Od{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Id={major:4,minor:3,patch:6},jd=Jc("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Id;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=xu(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=i._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new Yc;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a;e.issues.length!==t&&(o||(o=xu(e,t)))});else{if(e.issues.length===t)continue;o||(o=xu(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(xu(n))return n.aborted=!0,n;const a=t(o,r,i);if(a instanceof Promise){if(!1===i.async)throw new Yc;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const a=e._zod.parse(o,i);if(a instanceof Promise){if(!1===i.async)throw new Yc;return a.then(e=>t(e,r,i))}return t(a,r,i)}}su(e,"~standard",()=>({validate:t=>{try{const n=ju(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Pu(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Md=Jc("$ZodString",(e,t)=>{var n;jd.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Pd=Jc("$ZodStringFormat",(e,t)=>{Sd.init(e,t),Md.init(e,t)}),Fd=Jc("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Yu),Pd.init(e,t)}),Ld=Jc("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gu(e))}else t.pattern??(t.pattern=Gu());Pd.init(e,t)}),Rd=Jc("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Xu),Pd.init(e,t)}),Dd=Jc("$ZodURL",(e,t)=>{Pd.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ud=Jc("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Pd.init(e,t)}),Bd=Jc("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ku),Pd.init(e,t)}),$d=Jc("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Hu),Pd.init(e,t)}),Vd=Jc("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Wu),Pd.init(e,t)}),Hd=Jc("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qu),Pd.init(e,t)}),Wd=Jc("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zu),Pd.init(e,t)}),qd=Jc("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Qu),Pd.init(e,t)}),Zd=Jc("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=cd({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${sd}T(?:${r})$`)}(t)),Pd.init(e,t)}),Qd=Jc("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ld),Pd.init(e,t)}),Kd=Jc("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${cd(t)}$`)),Pd.init(e,t)}),Jd=Jc("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ju),Pd.init(e,t)}),Yd=Jc("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ed),Pd.init(e,t),e._zod.bag.format="ipv4"}),Gd=Jc("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=td),Pd.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Xd=Jc("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nd),Pd.init(e,t)}),ef=Jc("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rd),Pd.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function tf(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const nf=Jc("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=od),Pd.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tf(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const rf=Jc("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=id),Pd.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!id.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tf(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),of=Jc("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ad),Pd.init(e,t)});const af=Jc("$ZodJWT",(e,t)=>{Pd.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),sf=Jc("$ZodNumber",(e,t)=>{jd.init(e,t),e._zod.pattern=e._zod.bag.pattern??dd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),lf=Jc("$ZodNumberFormat",(e,t)=>{vd.init(e,t),sf.init(e,t)}),cf=Jc("$ZodAny",(e,t)=>{jd.init(e,t),e._zod.parse=e=>e}),uf=Jc("$ZodUnknown",(e,t)=>{jd.init(e,t),e._zod.parse=e=>e}),df=Jc("$ZodNever",(e,t)=>{jd.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ff(e,t,n){e.issues.length&&t.issues.push(...ku(n,e.issues)),t.value[n]=e.value}const hf=Jc("$ZodArray",(e,t)=>{jd.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const a=o[e],s=t.element._zod.run({value:a,issues:[]},r);s instanceof Promise?i.push(s.then(t=>ff(t,n,e))):ff(s,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function pf(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...ku(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function mf(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function gf(e,t,n,r,o,i){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type,u="optional"===l.optout;for(const d in t){if(s.has(d))continue;if("never"===c){a.push(d);continue}const o=l.run({value:t[d],issues:[]},r);o instanceof Promise?e.push(o.then(e=>pf(e,n,d,t,u))):pf(o,n,d,t,u)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const yf=Jc("$ZodObject",(e,t)=>{jd.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=ru(()=>mf(t));su(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=fu,i=t.catchall;let a;e._zod.parse=(t,n)=>{a??(a=r.value);const s=t.value;if(!o(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const l=[],c=a.shape;for(const e of a.keys){const r=c[e],o="optional"===r._zod.optout,i=r._zod.run({value:s[e],issues:[]},n);i instanceof Promise?l.push(i.then(n=>pf(n,t,e,s,o))):pf(i,t,e,s,o)}return i?gf(l,s,t,n,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),bf=Jc("$ZodObjectJIT",(e,t)=>{yf.init(e,t);const n=e._zod.parse,r=ru(()=>mf(t));let o;const i=fu,a=!Xc.jitless,s=a&&hu.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=r.value);const f=u.value;return i(f)?a&&s&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new Od(["shape","payload","ctx"]),n=r.value,o=e=>{const t=uu(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let a=0;for(const r of n.keys)i[r]="key_"+a++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],a=uu(r),s=e[r],l="optional"===s?._zod?.optout;t.write(`const ${n} = ${o(r)};`),l?t.write(`\n if (${n}.issues.length) {\n if (${a} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),u=o(u,d),l?gf([],f,u,d,c,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function vf(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!xu(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>_u(e,r,eu())))}),t)}const wf=Jc("$ZodUnion",(e,t)=>{jd.init(e,t),su(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),su(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),su(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),su(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>iu(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then(t=>vf(t,o,e,i)):vf(s,o,e,i)}}),xf=Jc("$ZodIntersection",(e,t)=>{jd.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>Sf(e,t,n)):Sf(e,o,i)}});function kf(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(pu(e)&&pu(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const i of r){const n=kf(e[i],t[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};o[i]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=kf(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Sf(e,t,n){const r=new Map;let o;for(const s of t.issues)if("unrecognized_keys"===s.code){o??(o=s);for(const e of s.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(s);for(const s of n.issues)if("unrecognized_keys"===s.code)for(const e of s.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(s);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),xu(e))return e;const a=kf(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const _f=Jc("$ZodEnum",(e,t)=>{jd.init(e,t);const n=tu(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>gu.has(typeof e)).map(e=>"string"==typeof e?yu(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Cf=Jc("$ZodTransform",(e,t)=>{jd.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Gc(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n))}if(o instanceof Promise)throw new Yc;return n.value=o,n}});function Ef(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const zf=Jc("$ZodOptional",(e,t)=>{jd.init(e,t),e._zod.optin="optional",e._zod.optout="optional",su(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),su(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${iu(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ef(t,e.value)):Ef(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Af=Jc("$ZodExactOptional",(e,t)=>{zf.init(e,t),su(e._zod,"values",()=>t.innerType._zod.values),su(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nf=Jc("$ZodNullable",(e,t)=>{jd.init(e,t),su(e._zod,"optin",()=>t.innerType._zod.optin),su(e._zod,"optout",()=>t.innerType._zod.optout),su(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${iu(e.source)}|null)$`):void 0}),su(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Tf=Jc("$ZodDefault",(e,t)=>{jd.init(e,t),e._zod.optin="optional",su(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Of(e,t)):Of(r,t)}});function Of(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const If=Jc("$ZodPrefault",(e,t)=>{jd.init(e,t),e._zod.optin="optional",su(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),jf=Jc("$ZodNonOptional",(e,t)=>{jd.init(e,t),su(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Mf(t,e)):Mf(o,e)}});function Mf(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Pf=Jc("$ZodCatch",(e,t)=>{jd.init(e,t),su(e._zod,"optin",()=>t.innerType._zod.optin),su(e._zod,"optout",()=>t.innerType._zod.optout),su(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>_u(e,n,eu()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>_u(e,n,eu()))},input:e.value}),e.issues=[]),e)}}),Ff=Jc("$ZodPipe",(e,t)=>{jd.init(e,t),su(e._zod,"values",()=>t.in._zod.values),su(e._zod,"optin",()=>t.in._zod.optin),su(e._zod,"optout",()=>t.out._zod.optout),su(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Lf(e,t.in,n)):Lf(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Lf(e,t.out,n)):Lf(r,t.out,n)}});function Lf(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Rf=Jc("$ZodReadonly",(e,t)=>{jd.init(e,t),su(e._zod,"propValues",()=>t.innerType._zod.propValues),su(e._zod,"values",()=>t.innerType._zod.values),su(e._zod,"optin",()=>t.innerType?._zod?.optin),su(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Df):Df(r)}});function Df(e){return e.value=Object.freeze(e.value),e}const Uf=Jc("$ZodCustom",(e,t)=>{pd.init(e,t),jd.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Bf(t,n,r,e));Bf(o,n,r,e)}});function Bf(e,t,n,r){if(!e){const 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(Eu(e))}}var $f;class Vf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const 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)}}($f=globalThis).__zod_globalRegistry??($f.__zod_globalRegistry=new Vf);const Hf=globalThis.__zod_globalRegistry;function Wf(e,t){return new e({type:"string",...vu(t)})}function qf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...vu(t)})}function Zf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...vu(t)})}function Qf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...vu(t)})}function Kf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...vu(t)})}function Jf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...vu(t)})}function Yf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...vu(t)})}function Gf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...vu(t)})}function Xf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...vu(t)})}function eh(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...vu(t)})}function th(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...vu(t)})}function nh(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...vu(t)})}function rh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...vu(t)})}function oh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...vu(t)})}function ih(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...vu(t)})}function ah(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...vu(t)})}function sh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...vu(t)})}function lh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...vu(t)})}function ch(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...vu(t)})}function uh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...vu(t)})}function dh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...vu(t)})}function fh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...vu(t)})}function hh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...vu(t)})}function ph(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...vu(t)})}function mh(e,t){return new e({type:"string",format:"date",check:"string_format",...vu(t)})}function gh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...vu(t)})}function yh(e,t){return new e({type:"string",format:"duration",check:"string_format",...vu(t)})}function bh(e,t){return new e({type:"number",checks:[],...vu(t)})}function vh(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...vu(t)})}function wh(e){return new e({type:"any"})}function xh(e){return new e({type:"unknown"})}function kh(e,t){return new e({type:"never",...vu(t)})}function Sh(e,t){return new gd({check:"less_than",...vu(t),value:e,inclusive:!1})}function _h(e,t){return new gd({check:"less_than",...vu(t),value:e,inclusive:!0})}function Ch(e,t){return new yd({check:"greater_than",...vu(t),value:e,inclusive:!1})}function Eh(e,t){return new yd({check:"greater_than",...vu(t),value:e,inclusive:!0})}function zh(e,t){return new bd({check:"multiple_of",...vu(t),value:e})}function Ah(e,t){return new wd({check:"max_length",...vu(t),maximum:e})}function Nh(e,t){return new xd({check:"min_length",...vu(t),minimum:e})}function Th(e,t){return new kd({check:"length_equals",...vu(t),length:e})}function Oh(e,t){return new _d({check:"string_format",format:"regex",...vu(t),pattern:e})}function Ih(e){return new Cd({check:"string_format",format:"lowercase",...vu(e)})}function jh(e){return new Ed({check:"string_format",format:"uppercase",...vu(e)})}function Mh(e,t){return new zd({check:"string_format",format:"includes",...vu(t),includes:e})}function Ph(e,t){return new Ad({check:"string_format",format:"starts_with",...vu(t),prefix:e})}function Fh(e,t){return new Nd({check:"string_format",format:"ends_with",...vu(t),suffix:e})}function Lh(e){return new Td({check:"overwrite",tx:e})}function Rh(e){return Lh(t=>t.normalize(e))}function Dh(){return Lh(e=>e.trim())}function Uh(){return Lh(e=>e.toLowerCase())}function Bh(){return Lh(e=>e.toUpperCase())}function $h(){return Lh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Vh(e,t,n){return new e({type:"array",element:t,...vu(n)})}function Hh(e,t,n){return new e({type:"custom",check:"custom",fn:t,...vu(n)})}function Wh(e){const t=qh(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Eu(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Eu(r))}},e(n.value,n)));return t}function qh(e,t){const n=new pd({check:"custom",...vu(t)});return n._zod.check=e,n}function Zh(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Hf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Qh(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i){i.count++;return n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema}const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{const n=a.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(a.ref||(a.ref=i),Qh(i,t,r),t.seen.get(i).isParent=!0)}const l=t.metadataRegistry.get(e);l&&Object.assign(a.schema,l),"input"===t.io&&Yh(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault;return t.seen.get(e).schema}function Kh(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const t=e.metadataRegistry.get(i[0])?.id;if(t){const e=r.get(t);if(e&&e!==i[0])throw new Error(`Duplicate schema id "${t}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(t,i[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const a=r.schema;for(const e in a)delete a[e];a.$ref=o};if("throw"===e.cycles)for(const i of e.seen.entries()){const e=i[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const n=i[1];if(t===i[0]){o(i);continue}if(e.external){const n=e.external.registry.get(i[0])?.id;if(t!==i[0]&&n){o(i);continue}}const r=e.metadataRegistry.get(i[0])?.id;r?o(i):(n.cycle||n.count>1&&"ref"===e.reused)&&o(i)}}function Jh(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},a=n.ref;if(n.ref=null,a){r(a);const n=e.seen.get(a),s=n.schema;!s.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,s):(o.allOf=o.allOf??[],o.allOf.push(s)),Object.assign(o,i);if(t._zod.parent===a)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(s.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const s=t._zod.parent;if(s&&s!==a){r(s);const t=e.seen.get(s);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const e=s[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Gh(t,"input",e.processors),output:Gh(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(a){throw new Error("Error converting schema to JSON.")}}function Yh(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Yh(r.element,n);if("set"===r.type)return Yh(r.valueType,n);if("lazy"===r.type)return Yh(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Yh(r.innerType,n);if("intersection"===r.type)return Yh(r.left,n)||Yh(r.right,n);if("record"===r.type||"map"===r.type)return Yh(r.keyType,n)||Yh(r.valueType,n);if("pipe"===r.type)return Yh(r.in,n)||Yh(r.out,n);if("object"===r.type){for(const e in r.shape)if(Yh(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Yh(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Yh(e,n))return!0;return!(!r.rest||!Yh(r.rest,n))}return!1}const Gh=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=Zh({...o??{},target:i,io:t,processors:n});return Qh(e,a),Kh(a,e),Jh(a,e)},Xh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ep=(e,t,n,r)=>{const o=e._zod.def;Qh(o.innerType,t,r);t.seen.get(e).ref=o.innerType},tp=Jc("ZodISODateTime",(e,t)=>{Zd.init(e,t),kp.init(e,t)});const np=Jc("ZodISODate",(e,t)=>{Qd.init(e,t),kp.init(e,t)});const rp=Jc("ZodISOTime",(e,t)=>{Kd.init(e,t),kp.init(e,t)});const op=Jc("ZodISODuration",(e,t)=>{Jd.init(e,t),kp.init(e,t)});const ip=Jc("ZodError",(e,t)=>{Au.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nu,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nu,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),ap=Tu(ip),sp=Ou(ip),lp=Iu(ip),cp=Mu(ip),up=Fu(ip),dp=Lu(ip),fp=Ru(ip),hp=Du(ip),pp=Uu(ip),mp=Bu(ip),gp=$u(ip),yp=Vu(ip),bp=Jc("ZodType",(e,t)=>(jd.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Gh(e,"input"),output:Gh(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Zh({...n,processors:t});return Qh(e,r),Kh(r,e),Jh(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(cu(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>bu(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ap(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lp(e,t,n),e.parseAsync=async(t,n)=>sp(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>cp(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>up(e,t,n),e.decode=(t,n)=>dp(e,t,n),e.encodeAsync=async(t,n)=>fp(e,t,n),e.decodeAsync=async(t,n)=>hp(e,t,n),e.safeEncode=(t,n)=>pp(e,t,n),e.safeDecode=(t,n)=>mp(e,t,n),e.safeEncodeAsync=async(t,n)=>gp(e,t,n),e.safeDecodeAsync=async(t,n)=>yp(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return Hh(mm,e,t)}(t,n)),e.superRefine=t=>e.check(Wh(t)),e.overwrite=t=>e.check(Lh(t)),e.optional=()=>om(e),e.exactOptional=()=>new im({type:"optional",innerType:e}),e.nullable=()=>sm(e),e.nullish=()=>om(sm(e)),e.nonoptional=t=>function(e,t){return new um({type:"nonoptional",innerType:e,...vu(t)})}(e,t),e.array=()=>{return Vh(Jp,e,t);var t},e.or=t=>{return new Gp({type:"union",options:[e,t],...vu(n)});var n},e.and=t=>new Xp({type:"intersection",left:e,right:t}),e.transform=t=>hm(e,new nm({type:"transform",transform:t})),e.default=t=>{return n=t,new lm({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():mu(n)}});var n},e.prefault=t=>{return n=t,new cm({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():mu(n)}});var n},e.catch=t=>{return new dm({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>hm(e,t),e.readonly=()=>new pm({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Hf.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Hf.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Hf.get(e);const n=e.clone();return Hf.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),vp=Jc("_ZodString",(e,t)=>{Md.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:a,patterns:s,contentEncoding:l}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),a&&(r.format=Xh[a]??a,""===r.format&&delete r.format,"time"===a&&delete r.format),l&&(r.contentEncoding=l),s&&s.size>0){const e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Oh(...t)),e.includes=(...t)=>e.check(Mh(...t)),e.startsWith=(...t)=>e.check(Ph(...t)),e.endsWith=(...t)=>e.check(Fh(...t)),e.min=(...t)=>e.check(Nh(...t)),e.max=(...t)=>e.check(Ah(...t)),e.length=(...t)=>e.check(Th(...t)),e.nonempty=(...t)=>e.check(Nh(1,...t)),e.lowercase=t=>e.check(Ih(t)),e.uppercase=t=>e.check(jh(t)),e.trim=()=>e.check(Dh()),e.normalize=(...t)=>e.check(Rh(...t)),e.toLowerCase=()=>e.check(Uh()),e.toUpperCase=()=>e.check(Bh()),e.slugify=()=>e.check($h())}),wp=Jc("ZodString",(e,t)=>{Md.init(e,t),vp.init(e,t),e.email=t=>e.check(qf(Sp,t)),e.url=t=>e.check(Gf(Ep,t)),e.jwt=t=>e.check(hh(Bp,t)),e.emoji=t=>e.check(Xf(zp,t)),e.guid=t=>e.check(Zf(_p,t)),e.uuid=t=>e.check(Qf(Cp,t)),e.uuidv4=t=>e.check(Kf(Cp,t)),e.uuidv6=t=>e.check(Jf(Cp,t)),e.uuidv7=t=>e.check(Yf(Cp,t)),e.nanoid=t=>e.check(eh(Ap,t)),e.guid=t=>e.check(Zf(_p,t)),e.cuid=t=>e.check(th(Np,t)),e.cuid2=t=>e.check(nh(Tp,t)),e.ulid=t=>e.check(rh(Op,t)),e.base64=t=>e.check(uh(Rp,t)),e.base64url=t=>e.check(dh(Dp,t)),e.xid=t=>e.check(oh(Ip,t)),e.ksuid=t=>e.check(ih(jp,t)),e.ipv4=t=>e.check(ah(Mp,t)),e.ipv6=t=>e.check(sh(Pp,t)),e.cidrv4=t=>e.check(lh(Fp,t)),e.cidrv6=t=>e.check(ch(Lp,t)),e.e164=t=>e.check(fh(Up,t)),e.datetime=t=>e.check(function(e){return ph(tp,e)}(t)),e.date=t=>e.check(function(e){return mh(np,e)}(t)),e.time=t=>e.check(function(e){return gh(rp,e)}(t)),e.duration=t=>e.check(function(e){return yh(op,e)}(t))});function xp(e){return Wf(wp,e)}const kp=Jc("ZodStringFormat",(e,t)=>{Pd.init(e,t),vp.init(e,t)}),Sp=Jc("ZodEmail",(e,t)=>{Rd.init(e,t),kp.init(e,t)}),_p=Jc("ZodGUID",(e,t)=>{Fd.init(e,t),kp.init(e,t)}),Cp=Jc("ZodUUID",(e,t)=>{Ld.init(e,t),kp.init(e,t)}),Ep=Jc("ZodURL",(e,t)=>{Dd.init(e,t),kp.init(e,t)}),zp=Jc("ZodEmoji",(e,t)=>{Ud.init(e,t),kp.init(e,t)}),Ap=Jc("ZodNanoID",(e,t)=>{Bd.init(e,t),kp.init(e,t)}),Np=Jc("ZodCUID",(e,t)=>{$d.init(e,t),kp.init(e,t)}),Tp=Jc("ZodCUID2",(e,t)=>{Vd.init(e,t),kp.init(e,t)}),Op=Jc("ZodULID",(e,t)=>{Hd.init(e,t),kp.init(e,t)}),Ip=Jc("ZodXID",(e,t)=>{Wd.init(e,t),kp.init(e,t)}),jp=Jc("ZodKSUID",(e,t)=>{qd.init(e,t),kp.init(e,t)}),Mp=Jc("ZodIPv4",(e,t)=>{Yd.init(e,t),kp.init(e,t)}),Pp=Jc("ZodIPv6",(e,t)=>{Gd.init(e,t),kp.init(e,t)}),Fp=Jc("ZodCIDRv4",(e,t)=>{Xd.init(e,t),kp.init(e,t)}),Lp=Jc("ZodCIDRv6",(e,t)=>{ef.init(e,t),kp.init(e,t)}),Rp=Jc("ZodBase64",(e,t)=>{nf.init(e,t),kp.init(e,t)}),Dp=Jc("ZodBase64URL",(e,t)=>{rf.init(e,t),kp.init(e,t)}),Up=Jc("ZodE164",(e,t)=>{of.init(e,t),kp.init(e,t)}),Bp=Jc("ZodJWT",(e,t)=>{af.init(e,t),kp.init(e,t)}),$p=Jc("ZodNumber",(e,t)=>{sf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:a,multipleOf:s,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof a&&a.includes("int")?r.type="integer":r.type="number","number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c),"number"==typeof o&&(r.minimum=o,"number"==typeof c&&"draft-04"!==t.target&&(c>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l),"number"==typeof i&&(r.maximum=i,"number"==typeof l&&"draft-04"!==t.target&&(l<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof s&&(r.multipleOf=s)})(e,t,n),e.gt=(t,n)=>e.check(Ch(t,n)),e.gte=(t,n)=>e.check(Eh(t,n)),e.min=(t,n)=>e.check(Eh(t,n)),e.lt=(t,n)=>e.check(Sh(t,n)),e.lte=(t,n)=>e.check(_h(t,n)),e.max=(t,n)=>e.check(_h(t,n)),e.int=t=>e.check(Wp(t)),e.safe=t=>e.check(Wp(t)),e.positive=t=>e.check(Ch(0,t)),e.nonnegative=t=>e.check(Eh(0,t)),e.negative=t=>e.check(Sh(0,t)),e.nonpositive=t=>e.check(_h(0,t)),e.multipleOf=(t,n)=>e.check(zh(t,n)),e.step=(t,n)=>e.check(zh(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Vp(e){return bh($p,e)}const Hp=Jc("ZodNumberFormat",(e,t)=>{lf.init(e,t),$p.init(e,t)});function Wp(e){return vh(Hp,e)}const qp=Jc("ZodAny",(e,t)=>{cf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});const Zp=Jc("ZodUnknown",(e,t)=>{uf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Qp(){return xh(Zp)}const Kp=Jc("ZodNever",(e,t)=>{df.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});const Jp=Jc("ZodArray",(e,t)=>{hf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;"number"==typeof a&&(o.minItems=a),"number"==typeof s&&(o.maxItems=s),o.type="array",o.items=Qh(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Nh(t,n)),e.nonempty=t=>e.check(Nh(1,t)),e.max=(t,n)=>e.check(Ah(t,n)),e.length=(t,n)=>e.check(Th(t,n)),e.unwrap=()=>e.element});const Yp=Jc("ZodObject",(e,t)=>{bf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const c in a)o.properties[c]=Qh(a[c],t,{...r,path:[...r.path,"properties",c]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));l.size>0&&(o.required=Array.from(l)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Qh(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),su(e,"shape",()=>t.shape),e.keyof=()=>tm(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qp()}),e.strict=()=>{return e.clone({...e._zod.def,catchall:kh(Kp,t)});var t},e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!pu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=cu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return lu(this,"shape",n),n}});return bu(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!pu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=cu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return lu(this,"shape",n),n}});return bu(e,n)}(e,t),e.merge=t=>function(e,t){const n=cu(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return lu(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return bu(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return bu(e,cu(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return lu(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=cu(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return lu(this,"shape",r),r},checks:[]});return bu(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=cu(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return lu(this,"shape",o),o},checks:[]});return bu(t,o)}(rm,e,t[0]),e.required=(...t)=>function(e,t,n){const r=cu(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return lu(this,"shape",o),o}});return bu(t,r)}(um,e,t[0])});const Gp=Jc("ZodUnion",(e,t)=>{wf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,a=o.options.map((e,n)=>Qh(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=a:n.anyOf=a})(e,t,n,r),e.options=t.options});const Xp=Jc("ZodIntersection",(e,t)=>{xf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Qh(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=Qh(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l})(e,t,n,r)});const em=Jc("ZodEnum",(e,t)=>{_f.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=tu(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new em({...t,checks:[],...vu(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new em({...t,checks:[],...vu(r),entries:o})}});function tm(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new em({type:"enum",entries:n,...vu(t)})}const nm=Jc("ZodTransform",(e,t)=>{Cf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Gc(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Eu(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Eu(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const rm=Jc("ZodOptional",(e,t)=>{zf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ep(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function om(e){return new rm({type:"optional",innerType:e})}const im=Jc("ZodExactOptional",(e,t)=>{Af.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ep(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const am=Jc("ZodNullable",(e,t)=>{Nf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Qh(o.innerType,t,r),a=t.seen.get(e);"openapi-3.0"===t.target?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sm(e){return new am({type:"nullable",innerType:e})}const lm=Jc("ZodDefault",(e,t)=>{Tf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Qh(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const cm=Jc("ZodPrefault",(e,t)=>{If.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Qh(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const um=Jc("ZodNonOptional",(e,t)=>{jf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Qh(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const dm=Jc("ZodCatch",(e,t)=>{Pf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;Qh(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const fm=Jc("ZodPipe",(e,t)=>{Ff.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;Qh(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function hm(e,t){return new fm({type:"pipe",in:e,out:t})}const pm=Jc("ZodReadonly",(e,t)=>{Rf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Qh(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const mm=Jc("ZodCustom",(e,t)=>{Uf.init(e,t),bp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const gm=Object.create(null);gm.open="0",gm.close="1",gm.ping="2",gm.pong="3",gm.message="4",gm.upgrade="5",gm.noop="6";const ym=Object.create(null);Object.keys(gm).forEach(e=>{ym[gm[e]]=e});const bm={type:"error",data:"parser error"},vm="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),wm="function"==typeof ArrayBuffer,xm=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,km=({type:e,data:t},n,r)=>vm&&t instanceof Blob?n?r(t):Sm(t,r):wm&&(t instanceof ArrayBuffer||xm(t))?n?r(t):Sm(new Blob([t]),r):r(gm[e]+(t||"")),Sm=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function _m(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Cm;const Em="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zm="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let Zy=0;Zy<64;Zy++)zm[Em.charCodeAt(Zy)]=Zy;const Am="function"==typeof ArrayBuffer,Nm=(e,t)=>{if("string"!=typeof e)return{type:"message",data:Om(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:Tm(e.substring(1),t)};return ym[n]?e.length>1?{type:ym[n],data:e.substring(1)}:{type:ym[n]}:bm},Tm=(e,t)=>{if(Am){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=zm[e.charCodeAt(t)],r=zm[e.charCodeAt(t+1)],o=zm[e.charCodeAt(t+2)],i=zm[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return Om(n,t)}return{base64:!0,data:e}},Om=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Im=String.fromCharCode(30);function jm(){return new TransformStream({transform(e,t){!function(e,t){vm&&e.data instanceof Blob?e.data.arrayBuffer().then(_m).then(t):wm&&(e.data instanceof ArrayBuffer||xm(e.data))?t(_m(e.data)):km(e,!1,e=>{Cm||(Cm=new TextEncoder),t(Cm.encode(e))})}(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Mm;function Pm(e){return e.reduce((e,t)=>e+t.length,0)}function Fm(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Lm(e){if(e)return function(e){for(var t in Lm.prototype)e[t]=Lm.prototype[t];return e}(e)}Lm.prototype.on=Lm.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Lm.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Lm.prototype.off=Lm.prototype.removeListener=Lm.prototype.removeAllListeners=Lm.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},Lm.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},Lm.prototype.emitReserved=Lm.prototype.emit,Lm.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Lm.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Rm="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Dm="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function Um(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const Bm=Dm.setTimeout,$m=Dm.clearTimeout;function Vm(e,t){t.useNativeTimers?(e.setTimeoutFn=Bm.bind(Dm),e.clearTimeoutFn=$m.bind(Dm)):(e.setTimeoutFn=Dm.setTimeout.bind(Dm),e.clearTimeoutFn=Dm.clearTimeout.bind(Dm))}function Hm(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}function Wm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class qm extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Zm extends Lm{constructor(e){super(),this.writable=!1,Vm(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new qm(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Nm(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class Qm extends Zm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(Im),r=[];for(let o=0;o<n.length;o++){const e=Nm(n[o],t);if(r.push(e),"error"===e.type)break}return r})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((e,i)=>{km(e,!1,e=>{r[i]=e,++o===n&&t(r.join(Im))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Wm()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let Km=!1;try{Km="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(qy){}const Jm=Km;function Ym(){}class Gm extends Qm{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class Xm extends Lm{constructor(e,t,n){super(),this.createRequest=e,Vm(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=Um(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(gy){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(gy){}try{n.setRequestHeader("Accept","*/*")}catch(gy){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof n.status?n.status:0)},0))},n.send(this._data)}catch(gy){return void this.setTimeoutFn(()=>{this._onError(gy)},0)}"undefined"!=typeof document&&(this._index=Xm.requestsCount++,Xm.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=Ym,e)try{this._xhr.abort()}catch(gy){}"undefined"!=typeof document&&delete Xm.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Xm.requestsCount=0,Xm.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",eg);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Dm?"pagehide":"unload",eg,!1)}function eg(){for(let e in Xm.requests)Xm.requests.hasOwnProperty(e)&&Xm.requests[e].abort()}const tg=function(){const e=ng({xdomain:!1});return e&&null!==e.responseType}();function ng(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||Jm))return new XMLHttpRequest}catch(gy){}if(!t)try{return new(Dm[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(gy){}}const rg="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class og extends Zm{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=rg?{}:Um(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(qy){return this.emitReserved("error",qy)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;km(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch(gy){}r&&Rm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Wm()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const ig=Dm.WebSocket||Dm.MozWebSocket;const ag={websocket:class extends og{createSocket(e,t,n){return rg?new ig(e,t,n):t?new ig(e,t):new ig(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Zm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(qy){return this.emitReserved("error",qy)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){Mm||(Mm=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(0===r){if(Pm(n)<1)break;const e=Fm(n,1);i=!(128&~e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(Pm(n)<2)break;const e=Fm(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(Pm(n)<8)break;const e=Fm(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){s.enqueue(bm);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(Pm(n)<o)break;const e=Fm(n,o);s.enqueue(Nm(i?e:Mm.decode(e),t)),r=0}if(0===o||o>e){s.enqueue(bm);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=jm();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const o=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),o())}).catch(e=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&Rm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends Gm{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=tg&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Xm(ng,this.uri(),e)}}},sg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function cg(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=sg.exec(e||""),i={},a=14;for(;a--;)i[lg[a]]=o[a]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}(0,i.query),i}const ug="function"==typeof addEventListener&&"function"==typeof removeEventListener,dg=[];ug&&addEventListener("offline",()=>{dg.forEach(e=>e())},!1);class fg extends Lm{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const n=cg(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=cg(t.host).host);Vm(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}(this.opts.query)),ug&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},dg.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&fg.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",fg.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=Hm(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Rm(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(fg.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ug&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=dg.indexOf(this._offlineEventListener);-1!==e&&dg.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}fg.protocol=4;class hg extends fg{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;fg.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;fg.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let pg=class extends hg{constructor(e,t={}){const n="object"==typeof e?e:t;(!n.transports||n.transports&&"string"==typeof n.transports[0])&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(e=>ag[e]).filter(e=>!!e)),super(e,n)}};const mg="function"==typeof ArrayBuffer,gg=Object.prototype.toString,yg="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===gg.call(Blob),bg="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===gg.call(File);function vg(e){return mg&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||yg&&e instanceof Blob||bg&&e instanceof File}function wg(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(wg(e[t]))return!0;return!1}if(vg(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return wg(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&wg(e[n]))return!0;return!1}function xg(e){const t=[],n=e.data,r=e;return r.data=kg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function kg(e,t){if(!e)return e;if(vg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=kg(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=kg(e[r],t));return n}return e}function Sg(e,t){return e.data=_g(e.data,t),delete e.attachments,e}function _g(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=_g(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=_g(e[n],t));return e}const Cg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Eg,zg;(zg=Eg||(Eg={}))[zg.CONNECT=0]="CONNECT",zg[zg.DISCONNECT=1]="DISCONNECT",zg[zg.EVENT=2]="EVENT",zg[zg.ACK=3]="ACK",zg[zg.CONNECT_ERROR=4]="CONNECT_ERROR",zg[zg.BINARY_EVENT=5]="BINARY_EVENT",zg[zg.BINARY_ACK=6]="BINARY_ACK";class Ag extends Lm{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===Eg.BINARY_EVENT;n||t.type===Eg.BINARY_ACK?(t.type=n?Eg.EVENT:Eg.ACK,this.reconstructor=new Ng(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!vg(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===Eg[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Eg.BINARY_EVENT||n.type===Eg.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!Ag.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(gy){return!1}}static isPayloadValid(e,t){switch(e){case Eg.CONNECT:return Og(t);case Eg.DISCONNECT:return void 0===t;case Eg.CONNECT_ERROR:return"string"==typeof t||Og(t);case Eg.EVENT:case Eg.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Cg.indexOf(t[0]));case Eg.ACK:case Eg.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ng{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Sg(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Tg=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function Og(e){return"[object Object]"===Object.prototype.toString.call(e)}const Ig=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ag,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Eg.EVENT&&e.type!==Eg.ACK||!wg(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Eg.EVENT?Eg.BINARY_EVENT:Eg.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Eg.BINARY_EVENT&&e.type!==Eg.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=xg(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return Eg},isPacketValid:function(e){return"string"==typeof e.nsp&&(void 0===(t=e.id)||Tg(t))&&function(e,t){switch(e){case Eg.CONNECT:return void 0===t||Og(t);case Eg.DISCONNECT:return void 0===t;case Eg.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Cg.indexOf(t[0]));case Eg.ACK:return Array.isArray(t);case Eg.CONNECT_ERROR:return"string"==typeof t||Og(t);default:return!1}}(e.type,e.data);var t},protocol:5},Symbol.toStringTag,{value:"Module"}));function jg(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Mg=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Pg extends Lm{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[jg(e,"open",this.onopen.bind(this)),jg(e,"packet",this.onpacket.bind(this)),jg(e,"error",this.onerror.bind(this)),jg(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,o;if(Mg.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:Eg.EVENT,data:t,options:{}};if(i.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),i.id=e}const a=null===(r=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===r?void 0:r.writable,s=this.connected&&!(null===(o=this.io.engine)||void 0===o?void 0:o._hasPingExpired());return this.flags.volatile&&!a||(s?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},r),i=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{const o=(e,t)=>e?r(e):n(t);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>{this._queue[0];return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Eg.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Eg.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Eg.EVENT:case Eg.BINARY_EVENT:this.onevent(e);break;case Eg.ACK:case Eg.BINARY_ACK:this.onack(e);break;case Eg.DISCONNECT:this.ondisconnect();break;case Eg.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Eg.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Eg.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Fg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Fg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Fg.prototype.reset=function(){this.attempts=0},Fg.prototype.setMin=function(e){this.ms=e},Fg.prototype.setMax=function(e){this.max=e},Fg.prototype.setJitter=function(e){this.jitter=e};class Lg extends Lm{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,Vm(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Fg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Ig;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pg(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=jg(t,"open",function(){n.onopen(),e&&e()}),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=jg(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),o(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(jg(e,"ping",this.onping.bind(this)),jg(e,"data",this.ondata.bind(this)),jg(e,"error",this.onerror.bind(this)),jg(e,"close",this.onclose.bind(this)),jg(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(gy){this.onclose("parse error",gy)}}ondecoded(e){Rm(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Pg(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Rg={};function Dg(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=cg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=Rg[o]&&i in Rg[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new Lg(r,t):(Rg[o]||(Rg[o]=new Lg(r,t)),s=Rg[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}Object.assign(Dg,{Manager:Lg,Socket:Pg,io:Dg,connect:Dg});const Ug="chat_device_id";function Bg(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const $g=function(e,t){const n={type:"object",shape:e??{},...vu(t)};return new Yp(n)}({id:xp().optional(),type:tm(["text","image","audio","location","system"]).default("text"),content:xp().optional(),imageUrl:xp().url().optional(),audioUrl:xp().url().optional(),latitude:Vp().optional(),longitude:Vp().optional(),timestamp:xp().optional(),sender:tm(["bot","user","system"]).optional(),emotion:wh(qp).optional()});function Vg(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,userContext:o}=e,i=k.useRef(e);k.useEffect(()=>{i.current=e},[e]);const a=k.useRef(null),[s,l]=k.useState(!1),[c,u]=k.useState(!1),d=k.useRef(function(){try{const e=localStorage.getItem(Ug);if(e)return e;const t=Bg();return localStorage.setItem(Ug,t),t}catch{return Vt("localStorage not available, using session-only device ID"),Bg()}}()),f=k.useRef(r);k.useEffect(()=>{f.current=r},[r]);const h=k.useCallback(e=>{const t=$g.safeParse(e),n=t.success&&t.data.id?t.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,r=t.success&&t.data.sender?t.data.sender:"bot",o=t.success&&t.data.timestamp?new Date(t.data.timestamp):new Date,i=t.success?t.data:{type:"text"};switch(i.type){case"image":return{id:n,type:"image",sender:r,timestamp:o,imageUrl:i.imageUrl||i.content||"",altText:"Imagen enviada"};case"audio":return{id:n,type:"audio",sender:r,timestamp:o,content:i.audioUrl||i.content||""};case"location":return{id:n,type:"location",sender:r,timestamp:o,latitude:Number(i.latitude||0),longitude:Number(i.longitude||0),name:i.content||"Ubicación compartida"};case"system":return{id:n,type:"system",sender:"system",timestamp:o,content:String(i.content||"")};default:return{id:n,type:"text",sender:r,timestamp:o,content:String(i.content||"Sin contenido"),emotion:i.emotion}}},[]),p=k.useCallback(()=>{if(!t||!n)return;if(a.current?.connected)return;l(!0);const e=Dg(`${n}/webchat`,{auth:{apiKey:t,deviceId:d.current,token:o?.token,metadata:o?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});e.on("connect",()=>{l(!1),u(!0),i.current.onConnected(`temp-${Date.now()}`,void 0)}),e.on("disconnect",e=>{l(!1),u(!1),i.current.onDisconnected()}),e.on("connect_error",e=>{l(!1),i.current.onError(`Error de conexión: ${e.message}`)}),e.on("connection_ack",e=>{i.current.onConnected(e.sessionId,e.config)}),e.on("bot_message",e=>{try{i.current.onMessage(h(e))}catch(gy){Ht("ChatSocket Error processing bot_message:",gy)}}),e.on("chat_history",e=>{e.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{try{i.current.onMessage(h(e))}catch(gy){Wt("Error processing history message:",gy)}}),i.current.onEvent&&i.current.onEvent("history_loaded",e)}),e.on("bot_typing",e=>i.current.onTyping(e)),e.on("auth_success",e=>{i.current.onLogin&&i.current.onLogin(e),e.theme&&i.current.onThemeUpdate&&i.current.onThemeUpdate(e.theme)}),a.current=e},[t,n]),m=k.useCallback(()=>{a.current&&(a.current.disconnect(),a.current=null,u(!1))},[]),g=k.useRef(p);g.current=p,k.useEffect(()=>(g.current(),()=>{a.current&&(a.current.disconnect(),a.current=null)}),[]);const y=k.useRef([]),b=k.useRef([]),v=k.useCallback(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),w=k.useCallback(()=>{if(a.current?.connected)for(;y.current.length>0;){const e=y.current.shift();a.current.emit("user_message",e)}},[]);k.useEffect(()=>{c&&w()},[c,w]),k.useEffect(()=>{if(!c)return;const e=setInterval(()=>{const e=Date.now();b.current=b.current.filter(t=>e<t.nextRetryAt||(t.attempts>=t.maxAttempts?(i.current.onEvent?.("message_failed",{id:t.id,payload:t.payload}),Ht("Message failed after max retries:",t.id),!1):!a.current?.connected||(a.current.emit("user_message",t.payload,e=>{e?.success&&i.current.onEvent?.("message_sent",{id:t.id})}),t.attempts++,t.nextRetryAt=e+1e3*Math.pow(2,t.attempts),t.attempts<t.maxAttempts)))},500);return()=>clearInterval(e)},[c]);const x=k.useCallback((e,t="text")=>{const n=v(),r={...f.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:(new Date).toISOString(),deviceId:d.current},o={id:n,content:e.trim(),type:t,metadata:r};return a.current?.connected?(a.current.emit("user_message",o,e=>{!1!==e?.success&&e?i.current.onEvent?.("message_sent",{id:n}):(b.current.push({id:n,payload:o,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),i.current.onEvent?.("message_retry_queued",{id:n}))}),n):(y.current.push(o),i.current.onEvent?.("queued_message",{id:n,payload:o}),n)},[v]),S=k.useMemo(()=>fc(e=>{a.current?.emit("typing",e)},250),[]);return{isConnected:c,isConnecting:s,sendMessage:x,sendTyping:S,requestHistory:k.useCallback(()=>{a.current?.emit("request_history")},[]),reconnect:p,disconnect:m}}function Hg(e=!1){const t="undefined"!=typeof window?window.location.pathname:"",n=k.useMemo(()=>t,[t]),[r,o]=k.useState({});return k.useEffect(()=>{if(!e)return void o({});const t=setTimeout(()=>{const e=function(){if("undefined"==typeof window)return{};const e={};e.title=document.title,document.querySelectorAll("meta").forEach(t=>{const n=t.getAttribute("name"),r=t.getAttribute("property"),o=t.getAttribute("content");if(o){if(n)switch(n){case"description":e.description=o;break;case"keywords":e.keywords=o.split(",").map(e=>e.trim());break;case"author":e.author=o}if(r){if(r.startsWith("og:")){const t=r.replace("og:","og_");e[t]=o}if(r.startsWith("twitter:")){const t=r.replace("twitter:","twitter_");e[t]=o}}}});try{const t=document.querySelectorAll('script[type="application/ld+json"]');if(t.length>0){const n=[];t.forEach(e=>{try{const t=JSON.parse(e.textContent||"");n.push(t)}catch{}}),n.length>0&&(e.structuredData=n)}}catch{}return e}();o(e)},100);return()=>clearTimeout(t)},[n,e]),e&&Object.keys(r).length>0?r:void 0}class Wg{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(e,t){this.endpoint=e,this.apiKey=t,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(e){this.track("message_sent",{type:e})}trackMessageReceived(e,t){this.track("message_received",{type:e,latency:t})}trackError(e,t){this.track("error",{error:e,context:t})}trackConnectionStatus(e){this.track("connection_status",{isConnected:e})}trackFeatureUsed(e){this.track("feature_used",{feature:e})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(e,t){this.track("attachment_sent",{type:e,size:t})}track(e,t){this.isDisabled||(this.queue.push({event:e,properties:{...t,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),Vt("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const e=[...this.queue];this.queue=[];try{const t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:e}),keepalive:!0});t.ok?Wt(`Analytics: Flushed ${e.length} events`):(this.isDisabled=!0,this.queue=[],Wt(`Analytics disabled: endpoint returned ${t.status}`))}catch(t){this.isDisabled=!0,this.queue=[],Wt("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let qg=null,Zg=null;function Qg(e){qg=e}function Kg(e){Zg=e}const Jg=k.createContext(null);const Yg=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)});function Gg(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o=!1,theme:i,userContext:a,onLogin:s,onNavigate:l,onEvent:c,onStateChange:u,onThemeUpdate:d}=e,[f,h]=k.useState(0),p=k.useRef(0),{t:m}=P(),g=function(e,t,n=!0){const r=k.useRef(null);return k.useEffect(()=>{if(!n||!e||!t)return;const o=`${e}/analytics`;r.current=new Wg(o,t);const i=()=>r.current?.flush(),a=()=>{"hidden"===document.visibilityState&&r.current?.flush()};return window.addEventListener("beforeunload",i),window.addEventListener("visibilitychange",a),()=>{window.removeEventListener("beforeunload",i),window.removeEventListener("visibilitychange",a),r.current?.destroy()}},[e,t,n]),{trackOpen:k.useCallback(()=>{r.current?.trackOpen()},[]),trackClose:k.useCallback(()=>{r.current?.trackClose()},[]),trackMessageSent:k.useCallback(e=>{r.current?.trackMessageSent(e)},[]),trackMessageReceived:k.useCallback((e,t)=>{r.current?.trackMessageReceived(e,t)},[]),trackError:k.useCallback((e,t)=>{r.current?.trackError(e,t)},[]),trackConnectionStatus:k.useCallback(e=>{r.current?.trackConnectionStatus(e)},[]),trackFeatureUsed:k.useCallback(e=>{r.current?.trackFeatureUsed(e)},[])}}(n,t,!0),y=function({enabled:e=!0,soundEnabled:t=!0,desktopEnabled:n=!0,botName:r="Asistente",logoUrl:o,notificationSoundUrl:i}={}){const[a,s]=k.useState("default"),l=k.useRef(null),c=o||Zt,u=i||Qt;k.useEffect(()=>{t&&"undefined"!=typeof window&&(l.current=new Audio(u),l.current.volume=.3)},[t,u]),k.useEffect(()=>{"undefined"!=typeof window&&"Notification"in window&&s(Notification.permission)},[]);const d=k.useCallback(async()=>{if("undefined"==typeof window||!("Notification"in window))return Vt("Notifications API not available"),!1;try{const e=await Notification.requestPermission();return s(e),qt("Notification permission:",e),"granted"===e}catch(e){return Ht("Error requesting notification permission:",e),!1}},[]),f=k.useCallback(t=>{if(e&&n&&"granted"===a&&("undefined"==typeof document||!document.hasFocus()))try{const e=`Nuevo mensaje de ${r}`;let n="Mensaje recibido";"text"===t.type&&"content"in t?n=t.content?.slice(0,100)||"Mensaje recibido":"image"===t.type?n="📷 Imagen":"audio"===t.type?n="🎵 Audio":"location"===t.type&&(n="📍 Ubicación");const o=new Notification(e,{body:n,icon:c,tag:"chat-message",requireInteraction:!1,silent:!1});o.onclick=()=>{window.focus(),o.close()},setTimeout(()=>o.close(),5e3)}catch(o){Ht("Error showing notification:",o)}},[e,n,a,r,c]),h=k.useCallback(()=>{if(e&&t&&("undefined"==typeof document||!document.hasFocus()))try{l.current?.play().catch(e=>{Wt("Audio playback blocked:",e)})}catch(n){Ht("Error playing sound:",n)}},[e,t]),p=k.useCallback(e=>{f(e),h()},[f,h]);return{permission:a,requestPermission:d,notify:f,playSound:h,notifyWithSound:p}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:i?.botName||"Asistente",logoUrl:i?.logoUrl}),b=function(e=10,t=6e4){const n=k.useRef([]);return{isAllowed:k.useCallback(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),!(n.current.length>=e||(n.current.push(r),0))},[e,t]),getRemainingAttempts:k.useCallback(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),Math.max(0,e-n.current.length)},[e,t]),getTimeUntilReset:k.useCallback(()=>{if(0===n.current.length)return 0;const e=Date.now(),r=n.current[0],o=t-(e-r);return Math.max(0,o)},[t]),reset:k.useCallback(()=>{n.current=[]},[])}}(10,6e4),{state:v,actions:w}=function(){const[e,t]=k.useReducer(Kc,Qc),[n,r]=k.useState(!1);k.useEffect(()=>{"undefined"==typeof window||n||(async()=>{try{await qc.migrateFromLocalStorage();const e=await qc.getMessages(100),n=await qc.getMetadata();if(e.length>0||n){const r={messages:e.map(e=>({...e,timestamp:new Date(e.timestamp)})),sessionId:n?.sessionId||null,isOpen:n?.isOpen||!1};t({type:"RESTORE_SESSION",payload:r})}}catch(gy){Vt("Chat: Error rehydrating from IndexedDB",gy);try{const e=localStorage.getItem(Zc);if(e){const n=JSON.parse(e);n.messages&&(n.messages=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))),t({type:"RESTORE_SESSION",payload:n})}}catch(e){Ht("Chat: Fallback rehydration failed",e)}}finally{r(!0)}})()},[n]),k.useEffect(()=>{if(!n)return;const t=setTimeout(async()=>{try{await qc.saveMessages(e.messages),await qc.setMetadata({isOpen:e.isOpen,sessionId:e.sessionId})}catch(gy){Ht("Chat Persistence Error:",gy);try{const t={isOpen:e.isOpen,messages:e.messages,sessionId:e.sessionId};localStorage.setItem(Zc,JSON.stringify(t))}catch(t){Ht("Chat: Fallback persistence failed",t)}}},500);return()=>clearTimeout(t)},[e.isOpen,e.messages,e.sessionId,n]);const o=k.useCallback(e=>{t({type:"ADD_MESSAGE",payload:e})},[]),i=k.useCallback(()=>t({type:"TOGGLE_WINDOW"}),[]),a=k.useCallback(()=>t({type:"OPEN_WINDOW"}),[]),s=k.useCallback(()=>t({type:"CLOSE_WINDOW"}),[]),l=k.useCallback(e=>t({type:"SET_CONNECTED",payload:e}),[]),c=k.useCallback(e=>t({type:"SET_TYPING",payload:e}),[]),u=k.useCallback(e=>t({type:"SET_MESSAGES",payload:e}),[]),d=k.useCallback(e=>t({type:"SET_ERROR",payload:e}),[]),f=k.useCallback(e=>t({type:"SET_SESSION_ID",payload:e}),[]),h=k.useCallback(()=>{localStorage.removeItem(Zc),t({type:"CLEAR_CHAT"})},[]),p=k.useCallback(()=>{t({type:"SET_MESSAGES",payload:[]})},[]);return{state:e,isHydrated:n,actions:{toggleWindow:i,openWindow:a,closeWindow:s,setConnected:l,setTyping:c,addMessage:o,setMessages:u,setError:d,setSessionId:f,clearChat:h,clearMessages:p}}}(),x=Hg(o),S=Vg({apiKey:t,apiBaseUrl:n,pageContext:k.useMemo(()=>x?{...r||{},seo:{...x||{}}}:r,[r,x]),userContext:a,onMessage:k.useCallback(e=>{const t=Date.now(),n=p.current>0?t-p.current:void 0;p.current=t,w.addMessage(e),g.trackMessageReceived(e.type,n),v.isOpen||"bot"!==e.sender||(h(e=>e+1),y.notifyWithSound(e))},[w,v.isOpen,g,y]),onConnected:k.useCallback((e,t)=>{w.setConnected(!0),w.setSessionId(e),g.trackConnectionStatus(!0),t&&c&&c("backend_config",t)},[w,c,g]),onDisconnected:k.useCallback(()=>{w.setConnected(!1),g.trackConnectionStatus(!1)},[w,g]),onTyping:k.useCallback(e=>w.setTyping(e),[w]),onError:k.useCallback(e=>{w.setError(e),g.trackError(e)},[w,g]),onLogin:s,onNavigate:l,onEvent:c,onThemeUpdate:d}),_=k.useCallback(()=>{Wt("ChatWidget handleToggle called, current isOpen:",v.isOpen),v.isOpen?(w.closeWindow(),g.trackClose(),u?.(!1),Wt("ChatWidget Closing window")):(w.openWindow(),h(0),g.trackOpen(),u?.(!0),Wt("ChatWidget Opening window"))},[v.isOpen,w,u,g]),C=k.useCallback(e=>{if(!b.isAllowed()){const e=b.getTimeUntilReset(),t=Math.ceil(e/1e3);return void w.setError(m("rate_limit_exceeded")+` Espera ${t}s.`)}const t={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:new Date,content:e};w.addMessage(t),g.trackMessageSent("text"),S.sendMessage(e,"text")},[w,S,b,g,m]),E=k.useCallback(async(e,t)=>{let n;n="audio"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:new Date,content:URL.createObjectURL(e)}:"image"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:new Date,imageUrl:URL.createObjectURL(e)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:new Date,content:`📎 ${e.name}`},w.addMessage(n);const r=await Yg(e);S.sendMessage(r,t)},[w,S]),z=k.useCallback(e=>{const t={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:new Date,latitude:e.latitude,longitude:e.longitude,name:"Mi ubicación"};w.addMessage(t),S.sendMessage(JSON.stringify(e),"location")},[w,S]);k.useEffect(()=>{const e=()=>{v.isOpen||w.openWindow()},t=()=>{v.isOpen&&w.closeWindow()},n=()=>{v.isOpen?w.closeWindow():w.openWindow()},r=e=>{e.detail?.message&&C(e.detail.message)};return window.addEventListener("botuyo-chat:open",e),window.addEventListener("botuyo-chat:close",t),window.addEventListener("botuyo-chat:toggle",n),window.addEventListener("botuyo-chat:send-message",r),()=>{window.removeEventListener("botuyo-chat:open",e),window.removeEventListener("botuyo-chat:close",t),window.removeEventListener("botuyo-chat:toggle",n),window.removeEventListener("botuyo-chat:send-message",r)}},[v.isOpen,w,C]),k.useEffect(()=>(Qg(C),()=>Qg(null)),[C]);const A=k.useCallback(()=>{w.clearMessages(),qt("Chat history cleared")},[w]);k.useEffect(()=>(Kg(A),()=>Kg(null)),[A]);const N=k.useMemo(()=>{if(v.isTyping)return"thinking";const e=[...v.messages].reverse().find(e=>"bot"===e.sender&&"text"===e.type);return"text"===e?.type&&e.emotion?e.emotion:"default"},[v.isTyping,v.messages]);return{state:v,actions:w,unreadCount:f,currentBotEmotion:N,isConnected:S.isConnected,handleToggle:_,handleSendText:C,handleSendAttachment:E,handleSendLocation:z}}function Xg(e){const{apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o=!1,theme:i,mediaConfig:a,userContext:s,onLogin:l,onNavigate:c,onEvent:u,onStateChange:d,onVoiceCall:f}=e,h=k.useRef(null),p=hc();!function(e){const[t,n]=k.useState(!1);k.useEffect(()=>{let t=null;const r=()=>{if(!e.current)return;const t=!!e.current.parentElement?.closest(".dark"),r=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),o=document.getElementById("botuyo-chat-widget-root"),i=!!o?.parentElement?.closest(".dark"),a=document.documentElement.classList.contains("dark"),s=document.body.classList.contains("dark"),l=window.matchMedia("(prefers-color-scheme: dark)").matches,c=t||r||i||a||s||l;e.current&&(c?e.current.classList.add("dark"):e.current.classList.remove("dark")),n(c)};r();const o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>r();o.addEventListener("change",i);const a=new MutationObserver(()=>{r()}),s=document.getElementById("botuyo-chat-widget-root");s&&(a.observe(s,{attributes:!0,attributeFilter:["class"]}),s.parentElement&&(a.observe(s.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=s.parentElement)),a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),a.observe(document.body,{attributes:!0,attributeFilter:["class"]});let l=e.current?.parentElement;for(;l;)a.observe(l,{attributes:!0,attributeFilter:["class"]}),l=l.parentElement;const c=setInterval(()=>{const e=document.getElementById("botuyo-chat-widget-root");e&&e.parentElement!==t&&(t&&e.parentElement&&(a.observe(e.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=e.parentElement),r())},100);return()=>{a.disconnect(),o.removeEventListener("change",i),clearInterval(c)}},[e])}(h);const[m,g]=k.useState(),{mergedTheme:y,mergedStyles:b,getContainerStyle:v}=kc(i,m),{state:w,actions:x,unreadCount:S,currentBotEmotion:_,isConnected:C,handleToggle:E,handleSendText:z,handleSendAttachment:N,handleSendLocation:T}=Gg({apiKey:t,apiBaseUrl:n,pageContext:r,includeSEOMetadata:o,theme:i,userContext:s,onLogin:l,onNavigate:c,onEvent:u,onStateChange:d,onThemeUpdate:g}),O=k.useCallback(e=>{e.stopPropagation()},[]),I=v(w.isOpen,p,i?.position),j=k.useMemo(()=>{if(!y.cssVariables)return{};const e={},t=y.cssVariables;return t.background&&(e["--background"]=t.background),t.foreground&&(e["--foreground"]=t.foreground),t.card&&(e["--card"]=t.card),t.cardForeground&&(e["--card-foreground"]=t.cardForeground),t.primary&&(e["--primary"]=t.primary),t.primaryForeground&&(e["--primary-foreground"]=t.primaryForeground),t.muted&&(e["--muted"]=t.muted),t.mutedForeground&&(e["--muted-foreground"]=t.mutedForeground),t.border&&(e["--border"]=t.border),t.destructive&&(e["--destructive"]=t.destructive),t.radius&&(e["--radius"]=t.radius),t.spacing1&&(e["--spacing-1"]=t.spacing1),t.spacing2&&(e["--spacing-2"]=t.spacing2),t.spacing3&&(e["--spacing-3"]=t.spacing3),t.spacing4&&(e["--spacing-4"]=t.spacing4),t.spacing5&&(e["--spacing-5"]=t.spacing5),t.spacing6&&(e["--spacing-6"]=t.spacing6),t.spacing8&&(e["--spacing-8"]=t.spacing8),e},[y.cssVariables]);return A.jsx(Bt,{animations:i?.animations,effects:i?.effects,children:A.jsxs("div",{ref:h,id:"botuyo-chat-widget",className:At("botuyo-chat-widget flex flex-col",!p&&("bottom-left"===i?.position?"items-start":"items-end")),style:{...I,...j,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===i?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===i?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===i?.effects?.softShadows?"false":void 0,children:[A.jsx("div",{className:At("transition-all duration-400 ease-[cubic-bezier(0.34,1.56,0.64,1)]",p?"bottom-left"===i?.position?"origin-bottom-left":"origin-bottom-right":"origin-bottom",w.isOpen?"opacity-100 scale-100 h-full w-full translate-y-0 pointer-events-auto":"opacity-0 scale-[0.85] pointer-events-none translate-y-8 h-0 w-0"),style:{pointerEvents:w.isOpen?"auto":"none"},onMouseDown:O,onTouchStart:O,children:A.jsx(bc,{children:A.jsx(yc,{isOpen:w.isOpen,isConnected:C,isTyping:w.isTyping,messages:w.messages,onClose:()=>x.closeWindow(),onSendMessage:z,onSendAttachment:N,onSendLocation:T,botName:i?.botName,logoUrl:i?.logoUrl,welcomeMessage:i?.welcomeMessage,inputPlaceholder:i?.inputPlaceholder,primaryColor:i?.primaryColor,position:i?.position,bubbleStyles:b,avatars:i?.avatars,mediaConfig:a,theme:y,onVoiceCall:f})})}),A.jsx("div",{className:At(w.isOpen?"hidden":"block",!p&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:O,onTouchStart:O,children:A.jsx(Jt,{isOpen:w.isOpen,onClick:E,unreadCount:S,position:i?.position||"bottom-right",primaryColor:i?.primaryColor,logoUrl:i?.logoUrl,starterPrompt:i?.starterPrompt,avatars:i?.avatars,emotion:_,styles:b,promptPersistence:i?.promptPersistence,avatarScale:i?.avatarScale})})]})})}const ey=Object.freeze(Object.defineProperty({__proto__:null,ChatWidget:Xg},Symbol.toStringTag,{value:"Module"})),ty=k.lazy(()=>Promise.resolve().then(()=>ey).then(e=>({default:e.ChatWidget})));class ny{root=null;container=null;config=null;init(e){return this.config=e,this.render(),this}render(){if(!this.config)return void console.error("[BotUyoChat] No configuration provided");if(this.container||(this.container=document.createElement("div"),this.container.id="botuyo-chat-widget-root",this.container.style.position="fixed",this.container.style.zIndex="999999",document.body.appendChild(this.container)),this.config.theme?.cssVariables){const e=this.config.theme.cssVariables,t={background:e.background,foreground:e.foreground,card:e.card,cardForeground:e.cardForeground,primary:e.primary,primaryForeground:e.primaryForeground,muted:e.muted,mutedForeground:e.mutedForeground,border:e.border,destructive:e.destructive,radius:e.radius,spacing1:e.spacing1,spacing2:e.spacing2,spacing3:e.spacing3,spacing4:e.spacing4,spacing5:e.spacing5,spacing6:e.spacing6,spacing8:e.spacing8};Object.entries(t).forEach(([e,t])=>{void 0!==t&&this.container.style.setProperty(`--${e}`,t)})}this.root||(this.root=x.createRoot(this.container));const e={apiKey:this.config.apiKey,apiBaseUrl:this.config.apiBaseUrl,theme:{primaryColor:"#10b981",botName:"Asistente Virtual",position:"bottom-right",welcomeMessage:"¡Hola! 👋 ¿En qué puedo ayudarte?",inputPlaceholder:"Escribe tu mensaje...",borderRadius:"0.75rem",launcherBorderRadius:"50%",...this.config.theme},userContext:this.config.userContext,pageContext:this.config.pageContext,includeSEOMetadata:this.config.includeSEOMetadata??!1,mediaConfig:this.config.mediaConfig,onNavigate:this.config.onNavigate,onLogin:this.config.onLogin,onEvent:this.config.onEvent,onStateChange:this.config.onStateChange,onVoiceCall:this.config.onVoiceCall},t=S.createElement(k.Suspense,{fallback:S.createElement("div",{style:{position:"fixed",bottom:"24px",right:"24px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:e.theme?.primaryColor||"#10b981",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",cursor:"wait"}},S.createElement("div",{style:{width:"24px",height:"24px",border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},S.createElement(ty,e));this.root.render(S.createElement(j,{defaultLocale:this.config.theme?.defaultLocale,children:t})),console.log("[BotUyoChat] Widget initialized",e)}update(e){this.config?(this.config={...this.config,...e,theme:{...this.config.theme,...e.theme}},this.render()):console.error("[BotUyoChat] Widget not initialized")}destroy(){this.root&&(this.root.unmount(),this.root=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null),this.config=null,console.log("[BotUyoChat] Widget destroyed")}open(){window.dispatchEvent(new CustomEvent("botuyo-chat:open"))}close(){window.dispatchEvent(new CustomEvent("botuyo-chat:close"))}sendMessage(e){window.dispatchEvent(new CustomEvent("botuyo-chat:send-message",{detail:{message:e}}))}getState(){return null}}const ry=new ny;window.BotUyoChat=ry;const oy=k.memo(function({url:e,isBot:t,primaryColor:n}){const[r,o]=k.useState(!1),[i,a]=k.useState(0),[s,l]=k.useState(0),[c,u]=k.useState(!0),[d,f]=k.useState(null),h=k.useRef(null),p=k.useMemo(()=>Ft({primaryColor:n}),[n]),m=k.useCallback(()=>{d||(r?h.current?.pause():h.current?.play().catch(e=>{console.error("[AudioPlayer] Play error:",e),f("Error al reproducir")}),o(!r))},[r,d]),g=k.useCallback(()=>{a(h.current?.duration||0)},[]),y=k.useCallback(()=>{u(!1),f(null)},[]),b=k.useCallback(()=>{console.error("[AudioPlayer] Failed to load audio:",e),u(!1),f("No se pudo cargar")},[e]),v=k.useCallback(()=>{u(!0),f(null),h.current&&h.current.load()},[]);return A.jsxs("div",{className:At("flex items-center gap-3 py-1 min-w-[200px]",t?"text-foreground":"text-primary-foreground"),children:[A.jsx("audio",{ref:h,src:e,preload:"metadata",onLoadedMetadata:g,onCanPlayThrough:y,onTimeUpdate:()=>l(h.current?.currentTime||0),onEnded:()=>o(!1),onError:b}),d?A.jsx("button",{onClick:v,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors",title:"Reintentar",children:A.jsx(ae,{className:"w-4 h-4"})}):A.jsx("button",{onClick:m,disabled:c,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity",style:{backgroundColor:t?p:"hsl(var(--card))",color:t?"white":p,opacity:c?.6:1},children:c?A.jsx(J,{className:"w-4 h-4 animate-spin"}):r?A.jsx(te,{className:"w-4 h-4 fill-current"}):A.jsx(oe,{className:"w-4 h-4 fill-current ml-0.5"})}),A.jsx("div",{className:"flex-1 space-y-1",children:d?A.jsxs("div",{className:"flex items-center gap-1.5 text-red-500",children:[A.jsx(H,{className:"w-3 h-3"}),A.jsx("span",{className:"text-[9px] font-bold",children:d})]}):A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"relative h-1 w-full bg-current/20 rounded-full overflow-hidden",children:A.jsx("div",{className:"absolute h-full bg-current rounded-full transition-all",style:{width:`${s/i*100||0}%`}})}),A.jsxs("div",{className:"flex justify-between text-[9px] font-bold opacity-60",children:[A.jsxs("span",{children:[Math.floor(s/60),":",Math.floor(s%60).toString().padStart(2,"0")]}),A.jsx("span",{children:c?"--:--":`${Math.floor(i/60)}:${Math.floor(i%60).toString().padStart(2,"0")}`})]})]})})]})}),iy=Object.freeze(Object.defineProperty({__proto__:null,AudioPlayer:oy},Symbol.toStringTag,{value:"Module"})),ay=k.memo(function({images:e,radius:t="rounded-lg"}){const{t:n}=P("extracted"),[r,o]=k.useState(0),[i,a]=k.useState(!1),s=()=>{o(t=>(t+1)%e.length)},l=()=>{o(t=>(t-1+e.length)%e.length)},c=e=>{o(e),a(!0)},[u,d]=k.useState(new Set),f=e=>{d(t=>new Set(t).add(e))};return 1===e.length?A.jsx("div",{className:"my-3 relative group",children:u.has(0)?A.jsxs("div",{className:At("w-full h-48 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),style:{borderColor:"hsl(var(--border))"},children:[A.jsx("svg",{className:"w-12 h-12 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),A.jsx("span",{className:"text-sm",children:"Imagen no disponible"})]}):A.jsxs(A.Fragment,{children:[A.jsx("img",{src:e[0].src,alt:e[0].alt||"Imagen",className:At("w-full h-auto object-cover cursor-pointer transition-all duration-300","border shadow-soft-md hover:shadow-soft-lg hover:scale-[1.02]",t),style:{borderColor:"hsl(var(--border))"},loading:"lazy",onClick:()=>c(0),onError:()=>f(0)}),A.jsx("div",{className:"absolute top-2 right-2 bg-black/50 backdrop-blur-sm p-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:A.jsx(fe,{size:16,className:"text-white"})})]})}):e.length<=3?A.jsxs("div",{className:At("my-3 grid gap-2",2===e.length?"grid-cols-2":"grid-cols-3"),children:[e.map((n,r)=>A.jsx("div",{className:"relative group overflow-hidden",children:u.has(r)?A.jsx("div",{className:At("w-full h-32 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),children:A.jsx("svg",{className:"w-8 h-8 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}):A.jsxs(A.Fragment,{children:[A.jsx("img",{src:n.src,alt:n.alt||`Imagen ${r+1}`,className:At("w-full h-32 object-cover cursor-pointer transition-all duration-300","border border-border shadow-soft-md hover:shadow-soft-lg hover:scale-110",t),loading:"lazy",onClick:()=>c(r),onError:()=>f(r)}),A.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-end p-2",children:A.jsxs("span",{className:"text-white text-xs font-bold bg-black/50 backdrop-blur-sm px-2 py-1 rounded-full",children:[r+1,"/",e.length]})})]})},r)),i&&A.jsx(sy,{images:e,currentIndex:r,onClose:()=>a(!1),onNext:s,onPrev:l})]}):A.jsxs("div",{className:"my-3 space-y-2",children:[A.jsx("div",{className:"relative group",children:u.has(r)?A.jsxs("div",{className:At("w-full h-56 flex flex-col items-center justify-center","border bg-muted text-muted-foreground",t),style:{borderColor:"hsl(var(--border))"},children:[A.jsx("svg",{className:"w-12 h-12 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),A.jsx("span",{className:"text-sm",children:"Imagen no disponible"})]}):A.jsxs(A.Fragment,{children:[A.jsx("img",{src:e[r].src,alt:e[r].alt||`Imagen ${r+1}`,className:At("w-full h-56 object-cover cursor-pointer transition-all duration-300","border shadow-soft-md",t),style:{borderColor:"hsl(var(--border))"},loading:"lazy",onClick:()=>c(r),onError:()=>f(r)}),A.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-black/20 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-between px-3",children:[A.jsx("button",{onClick:l,className:"p-2 rounded-full shadow-soft-lg transition-all hover:scale-110 active:scale-95",style:{backgroundColor:"hsl(var(--card) / 0.9)",color:"hsl(var(--foreground))"},"aria-label":n("anterior"),children:A.jsx($,{size:20})}),A.jsx("button",{onClick:s,className:"p-2 rounded-full shadow-soft-lg transition-all hover:scale-110 active:scale-95",style:{backgroundColor:"hsl(var(--card) / 0.9)",color:"hsl(var(--foreground))"},"aria-label":n("siguiente"),children:A.jsx(V,{size:20})})]}),A.jsx("div",{className:"absolute top-3 right-3 bg-black/70 backdrop-blur-sm px-3 py-1 rounded-full",children:A.jsxs("span",{className:"text-white text-xs font-bold",children:[r+1," / ",e.length]})}),A.jsx("div",{className:"absolute bottom-3 right-3 bg-black/70 backdrop-blur-sm p-2 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:A.jsx(fe,{size:16,className:"text-white"})})]})}),A.jsx("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",children:e.map((e,n)=>A.jsx("button",{onClick:()=>o(n),className:At("flex-shrink-0 w-16 h-16 overflow-hidden transition-all duration-300 relative","border-2 hover:scale-110",t,r===n?"border-[hsl(210,90%,50%)] ring-2 ring-[hsl(210,90%,50%)]/30 scale-105":"border-border hover:border-[hsl(210,90%,70%)] opacity-70 hover:opacity-100"),children:u.has(n)?A.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:A.jsx("svg",{className:"w-6 h-6 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}):A.jsx("img",{src:e.src,alt:e.alt||`Thumbnail ${n+1}`,className:"w-full h-full object-cover",loading:"lazy",onError:()=>f(n)})},n))}),i&&A.jsx(sy,{images:e,currentIndex:r,onClose:()=>a(!1),onNext:s,onPrev:l})]})});function sy({images:e,currentIndex:t,onClose:n,onNext:r,onPrev:o}){const{t:i}=P("extracted");return A.jsxs("div",{className:"fixed inset-0 z-[100000] bg-black/95 backdrop-blur-sm flex items-center justify-center animate-in fade-in duration-200",onClick:n,children:[A.jsx("button",{onClick:n,className:"absolute top-4 right-4 bg-white/10 hover:bg-white/20 p-2 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":i("cerrar"),children:A.jsx(de,{size:24,className:"text-white"})}),A.jsx("div",{className:"absolute top-4 left-4 bg-white/10 backdrop-blur-sm px-4 py-2 rounded-full z-10",children:A.jsxs("span",{className:"text-white text-sm font-bold",children:[t+1," / ",e.length]})}),e.length>1&&A.jsxs(A.Fragment,{children:[A.jsx("button",{onClick:e=>{e.stopPropagation(),o()},className:"absolute left-4 bg-white/10 hover:bg-white/20 p-3 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":"Anterior",children:A.jsx($,{size:32,className:"text-white"})}),A.jsx("button",{onClick:e=>{e.stopPropagation(),r()},className:"absolute right-4 bg-white/10 hover:bg-white/20 p-3 rounded-full transition-all hover:scale-110 active:scale-95 z-10","aria-label":"Siguiente",children:A.jsx(V,{size:32,className:"text-white"})})]}),A.jsx("img",{src:e[t].src,alt:e[t].alt||`Imagen ${t+1}`,className:"max-w-[90%] max-h-[90vh] object-contain",onClick:e=>e.stopPropagation()})]})}const ly=Object.freeze(Object.defineProperty({__proto__:null,Gallery:ay},Symbol.toStringTag,{value:"Module"}));function cy(e,t){return new Promise(function(n,r){let o;return uy(e).then(function(e){try{return o=e,n(new Blob([t.slice(0,2),o,t.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}},r)})}const uy=e=>new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",({target:{result:e}})=>{const r=new DataView(e);let o=0;if(65496!==r.getUint16(o))return n("not a valid JPEG");for(o+=2;;){const i=r.getUint16(o);if(65498===i)break;const a=r.getUint16(o+2);if(65505===i&&1165519206===r.getUint32(o+4)){const i=o+10;let s;switch(r.getUint16(i)){case 18761:s=!0;break;case 19789:s=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==r.getUint16(i+2,s))return n("TIFF header contains invalid version");const l=r.getUint32(i+4,s),c=i+l+2+12*r.getUint16(i+l,s);for(let e=i+l+2;e<c;e+=12)if(274==r.getUint16(e,s)){if(3!==r.getUint16(e+2,s))return n("Orientation data type is invalid");if(1!==r.getUint32(e+4,s))return n("Orientation data count is invalid");r.setUint16(e+8,1,s);break}return t(e.slice(o,o+2+a))}o+=2+a}return t(new Blob)}),r.readAsArrayBuffer(e)});var dy,fy,hy,py={},my={get exports(){return py},set exports(e){py=e}};hy={},my.exports=hy,hy.parse=function(e,t){for(var n=hy.bin.readUshort,r=hy.bin.readUint,o=0,i={},a=new Uint8Array(e),s=a.length-4;101010256!=r(a,s);)s--;o=s,o+=4;var l=n(a,o+=4);n(a,o+=2);var c=r(a,o+=2),u=r(a,o+=4);o+=4,o=u;for(var d=0;d<l;d++){r(a,o),o+=4,o+=4,o+=4,r(a,o+=4),c=r(a,o+=4);var f=r(a,o+=4),h=n(a,o+=4),p=n(a,o+2),m=n(a,o+4);o+=6;var g=r(a,o+=8);o+=4,o+=h+p+m,hy._readLocal(a,g,i,c,f,t)}return i},hy._readLocal=function(e,t,n,r,o,i){var a=hy.bin.readUshort,s=hy.bin.readUint;s(e,t),a(e,t+=4),a(e,t+=2);var l=a(e,t+=2);s(e,t+=2),s(e,t+=4),t+=4;var c=a(e,t+=8),u=a(e,t+=2);t+=2;var d=hy.bin.readUTF8(e,t,c);if(t+=c,t+=u,i)n[d]={size:o,csize:r};else{var f=new Uint8Array(e.buffer,t);if(0==l)n[d]=new Uint8Array(f.buffer.slice(t,t+r));else{if(8!=l)throw"unknown compression method: "+l;var h=new Uint8Array(o);hy.inflateRaw(f,h),n[d]=h}}},hy.inflateRaw=function(e,t){return hy.F.inflate(e,t)},hy.inflate=function(e,t){return e[0],e[1],hy.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},hy.deflate=function(e,t){null==t&&(t={level:6});var n=0,r=new Uint8Array(50+Math.floor(1.1*e.length));r[n]=120,r[n+1]=156,n+=2,n=hy.F.deflateRaw(e,r,n,t.level);var o=hy.adler(e,0,e.length);return r[n+0]=o>>>24&255,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o>>>0&255,new Uint8Array(r.buffer,0,n+4)},hy.deflateRaw=function(e,t){null==t&&(t={level:6});var n=new Uint8Array(50+Math.floor(1.1*e.length)),r=hy.F.deflateRaw(e,n,r,t.level);return new Uint8Array(n.buffer,0,r)},hy.encode=function(e,t){null==t&&(t=!1);var n=0,r=hy.bin.writeUint,o=hy.bin.writeUshort,i={};for(var a in e){var s=!hy._noNeed(a)&&!t,l=e[a],c=hy.crc.crc(l,0,l.length);i[a]={cpr:s,usize:l.length,crc:c,file:s?hy.deflateRaw(l):l}}for(var a in i)n+=i[a].file.length+30+46+2*hy.bin.sizeUTF8(a);n+=22;var u=new Uint8Array(n),d=0,f=[];for(var a in i){var h=i[a];f.push(d),d=hy._writeHeader(u,d,a,h,0)}var p=0,m=d;for(var a in i)h=i[a],f.push(d),d=hy._writeHeader(u,d,a,h,1,f[p++]);var g=d-m;return r(u,d,101010256),d+=4,o(u,d+=4,p),o(u,d+=2,p),r(u,d+=2,g),r(u,d+=4,m),d+=4,d+=2,u.buffer},hy._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},hy._writeHeader=function(e,t,n,r,o,i){var a=hy.bin.writeUint,s=hy.bin.writeUshort,l=r.file;return a(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),s(e,t,20),s(e,t+=2,0),s(e,t+=2,r.cpr?8:0),a(e,t+=2,0),a(e,t+=4,r.crc),a(e,t+=4,l.length),a(e,t+=4,r.usize),s(e,t+=4,hy.bin.sizeUTF8(n)),s(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,a(e,t+=6,i),t+=4),t+=hy.bin.writeUTF8(e,t,n),0==o&&(e.set(l,t),t+=l.length),t},hy.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update:function(e,t,n,r){for(var o=0;o<r;o++)e=hy.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^hy.crc.update(4294967295,e,t,n)}},hy.adler=function(e,t,n){for(var r=1,o=0,i=t,a=t+n;i<a;){for(var s=Math.min(i+5552,a);i<s;)o+=r+=e[i++];r%=65521,o%=65521}return o<<16|r},hy.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r="",o=0;o<n;o++)r+=String.fromCharCode(e[t+o]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var r,o="",i=0;i<n;i++)o+="%"+hy.bin.pad(e[t+i].toString(16));try{r=decodeURIComponent(o)}catch(a){return hy.bin.readASCII(e,t,n)}return r},writeUTF8:function(e,t,n){for(var r=n.length,o=0,i=0;i<r;i++){var a=n.charCodeAt(i);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+o]=240|a>>18,e[t+o+1]=128|a>>12&63,e[t+o+2]=128|a>>6&63,e[t+o+3]=128|63&a,o+=4}else e[t+o]=224|a>>12,e[t+o+1]=128|a>>6&63,e[t+o+2]=128|63&a,o+=3;else e[t+o]=192|a>>6,e[t+o+1]=128|63&a,o+=2;else e[t+o]=a,o++}return o},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var o=e.charCodeAt(r);if(4294967168&o)if(4294965248&o)if(4294901760&o){if(4292870144&o)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},hy.F={},hy.F.deflateRaw=function(e,t,n,r){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][r],i=hy.F.U,a=hy.F._goodIndex;hy.F._hash;var s=hy.F._putsE,l=0,c=n<<3,u=0,d=e.length;if(0==r){for(;l<d;)s(t,c,l+(S=Math.min(65535,d-l))==d?1:0),c=hy.F._copyExact(e,l,S,t,c+8),l+=S;return c>>>3}var f=i.lits,h=i.strt,p=i.prev,m=0,g=0,y=0,b=0,v=0,w=0;for(d>2&&(h[w=hy.F._hash(e,0)]=0),l=0;l<d;l++){if(v=w,l+1<d-2){w=hy.F._hash(e,l+1);var x=l+1&32767;p[x]=h[w],h[w]=x}if(u<=l){(m>14e3||g>26697)&&d-l>100&&(u<l&&(f[m]=l-u,m+=2,u=l),c=hy.F._writeBlock(l==d-1||u==d?1:0,f,m,b,e,y,l-y,t,c),m=g=b=0,y=l);var k=0;l<d-2&&(k=hy.F._bestMatch(e,l,p,v,Math.min(o[2],d-l),o[3]));var S=k>>>16,_=65535&k;if(0!=k){_=65535&k;var C=a(S=k>>>16,i.of0);i.lhst[257+C]++;var E=a(_,i.df0);i.dhst[E]++,b+=i.exb[C]+i.dxb[E],f[m]=S<<23|l-u,f[m+1]=_<<16|C<<8|E,m+=2,u=l+S}else i.lhst[e[l]]++;g++}}for(y==l&&0!=e.length||(u<l&&(f[m]=l-u,m+=2,u=l),c=hy.F._writeBlock(1,f,m,b,e,y,l-y,t,c),m=0,g=0,m=g=b=0,y=l);7&c;)c++;return c>>>3},hy.F._bestMatch=function(e,t,n,r,o,i){var a=32767&t,s=n[a],l=a-s+32768&32767;if(s==a||r!=hy.F._hash(e,t-l))return 0;for(var c=0,u=0,d=Math.min(32767,t);l<=d&&0!=--i&&s!=a;){if(0==c||e[t+c]==e[t+c-l]){var f=hy.F._howLong(e,t,l);if(f>c){if(u=l,(c=f)>=o)break;l+2<f&&(f=l+2);for(var h=0,p=0;p<f-2;p++){var m=t-l+p+32768&32767,g=m-n[m]+32768&32767;g>h&&(h=g,s=m)}}}l+=(a=s)-(s=n[a])+32768&32767}return c<<16|u},hy.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,o=Math.min(e.length,t+258);for(t+=3;t<o&&e[t]==e[t-n];)t++;return t-r},hy.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},hy.saved=0,hy.F._writeBlock=function(e,t,n,r,o,i,a,s,l){var c,u,d,f,h,p,m,g,y,b=hy.F.U,v=hy.F._putsF,w=hy.F._putsE;b.lhst[256]++,u=(c=hy.F.getTrees())[0],d=c[1],f=c[2],h=c[3],p=c[4],m=c[5],g=c[6],y=c[7];var x=32+(l+3&7?8-(l+3&7):0)+(a<<3),k=r+hy.F.contSize(b.fltree,b.lhst)+hy.F.contSize(b.fdtree,b.dhst),S=r+hy.F.contSize(b.ltree,b.lhst)+hy.F.contSize(b.dtree,b.dhst);S+=14+3*m+hy.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var _=0;_<286;_++)b.lhst[_]=0;for(_=0;_<30;_++)b.dhst[_]=0;for(_=0;_<19;_++)b.ihst[_]=0;var C=x<k&&x<S?0:k<S?1:2;if(v(s,l,e),v(s,l+1,C),l+=3,0==C){for(;7&l;)l++;l=hy.F._copyExact(o,i,a,s,l)}else{var E,z;if(1==C&&(E=b.fltree,z=b.fdtree),2==C){hy.F.makeCodes(b.ltree,u),hy.F.revCodes(b.ltree,u),hy.F.makeCodes(b.dtree,d),hy.F.revCodes(b.dtree,d),hy.F.makeCodes(b.itree,f),hy.F.revCodes(b.itree,f),E=b.ltree,z=b.dtree,w(s,l,h-257),w(s,l+=5,p-1),w(s,l+=5,m-4),l+=4;for(var A=0;A<m;A++)w(s,l+3*A,b.itree[1+(b.ordr[A]<<1)]);l+=3*m,l=hy.F._codeTiny(g,b.itree,s,l),l=hy.F._codeTiny(y,b.itree,s,l)}for(var N=i,T=0;T<n;T+=2){for(var O=t[T],I=O>>>23,j=N+(8388607&O);N<j;)l=hy.F._writeLit(o[N++],E,s,l);if(0!=I){var M=t[T+1],P=M>>16,F=M>>8&255,L=255&M;w(s,l=hy.F._writeLit(257+F,E,s,l),I-b.of0[F]),l+=b.exb[F],v(s,l=hy.F._writeLit(L,z,s,l),P-b.df0[L]),l+=b.dxb[L],N+=I}}l=hy.F._writeLit(256,E,s,l)}return l},hy.F._copyExact=function(e,t,n,r,o){var i=o>>>3;return r[i]=n,r[i+1]=n>>>8,r[i+2]=255-r[i],r[i+3]=255-r[i+1],i+=4,r.set(new Uint8Array(e.buffer,t,n),i),o+(n+4<<3)},hy.F.getTrees=function(){for(var e=hy.F.U,t=hy.F._hufTree(e.lhst,e.ltree,15),n=hy.F._hufTree(e.dhst,e.dtree,15),r=[],o=hy.F._lenCodes(e.ltree,r),i=[],a=hy.F._lenCodes(e.dtree,i),s=0;s<r.length;s+=2)e.ihst[r[s]]++;for(s=0;s<i.length;s+=2)e.ihst[i[s]]++;for(var l=hy.F._hufTree(e.ihst,e.itree,7),c=19;c>4&&0==e.itree[1+(e.ordr[c-1]<<1)];)c--;return[t,n,l,o,a,c,r,i]},hy.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},hy.F.nonZero=function(e){for(var t="",n=0;n<e.length;n+=2)0!=e[n+1]&&(t+=(n>>1)+",");return t},hy.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},hy.F._codeTiny=function(e,t,n,r){for(var o=0;o<e.length;o+=2){var i=e[o],a=e[o+1];r=hy.F._writeLit(i,t,n,r);var s=16==i?2:17==i?3:7;i>15&&(hy.F._putsE(n,r,a,s),r+=s)}return r},hy.F._lenCodes=function(e,t){for(var n=e.length;2!=n&&0==e[n-1];)n-=2;for(var r=0;r<n;r+=2){var o=e[r+1],i=r+3<n?e[r+3]:-1,a=r+5<n?e[r+5]:-1,s=0==r?-1:e[r-1];if(0==o&&i==o&&a==o){for(var l=r+5;l+2<n&&e[l+2]==o;)l+=2;(c=Math.min(l+1-r>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),r+=2*c-2}else if(o==s&&i==o&&a==o){for(l=r+5;l+2<n&&e[l+2]==o;)l+=2;var c=Math.min(l+1-r>>>1,6);t.push(16,c-3),r+=2*c-2}else t.push(o,0)}return n>>>1},hy.F._hufTree=function(e,t,n){var r=[],o=e.length,i=t.length,a=0;for(a=0;a<i;a+=2)t[a]=0,t[a+1]=0;for(a=0;a<o;a++)0!=e[a]&&r.push({lit:a,f:e[a]});var s=r.length,l=r.slice(0);if(0==s)return 0;if(1==s){var c=r[0].lit;return l=0==c?1:0,t[1+(c<<1)]=1,t[1+(l<<1)]=1,1}r.sort(function(e,t){return e.f-t.f});var u=r[0],d=r[1],f=0,h=1,p=2;for(r[0]={lit:-1,f:u.f+d.f,l:u,r:d,d:0};h!=s-1;)u=f!=h&&(p==s||r[f].f<r[p].f)?r[f++]:r[p++],d=f!=h&&(p==s||r[f].f<r[p].f)?r[f++]:r[p++],r[h++]={lit:-1,f:u.f+d.f,l:u,r:d};var m=hy.F.setDepth(r[h-1],0);for(m>n&&(hy.F.restrictDepth(l,n,m),m=n),a=0;a<s;a++)t[1+(l[a].lit<<1)]=l[a].d;return m},hy.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(hy.F.setDepth(e.l,t+1),hy.F.setDepth(e.r,t+1))},hy.F.restrictDepth=function(e,t,n){var r=0,o=1<<n-t,i=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),r=0;r<e.length&&e[r].d>t;r++){var a=e[r].d;e[r].d=t,i+=o-(1<<n-a)}for(i>>>=n-t;i>0;)(a=e[r].d)<t?(e[r].d++,i-=1<<t-a-1):r++;for(;r>=0;r--)e[r].d==t&&i<0&&(e[r].d--,i++);0!=i&&console.log("debt left")},hy.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},hy.F._writeLit=function(e,t,n,r){return hy.F._putsF(n,r,t[e<<1]),r+t[1+(e<<1)]},hy.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var r=hy.F,o=r._bitsF,i=r._bitsE,a=r._decodeTiny,s=r.makeCodes,l=r.codes2map,c=r._get17,u=r.U,d=null==t;d&&(t=new n(e.length>>>2<<3));for(var f,h,p=0,m=0,g=0,y=0,b=0,v=0,w=0,x=0,k=0;0==p;)if(p=o(e,k,1),m=o(e,k+1,2),k+=3,0!=m){if(d&&(t=hy.F._check(t,x+(1<<17))),1==m&&(f=u.flmap,h=u.fdmap,v=511,w=31),2==m){g=i(e,k,5)+257,y=i(e,k+5,5)+1,b=i(e,k+10,4)+4,k+=14;for(var S=0;S<38;S+=2)u.itree[S]=0,u.itree[S+1]=0;var _=1;for(S=0;S<b;S++){var C=i(e,k+3*S,3);u.itree[1+(u.ordr[S]<<1)]=C,C>_&&(_=C)}k+=3*b,s(u.itree,_),l(u.itree,_,u.imap),f=u.lmap,h=u.dmap,k=a(u.imap,(1<<_)-1,g+y,e,k,u.ttree);var E=r._copyOut(u.ttree,0,g,u.ltree);v=(1<<E)-1;var z=r._copyOut(u.ttree,g,y,u.dtree);w=(1<<z)-1,s(u.ltree,E),l(u.ltree,E,f),s(u.dtree,z),l(u.dtree,z,h)}for(;;){var A=f[c(e,k)&v];k+=15&A;var N=A>>>4;if(N>>>8==0)t[x++]=N;else{if(256==N)break;var T=x+N-254;if(N>264){var O=u.ldef[N-257];T=x+(O>>>3)+i(e,k,7&O),k+=7&O}var I=h[c(e,k)&w];k+=15&I;var j=I>>>4,M=u.ddef[j],P=(M>>>4)+o(e,k,15&M);for(k+=15&M,d&&(t=hy.F._check(t,x+(1<<17)));x<T;)t[x]=t[x++-P],t[x]=t[x++-P],t[x]=t[x++-P],t[x]=t[x++-P];x=T}}}else{7&k&&(k+=8-(7&k));var F=4+(k>>>3),L=e[F-4]|e[F-3]<<8;d&&(t=hy.F._check(t,x+L)),t.set(new n(e.buffer,e.byteOffset+F,L),x),k=F+L<<3,x+=L}return t.length==x?t:t.slice(0,x)},hy.F._check=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(Math.max(n<<1,t));return r.set(e,0),r},hy.F._decodeTiny=function(e,t,n,r,o,i){for(var a=hy.F._bitsE,s=hy.F._get17,l=0;l<n;){var c=e[s(r,o)&t];o+=15&c;var u=c>>>4;if(u<=15)i[l]=u,l++;else{var d=0,f=0;16==u?(f=3+a(r,o,2),o+=2,d=i[l-1]):17==u?(f=3+a(r,o,3),o+=3):18==u&&(f=11+a(r,o,7),o+=7);for(var h=l+f;l<h;)i[l]=d,l++}}return o},hy.F._copyOut=function(e,t,n,r){for(var o=0,i=0,a=r.length>>>1;i<n;){var s=e[i+t];r[i<<1]=0,r[1+(i<<1)]=s,s>o&&(o=s),i++}for(;i<a;)r[i<<1]=0,r[1+(i<<1)]=0,i++;return o},hy.F.makeCodes=function(e,t){for(var n,r,o,i,a=hy.F.U,s=e.length,l=a.bl_count,c=0;c<=t;c++)l[c]=0;for(c=1;c<s;c+=2)l[e[c]]++;var u=a.next_code;for(n=0,l[0]=0,r=1;r<=t;r++)n=n+l[r-1]<<1,u[r]=n;for(o=0;o<s;o+=2)0!=(i=e[o+1])&&(e[o]=u[i],u[i]++)},hy.F.codes2map=function(e,t,n){for(var r=e.length,o=hy.F.U.rev15,i=0;i<r;i+=2)if(0!=e[i+1])for(var a=i>>1,s=e[i+1],l=a<<4|s,c=t-s,u=e[i]<<c,d=u+(1<<c);u!=d;)n[o[u]>>>15-t]=l,u++},hy.F.revCodes=function(e,t){for(var n=hy.F.U.rev15,r=15-t,o=0;o<e.length;o+=2){var i=e[o]<<t-e[o+1];e[o]=n[i]>>>r}},hy.F._putsE=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},hy.F._putsF=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},hy.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},hy.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},hy.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},hy.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},hy.F.U=(dy=Uint16Array,fy=Uint32Array,{next_code:new dy(16),bl_count:new dy(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new dy(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new fy(32),flmap:new dy(512),fltree:[],fdmap:new dy(32),fdtree:[],lmap:new dy(32768),ltree:[],ttree:[],dmap:new dy(32768),dtree:[],imap:new dy(512),itree:[],rev15:new dy(32768),lhst:new fy(286),dhst:new fy(30),ihst:new fy(19),lits:new fy(15e3),strt:new dy(65536),prev:new dy(32768)}),function(){for(var e=hy.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];r(e.fltree,144,8),r(e.fltree,112,9),r(e.fltree,24,7),r(e.fltree,8,8),hy.F.makeCodes(e.fltree,9),hy.F.codes2map(e.fltree,9,e.flmap),hy.F.revCodes(e.fltree,9),r(e.fdtree,32,5),hy.F.makeCodes(e.fdtree,5),hy.F.codes2map(e.fdtree,5,e.fdmap),hy.F.revCodes(e.fdtree,5),r(e.itree,19,0),r(e.ltree,286,0),r(e.dtree,30,0),r(e.ttree,320,0)}();var gy,yy=(gy={__proto__:null,default:py},[py].forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(t){if("default"!==t&&!(t in gy)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(gy,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})}),Object.freeze(gy));const by=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII(e,t,n){let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(e[t+o]);return r},writeASCII(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes(e,t,n){const r=[];for(let o=0;o<n;o++)r.push(e[t+o]);return r},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,n,r){let o,i="";for(let s=0;s<r;s++)i+=`%${e.pad(t[n+s].toString(16))}`;try{o=decodeURIComponent(i)}catch(a){return e.readASCII(t,n,r)}return o}};function t(t,n,r,o){const a=n*r,s=i(o),l=Math.ceil(n*s/8),c=new Uint8Array(4*a),u=new Uint32Array(c.buffer),{ctype:d}=o,{depth:f}=o,h=e.readUshort;if(6==d){const e=a<<2;if(8==f)for(var p=0;p<e;p+=4)c[p]=t[p],c[p+1]=t[p+1],c[p+2]=t[p+2],c[p+3]=t[p+3];if(16==f)for(p=0;p<e;p++)c[p]=t[p<<1]}else if(2==d){const e=o.tabs.tRNS;if(null==e){if(8==f)for(p=0;p<a;p++){var m=3*p;u[p]=255<<24|t[m+2]<<16|t[m+1]<<8|t[m]}if(16==f)for(p=0;p<a;p++)m=6*p,u[p]=255<<24|t[m+4]<<16|t[m+2]<<8|t[m]}else{var g=e[0];const n=e[1],r=e[2];if(8==f)for(p=0;p<a;p++){var y=p<<2;m=3*p,u[p]=255<<24|t[m+2]<<16|t[m+1]<<8|t[m],t[m]==g&&t[m+1]==n&&t[m+2]==r&&(c[y+3]=0)}if(16==f)for(p=0;p<a;p++)y=p<<2,m=6*p,u[p]=255<<24|t[m+4]<<16|t[m+2]<<8|t[m],h(t,m)==g&&h(t,m+2)==n&&h(t,m+4)==r&&(c[y+3]=0)}}else if(3==d){const e=o.tabs.PLTE,i=o.tabs.tRNS,s=i?i.length:0;if(1==f)for(var b=0;b<r;b++){var v=b*l,w=b*n;for(p=0;p<n;p++){y=w+p<<2;var x=3*(k=t[v+(p>>3)]>>7-(7&p)&1);c[y]=e[x],c[y+1]=e[x+1],c[y+2]=e[x+2],c[y+3]=k<s?i[k]:255}}if(2==f)for(b=0;b<r;b++)for(v=b*l,w=b*n,p=0;p<n;p++)y=w+p<<2,x=3*(k=t[v+(p>>2)]>>6-((3&p)<<1)&3),c[y]=e[x],c[y+1]=e[x+1],c[y+2]=e[x+2],c[y+3]=k<s?i[k]:255;if(4==f)for(b=0;b<r;b++)for(v=b*l,w=b*n,p=0;p<n;p++)y=w+p<<2,x=3*(k=t[v+(p>>1)]>>4-((1&p)<<2)&15),c[y]=e[x],c[y+1]=e[x+1],c[y+2]=e[x+2],c[y+3]=k<s?i[k]:255;if(8==f)for(p=0;p<a;p++){var k;y=p<<2,x=3*(k=t[p]),c[y]=e[x],c[y+1]=e[x+1],c[y+2]=e[x+2],c[y+3]=k<s?i[k]:255}}else if(4==d){if(8==f)for(p=0;p<a;p++){y=p<<2;var S=t[_=p<<1];c[y]=S,c[y+1]=S,c[y+2]=S,c[y+3]=t[_+1]}if(16==f)for(p=0;p<a;p++){var _;y=p<<2,S=t[_=p<<2],c[y]=S,c[y+1]=S,c[y+2]=S,c[y+3]=t[_+2]}}else if(0==d)for(g=o.tabs.tRNS?o.tabs.tRNS:-1,b=0;b<r;b++){const e=b*l,r=b*n;if(1==f)for(var C=0;C<n;C++){var E=(S=255*(t[e+(C>>>3)]>>>7-(7&C)&1))==255*g?0:255;u[r+C]=E<<24|S<<16|S<<8|S}else if(2==f)for(C=0;C<n;C++)E=(S=85*(t[e+(C>>>2)]>>>6-((3&C)<<1)&3))==85*g?0:255,u[r+C]=E<<24|S<<16|S<<8|S;else if(4==f)for(C=0;C<n;C++)E=(S=17*(t[e+(C>>>1)]>>>4-((1&C)<<2)&15))==17*g?0:255,u[r+C]=E<<24|S<<16|S<<8|S;else if(8==f)for(C=0;C<n;C++)E=(S=t[e+C])==g?0:255,u[r+C]=E<<24|S<<16|S<<8|S;else if(16==f)for(C=0;C<n;C++)S=t[e+(C<<1)],E=h(t,e+(C<<1))==g?0:255,u[r+C]=E<<24|S<<16|S<<8|S}return c}function n(e,t,n,s){const l=i(e),c=Math.ceil(n*l/8),u=new Uint8Array((c+1+e.interlace)*s);return t=e.tabs.CgBI?o(t,u):r(t,u),0==e.interlace?t=a(t,e,0,n,s):1==e.interlace&&(t=function(e,t){const n=t.width,r=t.height,o=i(t),s=o>>3,l=Math.ceil(n*o/8),c=new Uint8Array(r*l);let u=0;const d=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],h=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let m=0;for(;m<7;){const i=h[m],y=p[m];let b=0,v=0,w=d[m];for(;w<r;)w+=i,v++;let x=f[m];for(;x<n;)x+=y,b++;const k=Math.ceil(b*o/8);a(e,t,u,b,v);let S=0,_=d[m];for(;_<r;){let t=f[m],r=u+S*k<<3;for(;t<n;){var g;if(1==o&&(g=(g=e[r>>3])>>7-(7&r)&1,c[_*l+(t>>3)]|=g<<7-(7&t)),2==o&&(g=(g=e[r>>3])>>6-(7&r)&3,c[_*l+(t>>2)]|=g<<6-((3&t)<<1)),4==o&&(g=(g=e[r>>3])>>4-(7&r)&15,c[_*l+(t>>1)]|=g<<4-((1&t)<<2)),o>=8){const n=_*l+t*s;for(let t=0;t<s;t++)c[n+t]=e[(r>>3)+t]}r+=o,t+=y}S++,_+=i}b*v!=0&&(u+=v*(1+k)),m+=1}return c}(t,e)),t}function r(e,t){return o(new Uint8Array(e.buffer,2,e.length-6),t)}var o=function(){const e={H:{}};return e.H.N=function(t,n){const r=Uint8Array;let o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,h=0,p=0;if(3==t[0]&&0==t[1])return n||new r(0);const m=e.H,g=m.b,y=m.e,b=m.R,v=m.n,w=m.A,x=m.Z,k=m.m,S=null==n;for(S&&(n=new r(t.length>>>2<<5));0==a;)if(a=g(t,p,1),s=g(t,p+1,2),p+=3,0!=s){if(S&&(n=e.H.W(n,h+(1<<17))),1==s&&(o=k.J,i=k.h,d=511,f=31),2==s){l=y(t,p,5)+257,c=y(t,p+5,5)+1,u=y(t,p+10,4)+4,p+=14;let e=1;for(var _=0;_<38;_+=2)k.Q[_]=0,k.Q[_+1]=0;for(_=0;_<u;_++){const n=y(t,p+3*_,3);k.Q[1+(k.X[_]<<1)]=n,n>e&&(e=n)}p+=3*u,v(k.Q,e),w(k.Q,e,k.u),o=k.w,i=k.d,p=b(k.u,(1<<e)-1,l+c,t,p,k.v);const n=m.V(k.v,0,l,k.C);d=(1<<n)-1;const r=m.V(k.v,l,c,k.D);f=(1<<r)-1,v(k.C,n),w(k.C,n,o),v(k.D,r),w(k.D,r,i)}for(;;){const e=o[x(t,p)&d];p+=15&e;const r=e>>>4;if(r>>>8==0)n[h++]=r;else{if(256==r)break;{let e=h+r-254;if(r>264){const n=k.q[r-257];e=h+(n>>>3)+y(t,p,7&n),p+=7&n}const o=i[x(t,p)&f];p+=15&o;const a=o>>>4,s=k.c[a],l=(s>>>4)+g(t,p,15&s);for(p+=15&s;h<e;)n[h]=n[h++-l],n[h]=n[h++-l],n[h]=n[h++-l],n[h]=n[h++-l];h=e}}}}else{7&p&&(p+=8-(7&p));const o=4+(p>>>3),i=t[o-4]|t[o-3]<<8;S&&(n=e.H.W(n,h+i)),n.set(new r(t.buffer,t.byteOffset+o,i),h),p=o+i<<3,h+=i}return n.length==h?n:n.slice(0,h)},e.H.W=function(e,t){const n=e.length;if(t<=n)return e;const r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,o,i,a){const s=e.H.e,l=e.H.Z;let c=0;for(;c<r;){const e=t[l(o,i)&n];i+=15&e;const r=e>>>4;if(r<=15)a[c]=r,c++;else{let e=0,t=0;16==r?(t=3+s(o,i,2),i+=2,e=a[c-1]):17==r?(t=3+s(o,i,3),i+=3):18==r&&(t=11+s(o,i,7),i+=7);const n=c+t;for(;c<n;)a[c]=e,c++}}return i},e.H.V=function(e,t,n,r){let o=0,i=0;const a=r.length>>>1;for(;i<n;){const n=e[i+t];r[i<<1]=0,r[1+(i<<1)]=n,n>o&&(o=n),i++}for(;i<a;)r[i<<1]=0,r[1+(i<<1)]=0,i++;return o},e.H.n=function(t,n){const r=e.H.m,o=t.length;let i,a,s,l;const c=r.j;for(var u=0;u<=n;u++)c[u]=0;for(u=1;u<o;u+=2)c[t[u]]++;const d=r.K;for(i=0,c[0]=0,a=1;a<=n;a++)i=i+c[a-1]<<1,d[a]=i;for(s=0;s<o;s+=2)l=t[s+1],0!=l&&(t[s]=d[l],d[l]++)},e.H.A=function(t,n,r){const o=t.length,i=e.H.m.r;for(let e=0;e<o;e+=2)if(0!=t[e+1]){const o=e>>1,a=t[e+1],s=o<<4|a,l=n-a;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)r[i[c]>>>15-n]=s,c++}},e.H.l=function(t,n){const r=e.H.m.r,o=15-n;for(let e=0;e<t.length;e+=2){const i=t[e]<<n-t[e+1];t[e]=r[i]>>>o}},e.H.M=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var n=0;n<32768;n++){let e=n;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[n]=(e>>>16|e<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];r(t._,144,8),r(t._,112,9),r(t._,24,7),r(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),r(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),r(t.Q,19,0),r(t.C,286,0),r(t.D,30,0),r(t.v,320,0)}(),e.H.N}();function i(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,n,r,o){let a=i(t);const l=Math.ceil(r*a/8);let c,u;a=Math.ceil(a/8);let d=e[n],f=0;if(d>1&&(e[n]=[0,0,1][d-2]),3==d)for(f=a;f<l;f++)e[f+1]=e[f+1]+(e[f+1-a]>>>1)&255;for(let i=0;i<o;i++)if(c=n+i*l,u=c+i+1,d=e[u-1],f=0,0==d)for(;f<l;f++)e[c+f]=e[u+f];else if(1==d){for(;f<a;f++)e[c+f]=e[u+f];for(;f<l;f++)e[c+f]=e[u+f]+e[c+f-a]}else if(2==d)for(;f<l;f++)e[c+f]=e[u+f]+e[c+f-l];else if(3==d){for(;f<a;f++)e[c+f]=e[u+f]+(e[c+f-l]>>>1);for(;f<l;f++)e[c+f]=e[u+f]+(e[c+f-l]+e[c+f-a]>>>1)}else{for(;f<a;f++)e[c+f]=e[u+f]+s(0,e[c+f-l],0);for(;f<l;f++)e[c+f]=e[u+f]+s(e[c+f-a],e[c+f-l],e[c+f-a-l])}return e}function s(e,t,n){const r=e+t-n,o=r-e,i=r-t,a=r-n;return o*o<=i*i&&o*o<=a*a?e:i*i<=a*a?t:n}function l(t,n,r){r.width=e.readUint(t,n),n+=4,r.height=e.readUint(t,n),n+=4,r.depth=t[n],n++,r.ctype=t[n],n++,r.compress=t[n],n++,r.filter=t[n],n++,r.interlace=t[n],n++}function c(e,t,n,r,o,i,a,s,l){const c=Math.min(t,o),u=Math.min(n,i);let d=0,f=0;for(let x=0;x<u;x++)for(let n=0;n<c;n++)if(a>=0&&s>=0?(d=x*t+n<<2,f=(s+x)*o+a+n<<2):(d=(-s+x)*t-a+n<<2,f=x*o+n<<2),0==l)r[f]=e[d],r[f+1]=e[d+1],r[f+2]=e[d+2],r[f+3]=e[d+3];else if(1==l){var h=e[d+3]*(1/255),p=e[d]*h,m=e[d+1]*h,g=e[d+2]*h,y=r[f+3]*(1/255),b=r[f]*y,v=r[f+1]*y,w=r[f+2]*y;const t=1-h,n=h+y*t,o=0==n?0:1/n;r[f+3]=255*n,r[f+0]=(p+b*t)*o,r[f+1]=(m+v*t)*o,r[f+2]=(g+w*t)*o}else if(2==l)h=e[d+3],p=e[d],m=e[d+1],g=e[d+2],y=r[f+3],b=r[f],v=r[f+1],w=r[f+2],h==y&&p==b&&m==v&&g==w?(r[f]=0,r[f+1]=0,r[f+2]=0,r[f+3]=0):(r[f]=p,r[f+1]=m,r[f+2]=g,r[f+3]=h);else if(3==l){if(h=e[d+3],p=e[d],m=e[d+1],g=e[d+2],y=r[f+3],b=r[f],v=r[f+1],w=r[f+2],h==y&&p==b&&m==v&&g==w)continue;if(h<220&&y>20)return!1}return!0}return{decode:function(t){const i=new Uint8Array(t);let a=8;const s=e,c=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},f=new Uint8Array(i.length);let h,p=0,m=0;const g=[137,80,78,71,13,10,26,10];for(var y=0;y<8;y++)if(i[y]!=g[y])throw"The input is not a PNG file!";for(;a<i.length;){const e=s.readUint(i,a);a+=4;const t=s.readASCII(i,a,4);if(a+=4,"IHDR"==t)l(i,a,d);else if("iCCP"==t){for(var b=a;0!=i[b];)b++;s.readASCII(i,a,b-a),i[b+1];const n=i.slice(b+2,a+e);let l=null;try{l=r(n)}catch(C){l=o(n)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=i.slice(a,a+4);else if("IDAT"==t){for(y=0;y<e;y++)f[p+y]=i[a+y];p+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(i,a),num_plays:u(i,a+4)},h=new Uint8Array(i.length);else if("fcTL"==t){0!=m&&((_=d.frames[d.frames.length-1]).data=n(d,h.slice(0,m),_.rect.width,_.rect.height),m=0);const e={x:u(i,a+12),y:u(i,a+16),width:u(i,a+4),height:u(i,a+8)};let t=c(i,a+22);t=c(i,a+20)/(0==t?100:t);const r={rect:e,delay:Math.round(1e3*t),dispose:i[a+24],blend:i[a+25]};d.frames.push(r)}else if("fdAT"==t){for(y=0;y<e-4;y++)h[m+y]=i[a+y+4];m+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(i,a),s.readUint(i,a+4),i[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],y=0;y<8;y++)d.tabs[t].push(s.readUint(i,a+4*y));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var v=s.nextZero(i,a),w=s.readASCII(i,a,v-a),x=a+e-v-1;if("tEXt"==t)S=s.readASCII(i,v+1,x);else{var k=r(i.slice(v+2,v+2+x));S=s.readUTF8(k,0,k.length)}d.tabs[t][w]=S}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),v=0,b=a,v=s.nextZero(i,b),w=s.readASCII(i,b,v-b);const n=i[b=v+1];var S;i[b+1],b+=2,v=s.nextZero(i,b),s.readASCII(i,b,v-b),b=v+1,v=s.nextZero(i,b),s.readUTF8(i,b,v-b),x=e-((b=v+1)-a),0==n?S=s.readUTF8(i,b,x):(k=r(i.slice(b,b+x)),S=s.readUTF8(k,0,k.length)),d.tabs[t][w]=S}else if("PLTE"==t)d.tabs[t]=s.readBytes(i,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],y=0;y<e;y++)d.tabs[t].push(c(i,a+2*y))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(i,a,e):0==d.ctype?d.tabs[t]=c(i,a):2==d.ctype&&(d.tabs[t]=[c(i,a),c(i,a+2),c(i,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(i,a)/1e5;else if("sRGB"==t)d.tabs[t]=i[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(i,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(i,a),c(i,a+2),c(i,a+4)]:3==d.ctype&&(d.tabs[t]=i[a]);else if("IEND"==t)break;a+=e,s.readUint(i,a),a+=4}var _;return 0!=m&&((_=d.frames[d.frames.length-1]).data=n(d,h.slice(0,m),_.rect.width,_.rect.height)),d.data=n(d,f,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const n=e.width,r=e.height;if(null==e.tabs.acTL)return[t(e.data,n,r,e).buffer];const o=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const i=n*r*4,a=new Uint8Array(i),s=new Uint8Array(i),l=new Uint8Array(i);for(let d=0;d<e.frames.length;d++){const f=e.frames[d],h=f.rect.x,p=f.rect.y,m=f.rect.width,g=f.rect.height,y=t(f.data,m,g,e);if(0!=d)for(var u=0;u<i;u++)l[u]=a[u];if(0==f.blend?c(y,m,g,a,n,r,h,p,0):1==f.blend&&c(y,m,g,a,n,r,h,p,1),o.push(a.buffer.slice(0)),0==f.dispose);else if(1==f.dispose)c(s,m,g,a,n,r,h,p,0);else if(2==f.dispose)for(u=0;u<i;u++)a[u]=l[u]}return o},_paeth:s,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=by,{_bin:t}=by,n=by._paeth;var r={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update(e,t,n,o){for(let i=0;i<o;i++)e=r.table[255&(e^t[n+i])]^e>>>8;return e},crc:(e,t,n)=>4294967295^r.update(4294967295,e,t,n)};function o(e,t,n,r){t[n]+=e[0]*r>>4,t[n+1]+=e[1]*r>>4,t[n+2]+=e[2]*r>>4,t[n+3]+=e[3]*r>>4}function i(e){return Math.max(0,Math.min(255,e))}function a(e,t){const n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],i=e[3]-t[3];return n*n+r*r+o*o+i*i}function s(e,t,n,r,s,l,c){null==c&&(c=1);const u=r.length,d=[];for(var f=0;f<u;f++){const e=r[f];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(f=0;f<u;f++){let e=4294967295;for(var h=0,p=0;p<u;p++){var m=a(d[f],d[p]);p!=f&&m<e&&(e=m,h=p)}}const g=new Uint32Array(s.buffer),y=new Int16Array(t*n*4),b=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<b.length;f++)b[f]=255*((b[f]+.5)/16-.5);for(let w=0;w<n;w++)for(let s=0;s<t;s++){var v;f=4*(w*t+s),2!=c?v=[i(e[f]+y[f]),i(e[f+1]+y[f+1]),i(e[f+2]+y[f+2]),i(e[f+3]+y[f+3])]:(m=b[4*(3&w)+(3&s)],v=[i(e[f]+m),i(e[f+1]+m),i(e[f+2]+m),i(e[f+3]+m)]),h=0;let x=16777215;for(p=0;p<u;p++){const e=a(v,d[p]);e<x&&(x=e,h=p)}const k=d[h],S=[v[0]-k[0],v[1]-k[1],v[2]-k[2],v[3]-k[3]];1==c&&(s!=t-1&&o(S,y,f+4,7),w!=n-1&&(0!=s&&o(S,y,f+4*t-4,3),o(S,y,f+4*t,5),s!=t-1&&o(S,y,f+4*t+4,1))),l[f>>2]=h,g[f>>2]=r[h]}}function l(e,n,o,i,a){null==a&&(a={});const{crc:s}=r,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const f=e.frames.length>1;let h,p=!1,m=33+(f?20:0);if(null!=a.sRGB&&(m+=13),null!=a.pHYs&&(m+=21),null!=a.iCCP&&(h=pako.deflate(a.iCCP),m+=21+h.length+4),3==e.ctype){for(var g=e.plte.length,y=0;y<g;y++)e.plte[y]>>>24!=255&&(p=!0);m+=8+3*g+4+(p?8+1*g+4:0)}for(var b=0;b<e.frames.length;b++)f&&(m+=38),m+=(k=e.frames[b]).cimg.length+12,0!=b&&(m+=4);m+=12;const v=new Uint8Array(m),w=[137,80,78,71,13,10,26,10];for(y=0;y<8;y++)v[y]=w[y];if(l(v,d,13),d+=4,u(v,d,"IHDR"),d+=4,l(v,d,n),d+=4,l(v,d,o),d+=4,v[d]=e.depth,d++,v[d]=e.ctype,d++,v[d]=0,d++,v[d]=0,d++,v[d]=0,d++,l(v,d,s(v,d-17,17)),d+=4,null!=a.sRGB&&(l(v,d,1),d+=4,u(v,d,"sRGB"),d+=4,v[d]=a.sRGB,d++,l(v,d,s(v,d-5,5)),d+=4),null!=a.iCCP){const e=13+h.length;l(v,d,e),d+=4,u(v,d,"iCCP"),d+=4,u(v,d,"ICC profile"),d+=11,d+=2,v.set(h,d),d+=h.length,l(v,d,s(v,d-(e+4),e+4)),d+=4}if(null!=a.pHYs&&(l(v,d,9),d+=4,u(v,d,"pHYs"),d+=4,l(v,d,a.pHYs[0]),d+=4,l(v,d,a.pHYs[1]),d+=4,v[d]=a.pHYs[2],d++,l(v,d,s(v,d-13,13)),d+=4),f&&(l(v,d,8),d+=4,u(v,d,"acTL"),d+=4,l(v,d,e.frames.length),d+=4,l(v,d,null!=a.loop?a.loop:0),d+=4,l(v,d,s(v,d-12,12)),d+=4),3==e.ctype){for(l(v,d,3*(g=e.plte.length)),d+=4,u(v,d,"PLTE"),d+=4,y=0;y<g;y++){const t=3*y,n=e.plte[y],r=255&n,o=n>>>8&255,i=n>>>16&255;v[d+t+0]=r,v[d+t+1]=o,v[d+t+2]=i}if(d+=3*g,l(v,d,s(v,d-3*g-4,3*g+4)),d+=4,p){for(l(v,d,g),d+=4,u(v,d,"tRNS"),d+=4,y=0;y<g;y++)v[d+y]=e.plte[y]>>>24&255;d+=g,l(v,d,s(v,d-g-4,g+4)),d+=4}}let x=0;for(b=0;b<e.frames.length;b++){var k=e.frames[b];f&&(l(v,d,26),d+=4,u(v,d,"fcTL"),d+=4,l(v,d,x++),d+=4,l(v,d,k.rect.width),d+=4,l(v,d,k.rect.height),d+=4,l(v,d,k.rect.x),d+=4,l(v,d,k.rect.y),d+=4,c(v,d,i[b]),d+=2,c(v,d,1e3),d+=2,v[d]=k.dispose,d++,v[d]=k.blend,d++,l(v,d,s(v,d-30,30)),d+=4);const t=k.cimg;l(v,d,(g=t.length)+(0==b?0:4)),d+=4;const n=d;u(v,d,0==b?"IDAT":"fdAT"),d+=4,0!=b&&(l(v,d,x++),d+=4),v.set(t,d),d+=g,l(v,d,s(v,n,d-n)),d+=4}return l(v,d,0),d+=4,u(v,d,"IEND"),d+=4,l(v,d,s(v,d-4,4)),d+=4,v.buffer}function c(e,t,n){for(let r=0;r<e.frames.length;r++){const o=e.frames[r];o.rect.width;const i=o.rect.height,a=new Uint8Array(i*o.bpl+i);o.cimg=h(o.img,i,o.bpp,o.bpl,a,t,n)}}function u(t,n,r,o,i){const a=i[0],l=i[1],c=i[2],u=i[3],h=i[4],p=i[5];let g=6,y=8,b=255;for(var v=0;v<t.length;v++){const e=new Uint8Array(t[v]);for(var w=e.length,x=0;x<w;x+=4)b&=e[x+3]}const k=255!=b,S=function(t,n,r,o,i,a){const s=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),h=new Uint32Array(d.buffer);var c;let m=0,g=0,y=n,b=r,v=o?1:0;if(0!=l){const w=a||o||1==l||0!=s[l-2].dispose?1:2;let x=0,k=1e9;for(let e=0;e<w;e++){var u=new Uint8Array(t[l-1-e]);const o=new Uint32Array(t[l-1-e]);let a=n,s=r,c=-1,d=-1;for(let e=0;e<r;e++)for(let t=0;t<n;t++)h[p=e*n+t]!=o[p]&&(t<a&&(a=t),t>c&&(c=t),e<s&&(s=e),e>d&&(d=e));-1==c&&(a=s=c=d=0),i&&(!(1&~a)&&a--,!(1&~s)&&s--);const f=(c-a+1)*(d-s+1);f<k&&(k=f,x=e,m=a,g=s,y=c-a+1,b=d-s+1)}u=new Uint8Array(t[l-1-x]),1==x&&(s[l-1].dispose=2),c=new Uint8Array(y*b*4),e(u,n,r,c,y,b,-m,-g,0),v=e(d,n,r,c,y,b,-m,-g,3)?1:0,1==v?f(d,n,r,c,{x:m,y:g,width:y,height:b}):e(d,n,r,c,y,b,-m,-g,0)}else c=d.slice(0);s.push({rect:{x:m,y:g,width:y,height:b},img:c,blend:v,dispose:0})}if(o)for(l=0;l<s.length;l++){if(1==(m=s[l]).blend)continue;const e=m.rect,o=s[l-1].rect,a=Math.min(e.x,o.x),c=Math.min(e.y,o.y),u={x:a,y:c,width:Math.max(e.x+e.width,o.x+o.width)-a,height:Math.max(e.y+e.height,o.y+o.height)-c};s[l-1].dispose=1,l-1!=0&&d(t,n,r,s,l-1,u,i),d(t,n,r,s,l,u,i)}let h=0;if(1!=t.length)for(var p=0;p<s.length;p++){var m;h+=(m=s[p]).rect.width*m.rect.height}return s}(t,n,r,a,l,c),_={},C=[],E=[];if(0!=o){const e=[];for(x=0;x<S.length;x++)e.push(S[x].img.buffer);const t=m(function(e){let t=0;for(var n=0;n<e.length;n++)t+=e[n].byteLength;const r=new Uint8Array(t);let o=0;for(n=0;n<e.length;n++){const t=new Uint8Array(e[n]),i=t.length;for(let e=0;e<i;e+=4){let n=t[e],i=t[e+1],a=t[e+2];const s=t[e+3];0==s&&(n=i=a=0),r[o+e]=n,r[o+e+1]=i,r[o+e+2]=a,r[o+e+3]=s}o+=i}return r.buffer}(e),o);for(x=0;x<t.plte.length;x++)C.push(t.plte[x].est.rgba);let n=0;for(x=0;x<S.length;x++){const e=(A=S[x]).img.length;var z=new Uint8Array(t.inds.buffer,n>>2,e>>2);E.push(z);const r=new Uint8Array(t.abuf,n,e);p&&s(A.img,A.rect.width,A.rect.height,C,r,z),A.img.set(r),n+=e}}else for(v=0;v<S.length;v++){var A=S[v];const e=new Uint32Array(A.img.buffer);var N=A.rect.width;for(w=e.length,z=new Uint8Array(w),E.push(z),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])z[x]=z[x-1];else if(x>N&&t==e[x-N])z[x]=z[x-N];else{let e=_[t];if(null==e&&(_[t]=e=C.length,C.push(t),C.length>=300))break;z[x]=e}}}const T=C.length;for(T<=256&&0==h&&(y=T<=2?1:T<=4?2:T<=16?4:8,y=Math.max(y,u)),v=0;v<S.length;v++){(A=S[v]).rect.x,A.rect.y,N=A.rect.width;const e=A.rect.height;let t=A.img;new Uint32Array(t.buffer);let n=4*N,r=4;if(T<=256&&0==h){n=Math.ceil(y*N/8);var O=new Uint8Array(n*e);const o=E[v];for(let t=0;t<e;t++){x=t*n;const e=t*N;if(8==y)for(var I=0;I<N;I++)O[x+I]=o[e+I];else if(4==y)for(I=0;I<N;I++)O[x+(I>>1)]|=o[e+I]<<4-4*(1&I);else if(2==y)for(I=0;I<N;I++)O[x+(I>>2)]|=o[e+I]<<6-2*(3&I);else if(1==y)for(I=0;I<N;I++)O[x+(I>>3)]|=o[e+I]<<7-1*(7&I)}t=O,g=3,r=1}else if(0==k&&1==S.length){O=new Uint8Array(N*e*3);const o=N*e;for(x=0;x<o;x++){const e=3*x,n=4*x;O[e]=t[n],O[e+1]=t[n+1],O[e+2]=t[n+2]}t=O,g=2,r=3,n=3*N}A.img=t,A.bpl=n,A.bpp=r}return{ctype:g,depth:y,plte:C,frames:S}}function d(t,n,r,o,i,a,s){const l=Uint8Array,c=Uint32Array,u=new l(t[i-1]),d=new c(t[i-1]),h=i+1<t.length?new l(t[i+1]):null,p=new l(t[i]),m=new c(p.buffer);let g=n,y=r,b=-1,v=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const r=a.x+t,s=a.y+e,l=s*n+r,c=m[l];0==c||0==o[i-1].dispose&&d[l]==c&&(null==h||0!=h[4*l+3])||(r<g&&(g=r),r>b&&(b=r),s<y&&(y=s),s>v&&(v=s))}-1==b&&(g=y=b=v=0),s&&(!(1&~g)&&g--,!(1&~y)&&y--),a={x:g,y:y,width:b-g+1,height:v-y+1};const w=o[i];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),0==o[i-1].dispose?(e(u,n,r,w.img,a.width,a.height,-a.x,-a.y,0),f(p,n,r,w.img,a)):e(p,n,r,w.img,a.width,a.height,-a.x,-a.y,0)}function f(t,n,r,o,i){e(t,n,r,o,i.width,i.height,-i.x,-i.y,2)}function h(e,t,n,r,o,i,a){const s=[];let l,c=[0,1,2,3,4];-1!=i?c=[i]:(t*r>5e5||1==n)&&(c=[0]),a&&(l={level:0});const u=yy;for(var d=0;d<c.length;d++){for(let i=0;i<t;i++)p(o,e,i,r,n,c[d]);s.push(u.deflate(o,l))}let f,h=1e9;for(d=0;d<s.length;d++)s[d].length<h&&(f=d,h=s[d].length);return s[f]}function p(e,t,r,o,i,a){const s=r*o;let l=s+r;if(e[l]=a,l++,0==a)if(o<500)for(var c=0;c<o;c++)e[l+c]=t[s+c];else e.set(new Uint8Array(t.buffer,s,o),l);else if(1==a){for(c=0;c<i;c++)e[l+c]=t[s+c];for(c=i;c<o;c++)e[l+c]=t[s+c]-t[s+c-i]+256&255}else if(0==r){for(c=0;c<i;c++)e[l+c]=t[s+c];if(2==a)for(c=i;c<o;c++)e[l+c]=t[s+c];if(3==a)for(c=i;c<o;c++)e[l+c]=t[s+c]-(t[s+c-i]>>1)+256&255;if(4==a)for(c=i;c<o;c++)e[l+c]=t[s+c]-n(t[s+c-i],0,0)+256&255}else{if(2==a)for(c=0;c<o;c++)e[l+c]=t[s+c]+256-t[s+c-o]&255;if(3==a){for(c=0;c<i;c++)e[l+c]=t[s+c]+256-(t[s+c-o]>>1)&255;for(c=i;c<o;c++)e[l+c]=t[s+c]+256-(t[s+c-o]+t[s+c-i]>>1)&255}if(4==a){for(c=0;c<i;c++)e[l+c]=t[s+c]+256-n(0,t[s+c-o],0)&255;for(c=i;c<o;c++)e[l+c]=t[s+c]+256-n(t[s+c-i],t[s+c-o],t[s+c-i-o])&255}}}function m(e,t){const n=new Uint8Array(e),r=n.slice(0),o=new Uint32Array(r.buffer),i=g(r,t),a=i[0],s=i[1],l=n.length,c=new Uint8Array(l>>2);let u;if(n.length<2e7)for(var d=0;d<l;d+=4)u=y(a,f=n[d]*(1/255),h=n[d+1]*(1/255),p=n[d+2]*(1/255),m=n[d+3]*(1/255)),c[d>>2]=u.ind,o[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var f=n[d]*(1/255),h=n[d+1]*(1/255),p=n[d+2]*(1/255),m=n[d+3]*(1/255);for(u=a;u.left;)u=b(u.est,f,h,p,m)<=0?u.left:u.right;c[d>>2]=u.ind,o[d>>2]=u.est.rgba}return{abuf:r.buffer,inds:c,plte:s}}function g(e,t,n){null==n&&(n=1e-4);const r=new Uint32Array(e.buffer),o={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};o.bst=x(e,o.i0,o.i1),o.est=k(o.bst);const i=[o];for(;i.length<t;){let t=0,o=0;for(var a=0;a<i.length;a++)i[a].est.L>t&&(t=i[a].est.L,o=a);if(t<n)break;const s=i[o],l=v(e,r,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=l||s.i1<=l){s.est.L=0;continue}const c={i0:s.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=x(e,c.i0,c.i1),c.est=k(c.bst);const u={i0:l,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-c.bst.N},a=0;a<16;a++)u.bst.R[a]=s.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)u.bst.m[a]=s.bst.m[a]-c.bst.m[a];u.est=k(u.bst),s.left=c,s.right=u,i[o]=c,i.push(u)}for(i.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<i.length;a++)i[a].ind=a;return[o,i]}function y(e,t,n,r,o){if(null==e.left)return e.tdst=function(e,t,n,r,o){const i=t-e[0],a=n-e[1],s=r-e[2],l=o-e[3];return i*i+a*a+s*s+l*l}(e.est.q,t,n,r,o),e;const i=b(e.est,t,n,r,o);let a=e.left,s=e.right;i>0&&(a=e.right,s=e.left);const l=y(a,t,n,r,o);if(l.tdst<=i*i)return l;const c=y(s,t,n,r,o);return c.tdst<l.tdst?c:l}function b(e,t,n,r,o){const{e:i}=e;return i[0]*t+i[1]*n+i[2]*r+i[3]*o-e.eMq}function v(e,t,n,r,o,i){for(r-=4;n<r;){for(;w(e,n,o)<=i;)n+=4;for(;w(e,r,o)>i;)r-=4;if(n>=r)break;const a=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=a,n+=4,r-=4}for(;w(e,n,o)>i;)n-=4;return n+4}function w(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]}function x(e,t,n){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=[0,0,0,0],i=n-t>>2;for(let a=t;a<n;a+=4){const t=e[a]*(1/255),n=e[a+1]*(1/255),i=e[a+2]*(1/255),s=e[a+3]*(1/255);o[0]+=t,o[1]+=n,o[2]+=i,o[3]+=s,r[0]+=t*t,r[1]+=t*n,r[2]+=t*i,r[3]+=t*s,r[5]+=n*n,r[6]+=n*i,r[7]+=n*s,r[10]+=i*i,r[11]+=i*s,r[15]+=s*s}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:o,N:i}}function k(e){const{R:t}=e,{m:n}=e,{N:r}=e,o=n[0],i=n[1],a=n[2],s=n[3],l=0==r?0:1/r,c=[t[0]-o*o*l,t[1]-o*i*l,t[2]-o*a*l,t[3]-o*s*l,t[4]-i*o*l,t[5]-i*i*l,t[6]-i*a*l,t[7]-i*s*l,t[8]-a*o*l,t[9]-a*i*l,t[10]-a*a*l,t[11]-a*s*l,t[12]-s*o*l,t[13]-s*i*l,t[14]-s*a*l,t[15]-s*s*l],u=c,d=S;let f=[Math.random(),Math.random(),Math.random(),Math.random()],h=0,p=0;if(0!=r)for(let g=0;g<16&&(f=d.multVec(u,f),p=Math.sqrt(d.dot(f,f)),f=d.sml(1/p,f),!(0!=g&&Math.abs(p-h)<1e-9));g++)h=p;const m=[o*l,i*l,a*l,s*l];return{Cov:c,q:m,e:f,L:h,eMq255:d.dot(d.sml(255,m),f),eMq:d.dot(f,m),rgba:(Math.round(255*m[3])<<24|Math.round(255*m[2])<<16|Math.round(255*m[1])<<8|Math.round(255*m[0]))>>>0}}var S={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};by.encode=function(e,t,n,r,o,i,a){null==r&&(r=0),null==a&&(a=!1);const s=u(e,t,n,r,[!1,!1,!1,0,a,!1]);return c(s,-1),l(s,t,n,o,i)},by.encodeLL=function(e,t,n,r,o,i,a,s){const u={ctype:0+(1==r?0:2)+(0==o?0:4),depth:i,frames:[]},d=(r+o)*i,f=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(f/8)});return c(u,0,!0),l(u,t,n,a,s)},by.encode.compress=u,by.encode.dither=s,by.quantize=m,by.quantize.getKDtree=g,by.quantize.getNearest=y}();const vy={toArrayBuffer(e,t){const n=e.width,r=e.height,o=n<<2,i=e.getContext("2d").getImageData(0,0,n,r),a=new Uint32Array(i.data.buffer),s=(32*n+31)/32<<2,l=s*r,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),f=1<<20;let h,p,m,g,y=f,b=0,v=0,w=0;function x(e){d.setUint16(v,e,!0),v+=2}function k(e){d.setUint32(v,e,!0),v+=4}function S(e){v+=e}x(19778),k(c),S(4),k(122),k(108),k(n),k(-r>>>0),x(1),x(32),k(3),k(l),k(2835),k(2835),S(8),k(16711680),k(65280),k(255),k(4278190080),k(1466527264),function e(){for(;b<r&&y>0;){for(g=122+b*s,h=0;h<o;)y--,p=a[w++],m=p>>>24,d.setUint32(g+h,p<<8|m),h+=4;b++}w<a.length?(y=f,setTimeout(e,vy._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var wy={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},xy={[wy.CHROME]:16384,[wy.FIREFOX]:11180,[wy.DESKTOP_SAFARI]:16384,[wy.IE]:8192,[wy.IOS]:4096,[wy.ETC]:8192};const ky="undefined"!=typeof window,Sy="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,_y=ky&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Cy=(ky||Sy)&&(_y&&_y.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Ey=(ky||Sy)&&(_y&&_y.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function zy(e,t,n=Date.now()){return new Promise(r=>{const o=e.split(","),i=o[0].match(/:(.*?);/)[1],a=globalThis.atob(o[1]);let s=a.length;const l=new Uint8Array(s);for(;s--;)l[s]=a.charCodeAt(s);const c=new Blob([l],{type:i});c.name=t,c.lastModified=n,r(c)})}function Ay(e){return new Promise((t,n)=>{const r=new Ey;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}function Ny(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e})}function Ty(){if(void 0!==Ty.cachedResult)return Ty.cachedResult;let e=wy.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=wy.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=wy.IOS:/Safari/i.test(t)?e=wy.DESKTOP_SAFARI:/Firefox/i.test(t)?e=wy.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=wy.IE),Ty.cachedResult=e,Ty.cachedResult}function Oy(e,t){const n=Ty(),r=xy[n];let o=e,i=t,a=o*i;const s=o>i?i/o:o/i;for(;a>r*r;){const e=(r+o)/2,t=(r+i)/2;e<t?(i=t,o=t*s):(i=e*s,o=e),a=o*i}return{width:o,height:i}}function Iy(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),null===r)throw new Error("getContext of OffscreenCanvas returns null")}catch(o){n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function jy(e,t){const{width:n,height:r}=Oy(e.width,e.height),[o,i]=Iy(n,r);return t&&/jpe?g/.test(t)&&(i.fillStyle="white",i.fillRect(0,0,o.width,o.height)),i.drawImage(e,0,0,o.width,o.height),o}function My(){return void 0!==My.cachedResult||(My.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),My.cachedResult}function Py(e,t={}){return new Promise(function(n,r){let o,i;var a=function(){try{return i=jy(o,t.fileType||e.type),n([o,i])}catch(a){return r(a)}},s=function(t){try{var n=function(e){try{throw e}catch(t){return r(t)}};try{let t;return Ay(e).then(function(e){try{return t=e,Ny(t).then(function(e){try{return o=e,function(){try{return a()}catch(e){return r(e)}}()}catch(t){return n(t)}},n)}catch(i){return n(i)}},n)}catch(i){n(i)}}catch(i){return r(i)}};try{if(My()||[wy.DESKTOP_SAFARI,wy.MOBILE_SAFARI].includes(Ty()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return o=e,a()}catch(t){return s()}},s)}catch(l){s()}})}function Fy(e,t,n,r,o=1){return new Promise(function(i,a){let s;if("image/png"===t){let i,a,c;return i=e.getContext("2d"),({data:a}=i.getImageData(0,0,e.width,e.height)),c=by.encode([a.buffer],e.width,e.height,4096*o),s=new Blob([c],{type:t}),s.name=n,s.lastModified=r,l.call(this)}{let i=function(){return l.call(this)};if("image/bmp"===t)return new Promise(t=>vy.toBlob(e,t)).then(function(e){try{return s=e,s.name=n,s.lastModified=r,i.call(this)}catch(t){return a(t)}}.bind(this),a);{let l=function(){return i.call(this)};if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:o}).then(function(e){try{return s=e,s.name=n,s.lastModified=r,l.call(this)}catch(t){return a(t)}}.bind(this),a);{let i;return i=e.toDataURL(t,o),zy(i,n,r).then(function(e){try{return s=e,l.call(this)}catch(t){return a(t)}}.bind(this),a)}}}function l(){return i(s)}})}function Ly(e){e.width=0,e.height=0}function Ry(){return new Promise(function(e,t){let n,r,o,i;return void 0!==Ry.cachedResult?e(Ry.cachedResult):zy("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return n=a,Py(n).then(function(a){try{return r=a[1],Fy(r,n.type,n.name,n.lastModified).then(function(n){try{return o=n,Ly(r),Py(o).then(function(n){try{return i=n[0],Ry.cachedResult=1===i.width&&2===i.height,e(Ry.cachedResult)}catch(r){return t(r)}},t)}catch(a){return t(a)}},t)}catch(s){return t(s)}},t)}catch(s){return t(s)}},t)})}function Dy(e){return new Promise((t,n)=>{const r=new Ey;r.onload=e=>{const n=new DataView(e.target.result);if(65496!=n.getUint16(0,!1))return t(-2);const r=n.byteLength;let o=2;for(;o<r;){if(n.getUint16(o+2,!1)<=8)return t(-1);const e=n.getUint16(o,!1);if(o+=2,65505==e){if(1165519206!=n.getUint32(o+=2,!1))return t(-1);const e=18761==n.getUint16(o+=6,!1);o+=n.getUint32(o+4,e);const r=n.getUint16(o,e);o+=2;for(let i=0;i<r;i++)if(274==n.getUint16(o+12*i,e))return t(n.getUint16(o+12*i+8,e))}else{if(65280&~e)break;o+=n.getUint16(o,!1)}}return t(-1)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}function Uy(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:o}=t;let i,a=e;return isFinite(o)&&(n>o||r>o)&&([a,i]=Iy(n,r),n>r?(a.width=o,a.height=r/n*o):(a.width=n/r*o,a.height=o),i.drawImage(e,0,0,a.width,a.height),Ly(e)),a}function By(e,t){const{width:n}=e,{height:r}=e,[o,i]=Iy(n,r);switch(t>4&&t<9?(o.width=r,o.height=n):(o.width=n,o.height=r),t){case 2:i.transform(-1,0,0,1,n,0);break;case 3:i.transform(-1,0,0,-1,n,r);break;case 4:i.transform(1,0,0,-1,0,r);break;case 5:i.transform(0,1,1,0,0,0);break;case 6:i.transform(0,1,-1,0,r,0);break;case 7:i.transform(0,-1,-1,0,r,n);break;case 8:i.transform(0,-1,1,0,0,n)}return i.drawImage(e,0,0,n,r),Ly(e),o}function $y(e,t,n=0){return new Promise(function(r,o){let i,a,s,l,c,u,d,f,h,p,m,g,y,b,v,w,x,k,S,_;function C(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;i+=e,t.onProgress(Math.min(i,100))}function E(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;i=Math.min(Math.max(e,i),100),t.onProgress(i)}return i=n,a=t.maxIteration||10,s=1024*t.maxSizeMB*1024,C(),Py(e,t).then(function(n){try{return[,l]=n,C(),c=Uy(l,t),C(),new Promise(function(n,r){var o;if(!(o=t.exifOrientation))return Dy(e).then(function(e){try{return o=e,i.call(this)}catch(t){return r(t)}}.bind(this),r);function i(){return n(o)}return i.call(this)}).then(function(n){try{return u=n,C(),Ry().then(function(n){try{return d=n?c:By(c,u),C(),f=t.initialQuality||1,h=t.fileType||e.type,Fy(d,h,e.name,e.lastModified,f).then(function(n){try{{let u=function(){if(a--&&(v>s||v>y)){let t,n;return t=_?.95*S.width:S.width,n=_?.95*S.height:S.height,[x,k]=Iy(t,n),k.drawImage(S,0,0,t,n),f*="image/png"===h?.85:.95,Fy(x,h,e.name,e.lastModified,f).then(function(e){try{return w=e,Ly(S),S=x,v=w.size,E(Math.min(99,Math.floor((b-v)/(b-s)*100))),u}catch(t){return o(t)}},o)}return[1]},z=function(){return Ly(S),Ly(x),Ly(c),Ly(d),Ly(l),E(100),r(w)};return p=n,C(),m=p.size>s,g=p.size>e.size,m||g?(y=e.size,b=p.size,v=b,S=d,_=!t.alwaysKeepResolution&&m,(i=function(e){for(;e;){if(e.then)return void e.then(i,o);try{if(e.pop){if(e.length)return e.pop()?z.call(this):e;e=u}else e=e.call(this)}catch(t){return o(t)}}}.bind(this))(u)):(E(100),r(p));var i}}catch(u){return o(u)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)}catch(i){return o(i)}}.bind(this),o)})}let Vy;function Hy(e,t){return new Promise(function(n,r){let o,i,a,s,l,c;if(o={...t},a=0,({onProgress:s}=o),o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof o.useWebWorker||o.useWebWorker,delete o.useWebWorker,o.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof Cy))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return $y(e,o).then(function(e){try{return i=e,f.call(this)}catch(t){return r(t)}}.bind(this),r);var u=function(){try{return f.call(this)}catch(e){return r(e)}}.bind(this),d=function(t){try{return $y(e,o).then(function(e){try{return i=e,u()}catch(t){return r(t)}},r)}catch(n){return r(n)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",function(e,t){return new Promise((n,r)=>{Vy||(Vy=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"));const o=new Worker(Vy);o.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)o.terminate();else if(void 0===e.data.progress){if(e.data.error)return r(new Error(e.data.error)),void o.terminate();n(e.data.file),o.terminate()}else t.onProgress(e.data.progress)}),o.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",()=>{r(t.signal.reason),o.terminate()}),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}(e,o).then(function(e){try{return i=e,u()}catch(t){return d()}},d)}catch(h){d()}function f(){try{i.name=e.name,i.lastModified=e.lastModified}catch(h){}try{o.preserveExif&&"image/jpeg"===e.type&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(i=cy(e,i))}catch(h){}return n(i)}})}Hy.getDataUrlFromFile=Ay,Hy.getFilefromDataUrl=zy,Hy.loadImage=Ny,Hy.drawImageInCanvas=jy,Hy.drawFileInCanvas=Py,Hy.canvasToFile=Fy,Hy.getExifOrientation=Dy,Hy.handleMaxWidthOrHeight=Uy,Hy.followExifOrientation=By,Hy.cleanupCanvasMemory=Ly,Hy.isAutoOrientationInBrowser=Ry,Hy.approximateBelowMaximumCanvasSizeOfBrowser=Oy,Hy.copyExifWithoutOrientation=cy,Hy.getBrowserName=Ty,Hy.version="2.0.2";const Wy=Object.freeze(Object.defineProperty({__proto__:null,default:Hy},Symbol.toStringTag,{value:"Module"}));e.BotUyoChatWidget=ny,e.ChatWidget=Xg,e.ChatWidgetProvider=function({children:e,defaultLocale:t,initialState:n,onStateChange:r,...o}){const[i,a]=k.useState(n?.isOpen??!1),[s,l]=k.useState(0),c=k.useCallback(()=>{a(!0),l(0),r?.(!0)},[r]),u=k.useCallback(()=>{a(!1),r?.(!1)},[r]),d=k.useCallback(()=>{a(e=>{const t=!e;return t&&l(0),r?.(t),t})},[r]),f=k.useCallback(e=>{qg?(qg(e),Wt("ChatWidgetProvider sendMessage:",e)):Vt("sendMessage called but no handler registered")},[]),h=k.useCallback(()=>{Zg?(Zg(),Wt("ChatWidgetProvider clearMessages called")):Vt("clearMessages called but no handler registered")},[]),p={isOpen:i,open:c,close:u,toggle:d,sendMessage:f,clearMessages:h,unreadCount:s},m=k.useCallback((e,t)=>{"message:received"!==e||i||l(e=>e+1),o.onEvent?.(e,t)},[i,o]);return A.jsx(j,{defaultLocale:t,children:A.jsxs(Jg.Provider,{value:p,children:[e,A.jsx(Xg,{...o,onStateChange:e=>{a(e),e&&l(0),r?.(e)},onEvent:m})]})})},e.LanguageProvider=j,e.default=ry,e.useChatWidget=function(){const e=k.useContext(Jg);if(!e)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return e},e.useLanguage=M,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
2
|
//# sourceMappingURL=botuyo-chat.umd.js.map
|