1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ee={current:null},te={transition:null},ne={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:te,ReactCurrentOwner:C};function re(){throw Error(`act(...) is not supported in production builds of React.`)}
vendor: 7,877 bytes, line 1
1e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,e.act=re,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=te.transition;te.transition={};try{e()}finally{te.transition=t}},e.unstable_act=re,e.useCallback=function(e,t){return ee.current.useCallback(e,t)},e.useContext=function(e){return ee.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return ee.current.useDeferredValue(e)},e.useEffect=function(e,t){return ee.current.useEffect(e,t)},e.useId=function(){return ee.current.useId()},e.useImperativeHandle=function(e,t,n){return ee.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return ee.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return ee.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return ee.current.useMemo(e,t)},e.useReducer=function(e,t,n){return ee.current.useReducer(e,t,n)},e.useRef=function(e){return ee.current.useRef(e)},e.useState=function(e){return ee.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return ee.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return ee.current.useTransition()},e.version=`18.3.1`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=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(){m||p||(m=!0,M(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`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},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,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p(),n=h();function r(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 i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function m(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;
vendor: 11,819 bytes, lines 1-5
1if(r)return!1;if(n!==null)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}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(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){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`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(b,x);y[t]=new v(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(b,x);y[t]=new v(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(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.offscreen`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Object.assign,oe;function se(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``}return` 2`+oe+e}var ce=!1;function le(e,t){if(!e||ce)return``;ce=!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()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(` 3`),a=r.stack.split(` 4`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=` 5`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ce=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?se(e):``}function ue(e){switch(e.tag){case 5:return se(e.type);case 16:return se(`Lazy`);case 13:return se(`Suspense`);case 19:return se(`SuspenseList`);case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return``}}function de(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}function fe(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=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return de(t);case 8:return t===D?`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(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function pe(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function he(e){var t=me(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.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]}}}}function ge(e){e._valueTracker||=he(e)}function _e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=me(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ve(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function ye(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function be(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=pe(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function xe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function Se(e,t){xe(e,t);var n=pe(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?we(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&we(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ce(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function we(e,t,n){(t!==`number`||ve(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Te=Array.isArray;function Ee(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+pe(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function De(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return ae({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Oe(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(Te(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:pe(n)}}function ke(e,t){var n=pe(t.value),r=pe(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function je(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 Me(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?je(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ne,Pe=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Ne||=document.createElement(`div`),Ne.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ne.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fe(e,t){if(t){var n=e.firstChild;
vendor: 2,303 bytes, line 5
5if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ie={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},Le=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ie).forEach(function(e){Le.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ie[t]=Ie[e]})});function Re(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ie.hasOwnProperty(e)&&Ie[e]?(``+t).trim():t+`px`}function ze(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Re(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Be=ae({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]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function He(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;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 Ue=null;function We(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ge=null,Ke=null,qe=null;function Je(e){if(e=qi(e)){if(typeof Ge!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Yi(t),Ge(e.stateNode,e.type,t))}}function Ye(e){Ke?qe?qe.push(e):qe=[e]:Ke=e}
vendor: 9,463 bytes, line 5
5function Xe(){if(Ke){var e=Ke,t=qe;if(qe=Ke=null,Je(e),t)for(e=0;e<t.length;e++)Je(t[e])}}function Ze(e,t){return e(t)}function Qe(){}var $e=!1;function et(e,t,n){if($e)return e(t,n);$e=!0;try{return Ze(e,t,n)}finally{$e=!1,(Ke!==null||qe!==null)&&(Qe(),Xe())}}function tt(e,t){var n=e.stateNode;if(n===null)return null;var i=Yi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var nt=!1;if(c)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){nt=!0}}),window.addEventListener(`test`,rt,rt),window.removeEventListener(`test`,rt,rt)}catch{nt=!1}function it(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var at=!1,ot=null,st=!1,ct=null,lt={onError:function(e){at=!0,ot=e}};function ut(e,t,n,r,i,a,o,s,c){at=!1,ot=null,it.apply(lt,arguments)}function dt(e,t,n,i,a,o,s,c,l){if(ut.apply(this,arguments),at){if(at){var u=ot;at=!1,ot=null}else throw Error(r(198));st||(st=!0,ct=u)}}function ft(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function pt(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function mt(e){if(ft(e)!==e)throw Error(r(188))}function ht(e){var t=e.alternate;if(!t){if(t=ft(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return mt(a),e;if(o===i)return mt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function P(e){return e=ht(e),e===null?null:gt(e)}function gt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gt(e);if(t!==null)return t;e=e.sibling}return null}var _t=n.unstable_scheduleCallback,vt=n.unstable_cancelCallback,yt=n.unstable_shouldYield,bt=n.unstable_requestPaint,xt=n.unstable_now,St=n.unstable_getCurrentPriorityLevel,Ct=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Tt=n.unstable_NormalPriority,Et=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Ot=null,kt=null;function At(e){if(kt&&typeof kt.onCommitFiberRoot==`function`)try{kt.onCommitFiberRoot(Ot,e,void 0,(e.current.flags&128)==128)}catch{}}var jt=Math.clz32?Math.clz32:Pt,Mt=Math.log,Nt=Math.LN2;function Pt(e){return e>>>=0,e===0?32:31-(Mt(e)/Nt|0)|0}var Ft=64,It=4194304;function Lt(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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Lt(a))):r=Lt(s)}else o=n&~i,o===0?a!==0&&(r=Lt(a)):r=Lt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-jt(t),i=1<<n,r|=e[n],t&=~i;return r}function zt(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;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-jt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=zt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Vt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Ht(){var e=Ft;return Ft<<=1,!(Ft&4194240)&&(Ft=64),e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Gt(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 i=31-jt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Kt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qt=0;function Jt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yt,Xt,Zt,Qt,$t,en=!1,tn=[],nn=null,rn=null,an=null,on=new Map,sn=new Map,cn=[],ln=`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 un(e,t){switch(e){case`focusin`:case`focusout`:nn=null;break;case`dragenter`:case`dragleave`:rn=null;break;case`mouseover`:case`mouseout`:an=null;break;case`pointerover`:case`pointerout`:on.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:sn.delete(t.pointerId)}}function dn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=qi(t),t!==null&&Xt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fn(e,t,n,r,i){switch(t){case`focusin`:return nn=dn(nn,e,t,n,r,i),!0;case`dragenter`:return rn=dn(rn,e,t,n,r,i),!0;case`mouseover`:return an=dn(an,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return on.set(a,dn(on.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,sn.set(a,dn(sn.get(a)||null,e,t,n,r,i)),!0}return!1}function pn(e){var t=Ki(e.target);if(t!==null){var n=ft(t);if(n!==null){if(t=n.tag,t===13){if(t=pt(n),t!==null){e.blockedOn=t,$t(e.priority,function(){Zt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ue=r,n.target.dispatchEvent(r),Ue=null}else return t=qi(n),t!==null&&Xt(t),e.blockedOn=n,!1;t.shift()}return!0}function hn(e,t,n){mn(e)&&n.delete(t)}function gn(){en=!1,nn!==null&&mn(nn)&&(nn=null),rn!==null&&mn(rn)&&(rn=null),an!==null&&mn(an)&&(an=null),on.forEach(hn),sn.forEach(hn)}function _n(e,t){e.blockedOn===t&&(e.blockedOn=null,en||(en=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,gn)))}function vn(e){function t(t){return _n(t,e)}if(0<tn.length){_n(tn[0],e);for(var n=1;n<tn.length;n++){var r=tn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nn!==null&&_n(nn,e),rn!==null&&_n(rn,e),an!==null&&_n(an,e),on.forEach(t),sn.forEach(t),n=0;n<cn.length;n++)r=cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cn.length&&(n=cn[0],n.blockedOn===null);)pn(n),n.blockedOn===null&&cn.shift()}var yn=C.ReactCurrentBatchConfig,bn=!0;function xn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=1,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Sn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=4,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Cn(e,t,n,r){if(bn){var i=Tn(e,t,n,r);if(i===null)vi(e,t,r,wn,n),un(e,r);else if(fn(i,e,t,n,r))r.stopPropagation();else if(un(e,r),t&4&&-1<ln.indexOf(e)){for(;i!==null;){var a=qi(i);if(a!==null&&Yt(a),a=Tn(e,t,n,r),a===null&&vi(e,t,r,wn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else vi(e,t,r,null,n)}}var wn=null;function Tn(e,t,n,r){if(wn=null,e=We(r),e=Ki(e),e!==null)if(t=ft(e),t===null)e=null;else if(n=t.tag,n===13){if(e=pt(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wn=e,null}function En(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`
vendor: 5,043 bytes, line 5
5: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(St()){case Ct:return 1;case wt:return 4;case Tt:case Et:return 16;case Dt:return 536870912;default:return 16}default:return 16}}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=ae({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=ae({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),F=Pn(ae({},Hn,{dataTransfer:0})),Wn=Pn(ae({},Ln,{relatedTarget:0})),Gn=Pn(ae({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Pn(ae({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Pn(ae({},Fn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Pn(ae({},Ln,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Pn(ae({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Pn(ae({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),nr=Pn(ae({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Pn(ae({},Hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}
vendor: 92,576 bytes, lines 5-8
5)),ir=[9,13,27,32],ar=c&&`CompositionEvent`in window,or=null;c&&`documentMode`in document&&(or=document.documentMode);var sr=c&&`TextEvent`in window&&!or,cr=c&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=An(),kn=On=Dn=null,pr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){Ye(r),t=bi(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){fi(e,0)}function Sr(e){if(_e(Ji(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(c){var Tr;if(c){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,We(e)),et(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rr(e,t){var n=Lr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(){for(var e=window,t=ve();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ve(e.document)}return t}function Vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Hr(e){var t=Br(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zr(n.ownerDocument.documentElement,n)){if(r!==null&&Vr(n)){if(t=r.start,e=r.end,e===void 0&&(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,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Rr(n,a);var o=Rr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ur=c&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==ve(r)||(r=Wr,`selectionStart`in r&&Vr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&Ir(Kr,r)||(Kr=r,r=bi(Gr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};c&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionend`),ii=new Map,ai=`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 oi(e,t){ii.set(e,t),o(t,[e])}for(var si=0;si<ai.length;si++){var ci=ai[si];oi(ci.toLowerCase(),`on`+(ci[0].toUpperCase()+ci.slice(1)))}oi(ei,`onAnimationEnd`),oi(ti,`onAnimationIteration`),oi(ni,`onAnimationStart`),oi(`dblclick`,`onDoubleClick`),oi(`focusin`,`onFocus`),oi(`focusout`,`onBlur`),oi(ri,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var li=`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(` `),ui=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(li));function di(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,dt(r,t,void 0,e),e.currentTarget=null}function fi(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;di(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;di(i,s,l),a=c}}}if(st)throw e=ct,st=!1,ct=null,e}function pi(e,t){var n=t[Ui];n===void 0&&(n=t[Ui]=new Set);var r=e+`__bubble`;n.has(r)||(_i(t,e,2,!1),n.add(r))}function mi(e,t,n){var r=0;t&&(r|=4),_i(n,e,r,t)}var hi=`_reactListening`+Math.random().toString(36).slice(2);function gi(e){if(!e[hi]){e[hi]=!0,i.forEach(function(t){t!==`selectionchange`&&(ui.has(t)||mi(t,!1,e),mi(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,mi(`selectionchange`,!1,t))}}function _i(e,t,n,r){switch(En(t)){case 1:var i=xn;break;case 4:i=Sn;break;default:i=Cn}n=i.bind(null,t,n,e),i=void 0,!nt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function vi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ki(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}et(function(){var r=a,i=We(n),o=[];a:{var s=ii.get(e);if(s!==void 0){var c=In,l=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=$n;break;case`focusin`:l=`focus`,c=Wn;break;case`focusout`:l=`blur`,c=Wn;break;case`beforeblur`:case`afterblur`:c=Wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=F;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=tr;break;case ei:case ti:case ni:c=Gn;break;case ri:c=nr;break;case`scroll`:c=Rn;break;case`wheel`:c=rr;break;case`copy`:case`cut`:case`paste`:c=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=er}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=tt(p,f),h!=null&&u.push(yi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ue&&(l=n.relatedTarget||n.fromElement)&&(Ki(l)||l[Hi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ki(l):null,l!==null&&(d=ft(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Un,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=er,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Ji(c),m=l==null?s:Ji(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ki(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=xi(m))p++;for(m=0,h=f;h;h=xi(h))m++;for(;0<p-m;)u=xi(u),p--;for(;0<m-p;)f=xi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=xi(u),f=xi(f)}u=null}else u=null;c!==null&&Si(o,s,c,u,!1),l!==null&&d!==null&&Si(o,d,l,u,!0)}}a:{if(s=r?Ji(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=Cr;else if(_r(s))if(wr)g=Nr;else{g=jr;var _=Ar}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Mr);if(g&&=g(e,r)){vr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&we(s,`number`,s.value)}switch(_=r?Ji(r):window,e){case`focusin`:(_r(_)||_.contentEditable===`true`)&&(Wr=_,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(o,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(o,n,i)}var v;if(ar)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else pr?dr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(cr&&n.locale!==`ko`&&(pr||y!==`onCompositionStart`?y===`onCompositionEnd`&&pr&&(v=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,pr=!0)),_=bi(r,y),0<_.length&&(y=new qn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=fr(n),v!==null&&(y.data=v)))),(v=sr?mr(e,n):hr(e,n))&&(r=bi(r,`onBeforeInput`),0<r.length&&(i=new qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}fi(o,t)})}function yi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tt(e,n),a!=null&&r.unshift(yi(e,a,i)),a=tt(e,t),a!=null&&r.push(yi(e,a,i))),e=e.return}return r}function xi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Si(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=tt(n,a),c!=null&&o.unshift(yi(n,c,s))):i||(c=tt(n,a),c!=null&&o.push(yi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ci=/\r\n?/g,wi=/\u0000|\uFFFD/g;function Ti(e){return(typeof e==`string`?e:``+e).replace(Ci,` 6`).replace(wi,``)}function Ei(e,t,n){if(t=Ti(t),Ti(e)!==t&&n)throw Error(r(425))}function Di(){}var Oi=null,ki=null;function Ai(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ji=typeof setTimeout==`function`?setTimeout:void 0,Mi=typeof clearTimeout==`function`?clearTimeout:void 0,Ni=typeof Promise==`function`?Promise:void 0,Pi=typeof queueMicrotask==`function`?queueMicrotask:Ni===void 0?ji:function(e){return Ni.resolve(null).then(e).catch(Fi)};function Fi(e){setTimeout(function(){throw e})}function Ii(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),vn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);vn(t)}function Li(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ri(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var zi=Math.random().toString(36).slice(2),Bi=`__reactFiber$`+zi,Vi=`__reactProps$`+zi,Hi=`__reactContainer$`+zi,Ui=`__reactEvents$`+zi,Wi=`__reactListeners$`+zi,Gi=`__reactHandles$`+zi;function Ki(e){var t=e[Bi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hi]||n[Bi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ri(e);e!==null;){if(n=e[Bi])return n;e=Ri(e)}return t}e=n,n=e.parentNode}return null}function qi(e){return e=e[Bi]||e[Hi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ji(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Yi(e){return e[Vi]||null}var Xi=[],Zi=-1;function Qi(e){return{current:e}}function $i(e){0>Zi||(e.current=Xi[Zi],Xi[Zi]=null,Zi--)}function ea(e,t){Zi++,Xi[Zi]=e.current,e.current=t}var ta={},na=Qi(ta),ra=Qi(!1),ia=ta;function aa(e,t){var n=e.type.contextTypes;if(!n)return ta;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function oa(e){return e=e.childContextTypes,e!=null}function sa(){$i(ra),$i(na)}function ca(e,t,n){if(na.current!==ta)throw Error(r(168));ea(na,t),ea(ra,n)}function la(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,fe(e)||`Unknown`,a));return ae({},n,i)}function ua(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ta,ia=na.current,ea(na,e),ea(ra,ra.current),!0}function da(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=la(e,t,ia),i.__reactInternalMemoizedMergedChildContext=e,$i(ra),$i(na),ea(na,e)):$i(ra),ea(ra,n)}var fa=null,pa=!1,ma=!1;function ha(e){fa===null?fa=[e]:fa.push(e)}function ga(e){pa=!0,ha(e)}function _a(){if(!ma&&fa!==null){ma=!0;var e=0,t=qt;try{var n=fa;for(qt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}fa=null,pa=!1}catch(t){throw fa!==null&&(fa=fa.slice(e+1)),_t(Ct,_a),t}finally{qt=t,ma=!1}}return null}var va=[],ya=0,ba=null,xa=0,Sa=[],Ca=0,wa=null,Ta=1,Ea=``;function Da(e,t){va[ya++]=xa,va[ya++]=ba,ba=e,xa=t}function Oa(e,t,n){Sa[Ca++]=Ta,Sa[Ca++]=Ea,Sa[Ca++]=wa,wa=e;var r=Ta;e=Ea;var i=32-jt(r)-1;r&=~(1<<i),n+=1;var a=32-jt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ta=1<<32-jt(t)+i|n<<i|r,Ea=a+e}else Ta=1<<a|n<<i|r,Ea=e}function ka(e){e.return!==null&&(Da(e,1),Oa(e,1,0))}function Aa(e){for(;e===ba;)ba=va[--ya],va[ya]=null,xa=va[--ya],va[ya]=null;for(;e===wa;)wa=Sa[--Ca],Sa[Ca]=null,Ea=Sa[--Ca],Sa[Ca]=null,Ta=Sa[--Ca],Sa[Ca]=null}var ja=null,Ma=null,Na=!1,Pa=null;function Fa(e,t){var n=su(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ia(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ja=e,Ma=Li(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ja=e,Ma=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=wa===null?null:{id:Ta,overflow:Ea},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=su(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ja=e,Ma=null,!0);default:return!1}}function La(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ra(e){if(Na){var t=Ma;if(t){var n=t;if(!Ia(e,t)){if(La(e))throw Error(r(418));t=Li(n.nextSibling);var i=ja;t&&Ia(e,t)?Fa(i,n):(e.flags=e.flags&-4097|2,Na=!1,ja=e)}}else{if(La(e))throw Error(r(418));e.flags=e.flags&-4097|2,Na=!1,ja=e}}}function za(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ja=e}function Ba(e){if(e!==ja)return!1;if(!Na)return za(e),Na=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ai(e.type,e.memoizedProps)),t&&=Ma){if(La(e))throw Va(),Error(r(418));for(;t;)Fa(e,t),t=Li(t.nextSibling)}if(za(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Ma=Li(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Ma=null}}else Ma=ja?Li(e.stateNode.nextSibling):null;return!0}function Va(){for(var e=Ma;e;)e=Li(e.nextSibling)}function Ha(){Ma=ja=null,Na=!1}function Ua(e){Pa===null?Pa=[e]:Pa.push(e)}var Wa=C.ReactCurrentBatchConfig;function Ga(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ka(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function qa(e){var t=e._init;return t(e._payload)}function Ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=uu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=mu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===te&&qa(i)===t.type)?(r=a(t,n.props),r.ref=Ga(e,t,n),r.return=e,r):(r=du(n.type,n.key,n.props,null,e.mode,r),r.ref=Ga(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=mu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=du(t.type,t.key,t.props,null,e.mode,n),n.ref=Ga(e,null,t),n.return=e,n;case T:return t=hu(t,e.mode,n),t.return=e,t;case te:var r=t._init;return f(e,r(t._payload),n)}if(Te(t)||ie(t))return t=fu(t,e.mode,n,null),t.return=e,t;Ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case te:return i=n._init,p(e,t,i(n._payload),r)}if(Te(n)||ie(n))return i===null?d(e,t,n,r,null):null;Ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case te:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Te(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);Ka(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Na&&Da(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Na&&Da(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Na&&Da(r,h),l}function g(a,s,c,l){var u=ie(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Na&&Da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Na&&Da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Na&&Da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===te&&qa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ga(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=fu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=du(i.type,i.key,i.props,null,e.mode,o),o.ref=Ga(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=hu(i,e.mode,o),r.return=e,e=r}return s(e);case te:return l=i._init,_(e,r,l(i._payload),o)}if(Te(i))return h(e,r,i,o);if(ie(i))return g(e,r,i,o);Ka(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=mu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ya=Ja(!0),Xa=Ja(!1),Za=Qi(null),Qa=null,$a=null,eo=null;function to(){eo=$a=Qa=null}function no(e){var t=Za.current;$i(Za),e._currentValue=t}function ro(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function io(e,t){Qa=e,eo=$a=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(qs=!0),e.firstContext=null)}function ao(e){var t=e._currentValue;if(eo!==e)if(e={context:e,memoizedValue:t,next:null},$a===null){if(Qa===null)throw Error(r(308));$a=e,Qa.dependencies={lanes:0,firstContext:e}}else $a=$a.next=e;return t}var oo=null;function so(e){oo===null?oo=[e]:oo.push(e)}function co(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,so(t)):(n.next=i.next,i.next=n),t.interleaved=n,lo(e,r)}function lo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function po(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 mo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function I(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,lo(e,n)}return i=r.interleaved,i===null?(t.next=t,so(r)):(t.next=i.next,i.next=t),r.interleaved=t,lo(e,n)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function _o(e,t,n,r){var i=e.updateQueue;uo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=ae({},d,f);break a;case 2:uo=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);ll|=o,e.lanes=o,e.memoizedState=d}}function vo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var yo={},bo=Qi(yo),xo=Qi(yo),So=Qi(yo);function Co(e){if(e===yo)throw Error(r(174));return e}function wo(e,t){switch(ea(So,t),ea(xo,e),ea(bo,yo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Me(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Me(t,e)}$i(bo),ea(bo,t)}function To(){$i(bo),$i(xo),$i(So)}function Eo(e){Co(So.current);var t=Co(bo.current),n=Me(t,e.type);t!==n&&(ea(xo,e),ea(bo,n))}function Do(e){xo.current===e&&($i(bo),$i(xo))}var Oo=Qi(0);function ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ao=[];function jo(){for(var e=0;e<Ao.length;e++)Ao[e]._workInProgressVersionPrimary=null;Ao.length=0}var Mo=C.ReactCurrentDispatcher,No=C.ReactCurrentBatchConfig,Po=0,Fo=null,Io=null,Lo=null,Ro=!1,zo=!1,Bo=0,Vo=0;function Ho(){throw Error(r(321))}function Uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Wo(e,t,n,i,a,o){if(Po=o,Fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mo.current=e===null||e.memoizedState===null?Ds:Os,e=n(i,a),zo){o=0;do{if(zo=!1,Bo=0,25<=o)throw Error(r(301));o+=1,Lo=Io=null,t.updateQueue=null,Mo.current=ks,e=n(i,a)}while(zo)}if(Mo.current=Es,t=Io!==null&&Io.next!==null,Po=0,Lo=Io=Fo=null,Ro=!1,t)throw Error(r(300));return e}function Go(){var e=Bo!==0;return Bo=0,e}function Ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?Fo.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function qo(){if(Io===null){var e=Fo.alternate;e=e===null?null:e.memoizedState}else e=Io.next;var t=Lo===null?Fo.memoizedState:Lo.next;if(t!==null)Lo=t,Io=e;else{if(e===null)throw Error(r(310));Io=e,e={memoizedState:Io.memoizedState,baseState:Io.baseState,baseQueue:Io.baseQueue,queue:Io.queue,next:null},Lo===null?Fo.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function Jo(e,t){return typeof t==`function`?t(e):t}function Yo(e){var t=qo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Io,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Po&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Fo.lanes|=d,ll|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Fr(i,t.memoizedState)||(qs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Fo.lanes|=o,ll|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Xo(e){var t=qo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Fr(o,t.memoizedState)||(qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Zo(){}function Qo(e,t){var n=Fo,i=qo(),a=t(),o=!Fr(i.memoizedState,a);if(o&&(i.memoizedState=a,qs=!0),i=i.queue,us(ts.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Lo!==null&&Lo.memoizedState.tag&1){if(n.flags|=2048,as(9,es.bind(null,n,i,a,t),void 0,null),nl===null)throw Error(r(349));Po&30||$o(n,t,a)}return a}function $o(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fo.updateQueue,t===null?(t={lastEffect:null,stores:null},Fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function es(e,t,n,r){t.value=n,t.getSnapshot=r,ns(t)&&rs(e)}function ts(e,t,n){return n(function(){ns(t)&&rs(e)})}function ns(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function rs(e){var t=lo(e,1);t!==null&&kl(t,e,1,-1)}function is(e){var t=Ko();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:e},t.queue=e,e=e.dispatch=Ss.bind(null,Fo,e),[t.memoizedState,e]}function as(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Fo.updateQueue,t===null?(t={lastEffect:null,stores:null},Fo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function os(){return qo().memoizedState}function ss(e,t,n,r){var i=Ko();Fo.flags|=e,i.memoizedState=as(1|t,n,void 0,r===void 0?null:r)}function cs(e,t,n,r){var i=qo();r=r===void 0?null:r;var a=void 0;if(Io!==null){var o=Io.memoizedState;if(a=o.destroy,r!==null&&Uo(r,o.deps)){i.memoizedState=as(t,n,a,r);return}}Fo.flags|=e,i.memoizedState=as(1|t,n,a,r)}function ls(e,t){return ss(8390656,8,e,t)}function us(e,t){return cs(2048,8,e,t)}function ds(e,t){return cs(4,2,e,t)}function fs(e,t){return cs(4,4,e,t)}function ps(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){return n=n==null?null:n.concat([e]),cs(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=qo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=qo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Uo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function vs(e,t,n){return Po&21?(Fr(n,t)||(n=Ht(),Fo.lanes|=n,ll|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qs=!0),e.memoizedState=n)}function ys(e,t){var n=qt;qt=n!==0&&4>n?n:4,e(!0);var r=No.transition;No.transition={};try{e(!1),t()}finally{qt=n,No.transition=r}}function bs(){return qo().memoizedState}function xs(e,t,n){var r=Ol(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cs(e))ws(t,n);else if(n=co(e,t,n,r),n!==null){var i=Dl();kl(n,e,r,i),Ts(n,t,r)}}function Ss(e,t,n){var r=Ol(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cs(e))ws(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o)){var c=t.interleaved;c===null?(i.next=i,so(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=co(e,t,i,r),n!==null&&(i=Dl(),kl(n,e,r,i),Ts(n,t,r))}}function Cs(e){var t=e.alternate;return e===Fo||t!==null&&t===Fo}function ws(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ts(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}var Es={readContext:ao,useCallback:Ho,useContext:Ho,useEffect:Ho,useImperativeHandle:Ho,useInsertionEffect:Ho,useLayoutEffect:Ho,useMemo:Ho,useReducer:Ho,useRef:Ho,useState:Ho,useDebugValue:Ho,useDeferredValue:Ho,useTransition:Ho,useMutableSource:Ho,useSyncExternalStore:Ho,useId:Ho,unstable_isNewReconciler:!1},Ds={readContext:ao,useCallback:function(e,t){return Ko().memoizedState=[e,t===void 0?null:t],e},useContext:ao,useEffect:ls,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ss(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){return ss(4,2,e,t)},useMemo:function(e,t){var n=Ko();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ko();return t=n===void 0?t:n(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=xs.bind(null,Fo,e),[r.memoizedState,e]},useRef:function(e){var t=Ko();return e={current:e},t.memoizedState=e},useState:is,useDebugValue:hs,useDeferredValue:function(e){return Ko().memoizedState=e},useTransition:function(){var e=is(!1),t=e[0];return e=ys.bind(null,e[1]),Ko().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Fo,a=Ko();if(Na){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),nl===null)throw Error(r(349));Po&30||$o(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(ts.bind(null,i,o,e),[e]),i.flags|=2048,as(9,es.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ko(),t=nl.identifierPrefix;if(Na){var n=Ea,r=Ta;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Vo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Os={readContext:ao,useCallback:gs,useContext:ao,useEffect:us,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Yo,useRef:os,useState:function(){return Yo(Jo)},useDebugValue:hs,useDeferredValue:function(e){return vs(qo(),Io.memoizedState,e)},useTransition:function(){return[Yo(Jo)[0],qo().memoizedState]},useMutableSource:Zo,useSyncExternalStore:Qo,useId:bs,unstable_isNewReconciler:!1},ks={readContext:ao,useCallback:gs,useContext:ao,useEffect:us,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Xo,useRef:os,useState:function(){return Xo(Jo)},useDebugValue:hs,useDeferredValue:function(e){var t=qo();return Io===null?t.memoizedState=e:vs(t,Io.memoizedState,e)},useTransition:function(){return[Xo(Jo)[0],qo().memoizedState]},useMutableSource:Zo,useSyncExternalStore:Qo,useId:bs,unstable_isNewReconciler:!1};function As(e,t){if(e&&e.defaultProps){for(var n in t=ae({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ms={isMounted:function(e){return(e=e._reactInternals)?ft(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Dl(),i=Ol(e),a=mo(r,i);a.payload=t,n!=null&&(a.callback=n),t=I(e,a,i),t!==null&&(kl(t,e,i,r),ho(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Dl(),i=Ol(e),a=mo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=I(e,a,i),t!==null&&(kl(t,e,i,r),ho(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Dl(),r=Ol(e),i=mo(n,r);i.tag=2,t!=null&&(i.callback=t),t=I(e,i,r),t!==null&&(kl(t,e,r,n),ho(t,e,r))}};function Ns(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ir(n,r)||!Ir(i,a):!0}function Ps(e,t,n){var r=!1,i=ta,a=t.contextType;return typeof a==`object`&&a?a=ao(a):(i=oa(t)?ia:na.current,r=t.contextTypes,a=(r=r!=null)?aa(e,i):ta),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ms,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Fs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ms.enqueueReplaceState(t,t.state,null)}function Is(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},fo(e);var a=t.contextType;typeof a==`object`&&a?i.context=ao(a):(a=oa(t)?ia:na.current,i.context=aa(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(js(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ms.enqueueReplaceState(i,i.state,null),_o(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ls(e,t){try{var n=``,r=t;do n+=ue(r),r=r.return;while(r);var i=n}catch(e){i=` 7Error generating stack: `+e.message+` 8`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Rs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Bs=typeof WeakMap==`function`?WeakMap:Map;function Vs(e,t,n){n=mo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_l||(_l=!0,vl=r),zs(e,t)},n}function Hs(e,t,n){n=mo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){zs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){zs(e,t),typeof r!=`function`&&(yl===null?yl=new Set([this]):yl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Us(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bs;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=eu.bind(null,e,t,n),t.then(e,e))}function Ws(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Gs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=mo(-1,1),t.tag=2,I(n,t,1))),n.lanes|=1),e)}var Ks=C.ReactCurrentOwner,qs=!1;function Js(e,t,n,r){t.child=e===null?Xa(t,null,n,r):Ya(t,e.child,n,r)}function Ys(e,t,n,r,i){n=n.render;var a=t.ref;return io(t,i),r=Wo(e,t,n,r,a,i),n=Go(),e!==null&&!qs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hc(e,t,i)):(Na&&n&&ka(t),t.flags|=1,Js(e,t,r,i),t.child)}function Xs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!cu(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Zs(e,t,a,r,i)):(e=du(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return hc(e,t,i)}return t.flags|=1,e=uu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref)if(qs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(qs=!0);else return t.lanes=e.lanes,hc(e,t,i)}return ec(e,t,n,r,i)}function Qs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ea(ol,al),al|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ea(ol,al),al|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,ea(ol,al),al|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),ea(ol,al),al|=r;return Js(e,t,i,n),t.child}function $s(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ec(e,t,n,r,i){var a=oa(n)?ia:na.current;return a=aa(t,a),io(t,i),n=Wo(e,t,n,r,a,i),r=Go(),e!==null&&!qs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hc(e,t,i)):(Na&&r&&ka(t),t.flags|=1,Js(e,t,n,i),t.child)}function tc(e,t,n,r,i){if(oa(n)){var a=!0;ua(t)}else a=!1;if(io(t,i),t.stateNode===null)mc(e,t),Ps(t,n,r),Is(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=ao(l):(l=oa(n)?ia:na.current,l=aa(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Fs(t,o,r,l),uo=!1;var f=t.memoizedState;o.state=f,_o(t,r,o,i),c=t.memoizedState,s!==r||f!==c||ra.current||uo?(typeof u==`function`&&(js(t,n,u,r),c=t.memoizedState),(s=uo||Ns(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,po(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:As(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=ao(c):(c=oa(n)?ia:na.current,c=aa(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Fs(t,o,r,c),uo=!1,f=t.memoizedState,o.state=f,_o(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||ra.current||uo?(typeof p==`function`&&(js(t,n,p,r),m=t.memoizedState),(l=uo||Ns(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return nc(e,t,n,r,a,i)}function nc(e,t,n,r,i,a){$s(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&da(t,n,!1),hc(e,t,a);r=t.stateNode,Ks.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ya(t,e.child,null,a),t.child=Ya(t,null,s,a)):Js(e,t,s,a),t.memoizedState=r.state,i&&da(t,n,!0),t.child}function rc(e){var t=e.stateNode;t.pendingContext?ca(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ca(e,t.context,!1),wo(e,t.containerInfo)}function ic(e,t,n,r,i){return Ha(),Ua(i),t.flags|=256,Js(e,t,n,r),t.child}var ac={dehydrated:null,treeContext:null,retryLane:0};function oc(e){return{baseLanes:e,cachePool:null,transitions:null}}function sc(e,t,n){var r=t.pendingProps,i=Oo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ea(Oo,i&1),e===null)return Ra(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=pu(o,r,0,null),e=fu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=oc(n),t.memoizedState=ac,e):cc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return uc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=uu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=fu(a,o,n,null),a.flags|=2):a=uu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?oc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=ac,r}return a=e.child,e=a.sibling,r=uu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function cc(e,t){return t=pu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function lc(e,t,n,r){return r!==null&&Ua(r),Ya(t,e.child,null,n),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Rs(Error(r(422))),lc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=pu({mode:`visible`,children:i.children},a,0,null),o=fu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ya(t,e.child,null,s),t.child.memoizedState=oc(s),t.memoizedState=ac,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return lc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Rs(o,i,void 0),lc(e,t,s,i)}if(c=(s&e.childLanes)!==0,qs||c){if(i=nl,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,lo(e,a),kl(i,e,a,-1))}return Ul(),i=Rs(Error(r(421))),lc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=nu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Ma=Li(a.nextSibling),ja=t,Na=!0,Pa=null,e!==null&&(Sa[Ca++]=Ta,Sa[Ca++]=Ea,Sa[Ca++]=wa,Ta=e.id,Ea=e.overflow,wa=t),t=cc(t,i.children),t.flags|=4096,t)}function dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ro(e.return,t,n)}function fc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function pc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Js(e,t,r.children,n),r=Oo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dc(e,n,t);else if(e.tag===19)dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ea(Oo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ko(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),fc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}fc(t,!0,n,null,a);break;case`together`:fc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function mc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ll|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=uu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=uu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gc(e,t,n){switch(t.tag){case 3:rc(t),Ha();break;case 5:Eo(t);break;case 1:oa(t.type)&&ua(t);break;case 4:wo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ea(Za,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ea(Oo,Oo.current&1),e=hc(e,t,n),e===null?null:e.sibling):sc(e,t,n):(ea(Oo,Oo.current&1),t.flags|=128,null);ea(Oo,Oo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return pc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ea(Oo,Oo.current),r)break;return null;case 22:case 23:return t.lanes=0,Qs(e,t,n)}return hc(e,t,n)}var _c=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},vc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Co(bo.current);var o=null;switch(n){case`input`:i=ye(e,i),r=ye(e,r),o=[];break;case`select`:i=ae({},i,{value:void 0}),r=ae({},r,{value:void 0}),o=[];break;case`textarea`:i=De(e,i),r=De(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Di)}Ve(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&pi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},yc=function(e,t,n,r){n!==r&&(t.flags|=4)};function bc(e,t){if(!Na)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Sc(e,t,n){var i=t.pendingProps;switch(Aa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xc(t),null;case 1:return oa(t.type)&&sa(),xc(t),null;case 3:return i=t.stateNode,To(),$i(ra),$i(na),jo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ba(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pa!==null&&(Nl(Pa),Pa=null))),xc(t),null;case 5:Do(t);var o=Co(So.current);if(n=t.type,e!==null&&t.stateNode!=null)vc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return xc(t),null}if(e=Co(bo.current),Ba(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Bi]=t,i[Vi]=s,e=(t.mode&1)!=0,n){case`dialog`:pi(`cancel`,i),pi(`close`,i);break;case`iframe`:case`object`:case`embed`:pi(`load`,i);break;case`video`:case`audio`:for(o=0;o<li.length;o++)pi(li[o],i);break;case`source`:pi(`error`,i);break;case`img`:case`image`:case`link`:pi(`error`,i),pi(`load`,i);break;case`details`:pi(`toggle`,i);break;case`input`:be(i,s),pi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},pi(`invalid`,i);break;case`textarea`:Oe(i,s),pi(`invalid`,i)}for(var c in Ve(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ei(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ei(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&pi(`scroll`,i)}switch(n){case`input`:ge(i),Ce(i,s,!0);break;case`textarea`:ge(i),Ae(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=Di)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=je(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Bi]=t,e[Vi]=i,_c(e,t,!1,!1),t.stateNode=e;a:{switch(c=He(n,i),n){case`dialog`:pi(`cancel`,e),pi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:pi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<li.length;o++)pi(li[o],e);o=i;break;case`source`:pi(`error`,e),o=i;break;case`img`:case`image`:case`link`:pi(`error`,e),pi(`load`,e),o=i;break;case`details`:pi(`toggle`,e),o=i;break;case`input`:be(e,i),o=ye(e,i),pi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=ae({},i,{value:void 0}),pi(`invalid`,e);break;case`textarea`:Oe(e,i),o=De(e,i),pi(`invalid`,e);break;default:o=i}for(s in Ve(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?ze(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Pe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Fe(e,u):typeof u==`number`&&Fe(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&pi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:ge(e),Ce(e,i,!1);break;case`textarea`:ge(e),Ae(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+pe(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Ee(e,!!i.multiple,i.defaultValue,!0):Ee(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=Di)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xc(t),null;case 6:if(e&&t.stateNode!=null)yc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=Co(So.current),Co(bo.current),Ba(t)){if(i=t.stateNode,n=t.memoizedProps,i[Bi]=t,(s=i.nodeValue!==n)&&(e=ja,e!==null))switch(e.tag){case 3:Ei(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ei(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Bi]=t,t.stateNode=i}return xc(t),null;case 13:if($i(Oo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Na&&Ma!==null&&t.mode&1&&!(t.flags&128))Va(),Ha(),t.flags|=98560,s=!1;else if(s=Ba(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Bi]=t}else Ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xc(t),s=!1}else Pa!==null&&(Nl(Pa),Pa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Oo.current&1?sl===0&&(sl=3):Ul())),t.updateQueue!==null&&(t.flags|=4),xc(t),null);case 4:return To(),e===null&&gi(t.stateNode.containerInfo),xc(t),null;case 10:return no(t.type._context),xc(t),null;case 17:return oa(t.type)&&sa(),xc(t),null;case 19:if($i(Oo),s=t.memoizedState,s===null)return xc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)bc(s,!1);else{if(sl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=ko(e),c!==null){for(t.flags|=128,bc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(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=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ea(Oo,Oo.current&1|2),t.child}e=e.sibling}s.tail!==null&&xt()>hl&&(t.flags|=128,i=!0,bc(s,!1),t.lanes=4194304)}else{if(!i)if(e=ko(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Na)return xc(t),null}else 2*xt()-s.renderingStartTime>hl&&n!==1073741824&&(t.flags|=128,i=!0,bc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(xc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xt(),t.sibling=null,n=Oo.current,ea(Oo,i?n&1|2:n&1),t);case 22:case 23:return zl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?al&1073741824&&(xc(t),t.subtreeFlags&6&&(t.flags|=8192)):xc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Cc(e,t){switch(Aa(t),t.tag){case 1:return oa(t.type)&&sa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return To(),$i(ra),$i(na),jo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Do(t),null;case 13:if($i(Oo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $i(Oo),null;case 4:return To(),null;case 10:return no(t.type._context),null;case 22:case 23:return zl(),null;case 24:return null;default:return null}}var wc=!1,Tc=!1,Ec=typeof WeakSet==`function`?WeakSet:Set,L=null;function Dc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){$l(e,t,n)}else n.current=null}function Oc(e,t,n){try{n()}catch(n){$l(e,t,n)}}var kc=!1;function Ac(e,t){if(Oi=bn,e=Br(),Vr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(ki={focusedElem:e,selectionRange:n},bn=!1,L=t;L!==null;)if(t=L,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:As(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$l(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return h=kc,kc=!1,h}function jc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Oc(t,n,a)}i=i.next}while(i!==r)}}function Mc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==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 Nc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Pc(e){var t=e.alternate;t!==null&&(e.alternate=null,Pc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bi],delete t[Vi],delete t[Ui],delete t[Wi],delete t[Gi])),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 Fc(e){return e.tag===5||e.tag===3||e.tag===4}function Ic(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Di));else if(r!==4&&(e=e.child,e!==null))for(Lc(e,t,n),e=e.sibling;e!==null;)Lc(e,t,n),e=e.sibling}function Rc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Rc(e,t,n),e=e.sibling;e!==null;)Rc(e,t,n),e=e.sibling}var zc=null,Bc=!1;function Vc(e,t,n){for(n=n.child;n!==null;)Hc(e,t,n),n=n.sibling}function Hc(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount==`function`)try{kt.onCommitFiberUnmount(Ot,n)}catch{}switch(n.tag){case 5:Tc||Dc(n,t);case 6:var r=zc,i=Bc;zc=null,Vc(e,t,n),zc=r,Bc=i,zc!==null&&(Bc?(e=zc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):zc.removeChild(n.stateNode));break;case 18:zc!==null&&(Bc?(e=zc,n=n.stateNode,e.nodeType===8?Ii(e.parentNode,n):e.nodeType===1&&Ii(e,n),vn(e)):Ii(zc,n.stateNode));break;case 4:r=zc,i=Bc,zc=n.stateNode.containerInfo,Bc=!0,Vc(e,t,n),zc=r,Bc=i;break;case 0:case 11:case 14:case 15:if(!Tc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Oc(n,t,o),i=i.next}while(i!==r)}Vc(e,t,n);break;case 1:if(!Tc&&(Dc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$l(n,t,e)}Vc(e,t,n);break;case 21:Vc(e,t,n);break;case 22:n.mode&1?(Tc=(r=Tc)||n.memoizedState!==null,Vc(e,t,n),Tc=r):Vc(e,t,n);break;default:Vc(e,t,n)}}function Uc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ec),t.forEach(function(t){var r=ru.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Wc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:zc=c.stateNode,Bc=!1;break a;case 3:zc=c.stateNode.containerInfo,Bc=!0;break a;case 4:zc=c.stateNode.containerInfo,Bc=!0;break a}c=c.return}if(zc===null)throw Error(r(160));Hc(o,s,a),zc=null,Bc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){$l(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gc(t,e),t=t.sibling}function Gc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Wc(t,e),Kc(e),i&4){try{jc(3,e,e.return),Mc(3,e)}catch(t){$l(e,e.return,t)}try{jc(5,e,e.return)}catch(t){$l(e,e.return,t)}}break;case 1:Wc(t,e),Kc(e),i&512&&n!==null&&Dc(n,n.return);break;case 5:if(Wc(t,e),Kc(e),i&512&&n!==null&&Dc(n,n.return),e.flags&32){var a=e.stateNode;try{Fe(a,``)}catch(t){$l(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&xe(a,o),He(c,s);var u=He(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?ze(a,f):d===`dangerouslySetInnerHTML`?Pe(a,f):d===`children`?Fe(a,f):S(a,d,f,u)}switch(c){case`input`:Se(a,o);break;case`textarea`:ke(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Ee(a,!!o.multiple,o.multiple?[]:``,!1):Ee(a,!!o.multiple,o.defaultValue,!0)):Ee(a,!!o.multiple,m,!1)}a[Vi]=o}catch(t){$l(e,e.return,t)}}break;case 6:if(Wc(t,e),Kc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){$l(e,e.return,t)}}break;case 3:if(Wc(t,e),Kc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(t){$l(e,e.return,t)}break;case 4:Wc(t,e),Kc(e);break;case 13:Wc(t,e),Kc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ml=xt())),i&4&&Uc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Tc=(u=Tc)||d,Wc(t,e),Tc=u):Wc(t,e),Kc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(L=e,d=e.child;d!==null;){for(f=L=d;L!==null;){switch(p=L,m=p.child,p.tag){case 0:case 11:case 14:case 15:jc(4,p,p.return);break;case 1:Dc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){$l(i,n,e)}}break;case 5:Dc(p,p.return);break;case 22:if(p.memoizedState!==null){Xc(f);continue}}m===null?Xc(f):(m.return=p,L=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Re(`display`,s))}catch(t){$l(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){$l(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Wc(t,e),Kc(e),i&4&&Uc(e);break;case 21:break;default:Wc(t,e),Kc(e)}}function Kc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Fc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Fe(a,``),i.flags&=-33),Rc(e,Ic(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Lc(e,Ic(e),o);break;default:throw Error(r(161))}}catch(t){$l(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qc(e,t,n){L=e,Jc(e,t,n)}function Jc(e,t,n){for(var r=(e.mode&1)!=0;L!==null;){var i=L,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||wc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Tc;s=wc;var l=Tc;if(wc=o,(Tc=c)&&!l)for(L=i;L!==null;)o=L,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Zc(i):(c.return=o,L=c);for(;a!==null;)L=a,Jc(a,t,n),a=a.sibling;L=i,wc=s,Tc=l}Yc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,L=a):Yc(e,t,n)}}function Yc(e){for(;L!==null;){var t=L;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Tc||Mc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Tc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:As(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&vo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}vo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&vn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tc||t.flags&512&&Nc(t)}catch(e){$l(t,t.return,e)}}if(t===e){L=null;break}if(n=t.sibling,n!==null){n.return=t.return,L=n;break}L=t.return}}function Xc(e){for(;L!==null;){var t=L;if(t===e){L=null;break}var n=t.sibling;if(n!==null){n.return=t.return,L=n;break}L=t.return}}function Zc(e){for(;L!==null;){var t=L;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Mc(4,t)}catch(e){$l(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){$l(t,i,e)}}var a=t.return;try{Nc(t)}catch(e){$l(t,a,e)}break;case 5:var o=t.return;try{Nc(t)}catch(e){$l(t,o,e)}}}catch(e){$l(t,t.return,e)}if(t===e){L=null;break}var s=t.sibling;if(s!==null){s.return=t.return,L=s;break}L=t.return}}var Qc=Math.ceil,$c=C.ReactCurrentDispatcher,el=C.ReactCurrentOwner,tl=C.ReactCurrentBatchConfig,R=0,nl=null,rl=null,il=0,al=0,ol=Qi(0),sl=0,cl=null,ll=0,ul=0,dl=0,fl=null,pl=null,ml=0,hl=1/0,gl=null,_l=!1,vl=null,yl=null,bl=!1,xl=null,Sl=0,Cl=0,wl=null,Tl=-1,El=0;function Dl(){return R&6?xt():Tl===-1?Tl=xt():Tl}function Ol(e){return e.mode&1?R&2&&il!==0?il&-il:Wa.transition===null?(e=qt,e===0?(e=window.event,e=e===void 0?16:En(e.type),e):e):(El===0&&(El=Ht()),El):1}function kl(e,t,n,i){if(50<Cl)throw Cl=0,wl=null,Error(r(185));Wt(e,n,i),(!(R&2)||e!==nl)&&(e===nl&&(!(R&2)&&(ul|=n),sl===4&&Fl(e,il)),Al(e,i),n===1&&R===0&&!(t.mode&1)&&(hl=xt()+500,pa&&_a()))}function Al(e,t){var n=e.callbackNode;Bt(e,t);var r=Rt(e,e===nl?il:0);if(r===0)n!==null&&vt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&vt(n),t===1)e.tag===0?ga(Il.bind(null,e)):ha(Il.bind(null,e)),Pi(function(){!(R&6)&&_a()}),n=null;else{switch(Jt(r)){case 1:n=Ct;break;case 4:n=wt;break;case 16:n=Tt;break;case 536870912:n=Dt;break;default:n=Tt}n=au(n,jl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jl(e,t){if(Tl=-1,El=0,R&6)throw Error(r(327));var n=e.callbackNode;if(Zl()&&e.callbackNode!==n)return null;var i=Rt(e,e===nl?il:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Wl(e,i);else{t=i;var a=R;R|=2;var o=Hl();(nl!==e||il!==t)&&(gl=null,hl=xt()+500,Bl(e,t));do try{Kl();break}catch(t){Vl(e,t)}while(1);to(),$c.current=o,R=a,rl===null?(nl=null,il=0,t=sl):t=0}if(t!==0){if(t===2&&(a=Vt(e),a!==0&&(i=a,t=Ml(e,a))),t===1)throw n=cl,Bl(e,0),Fl(e,i),Al(e,xt()),n;if(t===6)Fl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Pl(a)&&(t=Wl(e,i),t===2&&(o=Vt(e),o!==0&&(i=o,t=Ml(e,o))),t===1))throw n=cl,Bl(e,0),Fl(e,i),Al(e,xt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Yl(e,pl,gl);break;case 3:if(Fl(e,i),(i&130023424)===i&&(t=ml+500-xt(),10<t)){if(Rt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Dl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ji(Yl.bind(null,e,pl,gl),t);break}Yl(e,pl,gl);break;case 4:if(Fl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-jt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=xt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Qc(i/1960))-i,10<i){e.timeoutHandle=ji(Yl.bind(null,e,pl,gl),i);break}Yl(e,pl,gl);break;case 5:Yl(e,pl,gl);break;default:throw Error(r(329))}}}return Al(e,xt()),e.callbackNode===n?jl.bind(null,e):null}function Ml(e,t){var n=fl;return e.current.memoizedState.isDehydrated&&(Bl(e,t).flags|=256),e=Wl(e,t),e!==2&&(t=pl,pl=n,t!==null&&Nl(t)),e}function Nl(e){pl===null?pl=e:pl.push.apply(pl,e)}function Pl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Fr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fl(e,t){for(t&=~dl,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),r=1<<n;e[n]=-1,t&=~r}}function Il(e){if(R&6)throw Error(r(327));Zl();var t=Rt(e,0);if(!(t&1))return Al(e,xt()),null;var n=Wl(e,t);if(e.tag!==0&&n===2){var i=Vt(e);i!==0&&(t=i,n=Ml(e,i))}if(n===1)throw n=cl,Bl(e,0),Fl(e,t),Al(e,xt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yl(e,pl,gl),Al(e,xt()),null}function Ll(e,t){var n=R;R|=1;try{return e(t)}finally{R=n,R===0&&(hl=xt()+500,pa&&_a())}}function Rl(e){xl!==null&&xl.tag===0&&!(R&6)&&Zl();var t=R;R|=1;var n=tl.transition,r=qt;try{if(tl.transition=null,qt=1,e)return e()}finally{qt=r,tl.transition=n,R=t,!(R&6)&&_a()}}function zl(){al=ol.current,$i(ol)}function Bl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Mi(n)),rl!==null)for(n=rl.return;n!==null;){var r=n;switch(Aa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&sa();break;case 3:To(),$i(ra),$i(na),jo();break;case 5:Do(r);break;case 4:To();break;case 13:$i(Oo);break;case 19:$i(Oo);break;case 10:no(r.type._context);break;case 22:case 23:zl()}n=n.return}if(nl=e,rl=e=uu(e.current,null),il=al=t,sl=0,cl=null,dl=ul=ll=0,pl=fl=null,oo!==null){for(t=0;t<oo.length;t++)if(n=oo[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}oo=null}return e}function Vl(e,t){do{var n=rl;try{if(to(),Mo.current=Es,Ro){for(var i=Fo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Ro=!1}if(Po=0,Lo=Io=Fo=null,zo=!1,Bo=0,el.current=null,n===null||n.return===null){sl=1,cl=t,rl=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=il,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ws(s);if(m!==null){m.flags&=-257,Gs(m,s,c,o,t),m.mode&1&&Us(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Us(o,u,t),Ul();break a}l=Error(r(426))}}else if(Na&&c.mode&1){var _=Ws(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Gs(_,s,c,o,t),Ua(Ls(l,c));break a}}o=l=Ls(l,c),sl!==4&&(sl=2),fl===null?fl=[o]:fl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Vs(o,l,t);go(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(yl===null||!yl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Hs(o,c,t);go(o,x);break a}}o=o.return}while(o!==null)}Jl(n)}catch(e){t=e,rl===n&&n!==null&&(rl=n=n.return);continue}break}while(1)}function Hl(){var e=$c.current;return $c.current=Es,e===null?Es:e}function Ul(){(sl===0||sl===3||sl===2)&&(sl=4),nl===null||!(ll&268435455)&&!(ul&268435455)||Fl(nl,il)}function Wl(e,t){var n=R;R|=2;var i=Hl();(nl!==e||il!==t)&&(gl=null,Bl(e,t));do try{Gl();break}catch(t){Vl(e,t)}while(1);if(to(),R=n,$c.current=i,rl!==null)throw Error(r(261));return nl=null,il=0,sl}function Gl(){for(;rl!==null;)ql(rl)}function Kl(){for(;rl!==null&&!yt();)ql(rl)}function ql(e){var t=iu(e.alternate,e,al);e.memoizedProps=e.pendingProps,t===null?Jl(e):rl=t,el.current=null}function Jl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Cc(n,t),n!==null){n.flags&=32767,rl=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sl=6,rl=null;return}}else if(n=Sc(n,t,al),n!==null){rl=n;return}if(t=t.sibling,t!==null){rl=t;return}rl=t=e}while(t!==null);sl===0&&(sl=5)}function Yl(e,t,n){var r=qt,i=tl.transition;try{tl.transition=null,qt=1,Xl(e,t,n,r)}finally{tl.transition=i,qt=r}return null}function Xl(e,t,n,i){do Zl();while(xl!==null);if(R&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Gt(e,o),e===nl&&(rl=nl=null,il=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||bl||(bl=!0,au(Tt,function(){return Zl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=tl.transition,tl.transition=null;var s=qt;qt=1;var c=R;R|=4,el.current=null,Ac(e,n),Gc(n,e),Hr(ki),bn=!!Oi,ki=Oi=null,e.current=n,qc(n,e,a),bt(),R=c,qt=s,tl.transition=o}else e.current=n;if(bl&&(bl=!1,xl=e,Sl=a),o=e.pendingLanes,o===0&&(yl=null),At(n.stateNode,i),Al(e,xt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(_l)throw _l=!1,e=vl,vl=null,e;return Sl&1&&e.tag!==0&&Zl(),o=e.pendingLanes,o&1?e===wl?Cl++:(Cl=0,wl=e):Cl=0,_a(),null}function Zl(){if(xl!==null){var e=Jt(Sl),t=tl.transition,n=qt;try{if(tl.transition=null,qt=16>e?16:e,xl===null)var i=!1;else{if(e=xl,xl=null,Sl=0,R&6)throw Error(r(331));var a=R;for(R|=4,L=e.current;L!==null;){var o=L,s=o.child;if(L.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(L=u;L!==null;){var d=L;switch(d.tag){case 0:case 11:case 15:jc(8,d,o)}var f=d.child;if(f!==null)f.return=d,L=f;else for(;L!==null;){d=L;var p=d.sibling,m=d.return;if(Pc(d),d===u){L=null;break}if(p!==null){p.return=m,L=p;break}L=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}L=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,L=s;else b:for(;L!==null;){if(o=L,o.flags&2048)switch(o.tag){case 0:case 11:case 15:jc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,L=v;break b}L=o.return}}var y=e.current;for(L=y;L!==null;){s=L;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,L=b;else b:for(s=y;L!==null;){if(c=L,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Mc(9,c)}}catch(e){$l(c,c.return,e)}if(c===s){L=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,L=x;break b}L=c.return}}if(R=a,_a(),kt&&typeof kt.onPostCommitFiberRoot==`function`)try{kt.onPostCommitFiberRoot(Ot,e)}catch{}i=!0}return i}finally{qt=n,tl.transition=t}}return!1}function Ql(e,t,n){t=Ls(n,t),t=Vs(e,t,1),e=I(e,t,1),t=Dl(),e!==null&&(Wt(e,1,t),Al(e,t))}function $l(e,t,n){if(e.tag===3)Ql(e,e,n);else for(;t!==null;){if(t.tag===3){Ql(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yl===null||!yl.has(r))){e=Ls(n,e),e=Hs(t,e,1),t=I(t,e,1),e=Dl(),t!==null&&(Wt(t,1,e),Al(t,e));break}}t=t.return}}function eu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Dl(),e.pingedLanes|=e.suspendedLanes&n,nl===e&&(il&n)===n&&(sl===4||sl===3&&(il&130023424)===il&&500>xt()-ml?Bl(e,0):dl|=n),Al(e,t)}function tu(e,t){t===0&&(e.mode&1?(t=It,It<<=1,!(It&130023424)&&(It=4194304)):t=1);var n=Dl();e=lo(e,t),e!==null&&(Wt(e,t,n),Al(e,n))}function nu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tu(e,n)}function ru(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),tu(e,n)}var iu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ra.current)qs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return qs=!1,gc(e,t,n);qs=!!(e.flags&131072)}else qs=!1,Na&&t.flags&1048576&&Oa(t,xa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;mc(e,t),e=t.pendingProps;var a=aa(t,na.current);io(t,n),a=Wo(null,t,i,e,a,n);var o=Go();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,oa(i)?(o=!0,ua(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,fo(t),a.updater=Ms,t.stateNode=a,a._reactInternals=t,Is(t,i,e,n),t=nc(null,t,i,!0,o,n)):(t.tag=0,Na&&o&&ka(t),Js(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(mc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=lu(i),e=As(i,e),a){case 0:t=ec(null,t,i,e,n);break a;case 1:t=tc(null,t,i,e,n);break a;case 11:t=Ys(null,t,i,e,n);break a;case 14:t=Xs(null,t,i,As(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),ec(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),tc(e,t,i,a,n);case 3:a:{if(rc(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,po(e,t),_o(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ls(Error(r(423)),t),t=ic(e,t,i,n,a);break a}else if(i!==a){a=Ls(Error(r(424)),t),t=ic(e,t,i,n,a);break a}else for(Ma=Li(t.stateNode.containerInfo.firstChild),ja=t,Na=!0,Pa=null,n=Xa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ha(),i===a){t=hc(e,t,n);break a}Js(e,t,i,n)}t=t.child}return t;case 5:return Eo(t),e===null&&Ra(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ai(i,a)?s=null:o!==null&&Ai(i,o)&&(t.flags|=32),$s(e,t),Js(e,t,s,n),t.child;case 6:return e===null&&Ra(t),null;case 13:return sc(e,t,n);case 4:return wo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ya(t,null,i,n):Js(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),Ys(e,t,i,a,n);case 7:return Js(e,t,t.pendingProps,n),t.child;case 8:return Js(e,t,t.pendingProps.children,n),t.child;case 12:return Js(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,ea(Za,i._currentValue),i._currentValue=s,o!==null)if(Fr(o.value,s)){if(o.children===a.children&&!ra.current){t=hc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=mo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ro(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),ro(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Js(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,io(t,n),a=ao(a),i=i(a),t.flags|=1,Js(e,t,i,n),t.child;case 14:return i=t.type,a=As(i,t.pendingProps),a=As(i.type,a),Xs(e,t,i,a,n);case 15:return Zs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),mc(e,t),t.tag=1,oa(i)?(e=!0,ua(t)):e=!1,io(t,n),Ps(t,i,a),Is(t,i,a,n),nc(null,t,i,!0,e,n);case 19:return pc(e,t,n);case 22:return Qs(e,t,n)}throw Error(r(156,t.tag))};function au(e,t){return _t(e,t)}function ou(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 su(e,t,n,r){return new ou(e,t,n,r)}function cu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lu(e){if(typeof e==`function`)return+!!cu(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===ee)return 14}return 2}function uu(e,t){var n=e.alternate;return n===null?(n=su(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function du(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)cu(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return fu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=su(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=su(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=su(19,n,t,a),e.elementType=N,e.lanes=o,e;case ne:return pu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case ee:s=14;break a;case te:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=su(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function fu(e,t,n,r){return e=su(7,e,r,t),e.lanes=n,e}function pu(e,t,n,r){return e=su(22,e,r,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function mu(e,t,n){return e=su(6,e,null,t),e.lanes=n,e}function hu(e,t,n){return t=su(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gu(e,t,n,r,i){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=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _u(e,t,n,r,i,a,o,s,c){return e=new gu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=su(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fo(a),e}function vu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function yu(e){if(!e)return ta;e=e._reactInternals;
vendor: 4,407 bytes, line 8
8a:{if(ft(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(oa(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(oa(n))return la(e,n,t)}return t}function bu(e,t,n,r,i,a,o,s,c){return e=_u(n,r,!0,e,i,a,o,s,c),e.context=yu(null),n=e.current,r=Dl(),i=Ol(n),a=mo(r,i),a.callback=t??null,I(n,a,i),e.current.lanes=i,Wt(e,i,r),Al(e,r),e}function xu(e,t,n,r){var i=t.current,a=Dl(),o=Ol(i);return n=yu(n),t.context===null?t.context=n:t.pendingContext=n,t=mo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=I(i,t,o),e!==null&&(kl(e,i,o,a),ho(e,i,o)),o}function Su(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wu(e,t){Cu(e,t),(e=e.alternate)&&Cu(e,t)}function Tu(){return null}var Eu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Du(e){this._internalRoot=e}z.prototype.render=Du.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));xu(e,t,null,null)},z.prototype.unmount=Du.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rl(function(){xu(null,e,null,null)}),t[Hi]=null}};function z(e){this._internalRoot=e}z.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cn.length&&t!==0&&t<cn[n].priority;n++);cn.splice(n,0,e),n===0&&pn(e)}};function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function B(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function ku(){}function V(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=Su(o);a.call(e)}}var o=bu(t,r,e,0,null,!1,!1,``,ku);return e._reactRootContainer=o,e[Hi]=o.current,gi(e.nodeType===8?e.parentNode:e),Rl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=Su(c);s.call(e)}}var c=_u(e,0,!1,null,null,!1,!1,``,ku);return e._reactRootContainer=c,e[Hi]=c.current,gi(e.nodeType===8?e.parentNode:e),Rl(function(){xu(t,c,n,r)}),c}function Au(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=Su(o);s.call(e)}}xu(t,o,e,i)}else o=V(n,t,e,i,r);return Su(o)}Yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lt(t.pendingLanes);n!==0&&(Kt(t,n|1),Al(t,xt()),!(R&6)&&(hl=xt()+500,_a()))}break;case 13:Rl(function(){var t=lo(e,1);t!==null&&kl(t,e,1,Dl())}),wu(e,1)}},Xt=function(e){if(e.tag===13){var t=lo(e,134217728);t!==null&&kl(t,e,134217728,Dl()),wu(e,134217728)}},Zt=function(e){if(e.tag===13){var t=Ol(e),n=lo(e,t);n!==null&&kl(n,e,t,Dl()),wu(e,t)}},Qt=function(){return qt},$t=function(e,t){var n=qt;try{return qt=e,t()}finally{qt=n}},Ge=function(e,t,n){switch(t){case`input`:if(Se(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Yi(i);if(!a)throw Error(r(90));_e(i),Se(i,a)}}}break;case`textarea`:ke(e,n);break;case`select`:t=n.value,t!=null&&Ee(e,!!n.multiple,t,!1)}},Ze=Ll,Qe=Rl;var ju={usingClientEntryPoint:!1,Events:[qi,Ji,Yi,Ye,Xe,Ll]},Mu={findFiberByHostInstance:Ki,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},H={bundleType:Mu.bundleType,version:Mu.version,rendererPackageName:Mu.rendererPackageName,rendererConfig:Mu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=P(e),e===null?null:e.stateNode},findFiberByHostInstance:Mu.findFiberByHostInstance||Tu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};
8if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Ot=Nu.inject(H),kt=Nu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ju,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ou(t))throw Error(r(200));return vu(e,t,null,n)},e.createRoot=function(e,t){if(!Ou(e))throw Error(r(299));var n=!1,i=``,a=Eu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=_u(e,1,!1,null,null,n,!1,i,a),e[Hi]=t.current,gi(e.nodeType===8?e.parentNode:e),new Du(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=P(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Rl(e)},e.hydrate=function(e,t,n){if(!B(t))throw Error(r(200));return Au(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Ou(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=Eu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=bu(t,null,e,1,n??null,a,!1,o,s),e[Hi]=t.current,gi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new z(t)},e.render=function(e,t,n){if(!B(t))throw Error(r(200));return Au(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!B(e))throw Error(r(40));return e._reactRootContainer?(Rl(function(){Au(null,null,e,!1,function(){e._reactRootContainer=null,e[Hi]=null})}),!0):!1},e.unstable_batchedUpdates=Ll,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!B(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Au(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),y=u(p()),b=u(_()),x=u(v(),1);function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}var C;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(C||={});var w=`popstate`;function T(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return A(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:j(t)}return N(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function O(){return Math.random().toString(36).substr(2,8)}function k(e,t){return{usr:e.state,key:e.key,idx:t}}function A(e,t,n,r){return n===void 0&&(n=null),S({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?M(t):t,{state:n,key:t&&t.key||r||O()})}function j(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function M(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=C.Pop,c=null,l=u();l??(l=0,o.replaceState(S({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=C.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=C.Push;let r=A(h.location,e,t);n&&n(r,e),l=u()+1;let d=k(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=C.Replace;let r=A(h.location,e,t);n&&n(r,e),l=u();let i=k(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:j(e);return n=n.replace(/ $/,`%20`),E(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(w,d),c=e,()=>{i.removeEventListener(w,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var ee;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(ee||={});function te(e,t,n){return n===void 0&&(n=`/`),ne(e,t,n,!1)}function ne(e,t,n,r){let i=ye((typeof t==`string`?M(t):t).pathname||`/`,n);if(i==null)return null;let a=re(e);ae(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ve(i);o=he(a[e],t,r)}return o}function re(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(E(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not val
8id. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Ee([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),re(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:pe(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of ie(e.path))i(e,t,n)}),t}function ie(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ie(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ae(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,de=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=de),t&&(r+=ce),n.filter(e=>!fe(e)).reduce((e,t)=>e+(oe.test(t)?se:t===``?le:ue),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
8Object.assign(i,u.params),o.push({params:i,pathname:Ee([a,u.pathname]),pathnameBase:De(Ee([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Ee([a,u.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),D(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function ye(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function be(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?M(e):e;return{pathname:n?n.startsWith(`/`)?n:xe(n,t):t,search:Oe(r),hash:ke(i)}}function xe(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Se(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function Ce(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function we(e,t){let n=Ce(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Te(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=M(e):(i=S({},e),E(!i.pathname||!i.pathname.includes(`?`),Se(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),Se(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),Se(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=be(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ee=e=>e.join(`/`).replace(/\/\/+/g,`/`),De=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Oe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ke=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function Ae(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var je=[`post`,`put`,`patch`,`delete`];new Set(je);var Me=[`get`,...je];new Set(Me);function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(this,arguments)}var Pe=y.createContext(null),Fe=y.createContext(null),Ie=y.createContext(null),Le=y.createContext(null),Re=y.createContext({outlet:null,matches:[],isDataRoute:!1}),ze=y.createContext(null);function Be(e,t){let{relative:n}=t===void 0?{}:t;!Ve()&&E(!1);let{basename:r,navigator:i}=y.useContext(Ie),{hash:a,pathname:o,search:s}=Xe(e,{relative:n}),c=o;return r!==`/`&&(c=o===`/`?r:Ee([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Ve(){return y.useContext(Le)!=null}function He(){return!Ve()&&E(!1),y.useContext(Le).location}function Ue(e){y.useContext(Ie).static||y.useLayoutEffect(e)}function We(){let{isDataRoute:e}=y.useContext(Re);return e?dt():Ge()}function Ge(){!Ve()&&E(!1);
8let e=y.useContext(Pe),{basename:t,future:n,navigator:r}=y.useContext(Ie),{matches:i}=y.useContext(Re),{pathname:a}=He(),o=JSON.stringify(we(i,n.v7_relativeSplatPath)),s=y.useRef(!1);return Ue(()=>{s.current=!0}),y.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Te(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ee([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}var Ke=y.createContext(null);function qe(){return y.useContext(Ke)}function Je(e){let t=y.useContext(Re).outlet;return t&&y.createElement(Ke.Provider,{value:e},t)}function Ye(){let{matches:e}=y.useContext(Re),t=e[e.length-1];return t?t.params:{}}function Xe(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Ie),{matches:i}=y.useContext(Re),{pathname:a}=He(),o=JSON.stringify(we(i,r.v7_relativeSplatPath));return y.useMemo(()=>Te(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function Ze(e,t){return Qe(e,t)}function Qe(e,t,n,r){!Ve()&&E(!1);let{navigator:i}=y.useContext(Ie),{matches:a}=y.useContext(Re),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=He(),u;if(t){let e=typeof t==`string`?M(t):t;!(c===`/`||e.pathname?.startsWith(c))&&E(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=te(e,{pathname:f}),m=rt(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Ee([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ee([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?y.createElement(Le.Provider,{value:{location:Ne({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:C.Pop}},m):m}function $e(){let e=ut(),t=Ae(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var et=y.createElement($e,null),tt=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:y.createElement(Re.Provider,{value:this.props.routeContext},y.createElement(ze.Provider,{value:this.state.error,children:this.props.component}))}};function nt(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(Pe);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Re.Provider,{value:t},r)}function rt(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&E(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}
8return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||et,s&&(c<0&&i===0?(pt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?y.createElement(r.route.Component,null):r.route.element?r.route.element:e,y.createElement(nt,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?y.createElement(tt,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var it=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(it||{}),at=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(at||{});function ot(e){let t=y.useContext(Pe);return!t&&E(!1),t}function st(e){let t=y.useContext(Fe);return!t&&E(!1),t}function ct(e){let t=y.useContext(Re);return!t&&E(!1),t}function lt(e){let t=ct(e),n=t.matches[t.matches.length-1];return!n.route.id&&E(!1),n.route.id}function ut(){let e=y.useContext(ze),t=st(at.UseRouteError),n=lt(at.UseRouteError);return e===void 0?t.errors?.[n]:e}function dt(){let{router:e}=ot(it.UseNavigateStable),t=lt(at.UseNavigateStable),n=y.useRef(!1);return Ue(()=>{n.current=!0}),y.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,Ne({fromRouteId:t},i)))},[e,t])}var ft={};function pt(e,t,n){!t&&!ft[e]&&(ft[e]=!0)}function mt(e){let{to:t,replace:n,state:r,relative:i}=e;!Ve()&&E(!1);let{future:a,static:o}=y.useContext(Ie),{matches:s}=y.useContext(Re),{pathname:c}=He(),l=We(),u=Te(t,we(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return y.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function ht(e){return Je(e.context)}function P(e){E(!1)}function gt(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=C.Pop,navigator:a,static:o=!1,future:s}=e;Ve()&&E(!1);let c=t.replace(/^\/*/,`/`),l=y.useMemo(()=>({basename:c,navigator:a,static:o,future:Ne({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=M(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=y.useMemo(()=>{let e=ye(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:y.createElement(Ie.Provider,{value:l},y.createElement(Le.Provider,{children:n,value:h}))}function _t(e){let{children:t,location:n}=e;return Ze(yt(t),n)}var vt=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(vt||{});new Promise(()=>{}),y.Component;function yt(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(e,r)=>{if(!y.isValidElement(e))return;let i=[...t,r];if(e.type===y.Fragment){n.push.apply(n,yt(e.props.children,i));return}e.type!==P&&E(!1),!(!e.props.index||!e.props.children)&&E(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=yt(e.props.children,i)),n.push(a)}),n}function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(this,arguments)}function xt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function St(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t===`_self`)&&!St(e)}function wt(e){return e===void 0&&(e=``),new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Tt(e,t){let n=wt(e);return t&&t.forEach((e,r)=>
8{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Et=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`unstable_viewTransition`],Dt=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`unstable_viewTransition`,`children`],Ot=`6`;try{window.__reactRouterVersion=Ot}catch{}var kt=y.createContext({isTransitioning:!1}),At=y.startTransition;function jt(e){let{basename:t,children:n,future:r,window:i}=e,a=y.useRef();a.current??=T({window:i,v5Compat:!0});let o=a.current,[s,c]=y.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=y.useCallback(e=>{l&&At?At(()=>c(e)):c(e)},[c,l]);return y.useLayoutEffect(()=>o.listen(u),[o,u]),y.createElement(gt,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Mt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pt=y.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,unstable_viewTransition:u}=e,d=xt(e,Et),{basename:f}=y.useContext(Ie),p,m=!1;if(typeof c==`string`&&Nt.test(c)&&(p=c,Mt))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=ye(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=Be(c,{relative:r}),g=zt(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,unstable_viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return y.createElement(`a`,bt({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),Ft=y.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:i=``,end:a=!1,style:o,to:s,unstable_viewTransition:c,children:l}=e,u=xt(e,Dt),d=Xe(s,{relative:u.relative}),f=He(),p=y.useContext(Fe),{navigator:m,basename:h}=y.useContext(Ie),g=p!=null&&Vt(d)&&c===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(v=v.toLowerCase(),b=b?b.toLowerCase():null,_=_.toLowerCase()),b&&h&&(b=ye(b,h)||b);let x=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,S=v===_||!a&&v.startsWith(_)&&v.charAt(x)===`/`,C=b!=null&&(b===_||!a&&b.startsWith(_)&&b.charAt(_.length)===`/`),w={isActive:S,isPending:C,isTransitioning:g},T=S?n:void 0,E;E=typeof i==`function`?i(w):[i,S?`active`:null,C?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let D=typeof o==`function`?o(w):o;return y.createElement(Pt,bt({},u,{"aria-current":T,className:E,ref:t,style:D,to:s,unstable_viewTransition:c}),typeof l==`function`?l(w):l)}),It;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(It||={});var Lt;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(Lt||={});function Rt(e){let t=y.useContext(Pe);return!t&&E(!1),t}function zt(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,unstable_viewTransition:s}=t===void 0?{}:t,c=We(),l=He(),u=Xe(e,{relative:o});return y.useCallback(t=>{if(Ct(t,n)){t.preventDefault();let n=r===void 0?j(l)===j(u):r;c(e,{replace:n,state:i,preventScrollReset:a,relative:o,unstable_viewTransition:s})}},[l,c,u,r,i,n,e,a,o,s])}function Bt(e){let t=y.useRef(wt(e)),n=y.useRef(!1),r=He(),i=y.useMemo(()=>Tt(r.search,n.current?null:t.current),[r.search]),a=We();return[i,y.useCallback((e,t)=>{let r=wt(typeof e==`function`?e(i):e);n.current=!0,a(`?`+r,t)},[a,i])]}function Vt(e,t){t===void 0&&(t={});let n=y.useContext(kt);n??E(!1);let{basename:r}=Rt(It.useViewTransitionState),i=Xe(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ye(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ye(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ge(i.pathname,o)!=null||ge(i.pathname,a)!=null}var Ht=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ut=typeof window>`u`||`Deno`in globalThis;function Wt(){}function Gt(e,t){return typeof e==`function`?e(t):e}function Kt(e){return typeof e==`number`&&e>=0&&e!==1/0}function qt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jt(e,t){return typeof e==`function`?e(t):e}function Yt(e,t){return typeof e==`function`?e(t):e}function Xt(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Qt(o,t.options))return!1}else if(!en(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Zt(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if($t(t.options.mutationKey)!==$t(a))return!1}else if(!en(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qt(e,t){return(t?.queryKeyHashFn||$t)(e)}function $t(e){return JSON.stringify(e,(e,t)=>an(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function en(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?!Object.keys(t).some(n=>!en(e[n],t[n])):!1}function tn(e,t){if(e===t)return e;let n=rn(e)&&rn(t);if(n||an(e)&&an(t)){let r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,s=n?[]:{},c=0;for(let i=0;i<o;i++){let o=n?i:a[i];(!n&&r.includes(o)||n)&&e[o]===void 0&&t[o]===void 0?(s[o]=void 0,c++):(s[o]=tn(e[o],t[o]),s[o]===e[o]&&e[o]!==void 0&&c++)}return i===o&&c===i?e:s}return t}function nn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function rn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function an(e){if(!on(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!on(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function on(e){return Object.prototype.toString.call(e)===`[object Object]`}function sn(e){return new Promise(t=>{setTimeout(t,e)})}function cn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:tn(e,t)}function ln(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function un(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dn=Symbol();function fn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dn?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var pn=new class extends Ht{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ut&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();
8this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},mn=new class extends Ht{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ut&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function hn(e){return Math.min(1e3*2**e,3e4)}function gn(e){return(e??`online`)!==`online`||mn.isOnline()}var _n=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function vn(e){return e instanceof _n}function yn(e){let t=!1,n=0,r=!1,i,a,o,s=new Promise((e,t)=>{a=e,o=t}),c=t=>{r||(m(new _n(t)),e.abort?.())},l=()=>{t=!0},u=()=>{t=!1},d=()=>pn.isFocused()&&(e.networkMode===`always`||mn.isOnline())&&e.canRun(),f=()=>gn(e.networkMode)&&e.canRun(),p=t=>{r||(r=!0,e.onSuccess?.(t),i?.(),a(t))},m=t=>{r||(r=!0,e.onError?.(t),i?.(),o(t))},h=()=>new Promise(t=>{i=e=>{(r||d())&&t(e)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),g=()=>{if(r)return;let i,a=n===0?e.initialPromise:void 0;try{i=a??e.fn()}catch(e){i=Promise.reject(e)}Promise.resolve(i).then(p).catch(i=>{if(r)return;let a=e.retry??(Ut?0:3),o=e.retryDelay??hn,s=typeof o==`function`?o(n,i):o,c=a===!0||typeof a==`number`&&n<a||typeof a==`function`&&a(n,i);if(t||!c){m(i);return}n++,e.onFail?.(n,i),sn(s).then(()=>d()?void 0:h()).then(()=>{t?m(i):g()})})};return{promise:s,cancel:c,continue:()=>(i?.(),s),cancelRetry:l,continueRetry:u,canStart:f,start:()=>(f()?g():h().then(g),s)}}function bn(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=e=>setTimeout(e,0),a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var xn=bn(),Sn=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ut?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(clearTimeout(this.#e),void 0)}},Cn=class extends Sn{#e;#t;#n;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Tn(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=cn(this.state.data,e,this.options);return this.#o({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!qt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:`invalidate`})}fetch(e,t){if(this.state.fetchStatus!==`idle`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)}
8)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=fn(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return r(n),this.#a=!1,this.options.persister?this.options.persister(e,n,this):e(n)}};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:`fetch`,meta:i.fetchOptions?.meta});let a=e=>{vn(e)&&e.silent||this.#o({type:`error`,error:e}),vn(e)||(this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#r=yn({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(e===void 0){a(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){a(e);return}this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(e,t)=>{this.#o({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#o({type:`pause`})},onContinue:()=>{this.#o({type:`continue`})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...wn(t.data,this.options),fetchMeta:e.meta??null};case`success`:return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:`success`,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};case`error`:let n=e.error;return vn(n)&&n.revert&&this.#t?{...this.#t,fetchStatus:`idle`}:{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),xn.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function wn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gn(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Tn(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var En=class extends Ht{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Qt(r,t),a=this.get(i);return a||(a=new Cn({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){xn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Xt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Xt(e,t)):t}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Dn=class extends Sn{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||On(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:`observerRemoved`,mutation:this,observer:e})}
8optionalRemove(){this.#e.length||(this.state.status===`pending`?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=yn({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#r({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#r({type:`pause`})},onContinue:()=>{this.#r({type:`continue`})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t=this.state.status===`pending`,n=!this.#n.canStart();try{if(!t){this.#r({type:`pending`,variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#r({type:`pending`,context:t,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:`success`,data:r}),r}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#r({type:`error`,error:t})}}finally{this.#t.runNext(this)}}#r(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),xn.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:`updated`,action:e})})}};function On(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var kn=class extends Ht{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){let r=new Dn({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){let t=An(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:`added`,mutation:e})}remove(e){let t=An(e);if(this.#e.has(t)){let n=this.#e.get(t)?.filter(t=>t!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:`removed`,mutation:e})}canRun(e){let t=this.#e.get(An(e))?.find(e=>e.state.status===`pending`);return!t||t===e}runNext(e){return(this.#e.get(An(e))?.find(t=>
8t!==e&&t.state.isPaused))?.continue()??Promise.resolve()}clear(){xn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Zt(t,e))}findAll(e={}){return this.getAll().filter(t=>Zt(e,t))}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return xn.batch(()=>Promise.all(e.map(e=>e.continue().catch(Wt))))}};function An(e){return e.options.scope?.id??String(e.mutationId)}function jn(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=fn(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a={queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};l(a);let o=await u(a),{maxPages:s}=t.options,c=i?un:ln;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Nn:Mn,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Mn(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Mn(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Nn(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Pn=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new En,this.#t=e.mutationCache||new kn,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=pn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{let n=this.defaultQueryOptions(e),r=this.#e.build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Jt(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Gt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;xn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e,r={type:`active`,...e};return xn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){let n={revert:!0,...t},r=xn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Wt).catch(Wt)}invalidateQueries(e={},t={}){return xn.batch(()=>{if(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e.refetchType===`none`)return Promise.resolve();let n={...e,type:e.refetchType??e.type??`active`};return this.refetchQueries(n,t)})}refetchQueries(e={},t){let n={...t,cancelRefetch:t?.cancelRefetch??!0},r=xn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Wt)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Wt)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Jt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wt).catch(Wt)}
8fetchInfiniteQuery(e){return e.behavior=jn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wt).catch(Wt)}ensureInfiniteQueryData(e){return e.behavior=jn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set($t(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{en(e,t.queryKey)&&(n={...n,...t.defaultOptions})}),n}setMutationDefaults(e,t){this.#i.set($t(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{en(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Qt(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.enabled!==!0&&t.queryFn===dn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fn=class extends Ht{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ln(this.#t,this.options)?this.#m():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rn(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rn(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#b(),this.#t.removeObserver(this)}setOptions(e,t){let n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Yt(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#x(),this.#t.setOptions(this.options),n._defaulted&&!nn(this.options,n)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&zn(this.#t,r,this.options,n)&&this.#m(),this.updateResult(t),i&&(this.#t!==r||Yt(this.options.enabled,this.#t)!==Yt(n.enabled,this.#t)||Jt(this.options.staleTime,this.#t)!==Jt(n.staleTime,this.#t))&&this.#h();let a=this.#g();i&&(this.#t!==r||Yt(this.options.enabled,this.#t)!==Yt(n.enabled,this.#t)||a!==this.#f)&&this.#_(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Vn(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){let n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Wt)),t}#h(){this.#y();let e=Jt(this.options.staleTime,this.#t);if(Ut||this.#r.isStale||!Kt(e))return;let t=qt(this.#r.dataUpdatedAt,e)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#g(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#b(),this.#f=e,!(Ut||Yt(this.options.enabled,this.#t)===!1||!Kt(this.#f)||this.#f===0)&&(this.#d=setInterval(()=>
8{(this.options.refetchIntervalInBackground||pn.isFocused())&&this.#m()},this.#f))}#v(){this.#h(),this.#_(this.#g())}#y(){this.#u&&=(clearTimeout(this.#u),void 0)}#b(){this.#d&&=(clearInterval(this.#d),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ln(e,t),o=i&&zn(e,n,t,r);(a||o)&&(l={...l,...wn(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;if(t.select&&l.data!==void 0)if(i&&l.data===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(l.data),d=cn(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}else d=l.data;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;if(i?.isPlaceholderData&&t.placeholderData===o?.placeholderData)e=i.data;else if(e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,t.select&&e!==void 0)try{e=t.select(e),this.#o=null}catch(e){this.#o=e}e!==void 0&&(m=`success`,d=cn(i?.data,e,t),u=!0)}this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`);let h=l.fetchStatus===`fetching`,g=m===`pending`,_=m===`error`,v=g&&h,y=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:g,isSuccess:m===`success`,isError:_,isInitialLoading:v,isLoading:v,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:_&&!y,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:_&&y,isStale:Bn(e,t),refetch:this.refetch}}updateResult(e){let t=this.#r,n=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),nn(n,t))return;this.#r=n;let r={};e?.listeners!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,n=typeof e==`function`?e():e;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(e=>{let n=e;return this.#r[n]!==t[n]&&r.has(n)})})()&&(r.listeners=!0),this.#S({...r,...e})}#x(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){xn.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function In(e,t){return Yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Ln(e,t){return In(e,t)||e.state.data!==void 0&&Rn(e,t,t.refetchOnMount)}function Rn(e,t,n){if(Yt(t.enabled,e)!==!1){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Bn(e,t)}return!1}function zn(e,t,n,r){return(e!==t||Yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Bn(e,n)}function Bn(e,t){return Yt(t.enabled,e)!==!1&&e.isStaleByTime(Jt(t.staleTime,e))}function Vn(e,t){return!nn(e.getCurrentResult(),t)}var Hn=class extends Ht{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),nn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&$t(t.mutationKey)!==$t(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??On();
8this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){xn.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context;e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n),this.#r.onSettled?.(e.data,null,t,n)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n),this.#r.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#t)})})}},Un=s((e=>{var t=p(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),F=s(((e,t)=>{t.exports=Un()}))(),Wn=y.createContext(void 0),Gn=e=>{let t=y.useContext(Wn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Kn=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(Wn.Provider,{value:e,children:t})),qn=y.createContext(!1),Jn=()=>y.useContext(qn);qn.Provider;function Yn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Xn=y.createContext(Yn()),Zn=()=>y.useContext(Xn);function Qn(e,t){return typeof e==`function`?e(...t):!!e}function $n(){}var er=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},tr=e=>{y.useEffect(()=>{e.clearReset()},[e])},nr=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Qn(n,[e.error,r]),rr=e=>{e.suspense&&(typeof e.staleTime!=`number`&&(e.staleTime=1e3),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,1e3)))},ir=(e,t)=>
8e?.suspense&&t.isPending,ar=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function or(e,t,n){let r=Gn(n),i=Jn(),a=Zn(),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?`isRestoring`:`optimistic`,rr(o),er(o,a),tr(a);let[s]=y.useState(()=>new t(r,o)),c=s.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(e=>{let t=i?()=>void 0:s.subscribe(xn.batchCalls(e));return s.updateResult(),t},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),y.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),ir(o,c))throw ar(o,s,a);if(nr({result:c,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,c),o.notifyOnChangeProps?c:s.trackResult(c)}function sr(e,t){return or(e,Fn,t)}function cr(e,t){let n=Gn(t),[r]=y.useState(()=>new Hn(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=y.useSyncExternalStore(y.useCallback(e=>r.subscribe(xn.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((e,t)=>{r.mutate(e,t).catch($n)},[r]);if(i.error&&Qn(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function lr(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var ur=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),dr=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},fr=class extends dr{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},pr=class extends dr{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},mr=class extends dr{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},hr;(function(e){e.Any=`any`,e.ApNortheast1=`ap-northeast-1`,e.ApNortheast2=`ap-northeast-2`,e.ApSouth1=`ap-south-1`,e.ApSoutheast1=`ap-southeast-1`,e.ApSoutheast2=`ap-southeast-2`,e.CaCentral1=`ca-central-1`,e.EuCentral1=`eu-central-1`,e.EuWest1=`eu-west-1`,e.EuWest2=`eu-west-2`,e.EuWest3=`eu-west-3`,e.SaEast1=`sa-east-1`,e.UsEast1=`us-east-1`,e.UsWest1=`us-west-1`,e.UsWest2=`us-west-2`})(hr||={});var gr=class{constructor(e,{headers:t={},customFetch:n,region:r=hr.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=ur(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return lr(this,arguments,void 0,function*(e,t={}){var n;let r,i,a;try{let{headers:n,method:o,body:s,signal:c,timeout:l}=t,u={},{region:d}=t;d||=this.region;let f=new URL(`${this.url}/${e}`);d&&d!==`any`&&(u[`x-region`]=d,f.searchParams.set(`forceFunctionRegion`,d));let p,m=!!n&&Object.keys(n).some(e=>e.toLowerCase()===`content-type`);s&&!m?typeof Blob<`u`&&s instanceof Blob||s instanceof ArrayBuffer?(u[`Content-Type`]=`application/octet-stream`,p=s):typeof s==`string`?(u[`Content-Type`]=`text/plain`,p=s):typeof FormData<`u`&&s instanceof FormData?p=s:(u[`Content-Type`]=`application/json`,p=JSON.stringify(s)):p=s&&typeof s!=`string`&&!(typeof Blob<`u`&&s instanceof Blob)&&!(s instanceof ArrayBuffer)&&!(typeof FormData<`u`&&s instanceof FormData)?JSON.stringify(s):s;let h=c;l&&(i=new AbortController,r=setTimeout(()=>i.abort(),l),c?(h=i.signal,a=()=>i.abort(),c.addEventListener(`abort`,a)):h=i.signal);let g=yield this.fetch(f.toString(),{method:o||`POST`,headers:Object.assign(Object.assign(Object.assign({},u),this.headers),n),body:p,signal:h}).catch(e=>{throw new fr(e)}),_=g.headers.get(`x-relay-error`);if(_&&_===`true`)throw new pr(g);if(!g.ok)throw new mr(g);let v=(g.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim().toLowerCase(),y;return y=v===`application/json`?yield g.json():v===`application/octet-stream`||v===`application/pdf`?yield g.blob():v===`text/event-stream`?g:v===`multipart/form-data`?yield g.formData():yield g.text(),{data:y,error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof mr||e instanceof pr?e.context:void 0}}finally{r&&clearTimeout(r),a&&((n=t.signal)==null||n.removeEventListener(`abort`,a))}})}},_r=3,vr=e=>Math.min(1e3*2**e,3e4),yr=[520,503],br=[`GET`,`HEAD`,`OPTIONS`],xr=class extends
8Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Sr(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function Cr(e,t,n,r){return!(!r||n>=_r||!br.includes(e)||!yr.includes(t))}var wr=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!br.includes(n.method))throw t;if(n.retryEnabled&&e<_r){let t=vr(e);e++,await Sr(t,n.signal);continue}throw t}if(Cr(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?vr(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await Sr(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new xr({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 10,009 bytes, line 8
8catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new xr(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},Tr=class extends wr{throwOnError(){return super.throwOnError()}select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set(`Accept`,`application/vnd.pgrst.object+json`),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),this}rollback(){return this.headers.append(`Prefer`,`tx=rollback`),this}returns(){return this}maxAffected(e){return this.headers.append(`Prefer`,`handling=strict`),this.headers.append(`Prefer`,`max-affected=${e}`),this}},Er=RegExp(`[,()]`),Dr=class extends Tr{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(`,`)}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(`,`)}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(`,`)}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(`,`)}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Er.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Er.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Or=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new Dr({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new Dr({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new Dr({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new Dr({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new Dr({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function kr(e){"@babel/helpers - typeof";return kr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kr(e)}function Ar(e,t){if(kr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jr(e){var t=Ar(e,`string`);return kr(t)==`symbol`?t:t+``}function Mr(e,t,n){return(t=jr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Nr(Object(n),!0).forEach(function(t){Mr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fr=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Pr(Pr({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Pr(Pr({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new Or(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}
8`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new Dr({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Ir=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)return{type:`cloudflare`,error:`Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.`,workaround:`Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.`};if(typeof globalThis<`u`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.includes(`Vercel-Edge`))return{type:`unsupported`,error:`Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.`,workaround:`Use serverless functions or a different deployment target for WebSocket functionality.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node)return{type:`unsupported`,error:`Node.js detected but native WebSocket not found.`,workaround:`Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.`}}return{type:`unsupported`,error:`Unknown JavaScript runtime without WebSocket support.`,workaround:`Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.`}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{return this.detectEnvironment().type===`native`}catch{return!1}}},Lr=`realtime-js/2.110.8`,Rr=`1.0.0`,zr=`2.0.0`,Br=zr,Vr=1e4,Hr={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Ur={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},Wr={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},Gr=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=`broadcast`,this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=new TextEncoder,i=r.encode(e.topic),a=r.encode(e.ref??``),o=r.encode(e.join_ref??``),s=r.encode(e.payload.event),c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=r.encode(Object.keys(c).length===0?``:JSON.stringify(c));if(o.length>255)throw Error(`joinRef length ${o.length} exceeds maximum of 255`);if(a.length>255)throw Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`topic length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`userEvent length ${s.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+o.length+a.length+i.length+s.length+l.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),f=new DataView(d),p=new Uint8Array(d),m=0;f.setUint8(m++,this.KINDS.userBroadcastPush),f.setUint8(m++,o.length),f.setUint8(m++,a.length),f.setUint8(m++,i.length),f.setUint8(m++,s.length),f.setUint8(m++,l.length),f.setUint8(m++,t),p.set(o,m),m+=o.length,p.set(a,m),m+=a.length,p.set(i,m),m+=i.length,p.set(s,m),m+=s.length,p.set(l,m),m+=l.length;var h=new Uint8Array(d.byteLength+n.byteLength);return h.set(new Uint8Array(d),0),h.set(new Uint8Array(n),d.byteLength),h.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},Kr;(function(e){e.abstime=`abstime`,e.bool=`bool`,e.date=`date`,e.daterange=`daterange`,e.float4=`float4`,e.float8=`float8`,e.int2=`int2`,e.int4=`int4`,e.int4range=`int4range`,e.int8=`int8`,e.int8range=`int8range`,e.json=`json`,e.jsonb=`jsonb`,e.money=`money`,e.numeric=`numeric`,e.oid=`oid`,e.reltime=`reltime`,e.text=`text`,e.time=`time`,e.timestamp=`timestamp`,e.timestamptz=`timestamptz`,e.timetz=`timetz`,e.tsrange=`tsrange`,e.tstzrange=`tstzrange`})(Kr||={});var qr=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Jr(i,e,t,r),n),{}):{}},Jr=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Yr(i,a):Xr(a)},Yr=(e,t)=>{if(e.charAt(0)===`_`)return ei(t,e.slice(1,e.length));switch(e){case Kr.bool:return Zr(t);case Kr.float4:case Kr.float8:case Kr.int2:case Kr.int4:case Kr.int8:case Kr.numeric:case Kr.oid:return Qr(t);case Kr.json:case Kr.jsonb:return $r(t);case Kr.timestamp:return ti(t);case Kr.abstime:case Kr.date:case Kr.daterange:case Kr.int4range:case Kr.int8range:case Kr.money:case Kr.reltime:case Kr.text:case Kr.time:case Kr.timestamptz:case Kr.timetz:case Kr.tsrange:case Kr.tstzrange:return Xr(t);default:return Xr(t)}},Xr=e=>e,Zr=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},Qr=e=>{if(typeof e==`string`){let t=parseFloat(e);
vendor: 35,287 bytes, lines 8-9
8if(!Number.isNaN(t))return t}return e},$r=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},ei=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>Yr(t,e))}return e},ti=e=>typeof e==`string`?e.replace(` `,`T`):e,ni=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,`http`),t.pathname=t.pathname.replace(/\/+$/,``).replace(/\/socket\/websocket$/i,``).replace(/\/socket$/i,``).replace(/\/websocket$/i,``),t.pathname===``||t.pathname===`/`?t.pathname=`/api/broadcast`:t.pathname+=`/api/broadcast`,t.href},ri=e=>typeof e==`function`?e:function(){return e},ii=typeof self<`u`?self:null,ai=typeof window<`u`?window:null,oi=ii||ai||globalThis,si=`2.0.0`,ci=1e4,li=1e3,ui=100,di={connecting:0,open:1,closing:2,closed:3},fi={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},pi={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},mi={longpoll:`longpoll`,websocket:`websocket`},hi={complete:4},gi=`base64url.bearer.phx.`,_i=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived(`timeout`)||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},vi=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},yi=class{constructor(e,t,n){this.state=fi.closed,this.topic=e,this.params=ri(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new _i(this,pi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new vi(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=fi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=fi.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=fi.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=fi.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new _i(this,pi.leave,ri({}),this.timeout).send(),this.state=fi.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(pi.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=fi.closed,this.bindings=[]}onClose(e){this.on(pi.close,e)}onError(e){return this.on(pi.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new _i(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=fi.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(pi.close,`leave`)},n=new _i(this,pi.leave,ri({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=fi.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===fi.closed}isErrored(){return this.state===fi.errored}isJoined(){return this.state===fi.joined}isJoining(){return this.state===fi.joining}isLeaving(){return this.state===fi.leaving}},bi=class{static request(e,t,n,r,i,a,o){if(oi.XDomainRequest){let n=new oi.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(oi.XMLHttpRequest){let s=new oi.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(oi.fetch&&oi.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),oi.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===hi.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},xi=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},Si=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(gi)&&(this.authToken=atob(t[1].slice(gi.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=di.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+mi.websocket),`$1/`+mi.longpoll)}endpointURL(){return bi.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=di.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===di.open||this.readyState===di.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=di.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=xi(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let n=t+ui,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(` 9`),()=>this.onerror(`timeout`),t=>{!t||t.status!==200?(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,`internal server error`,!1)):n<e.length?this.batchSend(e,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=di.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=bi.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},Ci=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let a=Object.create(null),o=Object.create(null);return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){e=this.toNullProtoObj(e);let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},wi={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=new TextEncoder,s=o.encode(t),c=o.encode(n),l=o.encode(i),u=o.encode(r);this.assertFieldSize(s.byteLength,`join_ref`),this.assertFieldSize(c.byteLength,`ref`),this.assertFieldSize(l.byteLength,`topic`),this.assertFieldSize(u.byteLength,`event`);let d=this.META_LENGTH+s.byteLength+c.byteLength+l.byteLength+u.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),m=new DataView(f),h=0;m.setUint8(h++,this.KINDS.push),m.setUint8(h++,s.byteLength),m.setUint8(h++,c.byteLength),m.setUint8(h++,l.byteLength),m.setUint8(h++,u.byteLength),p.set(s,h),h+=s.byteLength,p.set(c,h),h+=c.byteLength,p.set(l,h),h+=l.byteLength,p.set(u,h),h+=u.byteLength;var g=new Uint8Array(f.byteLength+a.byteLength);return g.set(p,0),g.set(new Uint8Array(a),f.byteLength),g.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:pi.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},Ti=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||ci,this.transport=t.transport||oi.WebSocket||Si,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=oi&&oi.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=wi.encode.bind(wi),this.defaultDecoder=wi.decode.bind(wi),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===Si?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;ai&&ai.addEventListener&&(ai.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),ai.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),ai.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ri(t.params||{}),this.endPoint=`${e}/${mi.websocket}`,this.vsn=t.vsn||si,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new vi(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&ri(t.authToken)}getLongPollTransport(){return Si}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=bi.appendParams(bi.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=ri(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Si?this.connectWithFallback(Si,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Si:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${gi}${btoa(this.authToken()).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),li,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===di.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(pi.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case di.connecting:return`connecting`;case di.open:return`open`;case di.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new yi(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},Ei=class e{constructor(t,n){let r=ki(n);this.presence=new Ci(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=Oi(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Di(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:Ai(t),newPresences:Di(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:Ai(t),leftPresences:Di(n)}}};function Di(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function Oi(e){return JSON.parse(JSON.stringify(e))}function ki(e){return e?.events&&{events:e.events}}function Ai(e){return e?.metas?Di(e):[]}var ji;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(ji||={});var Mi=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Ei(this.channel.channelAdapter,t)}};function Ni(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var Pi=class{constructor(e,t,n){let r=Fi(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===Hr.joined}isJoined(){return this.state===Hr.joined}isJoining(){return this.state===Hr.joining}isClosed(){return this.state===Hr.closed}isLeaving(){return this.state===Hr.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Fi(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Ii=/[,()"\\]/,Li=e=>Ii.test(e)||e!==e.trim(),Ri=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,zi=e=>{let t=e===null?`null`:String(e);return Li(t)?Ri(t):t},Bi=e=>e===null?`null`:String(e),Vi=(e,t)=>{if(e===`in`){let e=Array.isArray(t)?t:[t];if(e.length===0)throw Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(e)).map(e=>zi(e)).join(`,`)})`}return e===`is`?`is.${Bi(t)}`:`${e}.${zi(t)}`},Hi=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${Vi(t,n)}`),this}eq(e,t){return this.add(e,`eq`,t)}neq(e,t){return this.add(e,`neq`,t)}gt(e,t){return this.add(e,`gt`,t)}gte(e,t){return this.add(e,`gte`,t)}lt(e,t){return this.add(e,`lt`,t)}lte(e,t){return this.add(e,`lte`,t)}in(e,t){return this.add(e,`in`,t)}like(e,t){return this.add(e,`like`,t)}ilike(e,t){return this.add(e,`ilike`,t)}match(e,t){return this.add(e,`match`,t)}imatch(e,t){return this.add(e,`imatch`,t)}is(e,t){return this.add(e,`is`,t)}isDistinct(e,t){return this.add(e,`isdistinct`,t)}not(e,t,n){return this.add(e,t,n,!0)}build(){return this.filters.join(`,`)}toString(){return this.build()}},Ui;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(Ui||={});var Wi;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(Wi||={});var Gi;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Gi||={});var Ki=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new Pi(this.socket.socketAdapter,e,this.params),this.presence=new Mi(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ni(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[Wi.PRESENCE]&&this.bindings[Wi.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Gi.CHANNEL_ERROR,Ni(t))}),this._onClose(()=>e?.(Gi.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Gi.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Hr.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Gi.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Gi.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o<i;o++){let i=r[o],{filter:{event:s,schema:c,table:l,filter:u}}=i,d=t&&t[o];if(d&&d.event===s&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u))a.push(Object.assign(Object.assign({},i),{id:d.id}));else{this.unsubscribe(),this.state=Hr.errored,n?.(Gi.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Hr.errored&&n&&n(Gi.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:`presence`,event:`track`,payload:e},t)}async untrack(e={}){return await this.send({type:`presence`,event:`untrack`},e)}on(e,t,n){let r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Wi.PRESENCE||e===Wi.POSTGRES_CHANGES;if(r&&i)throw this.socket.log(`channel`,`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){if(t==null)return Promise.reject(Error(`Payload is required for httpSend()`));let r=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":r?`application/octet-stream`:`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set(`private`,`true`);let o={method:`POST`,headers:i,body:r?t:JSON.stringify(t)},s=await this._fetchWithTimeout(a.toString(),o,n.timeout??this.timeout);if(s.status===202)return{success:!0};if(s.status===404)return Promise.reject(Error(`httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realt
9ime-js/migrations/httpsend-server-version.md`));let c=s.statusText;try{let e=await s.json();c=e.error||e.message||c}catch{}return Promise.reject(Error(c))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.type===`broadcast`){console.warn(`Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e instanceof Error&&e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i=t?.filter;(i instanceof Hi||typeof i==`object`&&i&&typeof i.build==`function`)&&(t=Object.assign(Object.assign({},t),{filter:i.build()}));let a=this.channelAdapter.on(e,n),o={type:r,filter:t,callback:n,ref:a};return this.bindings[r]?this.bindings[r].push(o):this.bindings[r]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Ur;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=qr(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=qr(e.columns,e.old_record)),t}},qi=class{constructor(e,t){this.socket=new Ti(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Wr.connecting}isDisconnecting(){return this.socket.connectionState()==Wr.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},Ji={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Yi=[1e3,2e3,5e3,1e4],Xi=1e4;function Zi(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function Qi(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Zi()}var $i=` 10 addEventListener("message", (e) => { 11 if (e.data.event === "start") { 12 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 13 } 14 });`,ea=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={}
14,this.ref=0,this.serializer=new Gr,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new qi(e,n),this.httpEndpoint=ni(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||Wr.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new Ki(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}
14this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:Lr};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Ur.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t!==`disconnected`&&(t==`sent`&&this._setAuthSafely(),e&&e(t,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([$i],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??Vr,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??Ji.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??Ji.HEARTBEAT_INTERVAL),t.transport=e?.transport??Ir.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??Qi(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>Yi[e-1]||Xi);let n,r,i=e?.vsn??Br;switch(i){case Rr:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case zr:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
vendor: 4,836 bytes, line 14
14,ta=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function na(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function ra(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function ia(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=na(e.baseUrl,r,i),c=await ra(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new ta(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function aa(e){return e.join(`�`)}var oa=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:aa(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${aa(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${aa(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${aa(e.namespace)}`}),!0}catch(e){if(e instanceof ta&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof ta&&e.status===409)return;throw e}}};function sa(e){return e.join(`�`)}var ca=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${sa(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof ta&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof ta&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},la=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=ia({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new oa(this.client,t),this.tableOps=new ca(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
14async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function ua(e){"@babel/helpers - typeof";return ua=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ua(e)}function da(e,t){if(ua(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ua(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function fa(e){var t=da(e,`string`);return ua(t)==`symbol`?t:t+``}function pa(e,t,n){return(t=fa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ma(Object(n),!0).forEach(function(t){pa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ga=class extends Error{constructor(e,t=`storage`,n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t===`vectors`?`StorageVectorsError`:`StorageError`,this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function _a(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var va=class extends ga{constructor(e,t,n,r=`storage`){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n}toJSON(){return ha({},super.toJSON())}},ya=class extends ga{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function ba(e,t,n){let r=ha({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function xa(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var Sa=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Ca=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},wa=e=>{if(Array.isArray(e))return e.map(e=>wa(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=wa(n)}),t},Ta=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Ea=e=>e.split(`/`).map(encodeURIComponent).join(`/`),Da=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},Oa=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new va(Da(e),i,n,r))}).catch(()=>{let e=i+``;t(new va(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new ya(Da(e),e,r))},ka=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return ha(ha({},i),n);if(Ca(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=ba(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),ha(ha({},i),n)};async function Aa(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,ka(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>Oa(e,c,r,o))})}function ja(e=`storage`){return{get:async(t,n,r,i)=>Aa(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Aa(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Aa(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Aa(t,`HEAD`,n,ha(ha({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Aa(t,`DELETE`,n,i,a,r,e)}}var{get:Ma,post:Na,put:Pa,head:Fa,remove:Ia}=ja(`storage`),La=ja(`vectors`),Ra=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=xa(t),this.fetch=Sa(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=ba(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(_a(e))return{data:null,error:e};throw e}}},za=Symbol.toStringTag,Ba=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[za]=`StreamDownloadBuilder`,this.promise=null}
14then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(_a(t))return{data:null,error:t};throw t}}},Va=Symbol.toStringTag,Ha=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Va]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Ba(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(_a(t))return{data:null,error:t};throw t}}},Ua={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Wa={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Ga=class extends Ra{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=ha(ha({},Wa),r),s=ha(ha({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=ba(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?Pa:Na)(i.fetch,`${i.url}/object/${u}`,a,ha({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=ha(ha({},Wa),r),o=ha(ha({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=ba(o,e,t);return{path:a,fullPath:(await Pa(i.fetch,s.toString(),e,ha({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=ha({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await Na(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new ga(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Na(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
14stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Na(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await Na(r.fetch,`${r.url}/object/sign/${i}`,ha({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await Na(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>ha(ha({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new Ha(()=>Ma(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>wa(await Ma(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Fa(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(_a(e)){let t=e instanceof va?e.status:e instanceof ya?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Ia(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=Ea(r._getFinalPath(e)),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await Ia(r.fetch,`${r.url}/cdn/${i}${o?`?${o}`:``}`,{},{headers:r.headers},n)})}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=t?.sortBy?ha(ha({},Ua.sortBy),t.sortBy):Ua.sortBy,a=ha(ha(ha({},Ua),t),{},{sortBy:i,prefix:e||``});return await Na(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=ha({},e);return await Na(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},Ka={"X-Client-Info":`storage-js/2.110.8`},qa=class extends Ra{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=ha(ha({},Ka),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Ma(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ma(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Na(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Pa(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Na(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ia(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=new URLSearchParams;t?.transformations&&i.set(`transformations`,`true`);let a=i.toString();return await Ia(r.fetch,`${r.url}/cdn/${Ea(e)}${a?`?${a}`:``}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>
140?`?`+new URLSearchParams(t).toString():``}},Ja=class extends Ra{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=ha(ha({},Ka),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Na(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Ma(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ia(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Ta(e))throw new ga(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new la({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},Ya=class extends Ra{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=ha(ha({},Ka),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await La.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await La.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Xa=class extends Ra{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=ha(ha({},Ka),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Za=class extends Ra{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=ha(ha({},Ka),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await La.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Qa=class extends Za{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new $a(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},$a=class extends Ya{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName}))}
14async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new eo(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},eo=class extends Xa{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ha(ha({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},to=class extends qa{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Ga(this.url,this.headers,e,this.fetch)}get vectors(){return new Qa(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Ja(this.url+`/iceberg`,this.headers,this.fetch)}};function no(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var ro=`2.110.8`,io=30*1e3,ao=3*io,oo=2*io,so=`http://localhost:9999`,co=`supabase.auth.token`,lo={"X-Client-Info":`gotrue-js/${ro}`},uo=`X-Supabase-Api-Version`,fo={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},po=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,mo=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function I(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var ho=class extends mo{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function go(e){return I(e)&&e.name===`AuthApiError`}var _o=class extends mo{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},vo=class extends mo{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},yo=class extends vo{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function bo(e){return I(e)&&e.name===`AuthSessionMissingError`}var xo=class extends vo{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
14ResponseError`,500,void 0)}},So=class extends vo{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},Co=class extends vo{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function wo(e){return I(e)&&e.name===`AuthImplicitGrantRedirectError`}var To=class extends vo{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},Eo=class extends vo{constructor(){super(`PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.`,`AuthPKCECodeVerifierMissingError`,400,`pkce_code_verifier_not_found`)}},Do=class extends vo{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function Oo(e){return I(e)&&e.name===`AuthRetryableFetchError`}var ko=class extends vo{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function Ao(e){return I(e)&&e.name===`AuthRefreshDiscardedError`}var jo=class extends vo{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},Mo=class extends vo{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},No=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),Po=` 15\r=`.split(``),Fo=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Po.length;t+=1)e[Po[t].charCodeAt(0)]=-2;for(let t=0;t<No.length;t+=1)e[No[t].charCodeAt(0)]=t;return e})();function Io(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(No[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(No[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Lo(e,t,n){let r=Fo[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function Ro(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Vo(e,r,n)};for(let t=0;t<e.length;t+=1)Lo(e.charCodeAt(t),i,a);return t.join(``)}function zo(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Bo(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}zo(r,t)}}function Vo(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function Ho(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)Lo(e.charCodeAt(t),n,r);return new Uint8Array(t)}function Uo(e){let t=[];return Bo(e,e=>t.push(e)),new Uint8Array(t)}function Wo(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Io(e,n,r)),Io(null,n,r),t.join(``)}function Go(e){return Math.round(Date.now()/1e3)+e}function Ko(){return Symbol(`auth-callback`)}var qo=()=>typeof window<`u`&&typeof document<`u`,Jo={tested:!1,writable:!1},Yo=()=>
15{if(!qo())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(Jo.tested)return Jo.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Jo.tested=!0,Jo.writable=!0}catch{Jo.tested=!0,Jo.writable=!1}return Jo.writable};function Xo(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Zo=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Qo=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,$o=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},es=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},ts=async(e,t)=>{await e.removeItem(t)},ns=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};ns.promiseConstructor=Promise;function rs(e){let t=e.split(`.`);if(t.length!==3)throw new Mo(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!po.test(t[e]))throw new Mo(`JWT not in base64url format`);return{header:JSON.parse(Ro(t[0])),payload:JSON.parse(Ro(t[1])),signature:Ho(t[2]),raw:{header:t[0],payload:t[1]}}}async function is(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function as(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function os(e){return(`0`+e.toString(16)).substr(-2)}function ss(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,os).join(``)}async function cs(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function ls(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await cs(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function us(e,t,n=!1){let r=ss(),i=r;n&&(i+=`/recovery`),await $o(e,`${t}-code-verifier`,i);let a=await ls(r);return[a,r===a?`plain`:`s256`]}var ds=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function fs(e){let t=e.headers.get(uo);if(!t||!t.match(ds))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function ps(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function ms(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var hs=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gs(e){if(!hs.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function _s(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function vs(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ys(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;
15if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`string`&&(console.warn(`Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.`),t.value=!0),Reflect.get(e,n,r)}})}function bs(e){return JSON.parse(JSON.stringify(e))}var xs=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},Ss=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Cs(e){if(!Qo(e))throw new Do(xs(e),0);if(Ss.includes(e.status))throw new Do(xs(e),e.status);let t;try{t=await e.json()}catch(e){throw new _o(xs(e),e)}let n,r=fs(e);if(r&&r.getTime()>=fo[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new jo(xs(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new jo(xs(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new yo;throw new ho(xs(t),e.status||500,n)}var ws=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Ts(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[uo]=fo[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await Es(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function Es(e,t,n,r,i,a){let o=ws(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw new Do(xs(e),0)}if(s.ok||await Cs(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Cs(e)}}function Ds(e){let t=null;Ns(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Go(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Os(e){let t=Ds(e);return!t.error&&e.weak_password&&typeof e.weak_password==`object`&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message==`string`&&e.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function ks(e){return{data:{user:e.user??e},error:null}}function As(e){return{data:e,error:null}}function js(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=no(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function Ms(e){return e}function Ns(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Ps=[`global`,`local`,`others`],Fs=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Zo(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}
15async signOut(e,t=Ps[0]){if(Ps.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Ps.join(`, `)}`);try{return await Ts(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await Ts(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:ks})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=no(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await Ts(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:js,redirectTo:t?.redirectTo})}catch(e){if(I(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await Ts(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:ks})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Ts(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Ms});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(I(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){gs(e);try{return await Ts(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:ks})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){gs(e);try{return await Ts(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:ks})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){gs(e);try{return await Ts(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:ks})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){gs(e.userId);try{let{data:t,error:n}=await Ts(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteFactor(e){gs(e.userId),gs(e.id);try{return{data:await Ts(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Ts(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Ms});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(I(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await Ts(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await Ts(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await Ts(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await Ts(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await Ts(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await Ts(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(I(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await Ts(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await Ts(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await Ts(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await Ts(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){_s(this.experimental),gs(e.userId);try{return await Ts(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){_s(this.experimental),gs(e.userId),gs(e.passkeyId);try{return await Ts(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}};function Is(e={}){return{getItem:t=>
15e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Yo()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var Ls=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Rs(){if(typeof globalThis!=`object`)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<`u`&&(self.globalThis=self)}}function zs(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Bs(e){return parseInt(e,16)}function Vs(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Hs(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` 16`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=zs(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` 17Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var Us=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},Ws=class extends Us{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Gs({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Us({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Us({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Us({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Us({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Us({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Us({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Us({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Us({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!Qs(t))return new Us({message:`${window.location.hostname}
17 is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Us({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Us({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Us({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new Us({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function Ks({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Us({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Us({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!Qs(t))return new Us({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Us({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Us({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new Us({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var qs=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function Js(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=no(e,[`challenge`,`user`,`excludeCredentials`]),a=Ho(t).buffer,o=Object.assign(Object.assign({},n),{id:Ho(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:Ho(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function Ys(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=no(e,[`challenge`,`allowCredentials`]),i=Ho(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:Ho(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function Xs(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:Wo(new Uint8Array(e.response.attestationObject)),clientDataJSON:Wo(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function Zs(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Wo(new Uint8Array(r.authenticatorData)),clientDataJSON:Wo(new Uint8Array(r.clientDataJSON)),signature:Wo(new Uint8Array(r.signature)),userHandle:r.userHandle?Wo(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function Qs(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function $s(){return!!(qo()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function ec(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ws(`Browser returned unexpected credential type`,t)}:{data:null,error:new Ws(`Empty credential response`,t)}}
17catch(t){return{data:null,error:Gs({error:t,options:e})}}}async function tc(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ws(`Browser returned unexpected credential type`,t)}:{data:null,error:new Ws(`Empty credential response`,t)}}catch(t){return{data:null,error:Ks({error:t,options:e})}}}var nc={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},rc={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function ic(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=ic(n,a):r[e]=ic(a)}else r[e]=a}return r}function ac(e,t){return ic(nc,e,t||{})}function oc(e,t){return ic(rc,e,t||{})}var sc=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??qs.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await ec({publicKey:ac(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=oc(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await tc(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new _o(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new mo(`rpId is required for WebAuthn authentication`)};try{if(!$s())return{data:null,error:new _o(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new _o(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new mo(`rpId is required for WebAuthn registration`)};try{if(!$s())return{data:null,error:new _o(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new _o(`Unexpected error in register`,e)}}}};Rs();var cc={url:so,storageKey:co,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:lo,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},lc={},uc=class e{get jwks(){return lc[this.storageKey]?.jwks??{keys:[]}}set jwks(e){lc[this.storageKey]=Object.assign(Object.assign({},lc[this.storageKey]),{jwks:e})}get jwks_cached_at(){return lc[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){lc[this.storageKey]=Object.assign(Object.assign({},lc[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},cc),t);
17if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&qo()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new Fs({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Zo(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new sc(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:Yo()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Is(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Is(this.memoryStorage)),qo()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e),(e.data.event===`TOKEN_REFRESHED`||e.data.event===`SIGNED_IN`)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${ro}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock==null?await this._initialize():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))();let e=await this.initializePromise,t=this._pendingInitNotifications??[];this._pendingInitNotifications=null;for(let e of t)await this._notifyAllSubscribers(e.event,e.session,e.broadcast);return e}async _initialize(){try{let e={},t=`none`;if(qo()&&(e=Xo(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),qo()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),wo(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return I(e)?this._returnResult({error:e}):this._returnResult({error:new _o(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await Ts(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Ds});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await us(this.storage,this.storageKey)),t=await Ts(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:Ds})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Ts(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ds})}else throw new So(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await ts(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Os})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Os})}else throw new So(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new xo;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!qo()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=zs(l[0]),d=o?.signInWithEthereum?.chainId;d||=Bs(await s.request({method:`eth_chainId`})),t=Hs({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[Vs(t),u]})}try{let{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Ds});if(i)throw i;if(!r||!r.session||!r.user){let e=new xo;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!qo()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.
17solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` 18`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:Wo(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Ds});if(i)throw i;if(!r||!r.session||!r.user){let e=new xo;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await es(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new Eo;let{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Ds});if(await ts(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new xo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Ds});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new xo;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await us(this.storage,this.storageKey));let{error:a}=await Ts(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new So(`You must provide either an email or phone number.`)}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Ds});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await us(this.storage,this.storageKey));let r=await Ts(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:As});return r.data?.url&&qo()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,this.lock==null?await this._reauthenticate():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new yo;let{error:r}=await Ts(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await us(this.storage,this.storageKey));let{error:s}=await Ts(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i?.emailRedirectTo});return s&&await ts(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await Ts(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new So(`You must provide either an email or phone number and a type`)}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,this.lock==null?await this._useSession(async e=>e):await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lock!=null&&!this.lockAcquired&&this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await es(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not val
18id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<ao:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await es(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=vs()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=ys(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);if(i){if(e.expires_at&&e.expires_at*1e3>Date.now()){let t=await es(this.storage,this.storageKey);if(t&&t.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return t=this.lock==null?await this._getUser():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await Ts(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:ks}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new yo}:await Ts(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:ks})})}catch(e){if(I(e))return bo(e)&&(await this._removeSession(),await ts(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new yo;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await us(this.storage,this.storageKey));let{data:c,error:l}=await Ts(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:ks});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,this.lock==null?await this._setSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new yo;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=rs(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(I(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,this.lock==null?await this._refreshSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new yo;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!qo())throw new Co(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new Co(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new To(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new Co(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new To(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
18if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new Co(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(I(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){let t=await es(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let n=async()=>{await this._removeSession(),await ts(this.storage,`${this.storageKey}-code-verifier`)},{data:r,error:i}=t;if(i&&!bo(i))return this._returnResult({error:i});let a=r.session?.access_token;if(a){let{error:t}=await this.admin.signOut(a,e);if(t&&!(go(t)&&(t.status===404||t.status===401||t.status===403)||bo(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=Ko(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,this.lock==null?await this._emitInitialSession(t):await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),bo(t)||Oo(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await us(this.storage,this.storageKey,!0));try{return await Ts(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await Ts(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return qo()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(I(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ds});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new xo}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await ts(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await Ts(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken()`;this._debug(t,`begin`);try{let n=Date.now();return await as(async n=>(n>0&&await is(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await Ts(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ds})),(e,t)=>{let r=200*2**e;return t&&Oo(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),I(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),qo()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await es(this.storage,this.storageKey);if(t&&this.userStorage){let e=await es(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await $o(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??vs()}else if(t&&!t.user&&!t.user){let e=await es(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await ts(this.storage,this.storageKey+`-user`),await $o(this.storage,this.storageKey,t)):t.user=vs()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
18id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<ao;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${ao}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(Ao(n)?this._debug(e,`refresh discarded by commit guard`,n):this._debug(e,`refresh failed`,n))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),Oo(t)?console.warn(t):console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new yo;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug(`#_callRefreshToken()`,`returning cached failure (cooldown active)`),this.lastRefreshFailure.result;let r=`#_callRefreshToken()`;this._debug(r,`begin`);try{this.refreshingDeferred=new ns;let t=await es(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new yo;let a=await es(this.storage,this.storageKey);if(t!==null&&(a===null||a.refresh_token!==t.refresh_token)){this._debug(r,`commit guard: storage changed since refresh started, discarding rotated tokens`,{startedWith:`present`,nowHolds:a?`replaced`:`cleared`});let e={data:null,error:new ko};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(n.session),this._sessionRemovalEpoch!==o){this._debug(r,`commit guard (post-save): _removeSession ran during _saveSession, undoing write`),await ts(this.storage,this.storageKey),this.userStorage&&await ts(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new ko};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers(`TOKEN_REFRESHED`,n.session);let s={data:n.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(s),s}catch(i){if(this._debug(r,`error`,i),I(i)){let n={data:null,error:i};if(!Oo(i)){let e=await es(this.storage,this.storageKey);e?.expires_at&&e.expires_at*1e3>Date.now()?this._debug(r,`proactive refresh failed, access token still valid â preserving session`):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:n,expiresAt:Date.now()+oo},(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:e,session:t,broadcast:n});return}let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0;let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await $o(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=bs(e);await $o(this.storage,this.storageKey,r)}else{let e=bs(t);await $o(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await ts(this.storage,this.storageKey),await ts(this.storage,this.storageKey+`-code-verifier`),await ts(this.storage,this.storageKey+`-user`),this.userStorage&&await ts(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&qo()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}
18catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),io);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)==null||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(`#_autoRefreshTokenTick()`,`begin`),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/io);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${io}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof Ls)this._debug(`auto refresh token tick lock not available`);else throw e}return}if(this.refreshingDeferred!==null){this._debug(`#_autoRefreshTokenTick()`,`refresh already in flight, skipping`);return}try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/io);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${io}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!qo()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await us(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});
18r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await Ts(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await Ts(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?Xs(e.webauthn.credential_response):Zs(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await Ts(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await Ts(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Js(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Ys(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=rs(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
18=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=rs(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Ts(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new yo})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new yo});let a=await Ts(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&qo()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new yo});let a=await Ts(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&qo()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await Ts(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new yo})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await Ts(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new yo})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await Ts(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}
18=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=rs(n);if(!t?.allowExpired)try{ps(i.exp)}catch(e){throw new Mo(e instanceof Error?e.message:`JWT validation failed`)}let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=ms(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,Uo(`${o}.${s}`)))throw new Mo(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){_s(this.experimental);try{if(!$s())return this._returnResult({data:null,error:new _o(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await tc({publicKey:Ys(t.options),signal:e?.options?.signal??qs.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new _o(`WebAuthn ceremony failed`,null)});let a=Zs(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){_s(this.experimental);try{if(!$s())return this._returnResult({data:null,error:new _o(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await ec({publicKey:Js(t.options),signal:e?.options?.signal??qs.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new _o(`WebAuthn ceremony failed`,null)});let a=Xs(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){_s(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new yo});let{data:r,error:i}=await Ts(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){_s(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new yo});let{data:i,error:a}=await Ts(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){_s(this.experimental);try{let{data:t,error:n}=await Ts(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){_s(this.experimental);try{let{data:t,error:n}=await Ts(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Ds});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){_s(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new yo});let{data:r,error:i}=await Ts(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){_s(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new yo});let{data:i,error:a}=await Ts(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){_s(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new yo});let{error:i}=await Ts(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}};uc.nextInstanceID={};var dc=uc,fc=`modulepreload`,pc=function(e){return`/`+e},mc={},hc=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pc(t,n),t=s(t),t in mc)return;mc[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fc,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n
18)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gc=`2.110.8`,_c=``,vc;if(typeof Deno<`u`)_c=`deno`,vc=Deno.version?.deno;else if(typeof document<`u`)_c=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)_c=`react-native`;else{var yc;_c=`node`;let e=globalThis.process;vc=e==null||(yc=e.version)==null?void 0:yc.replace(/^v/,``)}var bc=[`runtime=${_c}`];vc&&bc.push(`runtime-version=${vc}`);var xc={headers:{"X-Client-Info":`supabase-js/${gc}; ${bc.join(`; `)}`}},Sc={schema:`public`},Cc={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},wc={},Tc={enabled:!1,respectSamplingDecision:!0};function Ec(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var L=null,Dc=`@opentelemetry/api`;function Oc(){return L===null&&(L=hc(()=>import(Dc),[]).catch(()=>null)),L}function kc(){return Ec(this,void 0,void 0,function*(){try{let e=yield Oc();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Ac(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function jc(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(Mc(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function Mc(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function Nc(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Pc(e)}function Fc(e,t){if(Pc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Pc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ic(e){var t=Fc(e,`string`);return Pc(t)==`symbol`?t:t+``}function Lc(e,t,n){return(t=Ic(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rc(Object(n),!0).forEach(function(t){Lc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Bc=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Vc=()=>Headers,Hc=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),Uc=`sb_temp_`,Wc=new Set,Gc=e=>{if(!e.startsWith(`sb_`)||Hc(e)||e.startsWith(Uc))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;
18Wc.has(t)||(Wc.add(t),console.warn(`@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.`))},Kc=(e,t,n,r,i,a)=>{let o=Bc(r),s=Vc(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?Nc(t):null,d=!(a?.omitApiKeyAsBearer&&Hc(e));return async(t,r)=>{let i=await n(),a=new s(r?.headers);if(a.has(`apikey`)||a.set(`apikey`,e),!a.has(`Authorization`)){let t=i??(d?e:null);t&&a.set(`Authorization`,`Bearer ${t}`)}if(u){let e=await qc(t,u,l);e&&(e.traceparent&&!a.has(`traceparent`)&&a.set(`traceparent`,e.traceparent),e.tracestate&&!a.has(`tracestate`)&&a.set(`tracestate`,e.tracestate),e.baggage&&!a.has(`baggage`)&&a.set(`baggage`,e.baggage))}return o(t,zc(zc({},r),{},{headers:a}))}};async function qc(e,t,n){if(!jc(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await kc();if(!r||!r.traceparent)return null;if(n){let e=Ac(r.traceparent);if(e&&!e.isSampled)return null}return r}function Jc(e){return typeof e==`boolean`?{enabled:e}:e}function Yc(e){return e.endsWith(`/`)?e:e+`/`}function Xc(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Jc(e.tracePropagation),d=Jc(t.tracePropagation),f={db:zc(zc({},o),n),auth:zc(zc({},s),r),realtime:zc(zc({},c),i),storage:{},global:zc(zc(zc({},l),a),{},{headers:zc(zc({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Zc(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Yc(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var Qc=class extends dc{constructor(e){super(e)}},$c=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=Zc(e);if(!t)throw Error(`supabaseKey is required.`);Gc(t),this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:Sc,realtime:wc,auth:zc(zc({},Cc),{},{storageKey:i}),global:xc,tracePropagation:Tc},o=Xc(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Kc(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=Kc(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(zc({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new Fr(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new to(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new gr(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??null}async _getAccessToken(){var e=this;return await e._getSessionToken()??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Qc({url:this.authUrl.href,headers:zc(zc({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new ea(this.realtimeUrl.href,zc(zc({},e),{},{params:zc(zc({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`||e===`INITIAL_SESSION`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}}
18,el=(e,t,n)=>new $c(e,t,n);function tl(){if(typeof window<`u`||globalThis.Deno!==void 0)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=20:!1}tl()&&console.warn(`â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715`);var R=el(`https://xrmpimzfhftwenxjyhmw.supabase.co`,`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhybXBpbXpmaGZ0d2VueGp5aG13Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDU4OTk2MjksImV4cCI6MjA2MTQ3NTYyOX0.bv7S7VaKTSC_VxmgdfzprrJ8cY7z-HLgpUJEoTX93sk`),nl=1,rl=1e6,il=0;function al(){return il=(il+1)%(2**53-1),il.toString()}var ol=new Map,sl=e=>{if(ol.has(e))return;let t=setTimeout(()=>{ol.delete(e),dl({type:`REMOVE_TOAST`,toastId:e})},rl);ol.set(e,t)},cl=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,nl)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?sl(n):e.toasts.forEach(e=>{sl(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},ll=[],ul={toasts:[]};function dl(e){ul=cl(ul,e),ll.forEach(e=>{e(ul)})}function fl({...e}){let t=al(),n=e=>dl({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>dl({type:`DISMISS_TOAST`,toastId:t});return dl({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function pl(){let[e,t]=y.useState(ul);return y.useEffect(()=>(ll.push(t),()=>{let e=ll.indexOf(t);e>-1&&ll.splice(e,1)}),[e]),{...e,toast:fl,dismiss:e=>dl({type:`DISMISS_TOAST`,toastId:e})}}var ml=(0,y.createContext)(void 0),hl={job_seeker:1e5,organization:5e5,career_tech:2e5,admin:1e6},gl=({children:e})=>{let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!0),{toast:l}=pl(),u=(0,y.useRef)(!1),d=(0,y.useRef)(null),f=(0,y.useCallback)(async(e,t=!1)=>{if(!(!t&&(u.current||d.current===e)))try{u.current=!0;let{data:t,error:r}=await R.from(`profiles`).select(`*, organizations!profiles_organization_id_fkey(name, industry, company_size, services)`).eq(`id`,e).single();if(r&&(r.message?.includes(`relation`)||r.message?.includes(`organizations`))){console.warn(`Organizations table not available, fetching profile without org join`);let n=await R.from(`profiles`).select(`*`).eq(`id`,e).single();t=n.data,r=n.error}if(r){if(console.error(`Error fetching profile:`,r),r.code===`PGRST116`){console.error(`Profile not found in database for user:`,e),l({title:`Profile Not Found`,description:`Your account profile could not be found. Please contact support or try signing up again.`,variant:`destructive`}),await R.auth.signOut(),i(null),n(null),d.current=null;return}}else{console.log(`Profile fetched:`,t);let n=t.organizations,r={...t,organization_name:n?.name||null,organization_industry:n?.industry||null,organization_company_size:n?.company_size||null,organization_services:n?.services||null};i(r),d.current=e}}catch(e){console.error(`Error in profile fetch:`,e)}finally{u.current=!1}},[l]);(0,y.useEffect)(()=>{let e;return(async()=>{try{let{data:{session:t}}=await R.auth.getSession();o(t),n(t?.user??null),t?.user&&await f(t.user.id,!0),e=R.auth.onAuthStateChange(async(e,t)=>{console.log(`Auth state change event:`,e),o(t),n(t?.user??null),t?.user?d.current!==t.user.id&&await f(t.user.id,!0):(d.current&&sessionStorage.removeItem(`profile_modal_shown_${d.current}`),i(null),d.current=null)})}catch(e){console.error(`Auth initialization error:`,e)}finally{c(!1)}})(),()=>{e?.data?.subscription&&e.data.subscription.unsubscribe()}},[f]);let p=(0,y.useCallback)(async()=>{try{console.log(`[SIGN_OUT] Starting sign out process`),t?.id&&sessionStorage.removeItem(`profile_modal_shown_${t.id}`),n(null),i(null),o(null),d.current=null;let{error:e}=await R.auth.signOut({scope:`global`});if(e&&e.message!==`Session from session_id claim in JWT does not exist`)throw console.error(`[SIGN_OUT] Sign out error:`,e),e;console.log(`[SIGN_OUT] Successfully signed out from backend`);
18try{Object.keys(localStorage).forEach(e=>{(e.startsWith(`sb-`)||e.includes(`supabase`))&&(localStorage.removeItem(e),console.log(`[SIGN_OUT] Removed localStorage key:`,e))})}catch(e){console.error(`[SIGN_OUT] Error clearing localStorage:`,e)}l({title:`Signed out`,description:`You have been successfully signed out.`}),await new Promise(e=>setTimeout(e,100)),console.log(`[SIGN_OUT] Redirecting to auth page`),window.location.href=`/auth`}catch(e){console.error(`[SIGN_OUT] Error during sign out:`,e),n(null),i(null),o(null),d.current=null;try{Object.keys(localStorage).forEach(e=>{(e.startsWith(`sb-`)||e.includes(`supabase`))&&localStorage.removeItem(e)})}catch(e){console.error(`[SIGN_OUT] Error clearing localStorage on error path:`,e)}!e.message?.includes(`session`)&&!e.message?.includes(`Session`)&&l({title:`Sign out failed`,description:e.message,variant:`destructive`}),await new Promise(e=>setTimeout(e,100)),window.location.href=`/auth`}},[l,t?.id]),m=(0,y.useCallback)(async e=>{if(!t){console.error(`[UPDATE_PROFILE] No user found, cannot update profile`);return}try{console.log(`[UPDATE_PROFILE] Starting profile update for user:`,t.id),console.log(`[UPDATE_PROFILE] Update payload:`,JSON.stringify(e,null,2));let{data:n,error:r}=await R.from(`profiles`).update({...e,updated_at:new Date().toISOString()}).eq(`id`,t.id).select(`*, organizations!profiles_organization_id_fkey(name, industry, company_size, services)`).single();if(r)throw console.error(`[UPDATE_PROFILE] Database error:`,r),console.error(`[UPDATE_PROFILE] Error details:`,{code:r.code,message:r.message,details:r.details,hint:r.hint}),r;if(n){console.log(`[UPDATE_PROFILE] Profile updated successfully in database`),console.log(`[UPDATE_PROFILE] Updated data:`,JSON.stringify(n,null,2));let e=n.organizations,t={...n,organization_name:e?.name||null,organization_industry:e?.industry||null,organization_company_size:e?.company_size||null,organization_services:e?.services||null};i(t),console.log(`[UPDATE_PROFILE] Local profile state updated`)}else console.warn(`[UPDATE_PROFILE] No data returned from update`);console.log(`[UPDATE_PROFILE] Force-fetching profile to refresh`),await f(t.id,!0),l({title:`Profile updated`,description:`Your profile has been successfully updated.`})}catch(e){console.error(`[UPDATE_PROFILE] Update failed with error:`,e),console.error(`[UPDATE_PROFILE] Error stack:`,e.stack);let t=e.message||`An unknown error occurred`;throw e.code===`42501`?t=`Permission denied. You may not have the necessary permissions to update this data.`:e.code===`23505`?t=`A record with this information already exists.`:e.code===`PGRST116`&&(t=`Profile not found. Please try signing out and back in.`),l({title:`Update failed`,description:t,variant:`destructive`}),e}},[t,f,l]),h=(0,y.useCallback)(async()=>{t&&await f(t.id,!0)},[f,t]),g=(0,y.useCallback)(async(e,n)=>{if(!t||!r)return!1;try{let a=e+n,o=r.tokens_used||0,s=r.tokens_limit||hl[r.user_type],c=o+a;if(c>s)return console.log(`User has exceeded token limit:`,c,`vs limit`,s),l({title:`Token limit reached`,description:`You've reached your monthly token limit. Please upgrade your plan to continue using Akito.`,variant:`destructive`}),!1;let{error:u}=await R.from(`profiles`).update({tokens_used:c,updated_at:new Date().toISOString()}).eq(`id`,t.id);return u?(console.error(`Error updating token usage:`,u),!1):(i({...r,tokens_used:c}),c>s*.8&&o<=s*.8&&l({title:`Token usage warning`,description:`You're approaching your monthly token limit. Consider upgrading your plan.`,variant:`default`}),!0)}catch(e){return console.error(`Error tracking token usage:`,e),!1}},[t,r,l]),_=(0,y.useCallback)(()=>{if(!r)return``;let e=[];switch(e.push(`User: ${r.full_name||`Anonymous`}`),e.push(`Type: ${r.user_type}`),r.about&&e.push(`About: ${r.about}`),r.location&&e.push(`Location: ${r.location}`),r.user_type){case`job_seeker`:r.skills?.length&&e.push(`Skills: ${r.skills.join(`, `)}`),r.career_goals&&e.push(`Career Goals: ${r.career_goals}`);break;case`organization`:r.organization_name&&e.push(`Organization: ${r.organization_name}`),r.organization_industry&&e.push(`Industry: ${r.organization_industry}
18`),r.organization_company_size&&e.push(`Organization Size: ${r.organization_company_size}`),r.organization_services?.length&&e.push(`Services: ${r.organization_services.join(`, `)}`);break;case`career_tech`:r.company_name&&e.push(`Company: ${r.company_name}`),r.services?.length&&e.push(`Services: ${r.services.join(`, `)}`);break}return e.join(` 19`)},[r]),v=y.useMemo(()=>({user:t,profile:r,session:a,loading:s,signOut:p,refreshProfile:h,updateProfile:m,trackTokenUsage:g,getProfileContext:_}),[t,r,a,s,p,h,m,g,_]);return(0,F.jsx)(ml.Provider,{value:v,children:e})},_l=()=>{let e=(0,y.useContext)(ml);if(e===void 0)throw Error(`useAuth must be used within an AuthProvider`);return e};function vl(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function yl(...e){return t=>e.forEach(e=>vl(e,t))}function bl(...e){return y.useCallback(yl(...e),e)}var xl=y.forwardRef((e,t)=>{let{children:n,...r}=e,i=y.Children.toArray(n),a=i.find(wl);if(a){let e=a.props.children,n=i.map(t=>t===a?y.Children.count(e)>1?y.Children.only(null):y.isValidElement(e)?e.props.children:null:t);return(0,F.jsx)(Sl,{...r,ref:t,children:y.isValidElement(e)?y.cloneElement(e,void 0,n):null})}return(0,F.jsx)(Sl,{...r,ref:t,children:n})});xl.displayName=`Slot`;var Sl=y.forwardRef((e,t)=>{let{children:n,...r}=e;if(y.isValidElement(n)){let e=El(n);return y.cloneElement(n,{...Tl(r,n.props),ref:t?yl(t,e):e})}return y.Children.count(n)>1?y.Children.only(null):null});Sl.displayName=`SlotClone`;var Cl=({children:e})=>(0,F.jsx)(F.Fragment,{children:e});function wl(e){return y.isValidElement(e)&&e.type===Cl}function Tl(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function El(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Dl(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ol(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Dl(e))&&(r&&(r+=` `),r+=t);return r}var kl=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Al=Ol,jl=(e,t)=>n=>{if(t?.variants==null)return Al(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kl(t)||kl(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Al(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ml=`-`,Nl=e=>{let t=Ll(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(Ml);return n[0]===``&&n.length!==1&&n.shift(),Pl(n,t)||Il(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Pl=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Pl(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(Ml);return t.validators.find(({validator:e})=>e(a))?.classGroupId},Fl=/^\[(.+)\]$/,Il=e=>{if(Fl.test(e)){let t=Fl.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},Ll=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Vl(Object.entries(e.classGroups),n).forEach(([e,n])=>{Rl(n,r,e,t)}),r},Rl=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:zl(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Bl(e)){Rl(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Rl(i,zl(t,e),n,r)})})},zl=(e,t)=>{let n=e;
vendor: 5,576 bytes, line 19
19return t.split(Ml).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Bl=e=>e.isThemeGetter,Vl=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Hl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},Ul=`!`,Wl=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(Ul);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},Gl=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Kl=e=>({cache:Hl(e.cacheSize),parseClassName:Wl(e),...Nl(e)}),ql=/\s+/,Jl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(ql),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=Gl(c).join(`:`),h=l?m+Ul:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function Yl(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Xl(t))&&(r&&(r+=` `),r+=n);return r}var Xl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Xl(e[r]))&&(n&&(n+=` `),n+=t);return n};function Zl(e,...t){let n,r,i,a=o;function o(o){return n=Kl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=Jl(e,n);return i(e,a),a}return function(){return a(Yl.apply(null,arguments))}}var Ql=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},$l=/^\[(?:([a-z-]+):)?(.+)\]$/i,eu=/^\d+\/\d+$/,tu=new Set([`px`,`full`,`screen`]),nu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ru=/\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$/,iu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,au=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ou=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,su=e=>lu(e)||tu.has(e)||eu.test(e),cu=e=>Su(e,`length`,Cu),lu=e=>!!e&&!Number.isNaN(Number(e)),uu=e=>Su(e,`number`,lu),du=e=>!!e&&Number.isInteger(Number(e)),fu=e=>e.endsWith(`%`)&&lu(e.slice(0,-1)),pu=e=>$l.test(e),mu=e=>nu.test(e),hu=new Set([`length`,`size`,`percentage`]),gu=e=>Su(e,hu,wu),_u=e=>Su(e,`position`,wu),vu=new Set([`image`,`url`]),yu=e=>Su(e,vu,Eu),bu=e=>Su(e,``,Tu),xu=()=>!0,Su=(e,t,n)=>{let r=$l.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},Cu=e=>ru.test(e)&&!iu.test(e),wu=()=>!1,Tu=e=>au.test(e),Eu=e=>ou.test(e),Du=Zl(()=>{let e=Ql(`colors`),t=Ql(`spacing`),n=Ql(`blur`),r=Ql(`brightness`),i=Ql(`borderColor`),a=Ql(`borderRadius`),o=Ql(`borderSpacing`),s=Ql(`borderWidth`),c=Ql(`contrast`),l=Ql(`grayscale`),u=Ql(`hueRotate`),d=Ql(`invert`),f=Ql(`gap`),p=Ql(`gradientColorStops`),m=Ql(`gradientColorStopPositions`),h=Ql(`inset`),g=Ql(`margin`),_=Ql(`opacity`),v=Ql(`padding`),y=Ql(`saturate`),b=Ql(`scale`),x=Ql(`sepia`),S=Ql(`skew`),C=Ql(`space`),w=Ql(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,pu,t],O=()=>[pu,t],k=()=>[``,su,cu],A=()=>[`auto`,lu,pu],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],te=()=>[``,`0`,pu],ne=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],re=()=>[lu,pu];return{cacheSize:500,separator:`:`,theme:{colors:[xu],spacing:[su,cu],blur:[`none`,``,mu,pu],brightness:re(),borderColor:[e],borderRadius:[`none`,``,`full`,mu,pu],borderSpacing:O(),borderWidth:k(),contrast:re(),grayscale:te(),hueRotate:re(),invert:te(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[fu,cu],inset:D(),margin:D(),opacity:re(),padding:O(),saturate:re(),scale:re(),sepia:te(),skew:re(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,pu]}],container:[`container`],columns:[{columns:[mu]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"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`,`
19contents`,`list-item`,`hidden`],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:[...j(),pu]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,du,pu]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,pu]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:[`first`,`last`,`none`,du,pu]}],"grid-cols":[{"grid-cols":[xu]}],"col-start-end":[{col:[`auto`,{span:[`full`,du,pu]},pu]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[xu]}],"row-start-end":[{row:[`auto`,{span:[du,pu]},pu]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,pu]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,pu]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...ee()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...ee(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...ee(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,pu,t]}],"min-w":[{"min-w":[pu,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[pu,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[mu]},mu]}],h:[{h:[pu,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[pu,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[pu,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[pu,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,mu,cu]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,uu]}],"font-family":[{font:[xu]}],"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-fractons`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,pu]}],"line-clamp":[{"line-clamp":[`none`,lu,uu]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,su,pu]}],"list-image":[{"list-image":[`none`,pu]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,pu]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,su,cu]}],"underline-offset":[{"underline-offset":[`auto`,su,pu]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,pu]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,pu]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),_u]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,gu]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},yu]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}
vendor: 4,152 bytes, line 19
19],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[su,pu]}],"outline-w":[{outline:[su,cu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[su,cu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,mu,bu]}],"shadow-color":[{shadow:[xu]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,mu,pu]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,pu]}],duration:[{duration:re()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,pu]}],delay:[{delay:re()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,pu]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[du,pu]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,pu]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],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
19-in`,`zoom-out`,pu]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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`,pu]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[su,cu,uu]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"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-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-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`],"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`]}}});function z(...e){return Du(Ol(e))}var Ou=jl(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),B=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,F.jsx)(r?xl:`button`,{className:z(Ou({variant:t,size:n,className:e})),ref:a,...i}));B.displayName=`Button`;var ku=y.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{type:t,className:z(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));ku.displayName=`Input`;var V=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:z(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));V.displayName=`Card`;var Au=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:z(`flex flex-col space-y-1.5 p-6`,e),...t}));Au.displayName=`CardHeader`;var ju=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`h3`,{ref:n,className:z(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));ju.displayName=`CardTitle`;var Mu=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`p`,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));Mu.displayName=`CardDescription`;var H=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:z(`p-6 pt-0`,e),...t}));H.displayName=`CardContent`;var Nu=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:z(`flex items-center p-6 pt-0`,e),...t}));
19Nu.displayName=`CardFooter`;var U=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=y.forwardRef((e,n)=>{let{asChild:r,...i}=e,a=r?xl:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(a,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Pu(e,t){e&&b.flushSync(()=>e.dispatchEvent(t))}var Fu=`Label`,Iu=y.forwardRef((e,t)=>(0,F.jsx)(U.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Iu.displayName=Fu;var Lu=Iu,Ru=jl(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),zu=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Lu,{ref:n,className:z(Ru(),e),...t}));zu.displayName=Lu.displayName;var Bu=jl(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),Vu=y.forwardRef(({className:e,variant:t,...n},r)=>(0,F.jsx)(`div`,{ref:r,role:`alert`,className:z(Bu({variant:t}),e),...n}));Vu.displayName=`Alert`;var Hu=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`h5`,{ref:n,className:z(`mb-1 font-medium leading-none tracking-tight`,e),...t}));Hu.displayName=`AlertTitle`;var Uu=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:z(`text-sm [&_p]:leading-relaxed`,e),...t}));Uu.displayName=`AlertDescription`;var Wu=(0,y.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`}),Gu=(0,y.createContext)({}),Ku=(0,y.createContext)(null),qu=typeof document<`u`,Ju=qu?y.useLayoutEffect:y.useEffect,Yu=(0,y.createContext)({strict:!1}),Xu=e=>e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase(),Zu=`data-`+Xu(`framerAppearId`);function eee(e,t,n,r){let{visualElement:i}=(0,y.useContext)(Gu),a=(0,y.useContext)(Yu),o=(0,y.useContext)(Ku),s=(0,y.useContext)(Wu).reducedMotion,c=(0,y.useRef)();r||=a.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:s}));let l=c.current;(0,y.useInsertionEffect)(()=>{l&&l.update(n,o)});let u=(0,y.useRef)(!!(n[Zu]&&!window.HandoffComplete));return Ju(()=>{l&&(l.render(),u.current&&l.animationState&&l.animationState.animateChanges())}),(0,y.useEffect)(()=>{l&&(l.updateFeatures(),!u.current&&l.animationState&&l.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),l}function Qu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function tee(e,t,n){return(0,y.useCallback)(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Qu(n)&&(n.current=r))},[t])}function $u(e){return typeof e==`string`||Array.isArray(e)}function ed(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var td=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],nd=[`initial`,...td];function rd(e){return ed(e.animate)||nd.some(t=>$u(e[t]))}function id(e){return!!(rd(e)||e.variants)}function nee(e,t){if(rd(e)){let{initial:t,animate:n}=e;return{initial:t===!1||$u(t)?t:void 0,animate:$u(n)?n:void 0}}return e.inherit===!1?{}:t}function ree(e){let{initial:t,animate:n}=nee(e,(0,y.useContext)(Gu));return(0,y.useMemo)(()=>({initial:t,animate:n}),[ad(t),ad(n)])}function ad(e){return Array.isArray(e)?e.join(` `):e}var od={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},sd={};for(let e in od)sd[e]={isEnabled:t=>od[e].some(e=>!!t[e])};function iee(e){for(let t in e)sd[t]={...sd[t],...e[t]}}var cd=(0,y.createContext)({}),ld=(0,y.createContext)({}),aee=Symbol.for(`motionComponentSymbol`);function oee({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&iee(e);function a(a,o){let s,c={...(0,y.useContext)(Wu),...a,layoutId:see(a)},{isStatic:l}=c,u=ree(a),d=r(a,l);
19if(!l&&qu){u.visualElement=eee(i,d,c,t);let n=(0,y.useContext)(ld),r=(0,y.useContext)(Yu).strict;u.visualElement&&(s=u.visualElement.loadFeatures(c,r,e,n))}return y.createElement(Gu.Provider,{value:u},s&&u.visualElement?y.createElement(s,{visualElement:u.visualElement,...c}):null,n(i,a,tee(d,u.visualElement,o),d,l,u.visualElement))}let o=(0,y.forwardRef)(a);return o[aee]=i,o}function see({layoutId:e}){let t=(0,y.useContext)(cd).id;return t&&e!==void 0?t+`-`+e:e}function cee(e){function t(t,n={}){return oee(e(t,n))}if(typeof Proxy>`u`)return t;let n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}var ud=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function dd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(ud.indexOf(e)>-1||/[A-Z]/.test(e))}var fd={};function lee(e){Object.assign(fd,e)}var pd=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],md=new Set(pd);function hd(e,{layout:t,layoutId:n}){return md.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!fd[e]||e===`opacity`)}var gd=e=>!!(e&&e.getVelocity),_d={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},vd=pd.length;function uee(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let a=``;for(let t=0;t<vd;t++){let n=pd[t];if(e[n]!==void 0){let t=_d[n]||n;a+=`${t}(${e[n]}) `}}return t&&!e.z&&(a+=`translateZ(0)`),a=a.trim(),i?a=i(e,r?``:a):n&&r&&(a=`none`),a}var yd=e=>t=>typeof t==`string`&&t.startsWith(e),bd=yd(`--`),xd=yd(`var(--`),Sd=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?
19:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,Cd=(e,t)=>t&&typeof e==`number`?t.transform(e):e,wd=(e,t,n)=>Math.min(Math.max(n,e),t),Td={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Ed={...Td,transform:e=>wd(0,1,e)},Dd={...Td,default:1},Od=e=>Math.round(e*1e5)/1e5,kd=/(-)?([\d]*\.?[\d])+/g,Ad=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,jd=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Md(e){return typeof e==`string`}var Nd=e=>({test:t=>Md(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pd=Nd(`deg`),Fd=Nd(`%`),Id=Nd(`px`),dee=Nd(`vh`),fee=Nd(`vw`),Ld={...Fd,parse:e=>Fd.parse(e)/100,transform:e=>Fd.transform(e*100)},Rd={...Td,transform:Math.round},zd={borderWidth:Id,borderTopWidth:Id,borderRightWidth:Id,borderBottomWidth:Id,borderLeftWidth:Id,borderRadius:Id,radius:Id,borderTopLeftRadius:Id,borderTopRightRadius:Id,borderBottomRightRadius:Id,borderBottomLeftRadius:Id,width:Id,maxWidth:Id,height:Id,maxHeight:Id,size:Id,top:Id,right:Id,bottom:Id,left:Id,padding:Id,paddingTop:Id,paddingRight:Id,paddingBottom:Id,paddingLeft:Id,margin:Id,marginTop:Id,marginRight:Id,marginBottom:Id,marginLeft:Id,rotate:Pd,rotateX:Pd,rotateY:Pd,rotateZ:Pd,scale:Dd,scaleX:Dd,scaleY:
19Dd,scaleZ:Dd,skew:Pd,skewX:Pd,skewY:Pd,distance:Id,translateX:Id,translateY:Id,translateZ:Id,x:Id,y:Id,z:Id,perspective:Id,transformPerspective:Id,opacity:Ed,originX:Ld,originY:Ld,originZ:Id,zIndex:Rd,fillOpacity:Ed,strokeOpacity:Ed,numOctaves:Rd};function Bd(e,t,n,r){let{style:i,vars:a,transform:o,transformOrigin:s}=e,c=!1,l=!1,u=!0;for(let e in t){let n=t[e];if(bd(e)){a[e]=n;continue}let r=zd[e],d=Cd(n,r);if(md.has(e)){if(c=!0,o[e]=d,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith(`origin`)?(l=!0,s[e]=d):i[e]=d}if(t.transform||(c||r?i.transform=uee(e.transform,n,u,r):i.transform&&=`none`),l){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=s;i.transformOrigin=`${e} ${t} ${n}`}}var Vd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hd(e,t,n){for(let r in t)!gd(t[r])&&!hd(r,n)&&(e[r]=t[r])}function Ud({transformTemplate:e},t,n){return(0,y.useMemo)(()=>{let r=Vd();return Bd(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Wd(e,t,n){let r=e.style||{},i={};return Hd(i,r,e),Object.assign(i,Ud(e,t,n)),e.transformValues?e.transformValues(i):i}function pee(e,t,n){let r={},i=Wd(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout=`none`,i.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}var mee=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.transformValues.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function Gd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||mee.has(e)}function hee(e){var t={};return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var gee=o((()=>{})),_ee=c({default:()=>qd}),Kd,qd,vee=o((()=>{gee(),Kd=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackgroun
19d|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,qd=hee(function(e){return Kd.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),Jd=e=>!Gd(e);function yee(e){e&&(Jd=t=>t.startsWith(`on`)?!Gd(t):e(t))}try{yee((vee(),d(_ee)).default)}catch{}function bee(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(Jd(i)||n===!0&&Gd(i)||!t&&!Gd(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function Yd(e,t,n){return typeof e==`string`?e:Id.transform(t+n*e)}function xee(e,t,n){return`${Yd(t,e.x,e.width)} ${Yd(n,e.y,e.height)}`}var See={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Cee={offset:`strokeDashoffset`,array:`strokeDasharray`};function wee(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?See:Cee;e[a.offset]=Id.transform(-r);let o=Id.transform(t),s=Id.transform(n);e[a.array]=`${o} ${s}`}function Xd(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...l},u,d,f){if(Bd(e,l,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:m,dimensions:h}=e;p.transform&&(h&&(m.transform=p.transform),delete p.transform),h&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=xee(h,i===void 0?.5:i,a===void 0?.5:a)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&wee(p,o,s,c,!1)}var Zd=()=>({...Vd(),attrs:{}}),Qd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Tee(e,t,n,r){let i=(0,y.useMemo)(()=>{let n=Zd();return Xd(n,t,{enableHardwareAcceleration:!1},Qd(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Hd(t,e.style,e),i.style={...t,...i.style}}return i}function Eee(e=!1){return(t,n,r,{latestValues:i},a)=>{let o=(dd(t)?Tee:pee)(n,i,a,t),s={...bee(n,typeof t==`string`,e),...o,ref:r},{children:c}=n,l=(0,y.useMemo)(()=>gd(c)?c.get():c,[c]);return(0,y.createElement)(t,{...s,children:l})}}function $d(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(let t in n)e.style.setProperty(t,n[t])}var ef=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function tf(e,t,n,r){$d(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ef.has(n)?n:Xu(n),t.attrs[n])}function nf(e,t){let{style:n}=e,r={};for(let i in n)(gd(n[i])||t.style&&gd(t.style[i])||hd(i,e))&&(r[i]=n[i]);return r}function rf(e,t){let n=nf(e,t);for(let r in e)if(gd(e[r])||gd(t[r])){let t=pd.indexOf(r)===-1?r:`attr`+r.charAt(0).toUpperCase()+r.substring(1);n[t]=e[r]}return n}function af(e,t,n,r={},i={}){return typeof t==`function`&&(t=t(n===void 0?e.custom:n,r,i)),typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`&&(t=t(n===void 0?e.custom:n,r,i)),t}function of(e){let t=(0,y.useRef)(null);return t.current===null&&(t.current=e()),t.current}var sf=e=>Array.isArray(e),Dee=e=>!!(e&&typeof e==`object`&&e.mix&&e.toValue),Oee=e=>sf(e)?e[e.length-1]||0:e;function cf(e){let t=gd(e)?e.get():e;return Dee(t)?t.toValue():t}function kee({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,a){let o={latestValues:Aee(r,i,a,e),renderState:t()};return n&&(o.mount=e=>n(r,e,o)),o}var lf=e=>(t,n)=>{let r=(0,y.useContext)(Gu),i=(0,y.useContext)(Ku),a=()=>
19kee(e,t,r,i);return n?a():of(a)};function Aee(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=cf(a[e]);let{initial:o,animate:s}=e,c=rd(e),l=id(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;return d&&typeof d!=`boolean`&&!ed(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{let n=af(e,t);if(!n)return;let{transitionEnd:r,transition:a,...o}=n;for(let e in o){let t=o[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let e in r)i[e]=r[e]}),i}var uf=e=>e,df=class{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){let t=this.order.indexOf(e);t!==-1&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}};function jee(e){let t=new df,n=new df,r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.add(e)&&c&&i&&(r=t.order.length),e},cancel:e=>{n.remove(e),o.delete(e)},process:c=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){let r=t.order[n];r(c),o.has(r)&&(s.schedule(r),e())}i=!1,a&&(a=!1,s.process(c))}};return s}var ff=[`prepare`,`read`,`update`,`preRender`,`render`,`postRender`],Mee=40;function pf(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=ff.reduce((e,t)=>
19(e[t]=jee(()=>n=!0),e),{}),o=e=>a[e].process(i),s=()=>{let a=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Mee),1),i.timestamp=a,i.isProcessing=!0,ff.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(s))},c=()=>{n=!0,r=!0,i.isProcessing||e(s)};return{schedule:ff.reduce((e,t)=>{let r=a[t];return e[t]=(e,t=!1,i=!1)=>(n||c(),r.schedule(e,t,i)),e},{}),cancel:e=>ff.forEach(t=>a[t].cancel(e)),state:i,steps:a}}var{schedule:mf,cancel:hf,state:gf,steps:_f}=pf(typeof requestAnimationFrame<`u`?requestAnimationFrame:uf,!0),vf={useVisualState:lf({scrapeMotionValuesFromProps:rf,createRenderState:Zd,onMount:(e,t,{renderState:n,latestValues:r})=>{mf.read(()=>{try{n.dimensions=typeof t.getBBox==`function`?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),mf.render(()=>{Xd(n,r,{enableHardwareAcceleration:!1},Qd(t.tagName),e.transformTemplate),tf(t,n)})}})},yf={useVisualState:lf({scrapeMotionValuesFromProps:nf,createRenderState:Vd})};function bf(e,{forwardMotionProps:t=!1},n,r){return{...dd(e)?vf:yf,preloadedFeatures:n,useRender:Eee(t),createVisualElement:r,Component:e}}function xf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var Sf=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Cf(e,t=`page`){return{point:{x:e[t+`X`],y:e[t+`Y`]}}}var wf=e=>t=>Sf(t)&&e(t,Cf(t));function Tf(e,t,n,r){return xf(e,t,wf(n),r)}var Ef=(e,t)=>n=>t(e(n)),Df=(...e)=>e.reduce(Ef);function Of(e){let t=null;return()=>t===null?(t=e,()=>{t=null}):!1}var kf=Of(`dragHorizontal`),Af=Of(`dragVertical`);function jf(e){let t=!1;if(e===`y`)t=Af();else if(e===`x`)t=kf();else{let e=kf(),n=Af();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Mf(){let e=jf(!0);return e?(e(),!1):!0}var Nf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Pf(e,t){let n=`pointer`+(t?`enter`:`leave`),r=`onHover`+(t?`Start`:`End`);return Tf(e.current,n,(n,i)=>{if(n.pointerType===`touch`||Mf())return;let a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive(`whileHover`,t),a[r]&&mf.update(()=>a[r](n,i))},{passive:!e.getProps()[r]})}var Ff=class extends Nf{mount(){this.unmount=Df(Pf(this.node,!0),Pf(this.node,!1))}unmount(){}},If=class extends Nf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Df(xf(this.node.current,`focus`,()=>this.onFocus()),xf(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}},Lf=(e,t)=>t?e===t||Lf(e,t.parentElement):!1;function Rf(e,t){if(!t)return;let n=new PointerEvent(`pointer`+e);t(n,Cf(n))}var zf=class extends Nf{constructor(){super(...arguments),this.removeStartListeners=uf,this.removeEndListeners=uf,this.removeAccessibleListeners=uf,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();let n=this.node.getProps(),r=Tf(window,`pointerup`,(e,t)=>{if(!this.checkPressEnd())return;let{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();mf.update(()=>{!i&&!Lf(this.node.current,e.target)?r&&r(e,t):n&&n(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),i=Tf(window,`pointercancel`,(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Df(r,i),this.startPress(e,t)},this.startAccessiblePress=()=>{let e=xf(this.node.current,`keydown`,e=>{if(e.key!==`Enter`||this.isPressing)return;let t=e=>{e.key!==`Enter`||!this.checkPressEnd()||Rf(`up`,(e,t)=>{let{onTap:n}=this.node.getProps();n&&mf.update(()=>n(e,t))})};this.removeEndListeners(),this.removeEndListeners=xf(this.node.current,`keyup`,t),Rf(`down`,(e,t)=>{this.startPress(e,t)})}),t=xf(this.node.current,`blur`,()=>{this.isPressing&&Rf(`cancel`,(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=Df(e,t)}}startPress(e,t){this.isPressing=!0;let{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive(`whileTap`,!0),n&&mf.update(()=>n(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(`whileTap`,!1),!Mf()}cancelPress(e,t){if(!this.checkPressEnd())return;let{onTapCancel:n}=this.node.getProps();n&&mf.update(()=>n(e,t))}mount(){let e=this.node.getProps(),t=Tf(e.globalTapTarget?window:this.node.current,`pointerdown`,this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=xf(this.node.current,`focus`,this.startAccessiblePress);this.removeStartListeners=Df(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}},Bf=new WeakMap,Vf=new WeakMap,Hf=e=>{let t=Bf.get(e.target);t&&t(e)},Uf=e=>{e.forEach(Hf)};function Wf({root:e,...t}){let n=e||document;Vf.has(n)||Vf.set(n,{});let r=Vf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uf,{root:e,...t})),r[i]}function Gf(e,t,n){let r=Wf(t);return Bf.set(e,n),r.observe(e),()=>{Bf.delete(e),r.unobserve(e)}}var Kf={some:0,all:1},Nee=class extends Nf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Kf[r]};return Gf(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Pee(e,t))&&this.startObserver()}unmount(){}};function Pee({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Fee={inView:{Feature:Nee},tap:{Feature:zf},focus:{Feature:If},hover:{Feature:Ff}};function qf(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Iee(e){let t={};
19return e.values.forEach((e,n)=>t[n]=e.get()),t}function Lee(e){let t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}function Jf(e,t,n){let r=e.getProps();return af(r,t,n===void 0?r.custom:n,Iee(e),Lee(e))}var Yf=uf,Xf=uf,Zf=e=>e*1e3,Qf=e=>e/1e3,$f={current:!1},ep=e=>Array.isArray(e)&&typeof e[0]==`number`;function tp(e){return!!(!e||typeof e==`string`&&rp[e]||ep(e)||Array.isArray(e)&&e.every(tp))}var np=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rp={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:np([0,.65,.55,1]),circOut:np([.55,0,1,.45]),backIn:np([.31,.01,.66,-.59]),backOut:np([.33,1.53,.69,.99])};function ip(e){if(e)return ep(e)?np(e):Array.isArray(e)?e.map(ip):rp[e]}function Ree(e,t,n,{delay:r=0,duration:i,repeat:a=0,repeatType:o=`loop`,ease:s,times:c}={}){let l={[t]:n};c&&(l.offset=c);let u=ip(s);return Array.isArray(u)&&(l.easing=u),e.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?`linear`:u,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`})}function zee(e,{repeat:t,repeatType:n=`loop`}){return e[t&&n!==`loop`&&t%2==1?0:e.length-1]}var ap=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bee=1e-7,Vee=12;function Hee(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ap(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bee&&++s<Vee);return o}function op(e,t,n,r){if(e===t&&n===r)return uf;let i=t=>Hee(t,0,1,e,n);return e=>e===0||e===1?e:ap(i(e),t,r)}var Uee=op(.42,0,1,1),Wee=op(0,0,.58,1),sp=op(.42,0,.58,1),Gee=e=>Array.isArray(e)&&typeof e[0]!=`number`,cp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lp=e=>t=>1-e(1-t),up=e=>1-Math.sin(Math.acos(e)),dp=lp(up),Kee=cp(up),fp=op(.33,1.53,.69,.99),pp=lp(fp),mp={linear:uf,easeIn:Uee,easeInOut:sp,easeOut:Wee,circIn:up,circInOut:Kee,circOut:dp,backIn:pp,backInOut:cp(pp),backOut:fp,anticipate:e=>(e*=2)<1?.5*pp(e):.5*(2-2**(-10*(e-1)))},hp=e=>{if(Array.isArray(e)){Xf(e.length===4,`Cubic bezier arrays must contain four numerical values.`);let[t,n,r,i]=e;return op(t,n,r,i)}else if(typeof e==`string`)return Xf(mp[e]!==void 0,`Invalid easing type '${e}'`),mp[e];return e},gp=(e,t)=>n=>!!(Md(n)&&jd.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),_p=(e,t,n)=>r=>{if(!Md(r))return r;let[i,a,o,s]=r.match(kd);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},qee=e=>wd(0,255,e),vp={...Td,transform:e=>Math.round(qee(e))},yp={test:gp(`rgb`,`red`),parse:_p(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+vp.transform(e)+`, `+vp.transform(t)+`, `+vp.transform(n)+`, `+Od(Ed.transform(r))+`)`};function Jee(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var bp={test:gp(`#`),parse:Jee,transform:yp.transform},xp={test:gp(`hsl`,`hue`),parse:_p(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Fd.transform(Od(t))+`, `+Fd.transform(Od(n))+`, `+Od(Ed.transform(r))+`)`},Sp={test:e=>yp.test(e)||bp.test(e)||xp.test(e),parse:e=>yp.test(e)?yp.parse(e):xp.test(e)?xp.parse(e):bp.parse(e),transform:e=>Md(e)?e:e.hasOwnProperty(`red`)?yp.transform(e):xp.transform(e)},Cp=(e,t,n)=>-n*e+n*t+e;function wp(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Yee({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=wp(s,r,e+1/3),a=wp(s,r,e),o=wp(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Tp=(e,t,n)=>{let r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Xee=[bp,yp,xp],Zee=e=>Xee.find(t=>t.test(e));function Ep(e){let t=Zee(e);Xf(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===xp&&(n=Yee(n)),n}var Dp=(e,t)=>{let n=Ep(e),r=Ep(t),i={...n};return e=>(i.red=Tp(n.red,r.red,e),i.green=Tp(n.green,r.green,e),i.blue=Tp(n.blue,r.blue,e),i.alpha=Cp(n.alpha,r.alpha,e),yp.transform(i))};function Qee(e){return isNaN(e)&&Md(e)&&(e.match(kd)?.length||0)+(e.match(Ad)?.length||0)>0}var Op={regex:Sd,countKey:`Vars`,token:"${v}",parse:uf},kp={regex:Ad,countKey:`Colors`,token:"${c}",parse:Sp.parse},Ap={regex:kd,countKey:`Numbers`,token:"${n}",parse:Td.parse};function jp(e,{regex:t,countKey:n,token:r,parse:i}){let a=e.tokenised.match(t);a&&(e[`num`+n]=a.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...a.map(i)))}function Mp(e){let t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes(`var(--`)&&jp(n,Op),jp(n,kp),jp(n,Ap),n}function Np(e){return Mp(e).values}function Pp(e){let{values:t,numColors:n,numVars:r,tokenised:i}=Mp(e),a=t.length;return e=>{let t=i;for(let i=0;i<a;i++)t=i<r?t.replace(Op.token,e[i]):i<r+n?t.replace(kp.token,Sp.transform(e[i])):t.replace(Ap.token,Od(e[i]));return t}}var $ee=e=>typeof e==`number`?0:e;function ete(e){let t=Np(e);return Pp(e)(t.map($ee))}var Fp={test:Qee,parse:Np,createTransformer:Pp,getAnimatableNone:ete},Ip=(e,t)=>n=>`${n>0?t:e}`;function Lp(e,t){return typeof e==`number`?n=>Cp(e,t,n):Sp.test(e)?Dp(e,t):e.startsWith(`var(`)?Ip(e,t):zp(e,t)}var Rp=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>Lp(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}},tte=(e,t)=>
19{let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Lp(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}},zp=(e,t)=>{let n=Fp.createTransformer(t),r=Mp(e),i=Mp(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Df(Rp(r.values,i.values),n):(Yf(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ip(e,t))},Bp=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Vp=(e,t)=>n=>Cp(e,t,n);function nte(e){return typeof e==`number`?Vp:typeof e==`string`?Sp.test(e)?Dp:zp:Array.isArray(e)?Rp:typeof e==`object`?tte:Vp}function rte(e,t,n){let r=[],i=n||nte(e[0]),a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Df(Array.isArray(t)?t[n]||uf:t,a)),r.push(a)}return r}function Hp(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(Xf(a===t.length,`Both input and output ranges must be the same length`),a===1)return()=>t[0];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=rte(t,r,i),s=o.length,c=t=>{let n=0;if(s>1)for(;n<e.length-2&&!(t<e[n+1]);n++);let r=Bp(e[n],e[n+1],t);return o[n](r)};return n?t=>c(wd(e[0],e[a-1],t)):c}function ite(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Bp(0,t,r);e.push(Cp(n,1,i))}}function ate(e){let t=[0];return ite(t,e.length-1),t}function ote(e,t){return e.map(e=>e*t)}function ste(e,t){return e.map(()=>t||sp).splice(0,e.length-1)}function Up({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Gee(r)?r.map(hp):hp(r),a={done:!1,value:t[0]},o=Hp(ote(n&&n.length===t.length?n:ate(t),e),t,{ease:Array.isArray(i)?i:ste(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Wp(e,t){return t?1e3/t*e:0}var cte=5;function Gp(e,t,n){let r=Math.max(t-cte,0);return Wp(n-e(r),t-r)}var Kp=.001,lte=.01,ute=.05;function dte({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a;Yf(e<=Zf(10),`Spring duration must be 10 seconds or less`);let o=1-t;o=wd(ute,1,o),e=wd(lte,10,Qf(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=qp(t,o),c=Math.exp(-i);return Kp-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=qp(t**2,o);return(-i(t)+Kp>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=pte(i,a,s);if(e=Zf(e),isNaN(c))return{stiffness:100,damping:10,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var fte=12;function pte(e,t,n){let r=n;for(let n=1;n<fte;n++)r-=e(r)/t(r);return r}function qp(e,t){return e*Math.sqrt(1-t*t)}var mte=[`duration`,`bounce`],hte=[`stiffness`,`damping`,`mass`];function Jp(e,t){return t.some(t=>e[t]!==void 0)}function gte(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Jp(e,hte)&&Jp(e,mte)){let n=dte(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Yp({keyframes:e,restDelta:t,restSpeed:n,...r}){let i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:c,mass:l,duration:u,velocity:d,isResolvedFromDuration:f}=gte({...r,velocity:-Qf(r.velocity||0)}),p=d||0,m=c/(2*Math.sqrt(s*l)),h=a-i,g=Qf(Math.sqrt(s/l)),_=Math.abs(h)<5;n||=_?.01:2,t||=_?.005:.5;let v;if(m<1){let e=qp(g,m);v=t=>{let n=Math.exp(-m*g*t);return a-n*((p+m*g*h)/e*Math.sin(e*t)+h*Math.cos(e*t))}}else if(m===1)v=e=>a-Math.exp(-g*e)*(h+(p+g*h)*e);else{let e=g*Math.sqrt(m*m-1);v=t=>{let n=Math.exp(-m*g*t),r=Math.min(e*t,300);return a-n*((p+m*g*h)*Math.sinh(r)+e*h*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{let r=v(e);if(f)o.done=e>=u;else{let i=p;e!==0&&(i=m<1?Gp(v,e,r):0);let s=Math.abs(i)<=n,c=Math.abs(a-r)<=t;o.done=s&&c}return o.value=o.done?a:r,o}}}function Xp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Yp({keyframes:[f.value,m(f.value)],velocity:Gp(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>x?S.next(e-x):(!t&&b(e),f)}}}var _te=e=>{let t=({timestamp:t})=>e(t);return{start:()=>mf.update(t,!0),stop:()=>hf(t),now:()=>gf.isProcessing?gf.timestamp:performance.now()}};function Zp(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var vte={decay:Xp,inertia:Xp,tween:Up,keyframes:Up,spring:Yp};function Qp({autoplay:e=!0,delay:t=0,driver:n=_te,keyframes:r,type:i=`keyframes`,repeat:a=0,repeatDelay:o=0,repeatType:s=`loop`,onPlay:c,onStop:l,onComplete:u,onUpdate:d,...f}){let p=1,m=!1,h,g,_=()=>{g=new Promise(e=>{h=e})};_();let v,y=vte[i]||Up,b;y!==Up&&typeof r[0]!=`number`&&(b=Hp([0,100],r,{clamp:!1}),r=[0,100]);let x=y({...f,keyframes:r}),S;s===`mirror`&&(S=y({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}
19));let C=`idle`,w=null,T=null,E=null;x.calculatedDuration===null&&a&&(x.calculatedDuration=Zp(x));let{calculatedDuration:D}=x,O=1/0,k=1/0;D!==null&&(O=D+o,k=O*(a+1)-o);let A=0,j=e=>{if(T===null)return;p>0&&(T=Math.min(T,e)),p<0&&(T=Math.min(e-k/p,T)),A=w===null?Math.round(e-T)*p:w;let n=A-t*(p>=0?1:-1),i=p>=0?n<0:n>k;A=Math.max(n,0),C===`finished`&&w===null&&(A=k);let c=A,l=x;if(a){let e=Math.min(A,k)/O,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,a+1),t%2&&(s===`reverse`?(n=1-n,o&&(n-=o/O)):s===`mirror`&&(l=S)),c=wd(0,1,n)*O}let u=i?{done:!1,value:r[0]}:l.next(c);b&&(u.value=b(u.value));let{done:f}=u;!i&&D!==null&&(f=p>=0?A>=k:A<=0);let m=w===null&&(C===`finished`||C===`running`&&f);return d&&d(u.value),m&&ee(),u},M=()=>{v&&v.stop(),v=void 0},N=()=>{C=`idle`,M(),h(),_(),T=E=null},ee=()=>{C=`finished`,u&&u(),M(),h()},te=()=>{if(m)return;v||=n(j);let e=v.now();c&&c(),w===null?(!T||C===`finished`)&&(T=e):T=e-w,C===`finished`&&_(),E=T,w=null,C=`running`,v.start()};e&&te();let ne={then(e,t){return g.then(e,t)},get time(){return Qf(A)},set time(e){e=Zf(e),A=e,w!==null||!v||p===0?w=e:T=v.now()-e/p},get duration(){return Qf(x.calculatedDuration===null?Zp(x):x.calculatedDuration)},get speed(){return p},set speed(e){e===p||!v||(p=e,ne.time=Qf(A))},get state(){return C},play:te,pause:()=>{C=`paused`,w=A},stop:()=>{m=!0,C!==`idle`&&(C=`idle`,l&&l(),N())},cancel:()=>{E!==null&&j(E),N()},complete:()=>{C=`finished`},sample:e=>(T=0,j(e))};return ne}function yte(e){let t;return()=>(t===void 0&&(t=e()),t)}var bte=yte(()=>Object.hasOwnProperty.call(Element.prototype,`animate`)),xte=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),$p=10,Ste=2e4,Cte=(e,t)=>t.type===`spring`||e===`backgroundColor`||!tp(t.ease);function wte(e,t,{onUpdate:n,onComplete:r,...i}){if(!(bte()&&xte.has(t)&&!i.repeatDelay&&i.repeatType!==`mirror`&&i.damping!==0&&i.type!==`inertia`))return!1;let a=!1,o,s,c=!1,l=()=>{s=new Promise(e=>{o=e})};l();let{keyframes:u,duration:d=300,ease:f,times:p}=i;if(Cte(t,i)){let e=Qp({...i,repeat:0,delay:0}),t={done:!1,value:u[0]},n=[],r=0;for(;!t.done&&r<Ste;)t=e.sample(r),n.push(t.value),r+=$p;p=void 0,u=n,d=r-$p,f=`linear`}let m=Ree(e.owner.current,t,u,{...i,duration:d,ease:f,times:p}),h=()=>{c=!1,m.cancel()},g=()=>{c=!0,mf.update(h),o(),l()};return m.onfinish=()=>{c||(e.set(zee(u,i)),r&&r(),g())},{then(e,t){return s.then(e,t)},attachTimeline(e){return m.timeline=e,m.onfinish=null,uf},get time(){return Qf(m.currentTime||0)},set time(e){m.currentTime=Zf(e)},get speed(){return m.playbackRate},set speed(e){m.playbackRate=e},get duration(){return Qf(d)},play:()=>{a||(m.play(),hf(h))},pause:()=>m.pause(),stop:()=>{if(a=!0,m.playState===`idle`)return;let{currentTime:t}=m;if(t){let n=Qp({...i,autoplay:!1});e.setWithVelocity(n.sample(t-$p).value,n.sample(t).value,$p)}g()},complete:()=>{c||m.finish()},cancel:g}}function Tte({keyframes:e,delay:t,onUpdate:n,onComplete:r}){let i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:uf,pause:uf,stop:uf,then:e=>(e(),Promise.resolve()),cancel:uf,complete:uf});return t?Qp({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}var Ete={type:`spring`,stiffness:500,damping:25,restSpeed:10},Dte=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ote={type:`keyframes`,duration:.8},kte={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ate=(e,{keyframes:t})=>t.length>2?Ote:md.has(e)?e.startsWith(`scale`)?Dte(t[1]):Ete:kte,em=(e,t)=>e!==`zIndex`&&!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&(Fp.test(t)||t===`0`)&&!t.startsWith(`url(`)),jte=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Mte(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(kd)||[];if(!r)return e;let i=n.replace(r,``),a=+!!jte.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Nte=/([a-z-]*)\(.*?\)/g,tm={...Fp,getAnimatableNone:e=>{let t=e.match(Nte);return t?t.map(Mte).join(` `):e}},nm={...zd,color:Sp,backgroundColor:Sp,outlineColor:Sp,fill:Sp,stroke:Sp,borderColor:Sp,borderTopColor:Sp,borderRightColor:Sp,borderBottomColor:Sp,borderLeftColor:Sp,filter:tm,WebkitFilter:tm},rm=e=>nm[e];function im(e,t){let n=rm(e);return n!==tm&&(n=Fp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var am=e=>/^0[^.\s]+$/.test(e);function Pte(e){if(typeof e==`number`)return e===0;if(e!==null)return e===`none`||e===`0`||am(e)}function Fte(e,t,n,r){let i=em(t,n),a;a=Array.isArray(n)?[...n]:[null,n];let o=r.from===void 0?e.get():r.from,s,c=[];for(let e=0;e<a.length;e++)a[e]===null&&(a[e]=e===0?o:a[e-1]),Pte(a[e])&&c.push(e),typeof a[e]==`string`&&a[e]!==`none`&&a[e]!==`0`&&(s=a[e]);if(i&&c.length&&s)for(let e=0;e<c.length;e++){let n=c[e];a[n]=im(t,s)}return a}function Ite({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:
19o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function om(e,t){return e[t]||e.default||e}var Lte={skipAnimations:!1},sm=(e,t,n,r={})=>i=>{let a=om(r,e)||{},o=a.delay||r.delay||0,{elapsed:s=0}=r;s-=Zf(o);let c=Fte(t,e,n,a),l=c[0],u=c[c.length-1],d=em(e,l),f=em(e,u);Yf(d===f,`You are trying to animate ${e} from "${l}" to "${u}". ${l} is not an animatable value - to enable this animation set ${l} to a value animatable to ${u} via the \`style\` property.`);let p={keyframes:c,velocity:t.getVelocity(),ease:`easeOut`,...a,delay:-s,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i(),a.onComplete&&a.onComplete()}};if(Ite(a)||(p={...p,...Ate(e,p)}),p.duration&&=Zf(p.duration),p.repeatDelay&&=Zf(p.repeatDelay),!d||!f||$f.current||a.type===!1||Lte.skipAnimations)return Tte($f.current?{...p,delay:0}:p);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){let n=wte(t,e,p);if(n)return n}return Qp(p)};function cm(e){return!!(gd(e)&&e.add)}var lm=e=>/^\-?\d*\.?\d+$/.test(e);function um(e,t){e.indexOf(t)===-1&&e.push(t)}function dm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var fm=class{constructor(){this.subscriptions=[]}add(e){return um(this.subscriptions,e),()=>dm(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},pm=e=>!isNaN(parseFloat(e)),mm={current:void 0},hm=class{constructor(e,t={}){this.version=`10.18.0`,this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;let{delta:n,timestamp:r}=gf;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,mf.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>mf.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=pm(this.current),this.owner=t.owner}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new fm);let n=this.events[e].add(t);return e===`change`?()=>{n(),mf.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return mm.current&&mm.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wp(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function gm(e,t){return new hm(e,t)}var _m=e=>t=>t.test(e),vm=[Td,Id,Fd,Pd,fee,dee,{test:e=>e===`auto`,parse:e=>e}],ym=e=>vm.find(_m(e)),bm=[...vm,Sp,Fp],Rte=e=>bm.find(_m(e));function zte(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gm(n))}function Bte(e,t){let n=Jf(e,t),{transitionEnd:r={},transition:i={},...a}=n?e.makeTargetAnimatable(n,!1):{};a={...a,...r};for(let t in a)zte(e,t,Oee(a[t]))}function Vte(e,t,n){let r=Object.keys(t).filter(t=>!e.hasValue(t)),i=r.length;if(i)for(let a=0;a<i;a++){let i=r[a],o=t[i],s=null;Array.isArray(o)&&(s=o[0]),s===null&&(s=n[i]??e.readValue(i)??t[i]),s!=null&&(typeof s==`string`&&(lm(s)||am(s))?s=p
vendor: 19,377 bytes, line 19
19arseFloat(s):!Rte(s)&&Fp.test(o)&&(s=im(i,o)),e.addValue(i,gm(s,{owner:e})),n[i]===void 0&&(n[i]=s),s!==null&&e.setBaseTarget(i,s))}}function Hte(e,t){if(t)return(t[e]||t.default||t).from}function Ute(e,t,n){let r={};for(let i in e){let e=Hte(i,t);if(e!==void 0)r[i]=e;else{let e=n.getValue(i);e&&(r[i]=e.get())}}return r}function Wte({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Gte(e,t){let n=e.get();if(Array.isArray(t)){for(let e=0;e<t.length;e++)if(t[e]!==n)return!0}else return n!==t}function xm(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=e.makeTargetAnimatable(t),c=e.getValue(`willChange`);r&&(a=r);let l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t),i=s[t];if(!r||i===void 0||u&&Wte(u,t))continue;let o={delay:n,elapsed:0,...om(a||{},t)};if(window.HandoffAppearAnimations){let n=e.getProps()[Zu];if(n){let e=window.HandoffAppearAnimations(n,t,r,mf);e!==null&&(o.elapsed=e,o.isHandoff=!0)}}let d=!o.isHandoff&&!Gte(r,i);if(o.type===`spring`&&(r.getVelocity()||o.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(sm(t,r,i,e.shouldReduceMotion&&md.has(t)?{type:!1}:o));let f=r.animation;cm(c)&&(c.add(t),f.then(()=>c.remove(t))),l.push(f)}return o&&Promise.all(l).then(()=>{o&&Bte(e,o)}),l}function Sm(e,t,n={}){let r=Jf(e,t,n.custom),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(xm(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Kte(e,t,a+r,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Kte(e,t,n=0,r=0,i=1,a){let o=[],s=(e.variantChildren.size-1)*r,c=i===1?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(qte).forEach((e,r)=>{e.notify(`AnimationStart`,t),o.push(Sm(e,t,{...a,delay:n+c(r)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(o)}function qte(e,t){return e.sortNodePosition(t)}function Jte(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Sm(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Sm(e,t,n);else{let i=typeof t==`function`?Jf(e,t,n.custom):t;r=Promise.all(xm(e,i,n))}return r.then(()=>e.notify(`AnimationComplete`,t))}var Yte=[...td].reverse(),Xte=td.length;function Zte(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Jte(e,t,n)))}function Qte(e){let t=Zte(e),n=ene(),r=!0,i=(t,n)=>{let r=Jf(e,n);if(r){let{transition:e,transitionEnd:n,...i}=r;t={...t,...i,...n}}return t};function a(n){t=n(e)}function o(a,o){let s=e.getProps(),c=e.getVariantContext(!0)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Xte;t++){let p=Yte[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=$u(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ed(h)||typeof h==`boolean`)continue;let y=$te(m.prevProp,h)||p===o&&m.isActive&&!v&&g||t>f&&g,b=!1,x=Array.isArray(h)?h:[h],S=x.reduce(i,{});_===!1&&(S={});let{prevResolvedValues:C={}}=m,w={...C,...S},T=e=>{y=!0,u.has(e)&&(b=!0,u.delete(e)),m.needsAnimating[e]=!0};for(let e in w){let t=S[e],n=C[e];if(d.hasOwnProperty(e))continue;let r=!1;r=sf(t)&&sf(n)?!qf(t,n):t!==n,r?t===void 0?u.add(e):T(e):t!==void 0&&u.has(e)?T(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&e.blockInitialAnimation&&(y=!1),y&&(!v||b)&&l.push(...x.map(e=>({animation:e,options:{type:p,...a}})))}if(u.size){let t={};u.forEach(n=>{let r=e.getBaseTarget(n);r!==void 0&&(t[n]=r)}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(l):Promise.resolve()}function s(t,r,i){var a;if(n[t].isActive===r)return Promise.resolve();(a=e.variantChildren)==null||a.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let s=o(i,t);for(let e in n)n[e].protectedKeys={};return s}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n}}function $te(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!qf(t,e):!1}function Cm(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ene(){return{animate:Cm(!0),whileInView:Cm(),whileHover:Cm(),whileTap:Cm(),whileDrag:Cm(),whileFocus:Cm(),exit:Cm()}}var tne=class extends Nf{constructor(e){super(e),e.animationState||=Qte(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();this.unmount(),ed(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}},nne=0,rne={animation:{Feature:tne},exit:{Feature:class extends Nf{constructor(){super(...arguments),this.id=nne++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let i=this.node.animationState.setActive(`exit`,!e,{custom:n??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},wm=(e,t)=>Math.abs(e-t);function ine(e,t){let n=wm(e.x,t.x),r=wm(e.y,t.y);return Math.sqrt(n**2+r**2)}var Tm=class{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Om(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=ine(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=gf;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Em(t,this.transformPagePoint),mf.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Om(e.type===`pointercancel`?this.lastMoveEventInfo:Em(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Sf(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;let a=Em(Cf(e),this.transformPagePoint),{point:o}=a,{timestamp:s}=gf;this.history=[{...o,timestamp:s}];let{onSessionStart:c}=t;c&&c(e,Om(a,this.history)),this.removeListeners=Df(Tf(this.contextWindow,`pointermove`,this.handlePointerMove),Tf(this.contextWindow,`pointerup`,this.handlePointerUp),Tf(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),hf(this.updatePoint)}};function Em(e,t){return t?{point:t(e.point)}:e}function Dm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Om({point:e},t){return{point:e,delta:Dm(e,km(t)),offset:Dm(e,ane(t)),velocity:Am(t,.1)}}function ane(e){return e[0]}function km(e){return e[e.length-1]}function Am(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=km(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Zf(t)));)n--;if(!r)return{x:0,y:0};let a=Qf(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function jm(e){return e.max-e.min}function Mm(e,t=0,n=.01){return Math.abs(e-t)<=n}function Nm(e,t,n,r=.5){e.origin=r,e.originPoint=Cp(t.min,t.max,e.origin),e.scale=jm(n)/jm(t),(Mm(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Cp(n.min,n.max,e.origin)-e.originPoint,(Mm(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Pm(e,t,n,r){Nm(e.x,t.x,n.x,r?r.originX:void 0),Nm(e.y,t.y,n.y,r?r.originY:void 0)}function Fm(e,t,n){e.min=n.min+t.min,e.max=e.min+jm(t)}function Im(e,t,n){Fm(e.x,t.x,n.x),Fm(e.y,t.y,n.y)}function Lm(e,t,n){e.min=t.min-n.min,e.max=e.min+jm(t)}function Rm(e,t,n){Lm(e.x,t.x,n.x),Lm(e.y,t.y,n.y)}function zm(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Cp(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Cp(n,e,r.max):Math.min(e,n)),e}function Bm(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Vm(e,{top:t,left:n,bottom:r,right:i}){return{x:Bm(e.x,n,i),y:Bm(e.y,t,r)}}function Hm(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Um(e,t){return{x:Hm(e.x,t.x),y:Hm(e.y,t.y)}}function Wm(e,t){let n=.5,r=jm(e),i=jm(t);return i>r?n=Bp(t.min,t.max-r,e.min):r>i&&(n=Bp(e.min,e.max-i,t.min)),wd(0,1,n)}function Gm(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Km=.35;function qm(e=Km){return e===!1?e=0:e===!0&&(e=Km),{x:Jm(e,`left`,`right`),y:Jm(e,`top`,`bottom`)}}function Jm(e,t,n){return{min:Ym(e,t),max:Ym(e,n)}}function Ym(e,t){return typeof e==`number`?e:e[t]||0}var Xm=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zm=()=>({x:Xm(),y:Xm()}),Qm=()=>({min:0,max:0}),$m=()=>({x:Qm(),y:Qm()});function eh(e){return[e(`x`),e(`y`)]}function th({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ih(e){return e===void 0||e===1}function ah({scale:e,scaleX:t,scaleY:n}){return!ih(e)||!ih(t)||!ih(n)}function oh(e){return ah(e)||sh(e)||e.z||e.rotate||e.rotateX||e.rotateY}function sh(e){return ch(e.x)||ch(e.y)}function ch(e){return e&&e!==`0%`}function lh(e,t,n){return n+t*(e-n)}function uh(e,t,n,r,i){return i!==void 0&&(e=lh(e,i,r)),lh(e,n,r)+t}function dh(e,t=0,n=1,r,i){e.min=uh(e.min,t,n,r,i),e.max=uh(e.max,t,n,r,i)}function fh(e,{x:t,y:n}){dh(e.x,t.translate,t.scale,t.originPoint),dh(e.y,n.translate,n.scale,n.originPoint)}function one(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let i=a.instance;i&&i.style&&i.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&gh(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,fh(e,o)),r&&oh(a.latestValues)&&gh(e,a.latestValues))}t.x=ph(t.x),t.y=ph(t.y)}function ph(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function mh(e,t){e.min+=t,e.max+=t}function hh(e,t,[n,r,i]){let a=t[i]===void 0?.5:t[i],o=Cp(e.min,e.max,a);dh(e,t[n],t[r],o,t.scale)}var sne=[`x`,`scaleX`,`originX`],cne=[`y`,`scaleY`,`originY`];function gh(e,t){hh(e.x,t,sne),hh(e.y,t,cne)}function _h(e,t){return th(rh(e.getBoundingClientRect(),t))}function lne(e,t,n){let r=_h(e,n),{scroll:i}=t;return i&&(mh(r.x,i.offset.x),mh(r.y,i.offset.y)),r}var vh=({current:e})=>e?e.ownerDocument.defaultView:null,une=new WeakMap,dne=class{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$m(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let r=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Cf(e,`page`).point)},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=jf(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eh(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Fd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=jm(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&mf.update(()=>i(e,t),!1,!0);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},a=(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openGlobalLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=fne(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},o=(e,t)=>this.stop(e,t),s=()=>eh(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Tm(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:vh(this.visualElement)})}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();i&&mf.update(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!yh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=zm(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Qu(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Vm(n.layoutBox,e):this.constraints=!1,this.elastic=qm(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&eh(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=Gm(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Qu(e))return!1;let n=e.current;Xf(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=lne(n,r.root,this.visualElement.getTransformPagePoint()),a=Um(r.layout.layoutBox,i);if(t){let e=t(nh(a));this.hasMutatedConstraints=!!e,e&&(a=th(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=eh(o=>{if(!yh(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return n.start(sm(e,n,0,t))}stopAnimation(){eh(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){eh(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag`+e.toUpperCase(),n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){eh(t=>{let{drag:n}=this.getProps();if(!yh(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-Cp(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Qu(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};eh(e=>{let t=this.getAxisMotionValue(e);if(t){let n=t.get();r[e]=Wm({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),eh(t=>{if(!yh(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Cp(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;une.set(this.visualElement,this);let e=this.visualElement.current,t=Tf(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Qu(e)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),n();let a=xf(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(eh(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Km,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function yh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function fne(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var pne=class extends Nf{constructor(e){super(e),this.removeGroupControls=uf,this.removeListeners=uf,this.controls=new dne(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||uf}unmount(){this.removeGroupControls(),this.removeListeners()}},bh=e=>(t,n)=>{e&&mf.update(()=>e(t,n))},mne=class extends Nf{constructor(){super(...arguments),this.removePointerDownListener=uf}onPointerDown(e){this.session=new Tm(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vh(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:bh(e),onStart:bh(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&mf.update(()=>r(e,t))}}}mount(){this.removePointerDownListener=Tf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};function hne(){let e=(0,y.useContext)(Ku);if(e===null)return[!0,null];let{isPresent:t,onExitComplete:n,register:r}=e,i=(0,y.useId)();return(0,y.useEffect)(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}var xh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Sh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ch={correct:(e,t)=>
19{if(!t.target)return e;if(typeof e==`string`)if(Id.test(e))e=parseFloat(e);else return e;return`${Sh(e,t.target.x)}% ${Sh(e,t.target.y)}%`}},gne={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Fp.parse(e);if(i.length>5)return r;let a=Fp.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Cp(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},_ne=class extends y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;lee(vne),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),xh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,a=n.projection;return a?(a.isPresent=i,r||e.layoutDependency!==t||t===void 0?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||mf.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function wh(e){let[t,n]=hne(),r=(0,y.useContext)(cd);return y.createElement(_ne,{...e,layoutGroup:r,switchLayoutGroup:(0,y.useContext)(ld),isPresent:t,safeToRemove:n})}var vne={borderRadius:{...Ch,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ch,borderTopRightRadius:Ch,borderBottomLeftRadius:Ch,borderBottomRightRadius:Ch,boxShadow:gne},Th=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yne=Th.length,Eh=e=>typeof e==`string`?parseFloat(e):e,Dh=e=>typeof e==`number`||Id.test(e);function bne(e,t,n,r,i,a){i?(e.opacity=Cp(0,n.opacity===void 0?1:n.opacity,xne(r)),e.opacityExit=Cp(t.opacity===void 0?1:t.opacity,0,Sne(r))):a&&(e.opacity=Cp(t.opacity===void 0?1:t.opacity,n.opacity===void 0?1:n.opacity,r));for(let i=0;i<yne;i++){let a=`border${Th[i]}Radius`,o=Oh(t,a),s=Oh(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||Dh(o)===Dh(s)?(e[a]=Math.max(Cp(Eh(o),Eh(s),r),0),(Fd.test(s)||Fd.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Cp(t.rotate||0,n.rotate||0,r))}function Oh(e,t){return e[t]===void 0?e.borderRadius:e[t]}var xne=kh(0,.5,dp),Sne=kh(.5,.95,uf);function kh(e,t,n){return r=>r<e?0:r>t?1:n(Bp(e,t,r))}function Ah(e,t){e.min=t.min,e.max=t.max}function jh(e,t){Ah(e.x,t.x),Ah(e.y,t.y)}function Mh(e,t,n,r,i){return e-=t,e=lh(e,1/n,r),i!==void 0&&(e=lh(e,1/i,r)),e}function Cne(e,t=0,n=1,r=.5,i,a=e,o=e){if(Fd.test(t)&&(t=parseFloat(t),t=Cp(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Cp(a.min,a.max,r);e===a&&(s-=t),e.min=Mh(e.min,t,n,s,i),e.max=Mh(e.max,t,n,s,i)}function Nh(e,t,[n,r,i],a,o){Cne(e,t[n],t[r],t[i],t.scale,a,o)}var wne=[`x`,`scaleX`,`originX`],Tne=[`y`,`scaleY`,`originY`];function Ph(e,t,n,r){Nh(e.x,t,wne,n?n.x:void 0,r?r.x:void 0),Nh(e.y,t,Tne,n?n.y:void 0,r?r.y:void 0)}function Fh(e){return e.translate===0&&e.scale===1}function Ih(e){return Fh(e.x)&&Fh(e.y)}function Ene(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function Lh(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Rh(e){return jm(e.x)/jm(e.y)}var zh=class{constructor(){this.members=[]}add(e){um(this.members,e),e.scheduleRender()}remove(e){if(dm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}
vendor: 16,091 bytes, line 19
19exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Bh(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y;if((i||a)&&(r=`translate3d(${i}px, ${a}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{rotate:e,rotateX:t,rotateY:i}=n;e&&(r+=`rotate(${e}deg) `),t&&(r+=`rotateX(${t}deg) `),i&&(r+=`rotateY(${i}deg) `)}let o=e.x.scale*t.x,s=e.y.scale*t.y;return(o!==1||s!==1)&&(r+=`scale(${o}, ${s})`),r||`none`}var Vh=(e,t)=>e.depth-t.depth,Hh=class{constructor(){this.children=[],this.isDirty=!1}add(e){um(this.children,e),this.isDirty=!0}remove(e){dm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vh),this.isDirty=!1,this.children.forEach(e)}};function Uh(e,t){let n=performance.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(hf(r),e(a-t))};return mf.read(r,!0),()=>hf(r)}function Wh(e){window.MotionDebug&&window.MotionDebug.record(e)}function Gh(e){return e instanceof SVGElement&&e.tagName!==`svg`}function Kh(e,t,n){let r=gd(e)?e:gm(e);return r.start(sm(``,r,t,n)),r.animation}var qh=[``,`X`,`Y`,`Z`],Jh={visibility:`hidden`},Yh=1e3,Xh=0,Zh={type:`projectionFrame`,totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Qh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Xh++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Zh.totalNodes=Zh.resolvedTargetDeltas=Zh.recalculatedProjection=0,this.nodes.forEach(tg),this.nodes.forEach(cg),this.nodes.forEach(lg),this.nodes.forEach(ng),Wh(Zh)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hh)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new fm),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Gh(t),this.instance=t;let{layoutId:r,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Uh(r,250),xh.hasAnimatedSinceResize&&(xh.hasAnimatedSinceResize=!1,this.nodes.forEach(sg))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&a&&(r||i)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||a.getDefaultTransition()||gg,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),c=!this.targetLayout||!Lh(this.targetLayout,r)||n,l=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,l);let t={...om(i,`layout`),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||sg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hf(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ug),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ig);return}this.isUpdating||this.nodes.forEach(ag),this.isUpdating=!1,this.nodes.forEach(og),this.nodes.forEach($h),this.nodes.forEach(eg),this.clearAllSnapshots();let e=performance.now();gf.delta=wd(0,1e3/60,e-gf.timestamp),gf.timestamp=e,gf.isProcessing=!0,_f.update.process(gf),_f.preRender.process(gf),_f.render.process(gf),gf.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(rg),this.sharedNodes.forEach(dg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,mf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){mf.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$m(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!Ih(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&(t||oh(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),bg(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return $m();let t=e.measureViewportBox(),{scroll:n}=this.root;return n&&(mh(t.x,n.offset.x),mh(t.y,n.offset.y)),t}removeElementScroll(e){let t=$m();jh(t,e);for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;if(r!==this.root&&i&&a.layoutScroll){if(i.isRoot){jh(t,e);let{scroll:n}=this.root;n&&(mh(t.x,-n.offset.x),mh(t.y,-n.offset.y))}mh(t.x,i.offset.x),mh(t.y,i.offset.y)}}return t}applyTransform(e,t=!1){let n=$m();jh(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&gh(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),oh(r.latestValues)&&gh(n,r.latestValues)}return oh(this.latestValues)&&gh(n,this.latestValues),n}removeTransform(e){let t=$m();jh(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!oh(n.latestValues))continue;ah(n.latestValues)&&n.updateSnapshot();let r=$m();jh(r,n.measurePageBox()),Ph(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return oh(this.latestValues)&&Ph(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==gf.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget))return;let{layout:r,layoutId:i}=this.options;if(!(!this.layout||!(r||i))){if(this.resolvedRelativeTargetAt=gf.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$m(),this.relativeTargetOrigin=$m(),Rm(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),jh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=$m(),this.targetWithTransforms=$m()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Im(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jh(this.target,this.layout.layoutBox),fh(this.target,this.targetDelta)):jh(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$m(),this.relativeTargetOrigin=$m(),Rm(this.relativeTargetOrigin,this.target,e.target),jh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Zh.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ah(this.parent.latestValues)||sh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===gf.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;jh(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;one(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox);let{target:s}=e;if(!s){this.projectionTransform&&(this.projectionDelta=Zm(),this.projectionTransform=`none`,this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Zm(),this.projectionDeltaWithTransform=Zm());let c=this.projectionTransform;Pm(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.projectionTransform=Bh(this.projectionDelta,this.treeScale),(this.projectionTransform!==c||this.treeScale.x!==a||this.treeScale.y!==o)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Zh.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Zm();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=$m(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(hg));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;fg(a.x,e.x,n),fg(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rm(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mg(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Ene(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=$m(),jh(d,this.relativeTarget)),s&&(this.animationValues=i,bne(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&=(hf(this.pendingAnimation),void 0),this.pendingAnimation=mf.update(()=>{xh.hasAnimatedSinceResize=!0,this.currentAnimation=Kh(0,Yh,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Yh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&xg(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||$m();let t=jm(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=jm(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}jh(t,n),gh(t,i),Pm(this.projectionDeltaWithTransform,this.layoutCorrected,t,i
19)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new zh),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),!t)return;let r={};for(let t=0;t<qh.length;t++){let i=`rotate`+qh[t];n[i]&&(r[i]=n[i],e.setStaticValue(i,0))}e.render();for(let t in r)e.setStaticValue(t,r[t]);e.scheduleRender()}getProjectionStyles(e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Jh;let t={visibility:``},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.opacity=``,t.pointerEvents=cf(e?.pointerEvents)||``,t.transform=n?n(this.latestValues,``):`none`,t;let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){let t={};return this.options.layoutId&&(t.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,t.pointerEvents=cf(e?.pointerEvents)||``),this.hasProjected&&!oh(this.latestValues)&&(t.transform=n?n({},``):`none`,this.hasProjected=!1),t}let i=r.animationValues||r.latestValues;this.applyTransformsToTarget(),t.transform=Bh(this.projectionDeltaWithTransform,this.treeScale,i),n&&(t.transform=n(i,t.transform));let{x:a,y:o}=this.projectionDelta;t.transformOrigin=`${a.origin*100}% ${o.origin*100}% 0`,r.animationValues?t.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:t.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let e in fd){if(i[e]===void 0)continue;let{correct:n,applyTo:a}=fd[e],o=t.transform===`none`?i[e]:n(i[e],r);if(a){let e=a.length;for(let n=0;n<e;n++)t[a[n]]=o}else t[e]=o}return this.options.layoutId&&(t.pointerEvents=r===this?cf(e?.pointerEvents)||``:`none`),t}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ig),this.root.sharedNodes.clear()}}}function $h(e){e.updateLayout()}function eg(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?eh(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=jm(r);r.min=n[e].min,r.max=r.min+i}):xg(i,t.layoutBox,n)&&eh(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=jm(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Zm();Pm(o,n,t.layoutBox);let s=Zm();a?Pm(s,e.applyTransform(r,!0),t.measuredBox):Pm(s,n,t.layoutBox);let c=!Ih(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=$m();Rm(o,t.layoutBox,i.layoutBox);let s=$m();Rm(s,n,a.layoutBox),Lh(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function tg(e){Zh.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ng(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rg(e){e.clearSnapshot()}function ig(e){e.clearMeasurements()}function ag(e){e.isLayoutDirty=!1}function og(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function sg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cg(e){e.resolveTargetDelta()}function lg(e){e.calcProjection()}function ug(e){e.resetRotation()}function dg(e){e.removeLeadSnapshot()}
19function fg(e,t,n){e.translate=Cp(t.translate,0,n),e.scale=Cp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pg(e,t,n,r){e.min=Cp(t.min,n.min,r),e.max=Cp(t.max,n.max,r)}function mg(e,t,n,r){pg(e.x,t.x,n.x,r),pg(e.y,t.y,n.y,r)}function hg(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var gg={duration:.45,ease:[.4,0,.1,1]},_g=e=>typeof navigator<`u`&&navigator.userAgent.toLowerCase().includes(e),vg=_g(`applewebkit/`)&&!_g(`chrome/`)?Math.round:uf;function yg(e){e.min=vg(e.min),e.max=vg(e.max)}function bg(e){yg(e.x),yg(e.y)}function xg(e,t,n){return e===`position`||e===`preserve-aspect`&&!Mm(Rh(t),Rh(n),.2)}var Sg=Qh({attachResizeListener:(e,t)=>xf(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cg={current:void 0},wg=Qh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cg.current){let e=new Sg({});e.mount(window),e.setOptions({layoutScroll:!0}),Cg.current=e}return Cg.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Tg={pan:{Feature:mne},drag:{Feature:pne,ProjectionNode:wg,MeasureLayout:wh}},Eg=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dg(e){let t=Eg.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]}var Og=4;function kg(e,t,n=1){Xf(n<=Og,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,i]=Dg(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return lm(e)?parseFloat(e):e}else if(xd(i))return kg(i,t,n+1);else return i}function Ag(e,{...t},n){let r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&={...n},e.values.forEach(e=>{let t=e.get();if(!xd(t))return;let n=kg(t,r);n&&e.set(n)});for(let e in t){let i=t[e];if(!xd(i))continue;let a=kg(i,r);a&&(t[e]=a,n||={},n[e]===void 0&&(n[e]=i))}return{target:t,transitionEnd:n}}var jg=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,`x`,`y`,`translateX`,`translateY`]),Mg=e=>jg.has(e),Ng=e=>Object.keys(e).some(Mg),Pg=e=>e===Td||e===Id,Fg=(e,t)=>
vendor: 4,588 bytes, line 19
19parseFloat(e.split(`, `)[t]),Ig=(e,t)=>(n,{transform:r})=>{if(r===`none`||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/);if(i)return Fg(i[1],t);{let t=r.match(/^matrix\((.+)\)$/);return t?Fg(t[1],e):0}},Lg=new Set([`x`,`y`,`z`]),Rg=pd.filter(e=>!Lg.has(e));function zg(e){let t=[];return Rg.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t.length&&e.render(),t}var Bg={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ig(4,13),y:Ig(5,14)};Bg.translateX=Bg.x,Bg.translateY=Bg.y;var Vg=(e,t,n)=>{let r=t.measureViewportBox(),i=t.current,a=getComputedStyle(i),{display:o}=a,s={};o===`none`&&t.setStaticValue(`display`,e.display||`block`),n.forEach(e=>{s[e]=Bg[e](r,a)}),t.render();let c=t.measureViewportBox();return n.forEach(n=>{let r=t.getValue(n);r&&r.jump(s[n]),e[n]=Bg[n](c,a)}),e},Hg=(e,t,n={},r={})=>{t={...t},r={...r};let i=Object.keys(t).filter(Mg),a=[],o=!1,s=[];if(i.forEach(i=>{let c=e.getValue(i);if(!e.hasValue(i))return;let l=n[i],u=ym(l),d=t[i],f;if(sf(d)){let e=d.length,t=+(d[0]===null);l=d[t],u=ym(l);for(let n=t;n<e&&d[n]!==null;n++)f?Xf(ym(d[n])===f,`All keyframes must be of the same type`):(f=ym(d[n]),Xf(f===u||Pg(u)&&Pg(f),`Keyframes must be of the same dimension as the current value`))}else f=ym(d);if(u!==f)if(Pg(u)&&Pg(f)){let e=c.get();typeof e==`string`&&c.set(parseFloat(e)),typeof d==`string`?t[i]=parseFloat(d):Array.isArray(d)&&f===Id&&(t[i]=d.map(parseFloat))}else u?.transform&&f?.transform&&(l===0||d===0)?l===0?c.set(f.transform(l)):t[i]=u.transform(d):(o||=(a=zg(e),!0),s.push(i),r[i]=r[i]===void 0?t[i]:r[i],c.jump(d))}),s.length){let n=s.indexOf(`height`)>=0?window.pageYOffset:null,i=Vg(t,e,s);return a.length&&a.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),qu&&n!==null&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Ug(e,t,n,r){return Ng(t)?Hg(e,t,n,r):{target:t,transitionEnd:r}}var Wg=(e,t,n,r)=>{let i=Ag(e,t,r);return t=i.target,r=i.transitionEnd,Ug(e,t,n,r)},Gg={current:null},Kg={current:!1};function qg(){if(Kg.current=!0,qu)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Gg.current=e.matches;e.addListener(t),t()}else Gg.current=!1}function Jg(e,t,n){let{willChange:r}=t;for(let i in t){let a=t[i],o=n[i];if(gd(a))e.addValue(i,a),cm(r)&&r.add(i);else if(gd(o))e.addValue(i,gm(a,{owner:e})),cm(r)&&r.remove(i);else if(o!==a)if(e.hasValue(i)){let t=e.getValue(i);!t.hasAnimated&&t.set(a)}else{let t=e.getStaticValue(i);e.addValue(i,gm(t===void 0?a:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Yg=new WeakMap,Xg=Object.keys(sd),Zg=Xg.length,Qg=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],$g=nd.length,e_=class{constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>mf.render(this.render,!1,!0);let{latestValues:o,renderState:s}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.isControllingVariants=rd(t),this.isVariantNode=id(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...l}=this.scrapeMotionValuesFromProps(t,{});for(let e in l){let t=l[e];o[e]!==void 0&&gd(t)&&(t.set(o[e],!1),cm(c)&&c.add(e))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Yg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
vendor: 8,423 bytes, lines 19-27
19h((e,t)=>this.bindToMotionValue(t,e)),Kg.current||qg(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`||Gg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Yg.delete(this.current),this.projection&&this.projection.unmount(),hf(this.notifyUpdate),hf(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){let n=md.has(e),r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&mf.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on(`renderRequest`,this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},n,r,i){let a,o;for(let e=0;e<Zg;e++){let n=Xg[e],{isEnabled:r,Feature:i,ProjectionNode:s,MeasureLayout:c}=sd[n];s&&(a=s),r(t)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),c&&(o=c))}if((this.type===`html`||this.type===`svg`)&&!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);let{layoutId:e,layout:n,drag:r,dragConstraints:o,layoutScroll:s,layoutRoot:c}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:!!r||o&&Qu(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof n==`string`?n:`both`,initialPromotionConfig:i,layoutScroll:s,layoutRoot:c})}return o}updateFeatures(){for(let e in this.features){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$m()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Qg.length;t++){let n=Qg[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Jg(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){let e=this.parent&&this.parent.getVariantContext()||{};return this.props.initial!==void 0&&(e.initial=this.props.initial),e}let t={};for(let e=0;e<$g;e++){let n=nd[e],r=this.props[n];($u(r)||r===!1)&&(t[n]=r)}return t}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=gm(t,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n=typeof t==`string`||typeof t==`object`?af(this.props,t)?.[e]:void 0;if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!gd(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new fm),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}},t_=class extends e_{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},i){let a=Ute(n,e||{},this);if(r&&(t&&=r(t),n&&=r(n),a&&=r(a)),i){Vte(this,n,a);let e=Wg(this,n,a,t);t=e.transitionEnd,n=e.target}return{transition:e,transitionEnd:t,...n}}};function n_(e){return window.getComputedStyle(e)}var Dne=class extends t_{constructor(){super(...arguments),this.type=`html`}readValueFromInstance(e,t){if(md.has(t)){let e=rm(t);return e&&e.default||0}else{let n=n_(e),r=(bd(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return _h(e,t)}build(e,t,n,r){Bd(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return nf(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;gd(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,n,r){$d(e,t,n,r)}},One=class extends t_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(md.has(t)){let e=rm(t);return e&&e.default||0}return t=ef.has(t)?t:Xu(t),e.getAttribute(t)}measureInstanceViewportBox(){return $m()}scrapeMotionValuesFromProps(e,t){return rf(e,t)}build(e,t,n,r){Xd(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){tf(e,t,n,r)}mount(e){this.isSVGTag=Qd(e.tagName),super.mount(e)}},kne=(e,t)=>dd(e)?new One(t,{enableHardwareAcceleration:!1}):new Dne(t,{enableHardwareAcceleration:!0}),Ane={layout:{ProjectionNode:wg,MeasureLayout:wh}},jne={...rne,...Fee,...Tg,...Ane},r_=cee((e,t)=>bf(e,t,jne,kne));function i_(){let e=(0,y.useRef)(!1);return Ju(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Mne(){let e=i_(),[t,n]=(0,y.useState)(0),r=(0,y.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,y.useCallback)(()=>mf.postRender(r),[r]),t]}var Nne=class extends y.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function Pne({children:e,isPresent:t}){let n=(0,y.useId)(),r=(0,y.useRef)(null),i=(0,y.useRef)({width:0,height:0,top:0,left:0});return(0,y.useInsertionEffect)(()=>{let{width:e,height:a,top:o,left:s}=i.current;if(t||!r.current||!e||!a)return;r.current.dataset.motionPopId=n;let c=document.createElement(`style`);return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` 20 [data-motion-pop-id="${n}"] { 21 position: absolute !important; 22 width: ${e}px !important; 23 height: ${a}px !important; 24 top: ${o}px !important; 25 left: ${s}px !important; 26 } 27 `),()=>{document.head.removeChild(c)}},[t]),y.createElement(Nne,{isPresent:t,childRef:r,sizeRef:i},y.cloneElement(e,{ref:r}))}var a_=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o})=>{let s=of(Fne),c=(0,y.useId)(),l=(0,y.useMemo)(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{s.set(e,!0);for(let e of s.values())if(!e)return;r&&r()},register:e=>(s.set(e,!1),()=>s.delete(e))}),a?void 0:[n]);return(0,y.useMemo)(()=>
27{s.forEach((e,t)=>s.set(t,!1))},[n]),y.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),o===`popLayout`&&(e=y.createElement(Pne,{isPresent:n},e)),y.createElement(Ku.Provider,{value:l},e)};function Fne(){return new Map}function Ine(e){return(0,y.useEffect)(()=>()=>e(),[])}var o_=e=>e.key||``;function Lne(e,t){e.forEach(e=>{let n=o_(e);t.set(n,e)})}function Rne(e){let t=[];return y.Children.forEach(e,e=>{(0,y.isValidElement)(e)&&t.push(e)}),t}var zne=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:o=`sync`})=>{Xf(!i,`Replace exitBeforeEnter with mode='wait'`);let s=(0,y.useContext)(cd).forceRender||Mne()[0],c=i_(),l=Rne(e),u=l,d=(0,y.useRef)(new Map).current,f=(0,y.useRef)(u),p=(0,y.useRef)(new Map).current,m=(0,y.useRef)(!0);if(Ju(()=>{m.current=!1,Lne(l,p),f.current=u}),Ine(()=>{m.current=!0,p.clear(),d.clear()}),m.current)return y.createElement(y.Fragment,null,u.map(e=>y.createElement(a_,{key:o_(e),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:a,mode:o},e)));u=[...u];let h=f.current.map(o_),g=l.map(o_),_=h.length;for(let e=0;e<_;e++){let t=h[e];g.indexOf(t)===-1&&!d.has(t)&&d.set(t,void 0)}return o===`wait`&&d.size&&(u=[]),d.forEach((e,n)=>{if(g.indexOf(n)!==-1)return;let i=p.get(n);if(!i)return;let m=h.indexOf(n),_=e;_||(_=y.createElement(a_,{key:o_(i),isPresent:!1,onExitComplete:()=>{d.delete(n);let e=Array.from(p.keys()).filter(e=>!g.includes(e));if(e.forEach(e=>p.delete(e)),f.current=l.filter(t=>{let r=o_(t);return r===n||e.includes(r)}),!d.size){if(c.current===!1)return;s(),r&&r()}},custom:t,presenceAffectsLayout:a,mode:o},i),d.set(n,_)),u.splice(m,0,_)}),u=u.map(e=>{let t=e.key;return d.has(t)?e:y.createElement(a_,{key:o_(e),isPresent:!0,presenceAffectsLayout:a,mode:o},e)}),y.createElement(y.Fragment,null,d.size?u:u.map(e=>(0,y.cloneElement)(e)))};function Bne(){let[e,t]=(0,y.useState)(!1);return{checkUserRegistration:(0,y.useCallback)(async e=>{try{t(!0);let{data:n,error:r}=await R.functions.invoke(`check-user-registration`,{body:{userId:e}});return r?(console.error(`Error checking user registration:`,r),{success:!1,error:r}):{success:!0,data:n}}catch(e){return console.error(`Exception checking user registration:`,e),{success:!1,error:e}}finally{t(!1)}},[]),checkEmailRegistered:(0,y.useCallback)(async e=>{try{t(!0);let{data:n,error:r}=await R.rpc(`check_user_email_exists`,{user_email:e.trim().toLowerCase()});return r?(console.error(`Error checking email:`,r),{success:!1,error:r}):{success:!0,exists:(Array.isArray(n)&&n.length>0?n[0]:null)?.email_exists===!0}}catch(e){return console.error(`Exception checking email:`,e),{success:!1,error:e}}finally{t(!1)}},[]),createAssessmentLink:(0,y.useCallback)(async(e,n=30)=>{try{t(!0);let r=Math.random().toString(36).substring(2,10),i=new Date;i.setDate(i.getDate()+n);let{data:a,error:o}=await R.from(`assessment_links`).insert({job_id:e,link_code:r,expires_at:i.toISOString(),clicks:0,submissions:0}).select().single();return o?(console.error(`Error creating assessment link:`,o),{success:!1,error:o}):{success:!0,data:{...a,fullLink:`${window.location.origin}/assessment/${r}`}}}catch(e){return console.error(`Exception creating assessment link:`,e),{success:!1,error:e}}finally{t(!1)}},[]),saveAssessment:(0,y.useCallback)(async(e,n,r)=>{try{t(!0);let{data:i,error:a}=await R.from(`assessments`).insert({job_id:e,content:n,type:r}).select().single();return a?(console.error(`Error saving assessment:`,a),{success:!1,error:a}):{success:!0,data:i}}catch(e){return console.error(`Exception saving assessment:`,e),{success:!1,error:e}}finally{t(!1)}},[]),isLoading:e}}var s_=`example.com,example.org,example.net,test.com,test.org,localhost,fake.com,dummy.com,tempmail.com,guerrillamail.com,10minutemail.com,mailinator.com,trashmail.com,throwaway.email,getnada.com,temp-mail.org,maildrop.cc,fakeinbox.com,yopmail.com,emailondeck.com,sharklasers.com,grr.la,guerrillamail.info,guerrillamail.biz,guerrillamail.de,spam4.me,mytemp.email,tempinbox.com,mohmal.com,dispostable.com`.split(`,`),c_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Vne(e){if(!e||typeof e!=`string`)return!1;let t=e.trim().toLowerCase();if(!c_.test(t))return!1;let n=t.split(`@`)[1];return!(!n||s_.includes(n))}function Hne(e){let t=e.trim().toLowerCase().split(`@`)[1];return s_.includes(t)}function Une(e){if(!e||typeof e!=`string`)return`Please enter an email address.`;let t=e.trim().toLowerCase();if(!c_.test(t))return`Please enter a valid email address format (e.g., [email protected]).`;let n=t.split(`@`)[1];return s_.includes(n)?`Temporary or disposable email addresses are not allowed. Please use a permanent email address.`:`Invalid email address.`}function Wne(e){if(!Vne(e))throw Error(Une(e))}function Gne(){let[e,t]=(0,y.useState)(!1);return{sendMagicLink:(0,y.useCallback)(async({email:e,userType:n,fullName:r,organizationName:i})=>{t(!0);try{let t=e.trim();if(Wne(t),Hne(t))throw Error(`Temporary or disposable email addresses are not allowed. Please use a permanent email address.`);let a={emailRedirectTo:`${window.location.origin}/email-verification`,shouldCreateUser:!0};if(n||r||i){let e={};
27n&&(e.user_type=n),r&&(e.full_name=r),i&&(e.organization_name=i),a.data=e}let{error:o}=await R.auth.signInWithOtp({email:t,options:a});if(o)throw o;return{success:!0}}finally{t(!1)}},[]),isLoading:e}}var Kne=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qne={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`},Jne=(0,y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,y.createElement)(`svg`,{ref:c,...qne,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l_(`lucide`,i),...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),W=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(Jne,{ref:i,iconNode:t,className:l_(`lucide-${Kne(e)}`,n),...r}));return n.displayName=`${e}`,n},u_=W(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Yne=W(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Xne=W(`ArrowUpDown`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Zne=W(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),d_=W(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),f_=W(`Briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),p_=W(`Building2`,[[`path`,{d:`M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z`,key:`1b4qmf`}],[`path`,{d:`M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2`,key:`i71pzd`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2`,key:`10jefs`}],[`path`,{d:`M10 6h4`,key:`1itunk`}],[`path`,{d:`M10 10h4`,key:`tcdvrf`}],[`path`,{d:`M10 14h4`,key:`kelpxr`}],[`path`,{d:`M10 18h4`,key:`1ulq68`}]]),Qne=W(`Calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),$ne=W(`ChartColumn`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),ere=W(`ChartNoAxesColumnIncreasing`,[[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`10`,key:`1vz5eb`}],[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`4`,key:`cun8e5`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`16`,key:`hq0ia6`}]]),m_=W(`ChartNoAxesColumn`,[[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`,key:`1xfpm4`}],[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`,key:`be30l9`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`,key:`1r4le6`}]]),h_=W(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),g_=W(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),__=W(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),v_=W(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),tre=W(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),y_=W(`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`}]]),nre=W(`CircleCheckBig`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),b_=W(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),x_=W(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),S_=W(`CirclePlus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),rre=W(`CircleUser`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]]),C_=W(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),w_=W(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),T_=W(`ClipboardCheck`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),ire=W(`ClipboardList`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),E_=W(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),are=W(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}
27]]),ore=W(`CreditCard`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),D_=W(`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`}]]),sre=W(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),O_=W(`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`}]]),k_=W(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),cre=W(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),lre=W(`FileQuestion`,[[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),A_=W(`FileText`,[[`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`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ure=W(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),j_=W(`GraduationCap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),dre=W(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),M_=W(`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`}]]),N_=W(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),P_=W(`Link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),F_=W(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fre=W(`LockOpen`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),I_=W(`Lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),pre=W(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),L_=W(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R_=W(`MapPin`,[[`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`}]]),mre=W(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),z_=W(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),hre=W(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),gre=W(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),_re=W(`PanelsTopLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),vre=W(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}
27]]),B_=W(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),yre=W(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),V_=W(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),H_=W(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),bre=W(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),U_=W(`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`}]]),W_=W(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xre=W(`Share2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Sre=W(`ShieldAlert`,[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Cre=W(`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`}]]),G_=W(`Shield`,[[`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`}]]),K_=W(`Trash`,[[`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`}]]),q_=W(`UserCheck`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`polyline`,{points:`16 11 18 13 22 9`,key:`1pwet4`}]]),J_=W(`UserCog`,[[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m21.7 16.4-.9-.3`,key:`12j9ji`}],[`path`,{d:`m15.2 13.9-.9-.3`,key:`1fdjdi`}],[`path`,{d:`m16.6 18.7.3-.9`,key:`heedtr`}],[`path`,{d:`m19.1 12.2.3-.9`,key:`1af3ki`}],[`path`,{d:`m19.6 18.7-.4-1`,key:`1x9vze`}],[`path`,{d:`m16.8 12.3-.4-1`,key:`vqeiwj`}],[`path`,{d:`m14.3 16.6 1-.4`,key:`1qlj63`}],[`path`,{d:`m20.7 13.8 1-.4`,key:`1v5t8k`}]]),Y_=W(`UserPlus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),wre=W(`UserX`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),X_=W(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Z_=W(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),Tre=W(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),Q_=W(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),$_={job_seeker:`/job-seeker`,organization:`/organization`,career_tech:`/organization`,admin:`/admin`};function ev(e){switch(e){case`job_seeker`:return`${$_.job_seeker}/jobs`;case`organization`:case`career_tech`:return`${$_.organization}/talent-pipeline`;case`admin`:return`${$_.admin}/talent-pipeline`;default:return`/settings/profile`}}function Ere(e){switch(e){case`job_seeker`:return $_.job_seeker;case`organization`:case`career_tech`:return $_.organization;case`admin`:return $_.admin;default:return`/`}}function Dre(e){return`${Ere(e)}/riipen`}var tv=({className:e})=>(0,F.jsx)(`div`,{className:z(`flex items-center justify-center min-h-screen`,e),children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}),Ore=()=>{let{user:e,profile:t,loading:n}=_l(),{checkEmailRegistered:r}=Bne(),{sendMagicLink:i,isLoading:a}=Gne(),o=He(),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(`collect-email`);if(n&&e)return(0,F.jsx)(tv,{});if(e&&t&&o.pathname===`/auth`)return(0,F.jsx)(mt,{to:ev(t.user_type),replace:!0});if(e&&!t&&!n)return(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center min-h-screen gap-3`,children:[(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`Loading your profile...`})]});let b=async(e,t,n)=>{c(!0);try{await i({email:l,userType:e,fullName:t,organizationName:n}),v(`sent`),fl({title:`Check your email`,description:`We sent you a sign-in link.`})}catch(e){fl({title:`Could not send link`,description:e instanceof Error?e.message:`Failed to send link`,variant:`destructive`})}finally{c(!1)}},x=async e=>{e.preventDefault(),c(!0);try{let e=await r(l);if(!e.success){fl({title:`Something went wrong`,description:`Could not verify your email. Please try again.`,variant:`destructive`});return}e.exists?await b():v(`choose-role`)}catch(e){console.error(e),fl({title:`Something went wrong`,description:`Please try again.`,variant:`destructive`})}finally{c(!1)}},S=e=>{g(e),v(`collect-name`)},C=e=>{e.preventDefault(),!(!h||!d.trim())&&(h===`organization`&&!p.trim()||b(h,d.trim(),h===`organization`?p.trim():void 0))},w=()=>{v(`collect-email`),u(``),f(``),m(``),g(null)},T=()=>{v(`choose-role`),f(``),m(``)}
27,E=s||a;return(0,F.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,F.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-6`,children:(0,F.jsxs)(r_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`w-full max-w-lg`,children:[(0,F.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,F.jsx)(`img`,{src:`/lovable-uploads/5b073f6e-f01a-41d5-9166-c07f7567d4b7.png`,alt:`Akito Logo`,className:`h-16 mx-auto mb-4`}),(0,F.jsx)(`h1`,{className:`text-3xl font-bold bg-clip-text text-transparent bg-akito-gradient`,children:`Welcome to Akito`}),(0,F.jsx)(`p`,{className:`text-gray-600 mt-2`,children:`Your AI partner for career growth and professional development`})]}),(0,F.jsxs)(Vu,{className:`mb-6 border-amber-300 bg-amber-50 text-amber-950 shadow-sm [&>svg]:text-amber-900`,children:[(0,F.jsx)(N_,{className:`h-4 w-4`}),(0,F.jsx)(Uu,{className:`text-sm text-amber-900`,children:`We've updated sign-in. Akito now uses secure email links instead of passwords.`})]}),(0,F.jsxs)(V,{children:[_===`collect-email`&&(0,F.jsxs)(`form`,{onSubmit:x,children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Continue with email`}),(0,F.jsx)(Mu,{children:`Enter your email and we'll send you a secure sign-in link.`})]}),(0,F.jsx)(H,{className:`space-y-4`,children:(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`auth-email`,children:`Email`}),(0,F.jsx)(ku,{id:`auth-email`,type:`email`,autoComplete:`email`,placeholder:`[email protected]`,value:l,onChange:e=>u(e.target.value),required:!0})]})}),(0,F.jsx)(Nu,{className:`flex flex-col gap-2`,children:(0,F.jsx)(B,{type:`submit`,className:`w-full bg-akito-gradient hover:opacity-90`,disabled:E||!l.trim(),children:E?`Please wait...`:`Continue`})})]}),_===`choose-role`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Choose how you'll use Akito`}),(0,F.jsxs)(Mu,{children:[`Select the option that best fits you for `,(0,F.jsx)(`strong`,{children:l.trim()}),`. We'll send your sign-in link right away.`]})]}),(0,F.jsxs)(H,{className:`grid gap-3`,children:[(0,F.jsxs)(`button`,{type:`button`,disabled:E,onClick:()=>
27S(`job_seeker`),className:`flex items-start gap-4 rounded-lg border p-4 text-left transition-colors hover:border-akito-teal hover:bg-akito-teal/5 disabled:opacity-50`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-2`,children:(0,F.jsx)(f_,{className:`h-5 w-5 text-akito-teal`})}),(0,F.jsxs)(`div`,{className:`flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium`,children:`Continue as Job Seeker`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Explore career paths, assess your skills, and discover learning resources`})]})]}),(0,F.jsxs)(`button`,{type:`button`,disabled:E,onClick:()=>S(`organization`),className:`flex items-start gap-4 rounded-lg border p-4 text-left transition-colors hover:border-akito-teal hover:bg-akito-teal/5 disabled:opacity-50`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-2`,children:(0,F.jsx)(p_,{className:`h-5 w-5 text-akito-teal`})}),(0,F.jsxs)(`div`,{className:`flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium`,children:`Continue as Organization`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Find talent, spot skill gaps, and build stronger teams`})]})]})]}),(0,F.jsx)(Nu,{children:(0,F.jsx)(B,{type:`button`,variant:`ghost`,className:`w-full`,onClick:w,disabled:E,children:`Use a different email`})})]}),_===`collect-name`&&(0,F.jsxs)(`form`,{onSubmit:C,children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(`div`,{className:`flex justify-center mb-2`,children:(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-3`,children:(0,F.jsx)(X_,{className:`h-6 w-6 text-akito-teal`})})}),(0,F.jsx)(ju,{children:h===`organization`?`Tell us about you`:`What's your name?`}),(0,F.jsx)(Mu,{children:`This helps us personalize your experience.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`full-name`,children:`Full Name`}),(0,F.jsx)(ku,{id:`full-name`,type:`text`,autoComplete:`name`,placeholder:`John Doe`,value:d,onChange:e=>f(e.target.value),required:!0,autoFocus:!0})]}),h===`organization`&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`organization-name`,children:`Organization Name`}),(0,F.jsx)(ku,{id:`organization-name`,type:`text`,autoComplete:`organization`,placeholder:`Acme Inc.`,value:p,onChange:e=>m(e.target.value),required:!0})]})]}),(0,F.jsxs)(Nu,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(B,{type:`submit`,className:`w-full bg-akito-gradient hover:opacity-90`,disabled:E||!d.trim()||h===`organization`&&!p.trim(),children:E?`Sending link...`:`Continue`}),(0,F.jsx)(B,{type:`button`,variant:`ghost`,className:`w-full`,onClick:T,disabled:E,children:`Back`})]})]}),_===`sent`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(`div`,{className:`flex justify-center mb-2`,children:(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-4`,children:(0,F.jsx)(L_,{className:`h-10 w-10 text-akito-teal`})})}),(0,F.jsx)(ju,{children:`Check your inbox`}),(0,F.jsxs)(Mu,{children:[`We sent a sign-in link to `,(0,F.jsx)(`strong`,{children:l.trim()}),`. Open the email and click the link to continue.`]})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(Vu,{className:`border-blue-200 bg-blue-50 text-blue-950 [&>svg]:text-blue-600`,children:[(0,F.jsx)(N_,{className:`h-4 w-4`}),(0,F.jsx)(Uu,{className:`text-sm text-blue-800`,children:`Don't see the email? Check your spam or junk folder.`})]})}),(0,F.jsx)(Nu,{children:(0,F.jsx)(B,{type:`button`,variant:`outline`,className:`w-full`,onClick:w,children:`Use another email`})})]})]})]})}),(0,F.jsx)(`div`,{className:`hidden lg:block lg:w-1/2 bg-akito-gradient`,children:(0,F.jsx)(`div`,{className:`h-full flex items-center justify-center p-12`,children:(0,F.jsxs)(`div`,{className:`text-white max-w-lg`,children:[(0,F.jsx)(`h2`,{className:`text-4xl font-bold mb-6`,children:`Discover Your Career Potential with Akito`}),(0,F.jsx)(`p`,{className:`text-lg opacity-90 mb-8`,children:`Akito helps you understand your career goals, develop skills, and connect with opportunities that match your unique profile.`}),(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-start space-x-4`,children:[(0,F.jsx)(`div`,{className:`bg-white/20 p-3 rounded-full`,children:(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,
27width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`h-6 w-6`,children:[(0,F.jsx)(`path`,{d:`M22 10v6M2 10l10-5 10 5-10 5z`}),(0,F.jsx)(`path`,{d:`M6 12v5c3 3 9 3 12 0v-5`})]})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Personalized Learning Paths`}),(0,F.jsx)(`p`,{className:`opacity-80`,children:`Custom learning recommendations based on your skills and goals`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-start space-x-4`,children:[(0,F.jsx)(`div`,{className:`bg-white/20 p-3 rounded-full`,children:(0,F.jsxs)(`svg`,{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`,className:`h-6 w-6`,children:[(0,F.jsx)(`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}),(0,F.jsx)(`circle`,{cx:`9`,cy:`7`,r:`4`}),(0,F.jsx)(`circle`,{cx:`19`,cy:`11`,r:`2`}),(0,F.jsx)(`path`,{d:`M19 8v1`}),(0,F.jsx)(`path`,{d:`M19 13v1`}),(0,F.jsx)(`path`,{d:`M16 11h1`}),(0,F.jsx)(`path`,{d:`M21 11h1`})]})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Powerful Job Matching`}),(0,F.jsx)(`p`,{className:`opacity-80`,children:`Get matched with opportunities tailored to your profile`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-start space-x-4`,children:[(0,F.jsx)(`div`,{className:`bg-white/20 p-3 rounded-full`,children:(0,F.jsxs)(`svg`,{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`,className:`h-6 w-6`,children:[(0,F.jsx)(`path`,{d:`m17 2 4 4-4 4`}),(0,F.jsx)(`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`}),(0,F.jsx)(`path`,{d:`m7 22-4-4 4-4`}),(0,F.jsx)(`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`})]})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Skills Assessment`}),(0,F.jsx)(`p`,{className:`opacity-80`,children:`Identify strengths and areas for growth in your professional profile`})]})]})]})]})})})]})},{createElement:nv,createContext:kre,createRef:Are,forwardRef:rv,useCallback:iv,useContext:av,useEffect:ov,useImperativeHandle:sv,useLayoutEffect:jre,useMemo:cv,useRef:lv,useState:uv}=y,dv=y[`useId${Math.random()}`.slice(0,5)],fv=jre,pv=kre(null);pv.displayName=`PanelGroupContext`;var mv=fv,hv=typeof dv==`function`?dv:()=>null,gv=0;function _v(e=null){let t=hv(),n=lv(e||t||null);return n.current===null&&(n.current=``+gv++),e??n.current}function vv({children:e,className:t=``,collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:o,maxSize:s,minSize:c,onCollapse:l,onExpand:u,onResize:d,order:f,style:p,tagName:m=`div`,...h}){let g=av(pv);if(g===null)throw Error(`Panel components must be rendered within a PanelGroup container`);let{collapsePanel:_,expandPanel:v,getPanelSize:y,getPanelStyle:b,groupId:x,isPanelCollapsed:S,reevaluatePanelConstraints:C,registerPanel:w,resizePanel:T,unregisterPanel:E}=g,D=_v(o),O=lv({callbacks:{onCollapse:l,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:c},id:D,idIsFromProps:o!==void 0,order:f});lv({didLogMissingDefaultSizeWarning:!1}),mv(()=>{let{callbacks:e,constraints:t}=O.current,a={...t};O.current.id=D,O.current.idIsFromProps=o!==void 0,O.current.order=f,e.onCollapse=l,e.onExpand=u,e.onResize=d,t.collapsedSize=n,t.collapsible=r,t.defaultSize=i,t.maxSize=s,t.minSize=c,(a.collapsedSize!==t.collapsedSize||a.collapsible!==t.collapsible||a.maxSize!==t.maxSize||a.minSize!==t.minSize)&&C(O.current,a)}),mv(()=>{let e=O.current;return w(e),()=>{E(e)}},[f,D,w,E]),sv(a,()=>({collapse:()=>{_(O.current)},expand:e=>{v(O.current,e)},getId(){return D},getSize(){return y(O.current)},isCollapsed(){return S(O.current)},isExpanded(){return!S(O.current)},resize:e=>{T(O.current,e)}}),[_,v,y,S,D,T]);let k=b(O.current,i);return nv(m,{...h,children:e,className:t,id:o,style:{...k,...p},"data-panel":``,"data-panel-collapsible":r||void 0,"data-panel-group-id":x,"data-panel-id":D,"data-panel-size":parseFloat(``+k.flexGrow).toFixed(1)})}var yv=rv((e,t)=>nv(vv,{...e,forwardedRef:t}));
vendor: 4,169 bytes, line 27
27vv.displayName=`Panel`,yv.displayName=`forwardRef(Panel)`;var bv;function xv(){return bv}var Sv=null,Cv=!0,wv=null;function Tv(e,t){if(t){let e=(t&Hv)!==0,n=(t&Uv)!==0,r=(t&Wv)!==0,i=(t&Gv)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function Ev(){wv!==null&&(document.head.removeChild(wv),Sv=null,wv=null)}function Dv(e,t){if(!Cv)return;let n=Tv(e,t);if(Sv!==n){if(Sv=n,wv===null){wv=document.createElement(`style`);let e=xv();e&&wv.setAttribute(`nonce`,e),document.head.appendChild(wv)}wv.innerHTML=`*{cursor: ${n}!important;}`}}function Ov(e){return e.type===`keydown`}function kv(e){return e.type.startsWith(`pointer`)}function Av(e){return e.type.startsWith(`mouse`)}function jv(e){if(kv(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Av(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Mv(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}function Nv(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function Pv(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Bv(e),b:Bv(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;cy(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:zv(Rv(n.a)),b:zv(Rv(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Fv=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Iv(e){let t=getComputedStyle(Vv(e)??e).display;return t===`flex`||t===`inline-flex`}function Lv(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Iv(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Fv.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Rv(e){let t=e.length;for(;t--;){let n=e[t];if(cy(n,`Missing node`),Lv(n))return n}return null}function zv(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Bv(e){let t=[];for(;e;)t.push(e),e=Vv(e);return t}function Vv(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}var Hv=1,Uv=2,Wv=4,Gv=8,Kv=Mv()===`coarse`,qv=[],Jv=!1,Yv=new Map,Xv=new Map,Zv=new Set;function Qv(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=Yv.get(a)??0;return Yv.set(a,s+1),Zv.add(o),ay(),function(){Xv.delete(e),Zv.delete(o);let t=Yv.get(a)??1;if(Yv.set(a,t-1),ay(),t===1&&Yv.delete(a),qv.includes(o)){let e=qv.indexOf(o);e>=0&&qv.splice(e,1),iy(),i(`up`,!0,null)}}}function $v(e){let{target:t}=e,{x:n,y:r}=jv(e);Jv=!0,ny({target:t,x:n,y:r}),ay(),qv.length>0&&(oy(`down`,e),e.preventDefault(),e.stopPropagation())}function ey(e){let{x:t,y:n}=jv(e);if(Jv&&e.buttons===0&&(Jv=!1,oy(`up`,e)),!Jv){let{target:r}=e;ny({target:r,x:t,y:n})}oy(`move`,e),iy(),qv.length>0&&e.preventDefault()}function ty(e){let{target:t}=e,{x:n,y:r}=jv(e);Xv.clear(),Jv=!1,qv.length>0&&e.preventDefault(),oy(`up`,e),ny({target:t,x:n,y:r}),iy(),ay()}function ny({target:e,x:t,y:n}){qv.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Zv.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=Kv?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&Pv(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(Nv(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}qv.push(e)}})}function ry(e,t){Xv.set(e,t)}function iy(){let e=!1,t=!1;qv.forEach(n=>{let{direction:r}=n;r===`horizontal`?e=!0:t=!0});let n=0;
27Xv.forEach(e=>{n|=e}),e&&t?Dv(`intersection`,n):e?Dv(`horizontal`,n):t?Dv(`vertical`,n):Ev()}function ay(){Yv.forEach((e,t)=>{let{body:n}=t;n.removeEventListener(`contextmenu`,ty),n.removeEventListener(`pointerdown`,$v),n.removeEventListener(`pointerleave`,ey),n.removeEventListener(`pointermove`,ey)}),window.removeEventListener(`pointerup`,ty),window.removeEventListener(`pointercancel`,ty),Zv.size>0&&(Jv?(qv.length>0&&Yv.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`contextmenu`,ty),n.addEventListener(`pointerleave`,ey),n.addEventListener(`pointermove`,ey))}),window.addEventListener(`pointerup`,ty),window.addEventListener(`pointercancel`,ty)):Yv.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`pointerdown`,$v,{capture:!0}),n.addEventListener(`pointermove`,ey))}))}function oy(e,t){Zv.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,qv.includes(n),t)})}function sy(){let[e,t]=uv(0);return iv(()=>t(e=>e+1),[])}function cy(e,t){if(!e)throw console.error(t),Error(t)}var ly=10;function uy(e,t,n=ly){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function dy(e,t,n=ly){return uy(e,t,n)===0}function fy(e,t,n){return uy(e,t,n)===0}function py(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!fy(i,a,n))return!1}return!0}function my({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];cy(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(uy(n,s)<0)if(a){let e=(i+s)/2;n=uy(n,e)<0?i:s}else n=s;return n=Math.min(o,n),n=parseFloat(n.toFixed(ly)),n}function hy({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(fy(e,0))return t;let o=[...t],[s,c]=r;cy(s!=null,`Invalid first pivot index`),cy(c!=null,`Invalid second pivot index`);let l=0;if(a===`keyboard`){{let r=e<0?c:s,i=n[r];cy(i,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(cy(n!=null,`Previous layout not found for panel index ${r}`),fy(n,a)){let t=l-n;uy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?s:c,i=n[r];cy(i,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(cy(n!=null,`Previous layout not found for panel index ${r}`),fy(n,l)){let t=n-a;uy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?c:s,a=0;for(;;){let e=t[i];cy(e!=null,`Previous layout not found for panel index ${i}`);let o=my({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let o=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-o:o}{let r=e<0?s:c;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(l),a=t[r];cy(a!=null,`Previous layout not found for panel index ${r}`);let s=a-i,c=my({panelConstraints:n,panelIndex:r,size:s});if(!fy(a,c)&&(l+=a-c,o[r]=c,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(py(i,o))return i;{let r=e<0?c:s,i=t[r];cy(i!=null,`Previous layout not found for panel index ${r}`);let a=i+l,u=my({panelConstraints:n,panelIndex:r,size:a});if(o[r]=u,!fy(u,a)){let t=a-u,r=e<0?c:s;for(;r>=0&&r<n.length;){let i=o[r];cy(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=my({panelConstraints:n,panelIndex:r,size:a});if(fy(i,s)||(t-=s-i,o[r]=s),fy(t,0))break;e>0?r--:r++}}}return fy(o.reduce((e,t)=>t+e,0),100)?o:i}function gy({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return cy(s!=null,`No pivot index found`),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function _y(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function vy(e,t,n=document){return _y(e,n).findIndex(e=>e.getAttribute(`data-panel-resize-handle-id`)===t)??null}function yy(e,t,n){let r=vy(e,t,n);return r==null?[-1,-1]:[r,r+1]}function by(e,t=document){return t instanceof HTMLElement&&t?.dataset?.panelGroupId==e?t:t.querySelector(`[data-
27panel-group][data-panel-group-id="${e}"]`)||null}function xy(e,t=document){return t.querySelector(`[data-panel-resize-handle-id="${e}"]`)||null}function Sy(e,t,n,r=document){let i=xy(t,r),a=_y(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function Cy({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:o}){lv({didWarnAboutMissingResizeHandle:!1}),mv(()=>{if(!a)return;let e=_y(n,a);for(let t=0;t<i.length-1;t++){let{valueMax:n,valueMin:a,valueNow:o}=gy({layout:r,panelsArray:i,pivotIndices:[t,t+1]}),s=e[t];if(s!=null){let e=i[t];cy(e,`No panel data found for index "${t}"`),s.setAttribute(`aria-controls`,e.id),s.setAttribute(`aria-valuemax`,``+Math.round(n)),s.setAttribute(`aria-valuemin`,``+Math.round(a)),s.setAttribute(`aria-valuenow`,o==null?``:``+Math.round(o))}}return()=>{e.forEach((e,t)=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})}},[n,r,i,a]),ov(()=>{if(!a)return;let e=t.current;cy(e,`Eager values not found`);let{panelDataArray:i}=e;cy(by(n,a)!=null,`No group found for id "${n}"`);let s=_y(n,a);cy(s,`No resize handles found for group id "${n}"`);let c=s.map(e=>{let t=e.getAttribute(`data-panel-resize-handle-id`);cy(t,`Resize handle element has no handle id attribute`);let[s,c]=Sy(n,t,i,a);if(s==null||c==null)return()=>{};let l=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let c=i.findIndex(e=>e.id===s);if(c>=0){let e=i[c];cy(e,`No panel data found for index ${c}`);let s=r[c],{collapsedSize:l=0,collapsible:u,minSize:d=0}=e.constraints;if(s!=null&&u){let e=hy({delta:fy(s,l)?d-l:l-s,initialLayout:r,panelConstraints:i.map(e=>e.constraints),pivotIndices:yy(n,t,a),prevLayout:r,trigger:`keyboard`});r!==e&&o(e)}}break}}};return e.addEventListener(`keydown`,l),()=>{e.removeEventListener(`keydown`,l)}});return()=>{c.forEach(e=>e())}},[a,e,t,n,r,i,o])}function wy(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ty(e,t){let n=e===`horizontal`,{x:r,y:i}=jv(t);return n?r:i}function Ey(e,t,n,r,i){let a=n===`horizontal`,o=xy(t,i);cy(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(`data-panel-group-id`);cy(s,`Resize handle element has no group id attribute`);let{initialCursorPosition:c}=r,l=Ty(n,e),u=by(s,i);cy(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function Dy(e,t,n,r,i,a){if(Ov(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:Ey(e,t,n,r,a)}function Oy({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];cy(e,`Panel constraints not found for index ${a}`);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];cy(o,`Panel constraints not found for index ${a}`);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function ky(e,t,n){t.forEach((t,r)=>{let i=e[r];cy(i,`Panel data not found for index ${r}`);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||dy(u,c))&&!dy(t,c)&&r(),e&&(u==null||!dy(u,c))&&dy(t,c)&&e())}})}function Ay(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function jy({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e==null?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function My(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Ny(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>
27{localStorage.setItem(e,t)};else throw Error(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Py(e){return`react-resizable-panels:${e}`}function Fy(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function Iy(e,t){try{let n=Py(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function Ly(e,t,n){return(Iy(e,n)??{})[Fy(t)]??null}function Ry(e,t,n,r,i){let a=Py(e),o=Fy(t),s=Iy(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function zy({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!fy(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];cy(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];cy(r!=null,`No layout data found for index ${e}`);let a=my({panelConstraints:t,panelIndex:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!fy(i,0))for(let e=0;e<t.length;e++){let r=n[e];cy(r!=null,`No layout data found for index ${e}`);let a=r+i,o=my({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,fy(i,0)))break}return n}var By=100,Vy={getItem:e=>(Ny(Vy),Vy.getItem(e)),setItem:(e,t)=>{Ny(Vy),Vy.setItem(e,t)}},Hy={};function Uy({autoSaveId:e=null,children:t,className:n=``,direction:r,forwardedRef:i,id:a=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=Vy,style:l,tagName:u=`div`,...d}){let f=_v(a),p=lv(null),[m,h]=uv(null),[g,_]=uv([]),v=sy(),y=lv({}),b=lv(new Map),x=lv(0),S=lv({autoSaveId:e,direction:r,dragState:m,id:f,keyboardResizeBy:s,onLayout:o,storage:c}),C=lv({layout:g,panelDataArray:[],panelDataArrayChanged:!1});lv({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),sv(i,()=>({getId:()=>S.current.id,getLayout:()=>{let{layout:e}=C.current;return e},setLayout:e=>{let{onLayout:t}=S.current,{layout:n,panelDataArray:r}=C.current,i=zy({layout:e,panelConstraints:r.map(e=>e.constraints)});wy(n,i)||(_(i),C.current.layout=i,t&&t(i),ky(r,i,y.current))}}),[]),mv(()=>{S.current.autoSaveId=e,S.current.direction=r,S.current.dragState=m,S.current.id=f,S.current.onLayout=o,S.current.storage=c}),Cy({committedValuesRef:S,eagerValuesRef:C,groupId:f,layout:g,panelDataArray:C.current.panelDataArray,setLayout:_,panelGroupElement:p.current}),ov(()=>{let{panelDataArray:t}=C.current;if(e){if(g.length===0||g.length!==t.length)return;let n=Hy[e];n??(n=My(Ry,By),Hy[e]=n);let r=[...t],i=new Map(b.current);n(e,r,i,g,c)}},[e,g,c]),ov(()=>{});let w=iv(e=>{let{onLayout:t}=S.current,{layout:n,panelDataArray:r}=C.current;if(e.constraints.collapsible){let i=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=Ky(r,e,n);if(cy(o!=null,`Panel size not found for panel "${e.id}"`),!dy(o,a)){b.current.set(e.id,o);let c=hy({delta:Gy(r,e)===r.length-1?o-a:a-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:`imperative-api`});Ay(n,c)||(_(c),C.current.layout=c,t&&t(c),ky(r,c,y.current))}}},[]),T=iv((e,t)=>{let{onLayout:n}=S.current,{layout:r,panelDataArray:i}=C.current;if(e.constraints.collapsible){let a=i.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=Ky(i,e,r),u=t??c;if(dy(s,o)){let t=b.current.get(e.id),o=t!=null&&t>=u?t:u,c=hy({delta:Gy(i,e)===i.length-1?s-o:o-s,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:`imperative-api`});Ay(r,c)||(_(c),C.current.layout=c,n&&n(c),ky(i,c,y.current))}}},[]),E=iv(e=>{let{layout:t,panelDataArray:n}=C.current,{panelSize:r}=Ky(n,e,t);return cy(r!=null,`Panel size not found for panel "${e.id}"`),r},[]),D=iv((e,t)=>{let{panelDataArray:n}=C.current,r=Gy(n,e);return jy({defaultSize:t,dragState:m,layout:g,panelData:n,panelIndex:r})},[m,g]),O=iv(e=>{let{layout:t,panelDataArray:n}=C.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=Ky(n,e,t);return cy(a!=null,`Panel size not found for panel "${e.id}"`),i===!0&&dy(a,r)},[]),k=iv(e=>{let{layout:t,panelDataArray:n}=C.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=Ky(n,e,t);return cy(a!=null,`Panel size not found for panel "${e.id}"`),!i||uy(a,r)>0},[]),A=iv(e=>{let{panelDataArray:t}=C.current;t.push(e),t.sort((e,t)=>
27{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),C.current.panelDataArrayChanged=!0,v()},[v]);mv(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;let{autoSaveId:e,onLayout:t,storage:n}=S.current,{layout:r,panelDataArray:i}=C.current,a=null;if(e){let t=Ly(e,i,n);t&&(b.current=new Map(Object.entries(t.expandToSizes)),a=t.layout)}a??=Oy({panelDataArray:i});let o=zy({layout:a,panelConstraints:i.map(e=>e.constraints)});wy(r,o)||(_(o),C.current.layout=o,t&&t(o),ky(i,o,y.current))}}),mv(()=>{let e=C.current;return()=>{e.layout=[]}},[]);let j=iv(e=>function(t){t.preventDefault();let n=p.current;if(!n)return()=>null;let{direction:r,dragState:i,id:a,keyboardResizeBy:o,onLayout:s}=S.current,{layout:c,panelDataArray:l}=C.current,{initialLayout:u}=i??{},d=yy(a,e,n),f=Dy(t,e,r,i,o,n),m=r===`horizontal`;document.dir===`rtl`&&m&&(f=-f);let h=l.map(e=>e.constraints),g=hy({delta:f,initialLayout:u??c,panelConstraints:h,pivotIndices:d,prevLayout:c,trigger:Ov(t)?`keyboard`:`mouse-or-touch`}),v=!Ay(c,g);(kv(t)||Av(t))&&x.current!=f&&(x.current=f,!v&&f!==0?m?ry(e,f<0?Hv:Uv):ry(e,f<0?Wv:Gv):ry(e,0)),v&&(_(g),C.current.layout=g,s&&s(g),ky(l,g,y.current))},[]),M=iv((e,t)=>{let{onLayout:n}=S.current,{layout:r,panelDataArray:i}=C.current,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=Ky(i,e,r);cy(o!=null,`Panel size not found for panel "${e.id}"`);let c=hy({delta:Gy(i,e)===i.length-1?o-t:t-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:`imperative-api`});Ay(r,c)||(_(c),C.current.layout=c,n&&n(c),ky(i,c,y.current))},[]),N=iv((e,t)=>{let{layout:n,panelDataArray:r}=C.current,{collapsedSize:i=0,collapsible:a}=t,{collapsedSize:o=0,collapsible:s,maxSize:c=100,minSize:l=0}=e.constraints,{panelSize:u}=Ky(r,e,n);u!=null&&(a&&s&&dy(u,i)?dy(i,o)||M(e,o):u<l?M(e,l):u>c&&M(e,c))},[M]),ee=iv((e,t)=>{let{direction:n}=S.current,{layout:r}=C.current;if(!p.current)return;let i=xy(e,p.current);cy(i,`Drag handle element not found for id "${e}"`);let a=Ty(n,t);h({dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),te=iv(()=>{h(null)},[]),ne=iv(e=>{let{panelDataArray:t}=C.current,n=Gy(t,e);n>=0&&(t.splice(n,1),delete y.current[e.id],C.current.panelDataArrayChanged=!0,v())},[v]),re=cv(()=>({collapsePanel:w,direction:r,dragState:m,expandPanel:T,getPanelSize:E,getPanelStyle:D,groupId:f,isPanelCollapsed:O,isPanelExpanded:k,reevaluatePanelConstraints:N,registerPanel:A,registerResizeHandle:j,resizePanel:M,startDragging:ee,stopDragging:te,unregisterPanel:ne,panelGroupElement:p.current}),[w,m,r,T,E,D,f,O,k,N,A,j,M,ee,te,ne]),ie={display:`flex`,flexDirection:r===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`};return nv(pv.Provider,{value:re},nv(u,{...d,children:t,className:n,id:a,ref:p,style:{...ie,...l},"data-panel-group":``,"data-panel-group-direction":r,"data-panel-group-id":f}))}var Wy=rv((e,t)=>nv(Uy,{...e,forwardedRef:t}));Uy.displayName=`PanelGroup`,Wy.displayName=`forwardRef(PanelGroup)`;function Gy(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function Ky(e,t,n){let r=Gy(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function Mre({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){ov(()=>{if(e||n==null||r==null)return;let i=xy(t,r);if(i==null)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),n(e);break;case`F6`:{e.preventDefault();let n=i.getAttribute(`data-panel-group-id`);cy(n,`No group element found for id "${n}"`);let a=_y(n,r),o=vy(n,t,r);cy(o!==null,`No resize element found for id "${t}"`),a[e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0].focus();break}}};return i.addEventListener(`keydown`,a),()=>{i.removeEventListener(`keydown`,a)}},[r,e,t,n])}function qy({children:e=null,className:t=``,disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onDragging:o,onFocus:s,style:c={},tabIndex:l=0,tagName:u=`div`,...d}){let f=lv(null),p=lv({onDragging:o});ov(()=>{p.current.onDragging=o});let m=av(pv);if(m===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:h,groupId:g,registerResizeHandle:_,startDragging:v,stopDragging:y,panelGroupElement:b}=m,x=_v(i),[S,C]=uv(`inactive`),[w,T]=uv(!1),[E,D]=uv(null),O=lv({state:S});mv(()=>{O.current.state=S}),ov(()=>{if(n)D(null);else{let e=_(x);D(()=>e)}},[n,x,_]);let k=r?.coarse??15,A=r?.fine??5;ov(()=>{if(n||E==null)return;let e=f.current;return cy(e,`Element ref not attached`),Qv(x,e,h,{coarse:k,fine:A},(e,t,n)=>{if(t)switch(e){case`down`:{C(`drag`),cy(n,`Expected event to be defined for "down" action`),v(x,n);let{onDragging:e}=p.current;e&&e(!0);break}case`move`:{let{state:e}=O.current;e!==`drag`&&C(`hover`),cy(n,`Expected event to be defined for "move" action`),E(n);break}case`up`:{C(`hover`),y();let{onDragging:e}=p.current;e&&e(!1);break}}else C(`inactive`)})},[k,h,n,A,_,x,E,v,y]),Mre({disabled:n,handleId:x,resizeHandler:E,panelGroupElement:b});let j={touchAction:`none`,userSelect:`none`};return nv(u,{...d,children:e,className:t,id:i,onBlur:()=>{T(!1),a?.()},onFocus:()=>{T(!0),s?.()},ref:f,role:`separator`,style:{...j,...c},tabIndex:l,"data-panel-group-direction":h,"data-panel-group-id":g,"data-resize-handle":``,"data-resize-handle-active":S===`drag`?`pointer`:w?`keyboard`:void 0,"data-resize-handle-state":S,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":x})}qy.displayName=`PanelResizeHandle`;var Jy=({className:e,...t})=>(0,F.jsx)(Wy,{className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),Yy=yv,Xy=({withHandle:e,className:t,...n})=>(0,F.jsx)(qy,{className:z(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,F.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,F.jsx)(dre,{className:`h-2.5 w-2.5`})})}),Nre=`Separator`,Zy=`horizontal`,Pre=[`horizontal`,`vertical`],Qy=y.forwardRef((e,t)=>
27{let{decorative:n,orientation:r=Zy,...i}=e,a=Fre(r)?r:Zy,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,F.jsx)(U.div,{"data-orientation":a,...o,...i,ref:t})});Qy.displayName=Nre;function Fre(e){return Pre.includes(e)}var $y=Qy,eb=y.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,F.jsx)($y,{ref:i,decorative:n,orientation:t,className:z(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));eb.displayName=$y.displayName;function Ire(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Lre=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rre=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zre={};function tb(e,t){return((t||zre).jsx?Rre:Lre).test(e)}var Bre=/[ \t\n\f\r]/g;function Vre(e){return typeof e==`object`?e.type===`text`&&nb(e.value):nb(e)}function nb(e){return e.replace(Bre,``)===``}var rb=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};rb.prototype.normal={},rb.prototype.property={},rb.prototype.space=void 0;function ib(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new rb(n,r,t)}function ab(e){return e.toLowerCase()}var ob=class{constructor(e,t){this.attribute=t,this.property=e}};ob.prototype.attribute=``,ob.prototype.booleanish=!1,ob.prototype.boolean=!1,ob.prototype.commaOrSpaceSeparated=!1,ob.prototype.commaSeparated=!1,ob.prototype.defined=!1,ob.prototype.mustUseProperty=!1,ob.prototype.number=!1,ob.prototype.overloadedBoolean=!1,ob.prototype.property=``,ob.prototype.spaceSeparated=!1,ob.prototype.space=void 0;var sb=c({boolean:()=>cb,booleanish:()=>lb,commaOrSpaceSeparated:()=>pb,commaSeparated:()=>fb,number:()=>G,overloadedBoolean:()=>ub,spaceSeparated:()=>db}),Hre=0,cb=mb(),lb=mb(),ub=mb(),G=mb(),db=mb(),fb=mb(),pb=mb();function mb(){return 2**++Hre}var hb=Object.keys(sb),gb=class extends ob{constructor(e,t,n,r){let i=-1;if(super(e,t),_b(this,`space`,r),typeof n==`number`)for(;++i<hb.length;){let e=hb[i];_b(this,hb[i],(n&sb[e])===sb[e])}}};gb.prototype.defined=!0;function _b(e,t,n){n&&(e[t]=n)}function vb(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new gb(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ab(r)]=r,n[ab(a.attribute)]=r}return new rb(t,n,e.space)}var yb=vb({properties:{ariaActiveDescendant:null,ariaAtomic:lb,ariaAutoComplete:null,ariaBusy:lb,ariaChecked:lb,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:db,ariaCurrent:null,ariaDescribedBy:db,ariaDetails:null,ariaDisabled:lb,ariaDropEffect:db,ariaErrorMessage:null,ariaExpanded:lb,ariaFlowTo:db,ariaGrabbed:lb,ariaHasPopup:null,ariaHidden:lb,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:db,ariaLevel:G,ariaLive:null,ariaModal:lb,ariaMultiLine:lb,ariaMultiSelectable:lb,ariaOrientation:null,ariaOwns:db,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:lb,ariaReadOnly:lb,ariaRelevant:null,ariaRequired:lb,ariaRoleDescription:db,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:lb,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function bb(e,t){return t in e?e[t]:t}function xb(e,t){return bb(e,t.toLowerCase())}var Ure=vb({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fb,acceptCharset:db,accessKey:db,action:null,allow:null,allowFullScreen:cb,allowPaymentRequest:cb,allowUserMedia:cb,alpha:cb,alt:null,as:null,async:cb,autoCapitalize:null,autoComplete:db,autoFocus:cb,autoPlay:cb,blocking:db,capture:null,charSet:null,checked:cb,cite:null,className:db,closedBy:null,colorSpace:null,cols:G,colSpan:G,command:null,commandFor:null,content:null,contentEditable:lb,controls:cb,controlsList:db,coords:G|fb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:cb,defer:cb,dir:null,dirName:null,disabled:cb,download:ub,draggable:lb,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:cb,formTarget:null,headers:db,height:G,hidden:ub,high:G,href:null,hrefLang:null,htmlFor:db,httpEquiv:db,id:null,imageSizes:null,imageSrcSet:null,inert:cb,inputMode:null,integrity:null,is:null,isMap:cb,itemId:null,itemProp:db,itemRef:db,itemScope:cb,itemType:db,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:cb,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:cb,muted:cb,name:null,nonce:null,noModule:cb,noValidate:cb,onAbort:null,onAfterPrint:null,onAuxCl
27ick: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:cb,optimum:G,pattern:null,ping:db,placeholder:null,playsInline:cb,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:cb,referrerPolicy:null,rel:db,required:cb,reversed:cb,rows:G,rowSpan:G,sandbox:db,scope:null,scoped:cb,seamless:cb,selected:cb,shadowRootClonable:cb,shadowRootCustomElementRegistry:cb,shadowRootDelegatesFocus:cb,shadowRootMode:null,shadowRootSerializable:cb,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:lb,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:cb,useMap:null,value:lb,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:db,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:cb,declare:cb,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:cb,noHref:cb,noShade:cb,noWrap:cb,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:lb,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:cb,disablePictureInPicture:cb,disableRemotePlayback:cb,exportParts:fb,part:db,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:xb}),Wre=vb({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`,maskType:`mask-type`,navDown:`nav-down`,n
27avDownLeft:`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:pb,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:db,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:cb,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:fb,g2:fb,glyphName:fb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:pb,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,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,on
vendor: 18,668 bytes, lines 27-28
27Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:db,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pb,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pb,rev:pb,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pb,requiredFeatures:pb,requiredFonts:pb,requiredFormats:pb,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:pb,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pb,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pb,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:bb}),Sb=vb({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Cb=vb({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xb}),wb=vb({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Gre={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`},Kre=/[A-Z]/g,Tb=/-[a-z]/g,qre=/^data[-\w.:]+$/i;function Jre(e,t){let n=ab(t),r=t,i=ob;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&qre.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Tb,Xre);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Tb.test(e)){let n=e.replace(Kre,Yre);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=gb}return new i(r,t)}function Yre(e){return`-`+e.toLowerCase()}function Xre(e){return e.charAt(1).toUpperCase()}var Zre=ib([yb,Ure,Sb,Cb,wb],`html`),Eb=ib([yb,Wre,Sb,Cb,wb],`svg`);function Qre(e){return e.join(` `).trim()}var $re=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` 28`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),eie=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t($re());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),tie=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),nie=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(eie()),r=tie();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Db=kb(`end`),Ob=kb(`start`);function kb(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function rie(e){let t=Ob(e),n=Db(e);if(t&&n)return{start:t,end:n}}function Ab(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Mb(e.position):`start`in e||`end`in e?Mb(e):`line`in e||`column`in e?jb(e):``}function jb(e){return Nb(e&&e.line)+`:`+Nb(e&&e.column)}function Mb(e){return jb(e&&e.start)+`-`+jb(e&&e.end)}function Nb(e){return e&&typeof e==`number`?e:1}var Pb=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ab(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Pb.prototype.file=``,Pb.prototype.name=``,Pb.prototype.reason=``,Pb.prototype.message=``,Pb.prototype.stack=``,Pb.prototype.column=void 0,Pb.prototype.line=void 0,Pb.prototype.ancestors=void 0,Pb.prototype.cause=void 0,Pb.prototype.fatal=void 0,Pb.prototype.place=void 0,Pb.prototype.ruleId=void 0,Pb.prototype.source=void 0;var iie=u(nie(),1),Fb={}.hasOwnProperty,aie=new Map,oie=/[A-Z]/g,sie=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),cie=new Set([`td`,`th`]);function lie(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=_ie(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=gie(n,t.jsx,t.jsxs)}let i={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:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Eb:Zre,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ib(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ib(e,t,n){if(t.type===`element`)return uie(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return die(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return pie(e,t,n);if(t.type===`mdxjsEsm`)return fie(e,t);if(t.type===`root`)return mie(e,t,n);if(t.type===`text`)return hie(e,t)}function uie(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Eb,e.schema=i),e.ancestors.push(t);let a=Bb(e,t.tagName,!1),o=vie(e,t),s=zb(e,t);return sie.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Vre(e)})),Lb(e,o,a,t),Rb(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function die(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Vb(e,t.position)}function fie(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vb(e,t.position)}function pie(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Eb,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Bb(e,t.name,!0),o=yie(e,t),s=zb(e,t);return Lb(e,o,a,t),Rb(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function mie(e,t,n){let r={};return Rb(r,zb(e,t)),e.create(t,e.Fragment,r,n)}function hie(e,t){return t.value}function Lb(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Rb(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function gie(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function _ie(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Ob(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function vie(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Fb.call(t.properties,i)){let a=bie(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&cie.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function yie(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Vb(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Vb(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function zb(e,t){let n=[],r=-1,i=e.passKeys?new Map:aie;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ib(e,a,o);s!==void 0&&n.push(s)}return n}function bie(e,t,n){let r=Jre(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ire(n):Qre(n)),r.property===`style`){let t=typeof n==`object`?n:xie(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Sie(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Gre[r.property]||r.property:r.attribute,n]}}function xie(e,t){try{return(0,iie.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Pb("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Bb(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=tb(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=tb(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Fb.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vb(e)}function Vb(e,t){let n=new Pb("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Sie(e){let t={},n;for(n in e)Fb.call(e,n)&&(t[Cie(n)]=e[n]);return t}function Cie(e){let t=e.replace(oie,wie);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function wie(e){return`-`+e.toLowerCase()}var Hb={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`]},Tie={};function Ub(e,t){let n=t||Tie;return Wb(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Wb(e,t,n){if(Eie(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Gb(e.children,t,n)}return Array.isArray(e)?Gb(e,t,n):``}function Gb(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Wb(e[i],t,n);return r.join(``)}function Eie(e){return!!(e&&typeof e==`object`)}var Kb=document.createElement(`i`);function qb(e){let t=`&`+e+`;`;Kb.innerHTML=t;let n=Kb.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Jb(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Yb(e,t){return e.length>0?(Jb(e,e.length,0,t),e):t}var Xb={}.hasOwnProperty;function Zb(e){let t={},n=-1;for(;++n<e.length;)Die(t,e[n]);return t}function Die(e,t){let n;for(n in t){let r=(Xb.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Xb.call(r,a)||(r[a]=[]);let e=i[a];Oie(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Oie(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Jb(e,0,0,r)}function Qb(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function $b(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ex=lx(/[A-Za-z]/),tx=lx(/[\dA-Za-z]/),kie=lx(/[#-'*+\--9=?A-Z^-~]/);function nx(e){return e!==null&&(e<32||e===127)}var rx=lx(/\d/),Aie=lx(/[\dA-Fa-f]/),jie=lx(/[!-/:-@[-`{-~]/);function ix(e){return e!==null&&e<-2}function ax(e){return e!==null&&(e<0||e===32)}function ox(e){return e===-2||e===-1||e===32}var sx=lx(/\p{P}|\p{S}/u),cx=lx(/\s/);function lx(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ux(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&tx(e.charCodeAt(n+1))&&tx(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function dx(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return ox(r)?(e.enter(n),s(r)):t(r)}function s(r){return ox(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Mie={tokenize:Nie};function Nie(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),dx(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return ix(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Pie={tokenize:Fie},fx={tokenize:Iie};function Fie(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Jb(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fx,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m
vendor: 8,861 bytes, line 28
28(e)}function f(n){return t.containerState={},e.attempt(fx,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return ix(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Jb(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Iie(e,t,n){return dx(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function px(e){if(e===null||ax(e)||cx(e))return 1;if(sx(e))return 2}function mx(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var hx={name:`attention`,resolveAll:Lie,tokenize:Rie};function Lie(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};gx(d,-c),gx(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Yb(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Yb(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Yb(l,mx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Yb(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Yb(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Jb(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Rie(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=px(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=px(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function gx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var zie={name:`autolink`,tokenize:Bie};function Bie(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ex(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||tx(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||tx(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||nx(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):kie(t)?(e.consume(t),l):n(t)}function u(e){return tx(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||tx(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var _x={partial:!0,tokenize:Vie};function Vie(e,t,n){return r;function r(t){return ox(t)?dx(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||ix(e)?t(e):n(e)}}var vx={continuation:{tokenize:Uie},exit:Wie,name:`blockQuote`,tokenize:Hie};function Hie(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return ox(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Uie(e,t,n){let r=this;return i;function i(t){return ox(t)?dx(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(vx,t,n)(r)}}function Wie(e){e.exit(`blockQuote`)}var yx={name:`characterEscape`,tokenize:Gie};function Gie(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return jie(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var bx={name:`characterReference`,tokenize:Kie};function Kie(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=tx,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Aie,u):(e.enter(`characterReferenceValue`),a=7,o=rx,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===tx&&!qb(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var xx={partial:!0,tokenize:Jie},Sx={concrete:!0,name:`codeFenced`,tokenize:qie};function qie(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),ox(t)?dx(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||ix(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(xx,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||ix(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):ox(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),dx(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||ix(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||ix(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&ox(t)?dx(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||ix(t)?e.check(xx,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||ix(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),ox(t)?dx(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),ox(t)?dx(e,d,`whitespace`)(t):d(t)):n(t)}
vendor: 13,843 bytes, line 28
28function d(r){return r===null||ix(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Jie(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Cx={name:`codeIndented`,tokenize:Xie},Yie={partial:!0,tokenize:Zie};function Xie(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),dx(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):ix(t)?e.attempt(Yie,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||ix(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Zie(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):ix(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):dx(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):ix(e)?i(e):n(e)}}var Qie={name:`codeText`,previous:eae,resolve:$ie,tokenize:tae};function $ie(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function eae(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function tae(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):ix(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||ix(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var nae=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw 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){let n=t??1/0;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){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&wx(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),wx(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wx(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);wx(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);wx(this.left,t.reverse())}}};function wx(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 Tx(e){let t={},n=-1,r,i,a,o,s,c,l,u=new nae(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rae(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Jb(e,0,1/0,u.slice(0)),!l}function rae(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var iae={resolve:oae,tokenize:sae},aae={partial:!0,tokenize:cae};function oae(e){return Tx(e),e}function sae(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):ix(t)?e.check(aae,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cae(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),dx(e,a,`linePrefix`)}function a(i){if(i===null||ix(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ex(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||nx(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||ix(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||ax(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||nx(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Dx(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):ix(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||ix(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!ox(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ox(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):ix(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),dx(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||ix(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function kx(e,t){let n;return r;function r(i){return ix(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):ox(i)?dx(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var lae={name:`definition`,tokenize:dae},uae={partial:!0,tokenize:fae};function dae(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Dx.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=$b(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return ax(t)?kx(e,l)(t):l(t)}function l(t){return Ex(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(uae,d,d)(t)}function d(t){return ox(t)?dx(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||ix(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function fae(e,t,n){return r;function r(t){return ax(t)?kx(e,i)(t):n(t)}function i(t){return Ox(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return ox(t)?dx(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||ix(e)?t(e):n(e)}}var pae={name:`hardBreakEscape`,tokenize:mae};function mae(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return ix(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var hae={name:`headingAtx`,resolve:gae,tokenize:_ae};function gae(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Jb(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _ae(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||ax(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||ix(n)?(e.exit(`atxHeading`),t(n)):ox(n)?dx(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||ax(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var vae=`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`.split(`.`),Ax=[`pre`,`script`,`style`,`textarea`],yae={concrete:!0,name:`htmlFlow`,resolveTo:Sae,tokenize:Cae},bae={partial:!0,tokenize:Tae},xae={partial:!0,tokenize:wae};function Sae(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cae(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):ex(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ex(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ex(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||ax(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ax.includes(l)?(i=1,r.interrupt?t(s):O(s)):vae.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||tx(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return ox(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ex(t)?(e.consume(t),b):ox(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||tx(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):ox(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):ox(t)?(e.consume(t),S):w(t)}
vendor: 19,216 bytes, lines 28-30
28function C(t){return t===c?(e.consume(t),c=null,T):t===null||ix(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||ax(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||ox(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||ix(t)?O(t):ox(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),te):ix(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(bae,ie,k)(t)):t===null||ix(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(xae,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||ix(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ne):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Ax.includes(n)?(e.consume(t),re):O(t)}return ex(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),ne):O(t)}function re(t){return t===null||ix(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function wae(e,t,n){let r=this;return i;function i(t){return ix(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Tae(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(_x,t,n)}}var Eae={name:`htmlText`,tokenize:Dae};function Dae(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ex(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ex(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):ix(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):ix(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):ix(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):ix(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return ex(t)?(e.consume(t),S):n(t)}function S(t){return t===45||tx(t)?(e.consume(t),S):C(t)}function C(t){return ix(t)?(o=C,N(t)):ox(t)?(e.consume(t),C):M(t)}function w(t){return t===45||tx(t)?(e.consume(t),w):t===47||t===62||ax(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||ex(t)?(e.consume(t),E):ix(t)?(o=T,N(t)):ox(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||tx(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):ix(t)?(o=D,N(t)):ox(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):ix(t)?(o=O,N(t)):ox(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):ix(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||ax(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||ax(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return ox(t)?dx(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var jx={name:`labelEnd`,resolveAll:jae,resolveTo:Mae,tokenize:Nae},Oae={tokenize:Pae},kae={tokenize:Fae},Aae={tokenize:Iae};function jae(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Jb(e,0,e.length,n),e}function Mae(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Yb(s,e.slice(a+1,a+r+3)),s=Yb(s,[[`enter`,u,t]]),s=Yb(s,mx(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Yb(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Yb(s,e.slice(o+1)),s=Yb(s,[[`exit`,c,t]]),Jb(e,a,e.length,s),e}function Nae(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes($b(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Oae,u,o?u:d)(t):t===91?e.attempt(kae,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Aae,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Pae(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return ax(t)?kx(e,a)(t):a(t)}function a(t){return t===41?u(t):Ex(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return ax(t)?kx(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ox(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return ax(t)?kx(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Fae(e,t,n){let r=this;return i;function i(t){return Dx.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes($b(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Iae(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Lae={name:`labelStartImage`,resolveAll:jx.resolveAll,tokenize:Rae};function Rae(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var zae={name:`labelStartLink`,resolveAll:jx.resolveAll,tokenize:Bae};function Bae(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Mx={name:`lineEnding`,tokenize:Vae};function Vae(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),dx(e,t,`linePrefix`)}}var Nx={name:`thematicBreak`,tokenize:Hae};function Hae(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||ix(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),ox(t)?dx(e,s,`whitespace`)(t):s(t))}}var Px={continuation:{tokenize:Kae},exit:Jae,name:`list`,tokenize:Gae},Uae={partial:!0,tokenize:Yae},Wae={partial:!0,tokenize:qae};function Gae(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:rx(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Nx,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return rx(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(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(_x,r.interrupt?n:u,e.attempt(Uae,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return ox(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Kae(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(_x,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dx(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!ox(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wae,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,dx(e,e.attempt(Px,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function qae(e,t,n){let r=this;return dx(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Jae(e){e.exit(this.containerState.type)}function Yae(e,t,n){let r=this;return dx(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!ox(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Fx={name:`setextUnderline`,resolveTo:Xae,tokenize:Zae};function Xae(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Zae(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),ox(t)?dx(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||ix(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Qae={tokenize:$ae};function $ae(e){let t=this,n=e.attempt(_x,r,e.attempt(this.parser.constructs.flowInitial,i,dx(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iae,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var eoe={resolveAll:Lx()},toe=Ix(`string`),noe=Ix(`text`);function Ix(e){return{resolveAll:Lx(e===`text`?roe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Lx(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function roe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ioe=c({attentionMarkers:()=>foe,contentInitial:()=>ooe,disable:()=>poe,document:()=>aoe,flow:()=>coe,flowInitial:()=>soe,insideSpan:()=>doe,string:()=>loe,text:()=>uoe}),aoe={42:Px,43:Px,45:Px,48:Px,49:Px,50:Px,51:Px,52:Px,53:Px,54:Px,55:Px,56:Px,57:Px,62:vx},ooe={91:lae},soe={[-2]:Cx,[-1]:Cx,32:Cx},coe={35:hae,42:Nx,45:[Fx,Nx],60:yae,61:Fx,95:Nx,96:Sx,126:Sx},loe={38:bx,92:yx},uoe={[-5]:Mx,[-4]:Mx,[-3]:Mx,33:Lae,38:bx,42:hx,60:[zie,Eae],91:zae,92:[pae,yx],93:jx,95:hx,96:Qie},doe={null:[hx,eoe]},foe={null:[42,95]},poe={null:[]};function moe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Yb(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=mx(a,l.events,l),l.events):[]}function f(e,t){return goe(p(e),t)}function p(e){return hoe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){ix(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Jb(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hoe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function goe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=` 29`;break;case-3:o=`\r 30`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function _oe(e){let t={constructs:Zb([ioe,...(e||{}).extensions||[]]),content:n(Mie),defined:[],document:n(Pie),flow:n(Qae),lazy:{},string:n(toe),text:n(noe)};return t;function n(e){return n;function n(n){return moe(t,e,n)}}}function voe(e){for(;!Tx(e););return e}var Rx=/[\0\t\n\r]/g;function yoe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Rx.lastIndex=u,c=Rx.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var boe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xoe(e){return e.replace(boe,Soe)}function Soe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;
vendor: 11,241 bytes, lines 30-32
30return Qb(n.slice(t?2:1),t?16:10)}return qb(n)||e}var zx={}.hasOwnProperty;function Coe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),woe(n)(voe(_oe(n).document().write(yoe()(e,t,!0))))}function woe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Vx(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];zx.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Hx).call(a,void 0,e[0])}for(r.position={start:Bx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Bx(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 i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){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:Bx(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Hx).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ab({start:e.start,end:e.end})+`): itâs not open`);n.position.end=Bx(e.end)}function u(){return Ub(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$b(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:Bx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Bx(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Bx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let 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 N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let 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 ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=xoe(t),n.identifier=$b(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$b(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Qb(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=qb(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=Bx(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function Bx(e){return{line:e.line,column:e.column,offset:e.offset}}function Vx(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Vx(e,r):Toe(e,r)}}function Toe(e,t){let n;for(n in t)if(zx.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Hx(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ab({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ab({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ab({start:t.start,end:t.end})+`) is still open`)}function Eoe(e){let t=this;t.parser=n;function n(n){return Coe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Doe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ooe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:` 31`}]}function koe(e,t){let n=t.value?t.value+` 32`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Aoe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function joe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}
vendor: 4,668 bytes, lines 32-34
32function Moe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=ux(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Noe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Poe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ux(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Foe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ux(e,t);let i={src:ux(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Ioe(e,t){let n={src:ux(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Loe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Roe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ux(e,t);let i={href:ux(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zoe(e,t){let n={href:ux(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Boe(e,t,n){let r=e.all(t),i=n?Voe(n):Wx(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?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:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:` 33`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:` 34`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Voe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Wx(n[r])}return t}function Wx(e){return e.spread??e.children.length>1}function Hoe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Uoe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Woe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Goe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Koe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Ob(t.children[1]),o=Db(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{}
vendor: 4,085 bytes, line 34
34,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function qoe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Joe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Gx=9,Kx=32;function Yoe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(qx(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(qx(t.slice(i),i>0,!1)),a.join(``)}function qx(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Gx||t===Kx;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Gx||t===Kx;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Xoe(e,t){let n={type:`text`,value:Yoe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Zoe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Qoe={blockquote:Doe,break:Ooe,code:koe,delete:Aoe,emphasis:joe,footnoteReference:Moe,heading:Noe,html:Poe,imageReference:Foe,image:Ioe,inlineCode:Loe,linkReference:Roe,link:zoe,listItem:Boe,list:Hoe,paragraph:Uoe,root:Woe,strong:Goe,table:Koe,tableCell:Joe,tableRow:qoe,text:Xoe,thematicBreak:Zoe,toml:Jx,yaml:Jx,definition:Jx,footnoteDefinition:Jx};function Jx(){}var Yx=typeof self==`object`?self:globalThis,Xx=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Yx[e](t)},$oe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Yx[e]==`function`?Xx(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Xx(a,o),i)};return r},Zx=e=>$oe(new Map,e)(0),Qx=``,{toString:ese}={},{keys:tse}=Object,$x=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=ese.call(e).slice(8,-1);switch(n){case`Array`:return[1,Qx];case`Object`:return[2,Qx];case`Date`:return[3,Qx];case`RegExp`:return[4,Qx];case`Map`:return[5,Qx];case`Set`:return[6,Qx];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},eS=([e,t])=>e===0&&(t===`function`||t===`symbol`),nse=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=$x(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of tse(r))(e||!eS($x(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Qx:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);
vendor: 2,798 bytes, lines 34-36
34for(let[n,i]of r)(e||!(eS($x(n))||eS($x(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!eS($x(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},tS=(e,{json:t,lossy:n}={})=>{let r=[];return nse(!(t||n),!!t,new Map,r)(e),r},nS=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Zx(tS(e,t)):structuredClone(e):(e,t)=>Zx(tS(e,t));function rse(e,t){let n=[{type:`text`,value:`â©`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function ise(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ase(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||rse,r=e.options.footnoteBackLabel||ise,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=ux(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...nS(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` 35`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` 36`}]}}var rS=(function(e){if(e==null)return lse;if(typeof e==`function`)return iS(e);if(typeof e==`object`)return Array.isArray(e)?ose(e):sse(e);if(typeof e==`string`)return cse(e);throw Error(`Expected function, string, or object as test`)});function ose(e){let t=[],n=-1;for(;++n<e.length;)t[n]=rS(e[n]);return iS(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sse(e){let t=e;return iS(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function cse(e){return iS(t);function t(t){return t&&t.type===e}}function iS(e){return t;
vendor: 9,186 bytes, lines 36-40
36function t(t,n,r){return!!(use(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function lse(){return!0}function use(e){return typeof e==`object`&&!!e&&`type`in e}function dse(e){return e}var aS=[];function oS(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=rS(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+dse(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=aS,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=fse(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function fse(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?aS:[e]}function sS(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),oS(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var cS={}.hasOwnProperty,pse={};function mse(e,t){let n=t||pse,r=new Map,i=new Map,a={all:s,applyData:gse,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Qoe,...n.handlers},one:o,options:n,patch:hse,wrap:vse};return sS(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(cS.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=nS(n);return r.children=a.all(e),r}return nS(e)}return(a.options.unknownHandler||_se)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=lS(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=lS(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function hse(e,t){e.position&&(t.position=rie(e))}function gse(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,nS(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function _se(e,t){let n=t.data||{},r=`value`in t&&!(cS.call(n,`hProperties`)||cS.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vse(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:` 37`});++r<e.length;)r&&n.push({type:`text`,value:` 38`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:` 39`}),n}function lS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uS(e,t){let n=mse(e,t),r=n.one(e,void 0),i=ase(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` 40`},i)),a}function yse(e,t){return e&&`run`in e?async function(n,r){let i=uS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return uS(n,{file:r,...e||t})}}function dS(e){if(e)throw e}var bse=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function fS(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xse(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Sse(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Sse(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var pS={basename:Cse,dirname:wse,extname:Tse,join:Ese,sep:`/`};function Cse(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);mS(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function wse(e){if(mS(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Tse(e){mS(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ese(...e){let t=-1,n;for(;++t<e.length;)mS(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Dse(n)}function Dse(e){mS(e);let t=e.codePointAt(0)===47,n=Ose(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ose(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function mS(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var kse={cwd:Ase};function Ase(){return`/`}function hS(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function jse(e){if(typeof e==`string`)e=new URL(e);else if(!hS(e)){let t=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(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Mse(e)}function Mse(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var gS=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],_S=class{constructor(e){let t;t=e?hS(e)?{path:e}:typeof e==`string`||Nse(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:kse.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<gS.length;){let e=gS[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)gS.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?pS.basename(this.path):void 0}
vendor: 14,725 bytes, lines 40-41
40set basename(e){yS(e,`basename`),vS(e,`basename`),this.path=pS.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?pS.dirname(this.path):void 0}set dirname(e){bS(this.basename,`dirname`),this.path=pS.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?pS.extname(this.path):void 0}set extname(e){if(vS(e,`extname`),bS(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=pS.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){hS(e)&&(e=jse(e)),yS(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?pS.basename(this.path,this.extname):void 0}set stem(e){yS(e,`stem`),vS(e,`stem`),this.path=pS.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Pb(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){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function vS(e,t){if(e&&e.includes(pS.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+pS.sep+"`")}function yS(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function bS(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Nse(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Pse=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),xS=u(bse(),1),Fse={}.hasOwnProperty,Ise=new class e extends Pse{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=xse()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,xS.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(wS(`data`,this.frozen),this.namespace[e]=t,this):Fse.call(this.namespace,e)&&this.namespace[e]||void 0:e?(wS(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=DS(e),n=this.parser||this.Parser;return SS(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),SS(`process`,this.parser||this.Parser),CS(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=DS(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Rse(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),SS(`processSync`,this.parser||this.Parser),CS(`processSync`,this.compiler||this.Compiler),this.process(e,r),ES(`processSync`,`process`,t),n;function r(e,r){t=!0,dS(e),n=r}}run(e,t,n){TS(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=DS(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ES(`runSync`,`run`,n),r;function i(e,t){dS(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=DS(t),r=this.compiler||this.Compiler;return CS(`stringify`,r),TS(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(wS(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,xS.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];fS(o)&&fS(r)&&(r=(0,xS.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function SS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function CS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function wS(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TS(e){if(!fS(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ES(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function DS(e){return Lse(e)?e:new _S(e)}function Lse(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Rse(e){return typeof e==`string`||zse(e)}function zse(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var OS=[],kS={allowDangerousHtml:!0},Bse=/^(https?|ircs?|mailto|xmpp)$/i,Vse=[{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:`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 Hse(e){let t=Use(e),n=Wse(e);return Gse(t.runSync(t.parse(n),n),e)}function Use(e){let t=e.rehypePlugins||OS,n=e.remarkPlugins||OS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kS}:kS;return Ise().use(Eoe).use(n).use(yse,r).use(t)}function Wse(e){let t=e.children||``,n=new _S;return typeof t==`string`?n.value=t:``+t,n}function Gse(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Kse;for(let e of Vse)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return t.className&&(e={type:`element`,tagName:`div`,properties:{className:t.className},children:e.type===`root`?e.children:[e]}),sS(e,l),lie(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Hb)if(Object.hasOwn(Hb,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Hb[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Kse(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Bse.test(e.slice(0,t))?e:``}function AS(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qse(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function jS(e,t,n){let r=rS((n||{}).ignore||[]),i=Jse(t),a=-1;for(;++a<i.length;)oS(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Jse(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Yse(e[0]),Xse(e[1])])}return t}function Yse(e){return typeof e==`string`?new RegExp(qse(e),`g`):e}function Xse(e){return typeof e==`function`?e:function(){return e}}var MS=`phrasing`,NS=[`autolink`,`link`,`image`,`label`];function Zse(){return{transforms:[ice],enter:{literalAutolink:$se,literalAutolinkEmail:PS,literalAutolinkHttp:PS,literalAutolinkWww:PS},exit:{literalAutolink:rce,literalAutolinkEmail:nce,literalAutolinkHttp:ece,literalAutolinkWww:tce}}}function Qse(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:MS,notInConstruct:NS},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:MS,notInConstruct:NS},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:MS,notInConstruct:NS}]}}function $se(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function PS(e){this.config.enter.autolinkProtocol.call(this,e)}function ece(e){this.config.exit.autolinkProtocol.call(this,e)}function tce(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function nce(e){this.config.exit.autolinkEmail.call(this,e)}function rce(e){this.exit(e)}function ice(e){jS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ace],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oce]],{ignore:[`link`,`linkReference`]})}function ace(e,t,n,r,i){let a=``;if(!FS(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!sce(n)))return!1;let o=cce(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function oce(e,t,n,r){return!FS(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function sce(e){let t=e.split(`.`);return!(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])))}function cce(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=AS(e,`(`),a=AS(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function FS(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||cx(n)||sx(n))&&(!t||n!==47)}IS.peek=_ce;function lce(){this.buffer()}function uce(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function dce(){this.buffer()}function fce(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function pce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$b(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mce(e){this.exit(e)}function hce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$b(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gce(e){this.exit(e)}function _ce(){return`[`}function IS(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function vce(){return{enter:{gfmFootnoteCallString:lce,gfmFootnoteCall:uce,gfmFootnoteDefinitionLabelString:dce,gfmFootnoteDefinition:fce},exit:{gfmFootnoteCallString:pce,gfmFootnoteCall:mce,gfmFootnoteDefinitionLabelString:hce,gfmFootnoteDefinition:gce}}}function yce(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:IS},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` 41`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?LS:bce))),s(),o}}function bce(e,t,n){return t===0?e:LS(e,t,n)}function LS(e,t,n){return(n?``:` `)+e}var xce=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];RS.peek=Ece;function Sce(){return{canContainEols:[`delete`],enter:{strikethrough:wce},exit:{strikethrough:Tce}}}function Cce(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:xce}],handlers:{delete:RS}}}function wce(e){this.enter({type:`delete`,children:[]},e)}function Tce(e){this.exit(e)}function RS(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Ece(){return`~`}function Dce(e){return e.length}function Oce(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Dce,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=kce(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}
vendor: 6,891 bytes, lines 41-53
41o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=zS(r[d]);else{let e=zS(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(` 42`)}function kce(e){return e==null?``:String(e)}function zS(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ace(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),jce);return i(),o}function jce(e,t,n){return`>`+(n?``:` `)+e}function Mce(e,t){return BS(e,t.inConstruct,!0)&&!BS(e,t.notInConstruct,!1)}function BS(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function VS(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===` 43`&&Mce(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\ 44`}function Nce(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Pce(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Fce(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ice(e,t,n,r){let i=Fce(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Pce(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Lce);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Nce(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` 45`,encode:["`"],...s.current()})),t()}return u+=s.move(` 46`),a&&(u+=s.move(a+` 47`)),u+=s.move(c),l(),u}function Lce(e,t,n){return(n?``:` `)+e}function HS(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Rce(e,t,n,r){let i=HS(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` 48`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function zce(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function US(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function WS(e,t,n){let r=px(e),i=px(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}GS.peek=Bce;function GS(e,t,n,r){let i=zce(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=WS(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=US(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=WS(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+US(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Bce(e,t,n){return n.options.emphasis||`*`}function Vce(e,t){let n=!1;return sS(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ub(e)&&(t.options.setext||n))}function Hce(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Vce(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` 49`,after:` 50`});return r(),t(),o+` 51`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` 52`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` 53`,...a.current()});return/^[\t ]/.test(l)&&(l=US(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}KS.peek=Uce;function KS(e){return e.value||``}function Uce(){return`<`}qS.peek=Wce;function qS(e,t,n,r){let i=HS(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Wce(){return`!`}JS.peek=Gce;function JS(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Gce(){return`!`}YS.peek=Kce;
vendor: 11,517 bytes, lines 53-55
53function YS(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Kce(){return"`"}function XS(e,t){let n=Ub(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ZS.peek=qce;function ZS(e,t,n,r){let i=HS(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(XS(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function qce(e,t,n){return XS(e,n)?`<`:`[`}QS.peek=Jce;function QS(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Jce(){return`[`}function $S(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Yce(e){let t=$S(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Xce(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function eC(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Zce(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Xce(n):$S(n),s=e.ordered?o===`.`?`)`:`.`:Yce(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),eC(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Qce(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $ce(e,t,n,r){let i=Qce(n),a=n.bulletCurrent||$S(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ele(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var tle=rS([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function nle(e,t,n,r){return(e.children.some(function(e){return tle(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rle(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tC.peek=ile;function tC(e,t,n,r){let i=rle(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=WS(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=US(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=WS(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+US(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ile(e,t,n){return n.options.strong||`*`}function ale(e,t,n,r){return n.safe(e.value,r)}function ole(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sle(e,t,n){let r=(eC(n)+(n.options.ruleSpaces?` `:``)).repeat(ole(n));return n.options.ruleSpaces?r.slice(0,-1):r}var nC={blockquote:Ace,break:VS,code:Ice,definition:Rce,emphasis:GS,hardBreak:VS,heading:Hce,html:KS,image:qS,imageReference:JS,inlineCode:YS,link:ZS,linkReference:QS,list:Zce,listItem:$ce,paragraph:ele,root:nle,strong:tC,text:ale,thematicBreak:sle};function cle(){return{enter:{table:lle,tableData:iC,tableHeader:iC,tableRow:dle},exit:{codeText:fle,table:ule,tableData:rC,tableHeader:rC,tableRow:rC}}}function lle(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function ule(e){this.exit(e),this.data.inTable=void 0}function dle(e){this.enter({type:`tableRow`,children:[]},e)}function rC(e){this.exit(e)}function iC(e){this.enter({type:`tableCell`,children:[]},e)}function fle(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ple));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ple(e,t){return t===`|`?t:e}function mle(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` 54`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` 55`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Oce(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=nC.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function hle(){return{exit:{taskListCheckValueChecked:aC,taskListCheckValueUnchecked:aC,paragraph:_le}}}function gle(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:vle}}}function aC(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function _le(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function vle(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=nC.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function yle(){return[Zse(),vce(),Sce(),cle(),hle()]}function ble(e){return{extensions:[Qse(),yce(e),Cce(),mle(e),gle()]}}var xle={tokenize:Dle,partial:!0},oC={tokenize:Ole,partial:!0},sC={tokenize:kle,partial:!0},cC={tokenize:Ale,partial:!0},Sle={tokenize:jle,partial:!0},lC={name:`wwwAutolink`,tokenize:Tle,previous:mC},uC={name:`protocolAutolink`,tokenize:Ele,previous:hC},dC={name:`emailAutolink`,tokenize:wle,previous:gC},fC={};function Cle(){return{text:fC}}for(var pC=48;pC<123;)fC[pC]=dC,pC++,pC===58?pC=65:pC===91&&(pC=97);fC[43]=dC,fC[45]=dC,fC[46]=dC,fC[95]=dC,fC[72]=[dC,uC],fC[104]=[dC,uC],fC[87]=[dC,lC],fC[119]=[dC,lC];function wle(e,t,n){let r=this,i,a;return o;function o(t){return!_C(t)||!gC.call(r,r.previous)||vC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _C(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Sle,u,l)(t):t===45||t===95||tx(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ex(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Tle(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!mC.call(r,r.previous)||vC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xle,e.attempt(oC,e.attempt(sC,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Ele(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&hC.call(r,r.previous)&&!vC(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ex(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||nx(t)||ax(t)||cx(t)||sx(t)?n(t):e.attempt(oC,e.attempt(sC,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Dle(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Ole(e,t,n){let r,i,a;return o;
vendor: 9,663 bytes, line 55
55function o(t){return t===46||t===95?e.check(cC,c,s)(t):t===null||ax(t)||cx(t)||t!==45&&sx(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function kle(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(cC,t,a)(o):o===null||ax(o)||cx(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ale(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ax(o)||cx(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||ax(e)||cx(e)?t(e):r(e)}function a(e){return ex(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ex(t)?(e.consume(t),o):n(t)}}function jle(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return tx(e)?n(e):t(e)}}function mC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ax(e)}function hC(e){return!ex(e)}function gC(e){return!(e===47||_C(e))}function _C(e){return e===43||e===45||e===46||e===95||tx(e)}function vC(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Mle={tokenize:Ble,partial:!0};function Nle(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Lle,continuation:{tokenize:Rle},exit:zle}},text:{91:{name:`gfmFootnoteCall`,tokenize:Ile},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ple,resolveTo:Fle}}}}function Ple(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=$b(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Fle(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Ile(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||ax(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes($b(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return ax(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Lle(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||ax(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=$b(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return ax(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),dx(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Rle(e,t,n){return e.check(_x,t,e.attempt(Mle,t,n))}function zle(e){e.exit(`gfmFootnoteDefinition`)}function Ble(e,t,n){let r=this;return dx(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Vle(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&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`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Jb(o,o.length,0,mx(s,e.slice(r+1,n),t)),Jb(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Jb(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=px(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=px(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Hle=class{constructor(){this.map=[]}add(e,t,n){Ule(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,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(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Ule(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Wle(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Gle(){return{flow:{null:{name:`table`,tokenize:Kle,resolveAll:qle}}}}function Kle(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):ix(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):ox(t)?dx(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||ax(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,ox(t)?dx(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return ox(t)?dx(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||i
55x(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return ox(t)?dx(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||ix(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||ix(n)?(e.exit(`tableRow`),t(n)):ox(n)?dx(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||ax(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function qle(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Hle;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(bC(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=yC(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=yC(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=yC(f,t,o,i,n,d)):(o[0]=o[1],d=yC(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&bC(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Wle(t.events,n))}return e}function yC(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},xC(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=xC(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=xC(t.events,n[2]),a=xC(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},xC(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function bC(e,t,n,r,i){let a=[],o=xC(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function xC(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Jle={name:`tasklistCheck`,tokenize:Xle};function Yle(){return{text:{91:Jle}}}function Xle(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return ax(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return ix(r)?t(r):ox(r)?e.check({tokenize:Zle},t,n)(r):n(r)}}function Zle(e,t,n){return dx(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Qle(e){return Zb([Cle(),Nle(),Vle(e),Gle(),Yle()])}var $le={};function eue(e){let t=this,n=e||$le,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Qle(n)),a.push(yle()),o.push(ble(n))}function tue(e){jS(e,[/\r?\n|\r/g,nue])}function nue(){return{type:`break`}}function rue(){return function(e){tue(e)}}var SC=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`textarea`,{className:z(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));SC.displayName=`Textarea`;var CC=globalThis?.document?y.useLayoutEffect:()=>{};function iue(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var wC=e=>{let{present:t,children:n}=e,r=aue(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=bl(r.ref,oue(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null};wC.displayName=`Presence`;function aue(e){let[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef(`none`),[o,s]=iue(e?`mounted`:`unmounted`,{mou
55nted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{let e=TC(r.current);a.current=o===`mounted`?e:`none`},[o]),CC(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=TC(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),CC(()=>{if(t){let e=e=>{let n=TC(r.current).includes(e.animationName);e.target===t&&n&&b.flushSync(()=>s(`ANIMATION_END`))},n=e=>{e.target===t&&(a.current=TC(r.current))};return t.addEventListener(`animationstart`,n),t.addEventListener(`animationcancel`,e),t.addEventListener(`animationend`,e),()=>{t.removeEventListener(`animationstart`,n),t.removeEventListener(`animationcancel`,e),t.removeEventListener(`animationend`,e)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:y.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function TC(e){return e?.animationName||`none`}function oue(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sue(e,t){let n=y.createContext(t);function r(e){let{children:t,...r}=e,i=y.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})}function i(r){let i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+`Provider`,[r,i]}function EC(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r),a=n.length;n=[...n,r];function o(t){let{scope:n,children:r,...o}=t,s=n?.[e][a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})}function s(n,o){let s=o?.[e][a]||i,c=y.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+`Provider`,[o,s]}let i=()=>{let t=n.map(e=>y.createContext(e));return function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,cue(i,...t)]}function cue(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function DC(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}var lue=y.createContext(void 0);function OC(e){let t=y.useContext(lue);return e||t||`ltr`}function kC(e,[t,n]){return Math.min(n,Math.max(t,e))}function K(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function uue(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var AC=`ScrollArea`,[jC,due]=EC(AC),[fue,MC]=jC(AC),NC=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=y.useState(null),[l,u]=y.useState(null),[d,f]=y.useState(null),[p,m]=y.useState(null),[h,g]=y.useState(null),[_,v]=y.useState(0),[b,x]=y.useState(0),[S,C]=y.useState(!1),[w,T]=y.useState(!1),E=bl(t,e=>c(e)),D=OC(i);return(0,F.jsx)(fue,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,F.jsx)(U.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});NC.displayName=AC;var PC=`ScrollAreaViewport`,FC=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=MC(PC,n),s=bl(t,y.useRef(null),o.onViewportChange);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,F.jsx)(U.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,F.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,dis
vendor: 7,602 bytes, line 55
55play:`table`},children:r})})]})});FC.displayName=PC;var IC=`ScrollAreaScrollbar`,LC=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=MC(IC,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return y.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,F.jsx)(pue,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,F.jsx)(mue,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,F.jsx)(RC,{...r,ref:t,forceMount:n}):i.type===`always`?(0,F.jsx)(zC,{...r,ref:t}):null});LC.displayName=IC;var pue=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=MC(IC,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,F.jsx)(wC,{present:n||a,children:(0,F.jsx)(RC,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),mue=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=MC(IC,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=ew(()=>c(`SCROLL_END`),100),[s,c]=uue(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return y.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),y.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,F.jsx)(wC,{present:n||s!==`hidden`,children:(0,F.jsx)(zC,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:K(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:K(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),RC=y.forwardRef((e,t)=>{let n=MC(IC,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),s=e.orientation===`horizontal`,c=ew(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return tw(n.viewport,c),tw(n.content,c),(0,F.jsx)(wC,{present:r||a,children:(0,F.jsx)(zC,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),zC=y.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=MC(IC,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[s,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=qC(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return YC(e,o.current,s,t)}return n===`horizontal`?(0,F.jsx)(hue,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=XC(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,F.jsx)(gue,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=XC(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),hue=y.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=MC(IC,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=bl(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(VC,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":JC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),QC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:KC(o.paddingLeft),paddingEnd:KC(o.paddingRight)}})}})}),gue=y.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=MC(IC,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=bl(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(VC,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":JC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),QC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:KC(o.paddingTop),paddingEnd:KC(o.paddingBottom)}})}})}),[_ue,BC]=jC(IC),VC=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=MC(IC,n),[m,h]=y.useState(null),g=bl(t,e=>h(e)),_=y.useRef(null),v=y.useRef(``),b=p.viewport,x=r.content-r.viewport,S=DC(u),C=DC(c),w=ew(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return y.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),y.useEffect(C,[r,C]),tw(m,w),tw(p.content,w),(0,F.jsx)(_ue,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:DC(a),onThumbPointerUp:DC(o),onThumbPositionChange:C,onThumbPointerDown:DC(s),children:(0,F.jsx)(U.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:K(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:K(e.onPointerMove,T),onPointerUp:K(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),HC=`ScrollAreaThumb`,UC=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=BC(HC,e.__scopeScrollArea);return(0,F.jsx)(wC,{present:n||i.hasThumb,children:(0,F.jsx)(vue,{ref:t,...r})})}),vue=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=MC(HC,n),o=BC(HC,n),{onThumbPositionChange:s}=o,c=bl(t,e=>o.onThumbChange(e)),l=y.useRef(),u=ew(()=>{l.current&&=(l.current(),void 0)},100);return y.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=$C(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,F.jsx)(U.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,he
55ight:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:K(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:K(e.onPointerUp,o.onThumbPointerUp)})});UC.displayName=HC;var WC=`ScrollAreaCorner`,GC=y.forwardRef((e,t)=>{let n=MC(WC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,F.jsx)(yue,{...e,ref:t}):null});GC.displayName=WC;var yue=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=MC(WC,n),[a,o]=y.useState(0),[s,c]=y.useState(0),l=!!(a&&s);return tw(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),tw(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,F.jsx)(U.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function KC(e){return e?parseInt(e,10):0}function qC(e,t){let n=e/t;return isNaN(n)?0:n}function JC(e){let t=qC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function YC(e,t,n,r=`ltr`){let i=JC(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ZC([c,l],d)(e)}function XC(e,t,n=`ltr`){let r=JC(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=kC(e,n===`ltr`?[0,o]:[o*-1,0]);return ZC([0,o],[0,s])(c)}function ZC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function QC(e,t){return e>0&&e<t}var $C=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function ew(e,t){let n=DC(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function tw(e,t){let n=DC(t);CC(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var nw=NC,bue=FC,xue=GC,rw=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(nw,{ref:r,className:z(`relative overflow-hidden`,e),...n,children:[(0,F.jsx)(bue,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,F.jsx)(iw,{}),(0,F.jsx)(xue,{})]}));rw.displayName=nw.displayName;var iw=y.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,F.jsx)(LC,{ref:r,orientation:t,className:z(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,F.jsx)(UC,{className:`relative flex-1 rounded-full bg-border`})}));iw.displayName=LC.displayName;function Sue(e,t){let n=y.createContext(t),r=e=>{let{children:t,...r}=e,i=y.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Cue(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=y.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>y.createContext(e));return function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,wue(i,...t)]}function wue(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Tue=y.useId||(()=>void 0),Eue=0;function aw(e){let[t,n]=y.useState(Tue());return CC(()=>{e||n(e=>e??String(Eue++))},[e]),e||(t?`radix-${t}`:``)}function ow({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=Due({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=DC(n);return[o,y.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function Due({defaultProp:e,onChange:t}){let n=y.useState(e),[r]=n,i=y.useRef(r),a=DC(t);return y.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function sw(e,t=globalThis?.document){let n=DC(e);y.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};
vendor: 18,672 bytes, lines 55-95
55return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Oue=`DismissableLayer`,cw=`dismissableLayer.update`,lw=`dismissableLayer.pointerDownOutside`,uw=`dismissableLayer.focusOutside`,dw,fw=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pw=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(fw),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=Aue(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=jue(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(dw=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),hw(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=dw)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),hw())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(cw,e),()=>document.removeEventListener(cw,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});pw.displayName=Oue;var mw=`DismissableLayerBranch`,kue=y.forwardRef((e,t)=>{let n=y.useContext(fw),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});kue.displayName=mw;function Aue(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){gw(lw,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function jue(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&gw(uw,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hw(){let e=new CustomEvent(cw);document.dispatchEvent(e)}function gw(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var _w=`focusScope.autoFocusOnMount`,vw=`focusScope.autoFocusOnUnmount`,yw={bubbles:!1,cancelable:!0},Mue=`FocusScope`,bw=y.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=y.useState(null),l=DC(i),u=DC(a),d=y.useRef(null),f=bl(t,e=>c(e)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Cw(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Cw(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Cw(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){ww.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(_w,yw);s.addEventListener(_w,l),s.dispatchEvent(t),t.defaultPrevented||(Nue(Rue(xw(s)),{select:!0}),document.activeElement===e&&Cw(s))}return()=>{s.removeEventListener(_w,l),setTimeout(()=>{let t=new CustomEvent(vw,yw);s.addEventListener(vw,u),s.dispatchEvent(t),t.defaultPrevented||Cw(e??document.body,{select:!0}),s.removeEventListener(vw,u),ww.remove(p)},0)}}},[s,l,u,p]);let m=y.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Pue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Cw(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Cw(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,F.jsx)(U.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});bw.displayName=Mue;function Nue(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Cw(r,{select:t}),document.activeElement!==n)return}function Pue(e){let t=xw(e);return[Sw(t,e),Sw(t.reverse(),e)]}function xw(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sw(e,t){for(let n of e)if(!Fue(n,{upTo:t}))return n}function Fue(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Iue(e){return e instanceof HTMLInputElement&&`select`in e}function Cw(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Iue(e)&&t&&e.select()}}var ww=Lue();function Lue(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Tw(e,t),e.unshift(t)},remove(t){e=Tw(e,t),e[0]?.resume()}}}function Tw(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Rue(e){return e.filter(e=>e.tagName!==`A`)}var zue=`Portal`,Ew=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});Ew.displayName=zue;function Bue(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var Dw=e=>{let{present:t,children:n}=e,r=Vue(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=bl(r.ref,Hue(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null};Dw.displayName=`Presence`;function Vue(e){let[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef(`none`),[o,s]=Bue(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{let e=Ow(r.current);a.current=o===`mounted`?e:`none`},[o]),CC(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ow(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),CC(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ow(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ow(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:y.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function Ow(e){return e?.animationName||`none`}function Hue(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kw=0;function Uue(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Aw()),document.body.insertAdjacentElement(`beforeend`,e[1]??Aw()),kw++,()=>{kw===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),kw--}},[])}function Aw(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var jw=function(){return jw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jw.apply(this,arguments)};function Mw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Nw(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Pw=`right-scroll-bar-position`,Fw=`width-before-scroll-bar`,Wue=`with-scroll-bars-hidden`,Gue=`--removed-body-scroll-bar-size`;function Iw(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lw(e,t){var n=(0,y.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Rw=typeof window<`u`?y.useLayoutEffect:y.useEffect,zw=new WeakMap;function Bw(e,t){var n=Lw(t||null,function(t){return e.forEach(function(e){return Iw(e,t)})});return Rw(function(){var t=zw.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Iw(e,null)}),i.forEach(function(e){r.has(e)||Iw(e,a)})}zw.set(n,e)},[e]),n}function Vw(e){return e}function Hw(e,t){t===void 0&&(t=Vw);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Uw(e){e===void 0&&(e={});var t=Hw(null);return t.options=jw({async:!0,ssr:!1},e),t}var Ww=function(e){var t=e.sideCar,n=Mw(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return y.createElement(r,jw({},n))};Ww.isSideCarExport=!0;function Gw(e,t){return e.useMedium(t),Ww}var Kw=Uw(),qw=function(){},Jw=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:qw,onWheelCapture:qw,onTouchMoveCapture:qw}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,g=e.as,_=g===void 0?`div`:g,v=e.gapMode,b=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bw([n,t]),C=jw(jw({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:Kw,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),jw(jw({},C),{ref:S})):y.createElement(_,jw({},C,{className:c,ref:S}),s))});Jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jw.classNames={fullWidth:Fw,zeroRight:Pw};var Yw,Xw=function(){if(Yw)return Yw;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Zw(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xw();return t&&e.setAttribute(`nonce`,t),e}function Qw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $w(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var eT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zw())&&(Qw(t,n),$w(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tT=function(){var e=eT();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nT=function(){var e=tT();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rT={left:0,top:0,right:0,gap:0},iT=function(e){return parseInt(e||``,10)||0},aT=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[iT(n),iT(r),iT(i)]},oT=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rT;var t=aT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},sT=nT(),cT=`data-scroll-locked`,lT=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` 56 .${Wue} { 57 overflow: hidden ${r}; 58 padding-right: ${s}px ${r}; 59 } 60 body[${cT}] { 61 overflow: hidden ${r}; 62 overscroll-behavior: contain; 63 ${[t&&`position: relative ${r};`,n===`margin`&&` 64 padding-left: ${i}px; 65 padding-top: ${a}px; 66 padding-right: ${o}px; 67 margin-left:0; 68 margin-top:0; 69 margin-right: ${s}px ${r}; 70 `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} 71 } 72 73 .${Pw} { 74 right: ${s}px ${r}; 75 } 76 77 .${Fw} { 78 margin-right: ${s}px ${r}; 79 } 80 81 .${Pw} .${Pw} { 82 right: 0 ${r}; 83 } 84 85 .${Fw} .${Fw} { 86 margin-right: 0 ${r}; 87 } 88 89 body[${cT}] { 90 ${Gue}: ${s}px; 91 } 92`},uT=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Kue=function(){y.useEffect(function(){return document.body.setAttribute(cT,(uT()+1).toString()),function(){var e=uT()-1;e<=0?document.body.removeAttribute(cT):document.body.setAttribute(cT,e.toString())}},[])},dT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Kue();var a=y.useMemo(function(){return oT(i)},[i]);return y.createElement(sT,{styles:lT(a,!t,i,n?``:`!important`)})},fT=!1;if(typeof window<`u`)try{var pT=Object.defineProperty({},"passive",{get:function(){return fT=!0,!0}});window.addEventListener(`test`,pT,pT),window.removeEventListener(`test`,pT,pT)}catch{fT=!1}var mT=fT?{passive:!1}:!1,que=function(e){return e.tagName===`TEXTAREA`},hT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!que(e)&&n[t]===`visible`)},Jue=function(e){return hT(e,`overflowY`)},Yue=function(e){return hT(e,`overflowX`)},gT=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_T(e,r)){var i=vT(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Xue=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Zue=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_T=function(e,t){return e===`v`?Jue(t):Yue(t)},vT=function(e,t){return e===`v`?Xue(t):Zue(t)},Que=function(e,t){return e===`h`&&t===`rtl`?-1:1},$ue=function(e,t,n,r,i){var a=Que(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=vT(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_T(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},yT=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bT=function(e){return[e.deltaX,e.deltaY]},xT=function(e){return e&&`current`in e?e.current:e},ede=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tde=function(e){return` 93 .block-interactivity-${e} {pointer-events: none;} 94 .allow-interactivity-${e} {pointer-events: all;} 95`},nde=0,ST=[];function rde(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(nde++)[0],a=y.useState(nT)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(xT),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=yT(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=gT(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=gT(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return $ue(p,t,e,p===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!ST.length||ST[ST.length-1]!==a)){var r=`deltaY`in n?bT(n):yT(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ede(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}
vendor: 6,297 bytes, line 95
95if(!i){var c=(o.current.shards||[]).map(xT).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ide(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=yT(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,bT(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,yT(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return ST.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,mT),document.addEventListener(`touchmove`,c,mT),document.addEventListener(`touchstart`,u,mT),function(){ST=ST.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,mT),document.removeEventListener(`touchmove`,c,mT),document.removeEventListener(`touchstart`,u,mT)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:tde(i)}):null,p?y.createElement(dT,{gapMode:e.gapMode}):null)}function ide(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ade=Gw(Kw,rde),CT=y.forwardRef(function(e,t){return y.createElement(Jw,jw({},e,{ref:t,sideCar:ade}))});CT.classNames=Jw.classNames;var ode=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},wT=new WeakMap,TT=new WeakMap,ET={},DT=0,OT=function(e){return e&&(e.host||OT(e.parentNode))},sde=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=OT(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},cde=function(e,t,n,r){var i=sde(t,Array.isArray(e)?e:[e]);ET[n]||(ET[n]=new WeakMap);var a=ET[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(wT.get(e)||0)+1,l=(a.get(e)||0)+1;wT.set(e,c),a.set(e,l),o.push(e),c===1&&i&&TT.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),DT++,function(){o.forEach(function(e){var t=wT.get(e)-1,i=a.get(e)-1;wT.set(e,t),a.set(e,i),t||(TT.has(e)||e.removeAttribute(r),TT.delete(e)),i||e.removeAttribute(n)}),DT--,DT||(wT=new WeakMap,wT=new WeakMap,TT=new WeakMap,ET={})}},kT=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ode(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live]`))),cde(r,i,n,`aria-hidden`)):function(){return null}},AT=`Dialog`,[jT,lde]=Cue(AT),[ude,MT]=jT(AT),NT=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l=!1,u]=ow({prop:r,defaultProp:i,onChange:a});return(0,F.jsx)(ude,{scope:t,triggerRef:s,contentRef:c,contentId:aw(),titleId:aw(),descriptionId:aw(),open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};NT.displayName=AT;var PT=`DialogTrigger`,FT=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=MT(PT,n),a=bl(t,i.triggerRef);return(0,F.jsx)(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":XT(i.open),...r,ref:a,onClick:K(e.onClick,i.onOpenToggle)})});FT.displayName=PT;var IT=`DialogPortal`,[dde,LT]=jT(IT,{forceMount:void 0}),RT=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=MT(IT,t);return(0,F.jsx)(dde,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,F.jsx)(Dw,{present:n||a.open,children:(0,F.jsx)(Ew,{asChild:!0,container:i,children:e})}))})};RT.displayName=IT;var zT=`DialogOverlay`,BT=y.forwardRef((e,t)=>{let n=LT(zT,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=MT(zT,e.__scopeDialog);return a.modal?(0,F.jsx)(Dw,{present:r||a.open,children:(0,F.jsx)(fde,{...i,ref:t})}):null});BT.displayName=zT;var fde=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=MT(zT,n);return(0,F.jsx)(CT,{as:xl,allowPinchZoom:!0,shards:[i.contentRef],children:(0,F.jsx)(U.div,{"data-state":XT(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),VT=`DialogContent`,HT=y.forwardRef((e,t)=>{let n=LT(VT,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=MT(VT,e.__scopeDialog);return(0,F.jsx)(Dw,{present:r||a.open,children:a.modal?(0,F.jsx)(pde,{...i,ref:t}):(0,F.jsx)(mde,{...i,ref:t})})});HT.displayName=VT;var pde=y.forwardRef((e,t)=>{let n=MT(VT,e.__scopeDialog),r=y.useRef(null),i=bl(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return kT(e)},[]),(0,F.jsx)(UT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault())})}),mde=y.forwardRef((e,t)=>{let n=MT(VT,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,F.jsx)(UT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),UT=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=MT(VT,n),c=y.useRef(null),l=bl(t,c);return Uue(),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(pw,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":XT(s.open
95),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(gde,{titleId:s.titleId}),(0,F.jsx)(vde,{contentRef:c,descriptionId:s.descriptionId})]})]})}),WT=`DialogTitle`,GT=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=MT(WT,n);return(0,F.jsx)(U.h2,{id:i.titleId,...r,ref:t})});GT.displayName=WT;var KT=`DialogDescription`,qT=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=MT(KT,n);return(0,F.jsx)(U.p,{id:i.descriptionId,...r,ref:t})});qT.displayName=KT;var JT=`DialogClose`,YT=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=MT(JT,n);return(0,F.jsx)(U.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});YT.displayName=JT;function XT(e){return e?`open`:`closed`}var ZT=`DialogTitleWarning`,[hde,QT]=Sue(ZT,{contentName:VT,titleName:WT,docsSlug:`dialog`}),gde=({titleId:e})=>{let t=QT(ZT),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 96 97If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 98 99For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},_de=`DialogDescriptionWarning`,vde=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${QT(_de).contentName}}.`;return y.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},yde=NT,bde=FT,$T=RT,eE=BT,tE=HT,nE=GT,rE=qT,iE=YT,aE=yde,oE=bde,xde=$T,sE=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(eE,{ref:n,className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));sE.displayName=eE.displayName;var cE=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(xde,{children:[(0,F.jsx)(sE,{}),(0,F.jsxs)(tE,{ref:r,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,F.jsxs)(iE,{className:`absolute right-4 top-4 roun
99ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,F.jsx)(Q_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));cE.displayName=tE.displayName;var lE=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});lE.displayName=`DialogHeader`;var uE=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});uE.displayName=`DialogFooter`;var dE=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(nE,{ref:n,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));dE.displayName=nE.displayName;var fE=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(rE,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));fE.displayName=rE.displayName;function pE(e){let t=e+`CollectionProvider`,[n,r]=EC(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,F.jsx)(xl,{ref:bl(t,a(s,n).collectionRef),children:r})});c.displayName=s;let l=e+`CollectionItemSlot`,u=`data-radix-collection-item`,d=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=bl(t,o),c=a(l,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(xl,{[u]:``,ref:s,children:r})});d.displayName=l;function f(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:c,ItemSlot:d},f,r]}var Sde=`DismissableLayer`,mE=`dismissableLayer.update`,Cde=`dismissableLayer.pointerDownOutside`,wde=`dismissableLayer.focusOutside`,hE,gE=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_E=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(gE),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=Dde(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Ode(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(hE=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vE(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=hE)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vE())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(mE,e),()=>document.removeEventListener(mE,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});_E.displayName=Sde;var Tde=`DismissableLayerBranch`,Ede=y.forwardRef((e,t)=>{let n=y.useContext(gE),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});Ede.displayName=Tde;function Dde(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){yE(Cde,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ode(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&yE(wde,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vE(){let e=new CustomEvent(mE);document.dispatchEvent(e)}function yE(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var bE=0;function xE(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??SE()),document.body.insertAdjacentElement(`beforeend`,e[1]??SE()),bE++,()=>{bE===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e
vendor: 17,643 bytes, line 99
99=>e.remove()),bE--}},[])}function SE(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.cssText=`outline: none; opacity: 0; position: fixed; pointer-events: none`,e}var CE=[`top`,`right`,`bottom`,`left`],wE=Math.min,TE=Math.max,EE=Math.round,DE=Math.floor,OE=e=>({x:e,y:e}),kE={left:`right`,right:`left`,bottom:`top`,top:`bottom`},AE={start:`end`,end:`start`};function jE(e,t,n){return TE(e,wE(t,n))}function ME(e,t){return typeof e==`function`?e(t):e}function NE(e){return e.split(`-`)[0]}function PE(e){return e.split(`-`)[1]}function FE(e){return e===`x`?`y`:`x`}function IE(e){return e===`y`?`height`:`width`}function LE(e){return[`top`,`bottom`].includes(NE(e))?`y`:`x`}function RE(e){return FE(LE(e))}function zE(e,t,n){n===void 0&&(n=!1);let r=PE(e),i=RE(e),a=IE(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=WE(o)),[o,WE(o)]}function BE(e){let t=WE(e);return[VE(e),t,VE(t)]}function VE(e){return e.replace(/start|end/g,e=>AE[e])}function HE(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function UE(e,t,n,r){let i=PE(e),a=HE(NE(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(VE)))),a}function WE(e){return e.replace(/left|right|bottom|top/g,e=>kE[e])}function GE(e){return{top:0,right:0,bottom:0,left:0,...e}}function KE(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:GE(e)}function qE(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function JE(e,t,n){let{reference:r,floating:i}=e,a=LE(t),o=RE(t),s=IE(o),c=NE(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(PE(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var YE=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=JE(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=JE(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function XE(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ME(t,e),p=KE(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qE(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=qE(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ZE=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ME(e,t)||{};if(l==null)return{};let d=KE(u),f={x:n,y:r},p=RE(i),m=IE(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=wE(d[_],T),D=wE(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=jE(O,A,k),M=!c.arrow&&PE(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),QE=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ME(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=NE(r),_=LE(o),v=NE(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[WE(o)]:BE(o)),x=p!==`none`;!d&&x&&b.push(...UE(o,m,p,y));let S=[o,...b],C=await XE(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=zE(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=LE(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $E(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eD(e){return CE.some(t=>e[t]>=0)}var tD=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=ME(e,t);switch(r){case`referenceHidden`:{let e=$E(await XE(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:eD(e)}}}case`escaped`:{let e=$E(await XE(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:eD(e)}}}default:return{}}}}};async function nD(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=NE(n),s=PE(n),c=LE(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=ME(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var rD=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await nD(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},iD=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ME(e,t),l={x:n,y:r},u=await XE(t,c),d=LE(NE(i)),f=FE(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=jE(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=jE(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},aD=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ME(e,t),u={x:n,y:r},d=LE(i),f=FE(d),p=u[f],m=u[d],h=ME(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=[`top`,`left`].includes(NE(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},oD=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ME(e,t),u=await XE(t,l),d=NE(i),f=PE(i),p=LE(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=wE(h-u[g],v),x=wE(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=TE(u.left,0),t=TE(u.right,0),n=TE(u.top,0),r=TE(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:TE(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:TE(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function sD(){return typeof window<`u`}function cD(e){return dD(e)?(e.nodeName||``).toLowerCase():`#document`}function lD(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function uD(e){return((dD(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function dD(e){return sD()?e instanceof Node||e instanceof lD(e).Node:!1}function fD(e){return sD()?e instanceof Element||e instanceof lD(e).Element:!1}function pD(e){return sD()?e instanceof HTMLElement||e instanceof lD(e).HTMLElement:!1}function mD(e){return!sD()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof lD(e).ShadowRoot}function hD(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=SD(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function gD(e){return[`table`,`td`,`th`].includes(cD(e))}function _D(e){return[`:popover-open`,`:modal`].some(t=>{try{return e.matches(t)}catch{return!1}})}function vD(e){let t=bD(),n=fD(e)?SD(e):e;return n.transform!==`none`||n.perspective!==`none`||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||[`transform`,`perspective`,`filter`].some(e=>(n.willChange||``).includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>(n.contain||``).includes(e))}function yD(e){let t=wD(e);for(;pD(t)&&!xD(t);){if(vD(t))return t;if(_D(t))return null;t=wD(t)}return null}function bD(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}function xD(e){return[`html`,`body`,`#document`].includes(cD(e))}function SD(e){return lD(e).getComputedStyle(e)}function CD(e){return fD(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wD(e){if(cD(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||mD(e)&&e.host||uD(e);return mD(t)?t.host:t}function TD(e){let t=wD(e);return xD(t)?e.ownerDocument?e.ownerDocument.body:e.body:pD(t)&&hD(t)?t:TD(t)}function ED(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=TD(e),i=r===e.ownerDocument?.body,a=lD(r);if(i){let e=DD(a);return t.concat(a,a.visualViewport||[],hD(r)?r:[],e&&n?ED(e):[])}return t.concat(r,ED(r,[],n))}function DD(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function OD(e){let t=SD(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pD(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=EE(n)!==a||EE(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function kD(e){return fD(e)?e:e.contextElement}function AD(e){let t=kD(e);if(!pD(t))return OE(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=OD(t),o=(a?EE(n.width):n.width)/r,s=(a?EE(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var kde=OE(0);function jD(e){let t=lD(e);return!bD()||!t.visualViewport?kde:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ade(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lD(e)?!1:t}function MD(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=kD(e),o=OE(1);t&&(r?fD(r)&&(o=AD(r)):o=AD(e));let s=Ade(a,n,r)?jD(a):OE(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=lD(a),t=r&&fD(r)?lD(r):r,n=e,i=DD(n);for(;i&&r&&t!==n;){let e=AD(i),t=i.getBoundingClientRect(),r=SD(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=lD(i),i=DD(n)}}return qE({width:u,height:d,x:c,y:l})}function jde(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=uD(r),s=t?_D(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=OE(1),u=OE(0),d=pD(r);if((d||!d&&!a)&&((cD(r)!==`body`||hD(o))&&(c=CD(r)),pD(r))){let e=MD(r);l=AD(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function Mde(e){return Array.from(e.getClientRects())}function ND(e,t){let n=CD(e).scrollLeft;return t?t.left+n:MD(uD(e)).left+n}function Nde(e){let t=uD(e),n=CD(e),r=e.ownerDocument.body,i=TE(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=TE(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ND(e),s=-n.scrollTop;return SD(r).direction===`rtl`&&(o+=TE(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Pde(e,t){let n=lD(e),r=uD(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=bD();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}function Fde(e,t){let n=MD(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pD(e)?AD(e):OE(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function PD(e,t,n){let r;if(t===`viewport`)r=Pde(e,n);else if(t===`document`)r=Nde(uD(e));else if(fD(t))r=Fde(t,n);else{let n=jD(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return qE(r)}function FD(e,t){let n=wD(e);return n===t||!fD(n)||xD(n)?!1:SD(n).position===`fixed`||FD(n,t)}function Ide(e,t){let n=t.get(e);if(n)return n;let r=ED(e,[],!1).filter(e=>fD(e)&&cD(e)!==`body`),i=null,a=SD(e).position===`fixed`,o=a?wD(e):e;for(;fD(o)&&!xD(o);){let t=SD(o),n=vD(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&[`absolute`,`fixed`].includes(i.position)||hD(o)&&!n&&FD(e,o))?r=r.filter(e=>e!==o):i=t,o=wD(o)}return t.set(e,r),r}function Lde(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_D(t)?[]:Ide(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=PD(t,n,i);return e.top=TE(r.top,e.top),e.right=wE(r.right,e.right),e.bottom=wE(r.bottom,e.bottom),e.left=TE(r.left,e.left),e},PD(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Rde(e){let{width:t,height:n}=OD(e);return{width:t,height:n}}function zde(e,t,n){let r=pD(t),i=uD(t),a=n===`fixed`,o=MD(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=OE(0);if(r||!r&&!a)if((cD(t)!==`body`||hD(i))&&(s=CD(t)),r){let e=MD(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=ND(i));let l=0,u=0;if(i&&!r&&!a){let e=i.getBoundingClientRect();u=e.top+s.scrollTop,l=e.left+s.scrollLeft-ND(i,e)}return{x:o.left+s.scrollLeft-c.x-l,y:o.top+s.scrollTop-c.y-u,width:o.width,height:o.height}}function ID(e){return SD(e).position===`static`}function LD(e,t){if(!pD(e)||SD(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return uD(e)===n&&(n=n.ownerDocument.body),n}function RD(e,t){let n=lD(e);if(_D(e))return n;if(!pD(e)){let t=wD(e);for(;t&&!xD(t);){if(fD(t)&&!ID(t))return t;t=wD(t)}return n}let r=LD(e,t);for(;r&&gD(r)&&ID(r);)r=LD(r,t);return r&&xD(r)&&ID(r)&&!vD(r)?n:r||yD(e)||n}var Bde=async function(e){let t=this.getOffsetParent||RD,n=this.getDimensions,r=await n(e.floating);return{reference:zde(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vde(e){return SD(e).direction===`rtl`}var Hde={convertOffsetParentRelativeRectToViewportRelativeRect:jde,getDocumentElement:uD,getClippingRect:Lde,getOffsetParent:RD,getElementRects:Bde,getClientRects:Mde,getDimensions:Rde,getScale:AD,isElement:fD,isRTL:Vde};function Ude(e,t){let n=null,r,i=uD(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let{left:l,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;let p=DE(u),m=DE(i.clientWidth-(l+d)),h=DE(i.clientHeight-(u+f)),g=DE(l),_={rootMargin:-p+`px `+-m+`px `+-h+`px `+-g+`px`,threshold:TE(0,wE(1,c))||1},v=!0;function y(e){let t=e[0].intersectionRatio;if(t!==c){if(!v)return o();t?o(!1,t):r=setTimeout(()=>{o(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(y,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,_)}n.observe(e)}return o(!0),a}function Wde(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=kD(e),u=i||a?[...l?ED(l):[],...ED(t)]:[];
vendor: 8,508 bytes, line 99
99u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ude(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?MD(e):null;c&&g();function g(){let t=MD(e);h&&(t.x!==h.x||t.y!==h.y||t.width!==h.width||t.height!==h.height)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Gde=rD,Kde=iD,qde=QE,Jde=oD,Yde=tD,zD=ZE,Xde=aD,Zde=(e,t,n)=>{let r=new Map,i={platform:Hde,...n},a={...i.platform,_c:r};return YE(e,t,{...i,platform:a})},BD=typeof document<`u`?y.useLayoutEffect:y.useEffect;function VD(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!VD(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!VD(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function HD(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UD(e,t){let n=HD(e);return Math.round(t*n)/n}function WD(e){let t=y.useRef(e);return BD(()=>{t.current=e}),t}function Qde(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);VD(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=y.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=y.useRef(null),T=y.useRef(null),E=y.useRef(u),D=c!=null,O=WD(c),k=WD(i),A=WD(l),j=y.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),Zde(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!VD(E.current,t)&&(E.current=t,b.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);BD(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=y.useRef(!1);BD(()=>(M.current=!0,()=>{M.current=!1}),[]),BD(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=y.useMemo(()=>({reference:w,floating:T,setReference:v,setFloating:x}),[v,x]),ee=y.useMemo(()=>({reference:S,floating:C}),[S,C]),te=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=UD(ee.floating,u.x),r=UD(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...HD(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:j,refs:N,elements:ee,floatingStyles:te}),[u,j,N,ee,te])}var $de=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:zD({element:r.current,padding:i}).fn(n):r?zD({element:r,padding:i}).fn(n):{}}}},efe=(e,t)=>({...Gde(e),options:[e,t]}),tfe=(e,t)=>({...Kde(e),options:[e,t]}),nfe=(e,t)=>({...Xde(e),options:[e,t]}),rfe=(e,t)=>({...qde(e),options:[e,t]}),ife=(e,t)=>({...Jde(e),options:[e,t]}),afe=(e,t)=>({...Yde(e),options:[e,t]}),ofe=(e,t)=>({...$de(e),options:[e,t]}),sfe=`Arrow`,GD=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,F.jsx)(U.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});GD.displayName=sfe;var cfe=GD;function KD(e){let[t,n]=y.useState(void 0);return CC(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var qD=`Popper`,[JD,YD]=EC(qD),[lfe,XD]=JD(qD),ZD=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,F.jsx)(lfe,{scope:t,anchor:r,onAnchorChange:i,children:n})};ZD.displayName=qD;var QD=`PopperAnchor`,$D=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=XD(QD,n),o=y.useRef(null),s=bl(t,o);return y.useEffect(()=>{a.onAnchorChange(r?.current||o.current)}),r?null:(0,F.jsx)(U.div,{...i,ref:s})});$D.displayName=QD;var eO=`PopperContent`,[ufe,dfe]=JD(eO),tO=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=XD(eO,n),[_,v]=y.useState(null),b=bl(t,e=>v(e)),[x,S]=y.useState(null),C=KD(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(pfe),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=Qde({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Wde(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[efe({mainAxis:i+T,alignmentAxis:o}),c&&tfe({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?nfe():void 0,...A}),c&&rfe({...A}),ife({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&ofe({element:x,padding:s}),mfe({arrowWidth:w,arrowHeight:T}),f&&afe({strategy:`referenceHidden`,...A})]}),[ne,re]=iO(N),ie=DC(m);CC(()=>{ee&&ie?.()},[ee,ie]);let ae=te.arrow?.x,oe=te.arrow?.y,se=te.arrow?.centerOffset!==0,[ce,le]=y.useState();return CC(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,F.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(ufe,{scope:n,placedSide:ne,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,F.jsx)(U.div,{"data-side":ne,"data-align":re,...h,ref:b,style:{...h.style,animation:ee?void 0:`none`}})})})});tO.displayName=eO;var nO=`PopperArrow`,ffe={top:`bottom`,right:`left`,bottom:`top`,left:`right`},rO=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=dfe(nO,n),a=ffe[i.placedSide];return(0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,F.jsx)(cfe,{...r,ref:t,style:{...r.style,display:`block`}})})});rO.displayName=nO;function pfe(e){return e!==null}var mfe=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=iO(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function iO(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var aO=ZD,oO=$D,sO=tO,cO=rO,hfe=`Portal`,lO=y.forwardRef((e,t)=>
99{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});lO.displayName=hfe;function uO(e){let t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gfe=`VisuallyHidden`,dO=y.forwardRef((e,t)=>(0,F.jsx)(U.span,{...e,ref:t,style:{position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`,...e.style}}));dO.displayName=gfe;var _fe=dO,fO=Uw(),pO=function(){},mO=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:pO,onWheelCapture:pO,onTouchMoveCapture:pO}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,g=e.as,_=g===void 0?`div`:g,v=e.gapMode,b=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bw([n,t]),C=jw(jw({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:fO,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),jw(jw({},C),{ref:S})):y.createElement(_,jw({},C,{className:c,ref:S}),s))});mO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mO.classNames={fullWidth:Fw,zeroRight:Pw};var hO=!1;if(typeof window<`u`)try{var gO=Object.defineProperty({},"passive",{get:function(){return hO=!0,!0}});window.addEventListener(`test`,gO,gO),window.removeEventListener(`test`,gO,gO)}catch{hO=!1}var _O=hO?{passive:!1}:!1,vfe=function(e){return e.tagName===`TEXTAREA`},vO=function(e,t){var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!vfe(e)&&n[t]===`visible`)},yfe=function(e){return vO(e,`overflowY`)},bfe=function(e){return vO(e,`overflowX`)},yO=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),bO(e,r)){var i=xO(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xfe=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Sfe=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},bO=function(e,t){return e===`v`?yfe(t):bfe(t)},xO=function(e,t){return e===`v`?xfe(t):Sfe(t)},Cfe=function(e,t){return e===`h`&&t===`rtl`?-1:1},wfe=function(e,t,n,r,i){var a=Cfe(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=xO(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&bO(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},SO=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},CO=function(e){return[e.deltaX,e.deltaY]},wO=function(e){return e&&`current`in e?e.current:e},Tfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Efe=function(e){return` 100 .block-interactivity-${e} {pointer-events: none;} 101 .allow-interactivity-${e} {pointer-events: all;} 102`},Dfe=0,TO=[];function Ofe(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Dfe++)[0],a=y.useState(nT)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(wO),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=SO(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=yO(d,u);if(!f)return!0;
102if(f?l=d:(l=d===`v`?`h`:`v`,f=yO(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return wfe(p,t,e,p===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!TO.length||TO[TO.length-1]!==a)){var r=`deltaY`in n?CO(n):SO(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Tfe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wO).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:kfe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=SO(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,CO(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,SO(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return TO.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,_O),document.addEventListener(`touchmove`,c,_O),document.addEventListener(`touchstart`,u,_O),function(){TO=TO.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,_O),document.removeEventListener(`touchmove`,c,_O),document.removeEventListener(`touchstart`,u,_O)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:Efe(i)}):null,p?y.createElement(dT,{gapMode:e.gapMode}):null)}function kfe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Afe=Gw(fO,Ofe),EO=y.forwardRef(function(e,t){return y.createElement(mO,jw({},e,{ref:t,sideCar:Afe}))});EO.classNames=mO.classNames;var jfe=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Mfe=[` `,`Enter`],DO=`Select`,[OO,kO,Nfe]=pE(DO),[AO,Pfe]=EC(DO,[Nfe,YD]),jO=YD(),[Ffe,MO]=AO(DO),[Ife,Lfe]=AO(DO),NO=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p}=e,m=jO(t),[h,g]=y.useState(null),[_,v]=y.useState(null),[b,x]=y.useState(!1),S=OC(l),[C=!1,w]=ow({prop:r,defaultProp:i,onChange:a}),[T,E]=ow({prop:o,defaultProp:s,onChange:c}),D=y.useRef(null),O=!h||!!h.closest(`form`),[k,A]=y.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,F.jsx)(aO,{...m,children:(0,F.jsxs)(Ffe,{required:p,scope:t,trigger:h,onTriggerChange:g,valueNode:_,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:aw(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,F.jsx)(OO.Provider,{scope:t,children:(0,F.jsx)(Ife,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:y.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,F.jsxs)(hk,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,children:[T===void 0?(0,F.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};NO.displayName=DO;var PO=`SelectTrigger`,FO=y.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=jO(n),o=MO(PO,n),s=o.disabled||r,c=bl(t,o.onTriggerChange),l=kO(n),[u,d,f]=gk(e=>{let t=l().filter(e=>!e.disabled),n=_k(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),p=()=>{s||(o.onOpenChange(!0),f())};return(0,F.jsx)(oO,{asChild:!0,...a,children:(0,F.jsx)(U.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":mk(o.value)?``:void 0,...i,ref:c,onClick:K(i.onClick,e=>{e.currentTarget.focus()}),onPointerDown:K(i.onPointerDown,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(p(),o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())}),onKeyDown:K(i.onKeyDown,e=>{let t=u.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&d(e.key),!(t&&e.key===` `)&&jfe.includes(e.ke
vendor: 6,629 bytes, line 102
102y)&&(p(),e.preventDefault())})})})});FO.displayName=PO;var IO=`SelectValue`,LO=y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=MO(IO,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=bl(t,c.onValueNodeChange);return CC(()=>{l(u)},[l,u]),(0,F.jsx)(U.span,{...s,ref:d,style:{pointerEvents:`none`},children:mk(c.value)?(0,F.jsx)(F.Fragment,{children:o}):a})});LO.displayName=IO;var Rfe=`SelectIcon`,RO=y.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(U.span,{"aria-hidden":!0,...i,ref:t,children:r||`â¼`})});RO.displayName=Rfe;var zfe=`SelectPortal`,zO=e=>(0,F.jsx)(lO,{asChild:!0,...e});zO.displayName=zfe;var BO=`SelectContent`,VO=y.forwardRef((e,t)=>{let n=MO(BO,e.__scopeSelect),[r,i]=y.useState();if(CC(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?b.createPortal((0,F.jsx)(UO,{scope:e.__scopeSelect,children:(0,F.jsx)(OO.Slot,{scope:e.__scopeSelect,children:(0,F.jsx)(`div`,{children:e.children})})}),t):null}return(0,F.jsx)(GO,{...e,ref:t})});VO.displayName=BO;var HO=10,[UO,WO]=AO(BO),Bfe=`SelectContentImpl`,GO=y.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=MO(BO,n),[b,x]=y.useState(null),[S,C]=y.useState(null),w=bl(t,e=>x(e)),[T,E]=y.useState(null),[D,O]=y.useState(null),k=kO(n),[A,j]=y.useState(!1),M=y.useRef(!1);y.useEffect(()=>{if(b)return kT(b)},[b]),xE();let N=y.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),ee=y.useCallback(()=>N([T,b]),[N,T,b]);y.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:te,triggerPointerDownPosRef:ne}=v;y.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||te(!1),document.removeEventListener(`pointermove`,t),ne.current=null};return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,te,ne]),y.useEffect(()=>{let e=()=>te(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[re,ie]=gk(e=>{let t=k().filter(e=>!e.disabled),n=_k(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=y.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(M.current=!0))},[v.value]),oe=y.useCallback(()=>b?.focus(),[b]),se=y.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),ce=r===`popper`?qO:KO,le=ce===qO?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,F.jsx)(UO,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:re,children:(0,F.jsx)(EO,{as:xl,allowPinchZoom:!0,children:(0,F.jsx)(bw,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:K(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(_E,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,F.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:K(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});GO.displayName=Bfe;var Vfe=`SelectItemAlignedPosition`,KO=y.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=MO(BO,n),o=WO(BO,n),[s,c]=y.useState(null),[l,u]=y.useState(null),d=bl(t,e=>u(e)),f=kO(n),p=y.useRef(!1),m=y.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,b=y.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=kC(a,[HO,window.innerWidth-HO-l]);s.style.minWidth=c+`px`,s.style.left=u+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=kC(a,[HO,window.innerWidth-HO-l]);s.style.minWidth=c+`px`,s.style.right=u+`px`}let o=f(),c=window.innerHeight-HO*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-HO,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${HO}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);CC(()=>b(),[b]);let[x,S]=y.useState();return CC(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,F.jsx)(Ufe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:y.useCallback(e=>
vendor: 4,482 bytes, line 102
102{e&&m.current===!0&&(b(),v?.(),m.current=!1)},[b,v]),children:(0,F.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,F.jsx)(U.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});KO.displayName=Vfe;var Hfe=`SelectPopperPosition`,qO=y.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=HO,...a}=e,o=jO(n);return(0,F.jsx)(sO,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});qO.displayName=Hfe;var[Ufe,JO]=AO(BO,{}),YO=`SelectViewport`,XO=y.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=WO(YO,n),o=JO(YO,n),s=bl(t,a.onViewportChange),c=y.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(OO.Slot,{scope:n,children:(0,F.jsx)(U.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`auto`,...i.style},onScroll:K(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-HO*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});XO.displayName=YO;var ZO=`SelectGroup`,[Wfe,Gfe]=AO(ZO),Kfe=y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=aw();return(0,F.jsx)(Wfe,{scope:n,id:i,children:(0,F.jsx)(U.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Kfe.displayName=ZO;var QO=`SelectLabel`,$O=y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Gfe(QO,n);return(0,F.jsx)(U.div,{id:i.id,...r,ref:t})});$O.displayName=QO;var ek=`SelectItem`,[qfe,tk]=AO(ek),nk=y.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=MO(ek,n),c=WO(ek,n),l=s.value===r,[u,d]=y.useState(a??``),[f,p]=y.useState(!1),m=bl(t,e=>c.itemRefCallback?.(e,r,i)),h=aw(),g=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(qfe,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:y.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(OO.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,F.jsx)(U.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:K(o.onFocus,()=>p(!0)),onBlur:K(o.onBlur,()=>p(!1)),onPointerUp:K(o.onPointerUp,g),onPointerMove:K(o.onPointerMove,e=>{i?c.onItemLeave?.():e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:K(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Mfe.includes(e.key)&&g(),e.key===` `&&e.preventDefault())})})})})});nk.displayName=ek;var rk=`SelectItemText`,ik=y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=MO(rk,n),s=WO(rk,n),c=tk(rk,n),l=Lfe(rk,n),[u,d]=y.useState(null),f=bl(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=y.useMemo(()=>(0,F.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return CC(()=>(h(m),()=>g(m)),[h,g,m]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(U.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?b.createPortal(a.children,o.valueNode):null]})});ik.displayName=rk;var ak=`SelectItemIndicator`,ok=y.forwardRef((e,t)=>
vendor: 3,681 bytes, line 102
102{let{__scopeSelect:n,...r}=e;return tk(ak,n).isSelected?(0,F.jsx)(U.span,{"aria-hidden":!0,...r,ref:t}):null});ok.displayName=ak;var sk=`SelectScrollUpButton`,ck=y.forwardRef((e,t)=>{let n=WO(sk,e.__scopeSelect),r=JO(sk,e.__scopeSelect),[i,a]=y.useState(!1),o=bl(t,r.onScrollButtonChange);return CC(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(dk,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});ck.displayName=sk;var lk=`SelectScrollDownButton`,uk=y.forwardRef((e,t)=>{let n=WO(lk,e.__scopeSelect),r=JO(lk,e.__scopeSelect),[i,a]=y.useState(!1),o=bl(t,r.onScrollButtonChange);return CC(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(dk,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});uk.displayName=lk;var dk=y.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=WO(`SelectScrollButton`,n),o=y.useRef(null),s=kO(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),CC(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(U.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:K(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:K(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:K(i.onPointerLeave,()=>{c()})})}),Jfe=`SelectSeparator`,fk=y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(U.div,{"aria-hidden":!0,...r,ref:t})});fk.displayName=Jfe;var pk=`SelectArrow`,Yfe=y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=jO(n),a=MO(pk,n),o=WO(pk,n);return a.open&&o.position===`popper`?(0,F.jsx)(cO,{...i,...r,ref:t}):null});Yfe.displayName=pk;function mk(e){return e===``||e===void 0}var hk=y.forwardRef((e,t)=>{let{value:n,...r}=e,i=y.useRef(null),a=bl(t,i),o=uO(n);return y.useEffect(()=>{let e=i.current,t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,`value`).set;if(o!==n&&r){let t=new Event(`change`,{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[o,n]),(0,F.jsx)(dO,{asChild:!0,children:(0,F.jsx)(`select`,{...r,ref:a,defaultValue:n})})});hk.displayName=`BubbleSelect`;function gk(e){let t=DC(e),n=y.useRef(``),r=y.useRef(0),i=y.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=y.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function _k(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xfe(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Xfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zfe=NO,vk=FO,Qfe=LO,$fe=RO,epe=zO,yk=VO,tpe=XO,bk=$O,xk=nk,npe=ik,rpe=ok,Sk=ck,Ck=uk,wk=fk,Tk=Zfe,Ek=Qfe,Dk=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(vk,{ref:r,className:z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
102ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,F.jsx)($fe,{asChild:!0,children:(0,F.jsx)(g_,{className:`h-4 w-4 opacity-50`})})]}));Dk.displayName=vk.displayName;var Ok=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Sk,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(tre,{className:`h-4 w-4`})}));Ok.displayName=Sk.displayName;var kk=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Ck,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(g_,{className:`h-4 w-4`})}));kk.displayName=Ck.displayName;var Ak=y.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,F.jsx)(epe,{children:(0,F.jsxs)(yk,{ref:i,className:z(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,F.jsx)(Ok,{}),(0,F.jsx)(tpe,{className:z(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,F.jsx)(kk,{})]})}));Ak.displayName=yk.displayName;var ipe=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(bk,{ref:n,className:z(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));ipe.displayName=bk.displayName;var jk=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(xk,{ref:r,className:z(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,F.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,F.jsx)(rpe,{children:(0,F.jsx)(h_,{className:`h-4 w-4`})})}),(0,F.jsx)(npe,{children:t})]}));jk.displayName=xk.displayName;var ape=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(wk,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));ape.displayName=wk.displayName;var ope=()=>{let{toast:e}=pl(),[t,n]=(0,y.useState)({isProcessing:!1,data:{},feedback:null}),r=(0,y.useCallback)(e=>{let t={},n=e.querySelectorAll(`input, textarea, select`);return console.log(`Found inputs:`,n.length),n.forEach((e,n)=>{if((e.type===`radio`||e.type===`checkbox`)&&!e.checked)return;let r=e.name||e.id||`input_${n+1}`,i=e.value||e.textContent||``;i.trim()&&(t[r]=i,console.log(`Collected: ${r} = ${i}`))}),e.querySelectorAll(`[data-value], [data-answer]`).forEach((e,n)=>{let r=e.getAttribute(`data-name`)||e.id||`data_${n+1}`,i=e.getAttribute(`data-value`)||e.getAttribute(`data-answer`)||e.textContent;i&&i.trim()&&(t[r]=i)}),t},[]),i=(0,y.useCallback)(()=>{let e=document.getElementById(`canvas-container`);if(!e)return[];let t=[];return e.querySelectorAll(`h1, h2, h3, h4, label, .question, [data-question]`).forEach(e=>{let n=e.textContent?.trim();n&&n.length>10&&!n.toLowerCase().includes(`submit`)&&t.push(n)}),t},[]),a=(0,y.useCallback)(async()=>{if(console.log(`handleInteractiveSubmission called`),t.isProcessing){console.log(`Already processing, skipping submission`);return}n(e=>({...e,isProcessing:!0}));try{let t=document.getElementById(`canvas-container`);if(!t)throw Error(`Interactive content container not found`);let a=r(t);if(console.log(`Final collected data:`,a),Object.keys(a).length===0){e({title:`No Data Found`,description:`Please complete the interactive content before submitting.`,variant:`destructive`}),n(e=>({...e,isProcessing:!1}));return}let s=i();n(e=>({...e,data:a,isProcessing:!1}));let c=o(a,s);return n(e=>({...e,feedback:c,isProcessing:!1})),e({title:`Content Submitted`,description:`Your interactive content has been successfully processed.`}),{data:a,questions:s,feedback:c}}catch(t){console.error(`Error submitting interactive content:`,t),e({title:`Submission Error`,description:`There was a problem submitting your content. Please try again.`,variant:`destructive`}),n(e=>({...e,isProcessing:!1}))}},[t.isProcessing,r,i,e]),o=(0,y.useCallback)((e,t)=>{let n=Object.keys(e).length,r=Object.entries(e).map(([e,t],n)=>{let r=`You provided: "${t}".`;return typeof t==`string`&&t.length>50?r+=` Your detailed response shows thorough understanding.`:typeof t==`string`&&t.length>20?r+=` Good response that demonstrates your knowledge.`:r+=` Consider providing more detail to showcase your understanding.`,{question:e.replace(/_/g,` `).replace(/([A-Z])/g,` $1`).trim()||`Question ${n+1}`,answer:t,feedback:r}}),i=Object.values(e).join(``).length/n,a=`Good`;return i>100?a=`Excellent`:i>50?a=`Very Good`:i<20&&(a=`Needs Improvement`),{overallFeedback:`Thank you for completing the interactive content! You provided ${n} response(s) with ${a.toLowerCase()} engagement level.`,questionFeedback:r,engagementLevel:a,interactiveHtml:null}},[]);return{state:t,handleSubmission:a,collectInteractiveData:r,extractQuestions:i,reset:(0,y.useCallback)(()=>{n({isProcessing:!1,data:{},feedback:null})},[])}},Mk=()=>{console.log(`Initializing interactive UI...`),spe(),cpe()},spe=()=>{window.submitContent||(window.submitContent=()=>{console.log(`Global submitContent called`),window.handleInteractiveSubmission&&window.handleInteractiveSubmission()}),window.submitAssessment=window.submitContent,window.submitQuiz=window.submitContent,window.submitForm=window.submitContent,window.completeAssessment=window.submitContent,window.completeContent=window.submitContent},cpe=()=>{let e=document.getElementById(`canvas-container`);
102e&&(e.querySelectorAll(`form`).forEach(e=>{e.hasAttribute(`data-initialized`)||(e.addEventListener(`submit`,e=>{e.preventDefault(),window.handleInteractiveSubmission&&window.handleInteractiveSubmission()}),e.setAttribute(`data-initialized`,`true`))}),e.querySelectorAll(`button:not([data-initialized])`).forEach(e=>{let t=e.textContent?.toLowerCase()||``;(t.includes(`submit`)||t.includes(`complete`)||t.includes(`finish`)||e.hasAttribute(`data-submit`)||e instanceof HTMLButtonElement&&e.type===`submit`)&&(e.addEventListener(`click`,e=>{e.preventDefault(),window.handleInteractiveSubmission&&window.handleInteractiveSubmission()}),e.setAttribute(`data-initialized`,`true`))}),lpe(e))},lpe=e=>{e.querySelectorAll(`input[type="radio"], input[type="checkbox"], input[type="text"], textarea`).forEach(e=>{e.hasAttribute(`data-validation-listener`)||(e.addEventListener(`change`,e=>{let t=e.target.closest(`.question, article.question`);t&&t.classList.remove(`validation-error`)}),(e instanceof HTMLInputElement&&e.type===`text`||e instanceof HTMLTextAreaElement)&&e.addEventListener(`input`,e=>{let t=e.target.closest(`.question, article.question`);t&&e.target.value.trim()!==``&&t.classList.remove(`validation-error`)}),e.setAttribute(`data-validation-listener`,`true`))})},upe=({data:e,questions:t,onFeedbackReceived:n})=>{let{toast:r}=pl(),[i,a]=y.useState(!1),[o,s]=y.useState(null);y.useEffect(()=>{Object.keys(e).length>0&&c()},[e]);let c=()=>{a(!0);try{let t=Object.keys(e).length,i=Object.entries(e).map(([e,t],n)=>{let r=`You provided: "${t}".`;return typeof t==`string`&&t.length>50?r+=` Your detailed response shows thorough understanding of the topic.`:typeof t==`string`&&t.length>20?r+=` Good explanation that demonstrates your knowledge.`:r+=` Consider providing more detail to showcase your understanding.`,{question:e.replace(/_/g,` `).replace(/([A-Z])/g,` $1`).trim()||`Question ${n+1}`,answer:t,feedback:r}}),a=Object.values(e).join(``).length/t,o=`Good`;a>100?o=`Excellent`:a>50?o=`Very Good`:a<20&&(o=`Needs Improvement`);let c={overallFeedback:`Thank you for completing the interactive content! You provided ${t} response(s) with ${o.toLowerCase()} engagement level. Your responses demonstrate your interaction with the material.`,questionFeedback:i,engagementLevel:o,interactiveHtml:null};s(c),n&&n(c),r({title:`Content Evaluated`,description:`Your interactive content has been successfully analyzed.`})}catch(e){console.error(`Error generating feedback:`,e),r({title:`Evaluation Error`,description:`There was a problem analyzing your content. Please try again.`,variant:`destructive`})}finally{a(!1)}};return i?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-4`,children:[(0,F.jsx)(F_,{className:`w-8 h-8 animate-spin text-purple-600 mb-2`}),(0,F.jsx)(`p`,{className:`text-center text-gray-600`,children:`Processing your submission...`}),(0,F.jsx)(`p`,{className:`text-center text-sm text-gray-500 mt-1`,children:`This may take a moment.`})]}):o?(0,F.jsxs)(`div`,{className:`interactive-content-feedback`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-4`,children:`Content Feedback`}),(0,F.jsxs)(`div`,{className:`bg-white p-4 rounded-lg shadow mb-4`,children:[(0,F.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:`Overall Evaluation`}),(0,F.jsx)(`p`,{children:o.overallFeedback}),o.engagementLevel&&(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsxs)(`span`,{className:`inline-block px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800`,children:[`Engagement Level: `,o.engagementLevel]})})]}),(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(`h3`,{className:`text-lg font-medium`,children:`Response Feedback`}),o.questionFeedback.map((e,t)=>(0,F.jsxs)(`div`,{className:`bg-white p-4 rounded-lg shadow`,children:[(0,F.jsx)(`h4`,{className:`font-medium text-purple-700 capitalize`,children:e.question}),(0,F.jsx)(`h5`,{className:`font-medium mt-3`,children:`Your Response:`}),(0,F.jsx)(`p`,{className:`text-gray-600 bg-gray-50 p-2 rounded`,children:e.answer}
102),(0,F.jsx)(`h5`,{className:`font-medium mt-3`,children:`Feedback:`}),(0,F.jsx)(`p`,{className:`text-gray-800`,children:e.feedback})]},t))]})]}):null},dpe=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=t.useRef,o=t.useEffect,s=t.useMemo,c=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}})),fpe=s(((e,t)=>{t.exports=dpe()}))();function ppe(e){e()}function mpe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ppe(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Nk={notify(){},get:()=>[]};function hpe(e,t){let n,r=Nk,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=mpe())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Nk)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var gpe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,_pe=typeof navigator<`u`&&navigator.product===`ReactNative`,vpe=gpe||_pe?y.useLayoutEffect:y.useEffect,ype=Symbol.for(`react-redux-context`),bpe=typeof globalThis<`u`?globalThis:{};function xpe(){if(!y.createContext)return{};
102let e=bpe[ype]??=new Map,t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var Pk=xpe();function Spe(e){let{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{let e=hpe(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);vpe(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Pk;return y.createElement(s.Provider,{value:a},t)}var Cpe=Spe;function Fk(e=Pk){return function(){return y.useContext(e)}}var Ik=Fk();function Lk(e=Pk){let t=e===Pk?Ik:Fk(e),n=()=>{let{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Rk=Lk();function zk(e=Pk){let t=e===Pk?Rk:Lk(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Bk=zk(),Vk=(e,t)=>e===t;function Hk(e=Pk){let t=e===Pk?Ik:Fk(e),n=(e,n={})=>{let{equalityFn:r=Vk}=typeof n==`function`?{equalityFn:n}:n,{store:i,subscription:a,getServerState:o}=t();y.useRef(!0);let s=y.useCallback({[e.name](t){return e(t)}}[e.name],[e]),c=(0,fpe.useSyncExternalStoreWithSelector)(a.addNestedSub,i.getState,o||i.getState,s,r);return y.useDebugValue(c),c};return Object.assign(n,{withTypes:()=>n}),n}var Uk=Hk(),Wk=()=>Bk(),Gk=Uk;function Kk(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var qk=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Jk=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Yk={INIT:`@@redux/INIT${Jk()}`,REPLACE:`@@redux/REPLACE${Jk()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Jk()}`};function Xk(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Zk(e,t,n){if(typeof e!=`function`)throw Error(Kk(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Kk(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Kk(1));return n(Zk)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Kk(3));return i}function d(e){if(typeof e!=`function`)throw Error(Kk(4));if(c)throw Error(Kk(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Kk(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Xk(e))throw Error(Kk(7));if(e.type===void 0)throw Error(Kk(8));if(typeof e.type!=`string`)throw Error(Kk(17));if(c)throw Error(Kk(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Kk(10));r=e,f({type:Yk.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Kk(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[qk](){return this}}}return f({type:Yk.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[qk]:m}}function Qk(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Yk.INIT})===void 0)throw Error(Kk(12));if(n(void 0,{type:Yk.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Kk(13))})}function $k(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Qk(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(Kk(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function eA(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function tA(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Kk(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=eA(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function nA(e){return Xk(e)&&`type`in e&&typeof e.type==`string`}var rA=Symbol.for(`immer-nothing`),iA=Symbol.for(`immer-draftable`),aA=Symbol.for(`immer-state`);function oA(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sA=Object,cA=sA.getPrototypeOf,lA=`constructor`,uA=`prototype`,dA=`configurable`,fA=`enumerable`,pA=`writable`,mA=`value`,hA=e=>!!e&&!!e[aA];
vendor: 8,292 bytes, line 102
102function gA(e){return e?yA(e)||EA(e)||!!e[iA]||!!e[lA]?.[iA]||DA(e)||OA(e):!1}var _A=sA[uA][lA].toString(),vA=new WeakMap;function yA(e){if(!e||!kA(e))return!1;let t=cA(e);if(t===null||t===sA[uA])return!0;let n=sA.hasOwnProperty.call(t,lA)&&t[lA];if(n===Object)return!0;if(!AA(n))return!1;let r=vA.get(n);return r===void 0&&(r=Function.toString.call(n),vA.set(n,r)),r===_A}function bA(e,t,n=!0){xA(e)===0?(n?Reflect.ownKeys(e):sA.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function xA(e){let t=e[aA];return t?t.type_:EA(e)?1:DA(e)?2:OA(e)?3:0}var SA=(e,t,n=xA(e))=>n===2?e.has(t):sA[uA].hasOwnProperty.call(e,t),CA=(e,t,n=xA(e))=>n===2?e.get(t):e[t],wA=(e,t,n,r=xA(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function TA(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var EA=Array.isArray,DA=e=>e instanceof Map,OA=e=>e instanceof Set,kA=e=>typeof e==`object`,AA=e=>typeof e==`function`,jA=e=>typeof e==`boolean`;function MA(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var NA=e=>e.copy_||e.base_,PA=e=>e.modified_?e.copy_:e.base_;function FA(e,t){if(DA(e))return new Map(e);if(OA(e))return new Set(e);if(EA(e))return Array[uA].slice.call(e);let n=yA(e);if(t===!0||t===`class_only`&&!n){let t=sA.getOwnPropertyDescriptors(e);delete t[aA];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[pA]===!1&&(a[pA]=!0,a[dA]=!0),(a.get||a.set)&&(t[i]={[dA]:!0,[pA]:!0,[fA]:a[fA],[mA]:e[i]})}return sA.create(cA(e),t)}else{let t=cA(e);if(t!==null&&n)return{...e};let r=sA.create(t);return sA.assign(r,e)}}function IA(e,t=!1){return zA(e)||hA(e)||!gA(e)?e:(xA(e)>1&&sA.defineProperties(e,{set:RA,add:RA,clear:RA,delete:RA}),sA.freeze(e),t&&bA(e,(e,t)=>{IA(t,!0)},!1),e)}function LA(){oA(2)}var RA={[mA]:LA};function zA(e){return e===null||!kA(e)||sA.isFrozen(e)}var BA=`MapSet`,VA=`Patches`,HA=`ArrayMethods`,UA={};function WA(e){let t=UA[e];return t||oA(0,e),t}var GA=e=>!!UA[e],KA,qA=()=>KA,JA=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:GA(BA)?WA(BA):void 0,arrayMethodsPlugin_:GA(HA)?WA(HA):void 0});function YA(e,t){t&&(e.patchPlugin_=WA(VA),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function XA(e){ZA(e),e.drafts_.forEach($A),e.drafts_=null}function ZA(e){e===KA&&(KA=e.parent_)}var QA=e=>KA=JA(KA,e);function $A(e){let t=e[aA];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ej(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[aA].modified_&&(XA(t),oA(4)),gA(e)&&(e=tj(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[aA].base_,e,t)}else e=tj(t,n);return nj(t,e,!0),XA(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===rA?void 0:e}function tj(e,t){if(zA(t))return t;let n=t[aA];if(!n)return uj(t,e.handledSet_,e);if(!ij(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);cj(n,e)}return n.copy_}function nj(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&IA(t,n)}function rj(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ij=(e,t)=>e.scope_===t,aj=[];function oj(e,t,n,r){let i=NA(e),a=e.type_;if(r!==void 0&&CA(i,r,a)===t){wA(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;bA(i,(e,n)=>{if(hA(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??aj;for(let e of o)wA(i,e,n,a)}function sj(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ij(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=PA(i);oj(e,i.draft_??i,a,n),cj(i,r)})}function cj(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}rj(e)}}function lj(e,t,n){let{scope_:r}=e;if(hA(n)){let i=n[aA];ij(i,r)&&i.callbacks_.push(function(){yj(e),oj(e,n,PA(i),t)})}else gA(n)&&e.callbacks_.push(function(){let i=NA(e);e.type_===3?i.has(n)&&uj(n,r.handledSet_,r):CA(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&uj(CA(e.copy_,t,e.type_),r.handledSet_,r)})}function uj(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||hA(e)||t.has(e)||!gA(e)||zA(e)?e:(t.add(e),bA(e,(r,i)=>{if(hA(i)){let t=i[aA];ij(t,n)&&(wA(e,r,PA(t),e.type_),rj(t))}else gA(i)&&uj(i,t,n)}),e)}function dj(e,t){let n=EA(e),r={type_:+!!n,scope_:t?t.scope_:qA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=fj;n&&(i=[r],a=pj);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var fj={get(e,t){if(t===aA)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=NA(e);if(!SA(i,t,e.type_))return gj(e,i,t);let a=i[t];if(e.finalized_||!gA(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&MA(t))return a;if(a===mj(e.base_,t)||hj(e,t,a)){yj(e);let n=e.type_===1?+t:t,r=xj(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in NA(e)},ownKeys(e){return Reflect.ownKeys(NA(e))},set(e,t,n){let r=_j(NA(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=mj(NA(e),t),i=r?.[aA];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(TA(n,r)&&(n!==void 0||SA(e.base_,t,e.type_)))return!0;yj(e),vj(e)}return e.copy_[t]===n&&(n!==void 0||SA(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),lj(e,t,n),!0)},deleteProperty(e,t){return yj(e),mj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vj(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=NA(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[pA]:!0,[dA]:e.type_!==1||t!==`length`,[fA]:r[fA],[mA]:n[t]}},defineProperty(){oA(11)},getPrototypeOf(e){return cA(e.base_)},setPrototypeOf(){oA(12)}},pj={};for(let e in fj){let t=fj[e];pj[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}pj.deleteProperty=function(e,t){return pj.set.call(this,e,t,void 0)},pj.set=function(e,t,n){return fj.set.call(this,e[0],t,n,e[0])};function mj(e,t){let n=e[aA];return(n?NA(n):e)[t]}function hj(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!gA(n)||n[aA]?!1:e.baseRefs_.has(n)}function gj(e,t,n){let r=_j(t,n);return r?mA in r?r[mA]:r.get?.call(e.draft_):void 0}function _j(e,t){if(!(t in e))return;let n=cA(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=cA(n)}}function vj(e){e.modified_||(e.modified_=!0,e.parent_&&vj(e.parent_))}function yj(e){e.copy_||=(e.assigned_=new Map,FA(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bj=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(AA(e)&&!AA(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}AA(t)||oA(6),n!==void 0&&!AA(n)&&oA(7);let r;if(gA(e)){let i=QA(this),a=xj(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?XA(i):ZA(i)}return YA(i,n),ej(r,i)}else if(!e||!kA(e)){if(r=t(e),r===void 0&&(r=e),r===rA&&(r=void 0),this.autoFreeze_&&IA(r,!0),n){let t=[],i=[];WA(VA).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else oA(1,e)},this.produceWithPatches=(e,t)=>{if(AA(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},jA(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),jA(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),jA(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){gA(e)||oA(8),hA(e)&&(e=Sj(e));let t=QA(this),n=xj(t,e,void 0);return n[aA].isManual_=!0,ZA(t),n}finishDraft(e,t){let n=e&&e[aA];(!n||!n.isManual_)&&oA(9);let{scope_:r}=n;return YA(r,t),ej(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>
102-1&&(t=t.slice(n+1));let r=WA(VA).applyPatches_;return hA(e)?r(e,t):this.produce(e,e=>r(e,t))}};function xj(e,t,n,r){let[i,a]=DA(t)?WA(BA).proxyMap_(t,n):OA(t)?WA(BA).proxySet_(t,n):dj(t,n);return(n?.scope_??qA()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?sj(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Sj(e){return hA(e)||oA(10,e),Cj(e)}function Cj(e){if(!gA(e)||zA(e))return e;let t=e[aA],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=FA(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=FA(e,!0);return bA(n,(e,t)=>{wA(n,e,Cj(t))},r),t&&(t.finalized_=!1),n}var wj=new bj().produce;function Tj(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Ej=Tj(),Dj=Tj,Oj=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?eA:eA.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function kj(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(cM(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>nA(t)&&t.type===e,n}var Aj=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function jj(e){return gA(e)?wj(e,()=>{}):e}function Mj(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Nj(e){return typeof e==`boolean`}var Pj=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Aj;return t&&(Nj(t)?a.push(Ej):a.push(Dj(t.extraArgument))),a},Fj=`RTK_autoBatch`,Ij=e=>t=>{setTimeout(t,e)},Lj=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},Rj=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Lj(window.requestAnimationFrame,100):Ij(10):e.type===`callback`?e.queueNotification:Ij(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Fj],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},zj=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Aj(e);return n&&r.push(Rj(typeof n==`object`?n:void 0)),r};function Bj(e){let t=Pj(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Xk(n))c=$k(n);else throw Error(cM(1));let l;l=typeof r==`function`?r(t):t();let u=eA;i&&(u=Oj({trace:!1,...typeof i==`object`&&i}));let d=zj(tA(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Zk(c,o,p)}function Vj(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(cM(28));if(r in t)throw Error(cM(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Hj(e){return typeof e==`function`}function Uj(e,t){let[n,r,i]=Vj(t),a;if(Hj(e))a=()=>jj(e());else{let t=jj(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(hA(e)){let r=n(e,t);return r===void 0?e:r}else if(gA(e))return wj(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var Wj=Symbol.for(`rtk-slice-createasyncthunk`);function Gj(e,t){return`${e}/${t}`}function Kj({creators:e}={}){let t=e?.asyncThunk?.[Wj];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(cM(11));let i=(typeof e.reducers==`function`?e.reducers(Yj()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(cM(12));if(n in o.sliceCaseReducersByType)throw Error(cM(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Gj(n,r),createNotation:typeof e.reducers==`function`};Zj(a)?$j(o,a,s,t):Xj(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Vj(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Uj(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Mj(d,r,m)),i}function i(t=l){return Mj(Mj(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=qj(a,t,()=>Mj(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function qj(e,t,n,r){function i(i,...a){let o=t(i);
102return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Jj=Kj();function Yj(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function Xj({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Qj(r))throw Error(cM(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?kj(e,o):kj(e))}function Zj(e){return e._reducerDefinitionType===`asyncThunk`}function Qj(e){return e._reducerDefinitionType===`reducerWithPrepare`}function $j({type:e,reducerName:t},n,r,i){if(!i)throw Error(cM(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||eM,pending:s||eM,rejected:c||eM,settled:l||eM})}function eM(){}var tM=`listener`,nM=`completed`,rM=`cancelled`;`${rM}`,`${nM}`,`${tM}${rM}`,`${tM}${nM}`;var{assign:iM}=Object,aM=`listenerMiddleware`,oM=iM(kj(`${aM}/add`),{withTypes:()=>oM});`${aM}`;var sM=iM(kj(`${aM}/remove`),{withTypes:()=>sM});function cM(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var lM=Jj({name:`canvas`,initialState:{hasCanvasContent:!1},reducers:{setHasCanvasContent(e,t){e.hasCanvasContent=t.payload}}}),{setHasCanvasContent:uM}=lM.actions,dM=lM.reducer,fM=({className:e,viewMode:t=`split`})=>{let[n,r]=(0,y.useState)([]),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(!1),u=y.useRef(null),[d,f]=(0,y.useState)(null),p=(0,y.useRef)(null),m=(0,y.useRef)(null),h=(0,y.useRef)(null),{session:g,user:_,profile:v}=_l(),b=(0,y.useRef)(null),{toast:x}=pl(),[S,C]=(0,y.useState)(null),w=He(),[T,E]=(0,y.useState)(null),[D,O]=(0,y.useState)(!1),k=Wk(),[A,j]=(0,y.useState)(!1),[M,N]=(0,y.useState)(null),ee=We(),[te,ne]=(0,y.useState)(``),[re,ie]=(0,y.useState)(30),[ae,oe]=(0,y.useState)(``),se=Gk(e=>e.canvas.hasCanvasContent),[ce,le]=(0,y.useState)(!1),[ue,de]=(0,y.useState)(null),[fe,pe]=(0,y.useState)(null),[me,he]=(0,y.useState)(!1),[ge,_e]=(0,y.useState)(null),[ve,ye]=(0,y.useState)(null),[be,xe]=(0,y.useState)(null),[Se,Ce]=(0,y.useState)(null),[we,Te]=(0,y.useState)(null),Ee=(0,y.useRef)(!1),De=(0,y.useRef)([]),{data:Oe}=sr({queryKey:[`active-job-listings`,_?.id],queryFn:async()=>{if(!_?.id)return[];let e=R.from(`job_listings`).select(`id, title, organization_id`).eq(`status`,`active`).order(`created_at`,{ascending:!1});v?.user_type===`organization`&&_?.id&&(e=e.eq(`created_by`,_.id));let{data:t,error:n}=await e;return n?(console.error(`Error fetching job listings:`,n),[]):t||[]},enabled:!!_?.id&&D});(0,y.useEffect)(()=>{let e=()=>O(!0);return window.addEventListener(`openPublishDialog`,e),()=>window.removeEventListener(`openPublishDialog`,e)},[]),(0,y.useEffect)(()=>{D||(oe(``),N(null))},[D]),(0,y.useEffect)(()=>{let e=()=>he(!0);return window.addEventListener(`openResultsDialog`,e),()=>window.removeEventListener(`openResultsDialog`,e)},[]),(0,y.useEffect)(()=>{fe&&window.dispatchEvent(new CustomEvent(`evaluationResultsAvailable`,{detail:fe}))},[fe]);let{state:ke,handleSubmission:Ae}=ope(),je=()=>{m.current?.scrollIntoView({behavior:`smooth`})};(0,y.useEffect)(()=>{n.length>0&&je()},[n]);let Me=()=>{let e=document.getElementById(`canvas-container`),t=!!(e&&e.getAttribute(`data-generated`)===`true`);return k(uM(t)),t},Ne=e=>{let t=`Assessment`,n=e.match(/^#\s+(.+)$/m);n&&(t=n[1].replace(/Assessment$/,``).trim()+` Assessment`);let r=[],i=null,a=null,o=(e||``).split(/\r?\n/),s=!1,c=(e,t)=>{i={type:t,title:e,questions:[]},r.push(i),a=null,s=!1},l=e=>{!i||s||(a={prompt:e.trim(),options:[]},i.questions.push(a))},u=e=>{if(!a||s)return;let t=e.replace(/^\s*-\s*\[(?:x|X| )\]\s*/,``);t=t.replace(/^\s*[A-Da-d]\)\s*/,``),a.options.push(t.trim())};for(let e of o){let t=e.trimEnd();if(/^\s*#{2}
102\s+(?!Multiple-Choice|Multi-Select|Short Answer|Long Answer)/i.test(t)){s=!0,i=null;continue}if(/^\s*#{2}\s+Multiple-Choice/i.test(t)){c(`Multiple-choice Questions`,`mc`);continue}if(/^\s*#{2}\s+Multi-Select/i.test(t)){c(`Multi-select Questions`,`ms`);continue}if(/^\s*#{2}\s+Short\s+Answer/i.test(t)){c(`Short Answer Questions`,`sa`);continue}if(/^\s*#{2}\s+Long\s+Answer/i.test(t)){c(`Long Answer Questions`,`la`);continue}if(s)continue;let n=t.match(/^\s*#{3}\s+Question\s+(\d+)\.\s+(.*)/i);if(n&&i){l(n[2].trim());continue}if(i&&(i.type===`mc`||i.type===`ms`)&&/^\s*-\s*\[(?:x|X| )\]\s*[A-D]\)/i.test(t)){u(t);continue}i&&(i.type===`sa`||i.type===`la`)&&/^\s*Model\s+answer:\s*/i.test(t)}if(r.length===0||r.every(e=>e.questions.length===0))return console.warn(`No valid assessment sections found in markdown`),``;let d=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),f=0,p=r.map(e=>{let t=0,n=e.questions.map(n=>{t+=1,f+=1;let r=`q_${f}`;if(e.type===`mc`||e.type===`ms`){let i=e.type===`ms`?`checkbox`:`radio`,a=n.options.map((e,t)=>{let n=`${r}_opt_${t+1}`;return`<li class="option-li"><input id="${n}" type="${i}" name="${r}" value="${d(e)}"><label for="${n}">${d(e)}</label></li>`}).join(``);return`<article class="question"><h3>${t}. ${d(n.prompt)}</h3><ul class="options">${a}</ul></article>`}let i=e.type===`la`?6:3;return`<article class="question"><h3>${t}. ${d(n.prompt)}</h3><textarea name="${r}" rows="${i}" class="w-full p-2 border rounded"></textarea></article>`}).join(``);return`<section class="section"><h2>${d(e.title)}</h2>${n}</section>`}).join(``);return` 103<div id="assessment-root" data-source-present="true"> 104 <h1 class="title">${d(t)}</h1> 105 <p class="desc">Answer the following questions. Select one option for Multiple-choice, multiple options for Multi-select, and write your responses for Short/Long Answer.</p> 106 <form id="assessmentForm">${p} 107 <div class="mt-6"><button type="submit" class="submit">Submit Assessment</button></div> 108 </form> 109</div> 110<style> 111 #assessment-root { max-width: 940px; margin: 0 auto; padding: 28px; font-size: 16.5px; line-height: 1.65; } 112 .title { font-size: 32px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.01em; } 113 .desc { color: #374151; margin-bottom: 22px; } 114 h2 { font-size: 22px; font-weight: 800; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; margin-top: 32px; } 115 .question { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px 18px 14px; margin-top: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); } 116 .question h3 { font-size: 19px; font-weight: 700; margin: 6px 0 14px; line-height: 1.45; } 117 .options { list-style: none; padding-left: 0; margin: 0; } 118 .options .option-li { display: grid; grid-template-columns: 20px 1fr; align-items: start; column-gap: 14px; row-gap: 6px; padding: 8px 10px; border-radius: 10px; } 119 .options .option-li input { width: 18px; height: 18px; margin-top: 3px; accent-color: #4f46e5; } 120 .options .option-li label { line-height: 1.8; } 121 .options .option-li:hover { background: #f9fafb; } 122 .submit { background: #4f46e5; color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; border: 1px solid #4338ca; box-shadow: 0 1px 1px rgba(0,0,0,0.04); } 123 .submit:hover { background: #4338ca; } 124 textarea { width: 100%; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; font-size: 16px; } 125</style>`},Pe=e=>{console.log(`generateChartFromMarkdown called with markdown length:`,e.length);try{let t=e.match(/```chart\s*\n([\s\S]*?)\n```/);if(!t)return console.warn(`No chart block found in markdown`),console.log(`Markdown content:`,e.substring(0,200)),``;let n=t[1].trim();console.log(`Extracted chart JSON:`,n.substring(0,150)+`...`);let r=JSON.parse(n);if(console.log(`Parsed chart config:`,r),!r.type||!r.data)throw Error(`Chart must have type and data fields`);let{type:i,title:a,data:o}=r,{labels:s,datasets:c}=o,l=s.map((e,t)=>({name:e,value:c[0].data[t]})),u=c[0]?.backgroundColor||[`#4f46e5`,`#06b6d4`,`#10b981`,`#f59e0b`,`#ef4444`],d=`chart-${Math.random().toString(36).slice(2,9)}`,f=JSON.stringify({type:i,title:a,data:l,colors:u,dataKey:`value`});return` 126<div id="chart-root-${d}" data-chart-present="true"> 127 <div style="max-width: 1200px; margin: 0 auto; padding: 32px;"> 128 <h1 style="font-size: 28px; font-weight: 700; margin-bottom: 24px; color: #1f2937; text-align: center;">${a||`Visualization`}</h1> 129 <div id="${d}" class="chart-container" data-chart='${f.replace(/'/g,`'`)}'></div> 130 </div> 131</div>`}catch(e){return console.error(`Chart parsing error:`,e),``}};(0,y.useEffect)(()=>{(async()=>{De.current=[];let e=new URLSearchParams(window.location.search),t=e.get(`job_id`);
131if(t){let e=localStorage.getItem(`jobId`);if(e&&e===t){_e(e),ye(localStorage.getItem(`jobTitle`)),xe(localStorage.getItem(`jobDescription`)),Ce(localStorage.getItem(`jobRequirements`));let t=localStorage.getItem(`jobSkillsRequired`);Te(t?JSON.parse(t):null)}else _e(t),ye(null),xe(null),Ce(null),Te(null)}try{let t=e.get(`id`),n=e.get(`artifact`);e.get(`type`);let i=e.get(`action`);if(!Ee.current&&i===`create_assessment`&&(v?.user_type===`organization`||v?.user_type===`admin`)){Ee.current=!0;let e=localStorage.getItem(`jobTitle`),t=localStorage.getItem(`jobDescription`),n=localStorage.getItem(`jobRequirements`),i=localStorage.getItem(`jobSkillsRequired`),a=localStorage.getItem(`OrganizationName`),o=i?JSON.parse(i):null,s=[],c=e?`for the role of "${e}"`:``,l=`Create a comprehensive assessment outline ${c}. Do NOT produce HTML in this response.`;t&&s.push(`Job Description:\n${t}`),n&&s.push(`Requirements:\n${n}`),o&&o.length>0&&s.push(`Skills Required:\n${o.join(`, `)}`),a&&s.push(`Organization Name:\n${a}`);let u={role:`user`,content:[l,...s].join(` 132 133`)+` 134 135`,displayContent:`Create a comprehensive assessment ${c}.\n\n${s.join(` 136 137`)}\n\n(Generating assessment...)`,metaAction:`generate_assessment`};r([{role:`assistant`,content:`I'd be happy to help you create a comprehensive assessment. Please provide any specific details about the program, level, or focus areas you have in mind.`}]),setTimeout(()=>{Re(u)},300);return}if(t&&_){C(t),s(!0);try{let{data:e,error:n}=await R.from(`saved_sessions`).select(`title, content, session_type`).eq(`id`,t).eq(`user_id`,_.id).single();if(n)throw n;if(e?.content)if(e.session_type===`chat`)try{let t=typeof e.content==`string`?e.content:JSON.stringify(e.content),n=JSON.parse(t);Array.isArray(n)&&(r(n),x({title:`Chat loaded`,description:`Previous conversation has been loaded`}))}catch(e){console.error(`Error parsing saved chat:`,e)}else{let n=document.getElementById(`canvas-container`);n&&b.current!==t&&(b.current=t,n.innerHTML=String(e.content),Mk(),k(uM(!0)),x({title:e.title||`Artifact`,description:`Loaded into canvas`}))}}catch(e){console.error(`Error loading chat:`,e),x({title:`Error`,description:`Failed to load saved chat`,variant:`destructive`})}finally{s(!1)}}else if(n&&_){if(b.current===n)return;s(!0);try{let{data:e,error:t}=await R.from(`saved_sessions`).select(`title, content`).eq(`id`,n).eq(`user_id`,_.id).single();if(t)throw t;if(e?.content){let t=document.getElementById(`canvas-container`);t&&(b.current=n,t.innerHTML=typeof e.content==`string`?e.content:JSON.stringify(e.content),Mk(),k(uM(!0)),t.querySelectorAll(`form`).forEach(e=>{e.addEventListener(`submit`,Xe)}),t.querySelectorAll(`[data-action]`).forEach(e=>{e.addEventListener(`click`,rt)}),x({title:`Artifact loaded`,description:`${e.title} has been loaded`}))}}catch(e){console.error(`Error loading artifact:`,e),x({title:`Error`,description:`Failed to load artifact`,variant:`destructive`})}finally{s(!1)}}}catch(e){console.error(`Error injecting hidden system message:`,e)}})()},[_,v,w.search,w.pathname]);let Fe=e=>{if(e.target.files&&e.target.files[0]){let t=e.target.files[0];if(![`application/pdf`,`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`image/jpeg`,`image/png`,`image/gif`].includes(t.type)){x({title:`Invalid file type`,description:`Please upload a PDF, DOC, DOCX, or image file only.`,variant:`destructive`});return}if(t.size>5*1024*1024){x({title:`File too large`,description:`Please upload a file smaller than 5MB.`,variant:`destructive`});return}f(t),x({title:`File selected`,description:`Ready to send: ${t.name}`})}},Ie=()=>{f(null),p.current&&(p.current.value=``)},Le=e=>{let t=``,n=``,r=``;for(let i of e)if(i.role===`user`&&i.content){let e=i.content.match(/(?:company|organization|business|employer)[:\s]+([A-Za-z0-9\s&]+)(?:\.|\,|\s|$)/i);e&&e[1]&&(t=e[1].trim());let a=i.content.match(/(https?:\/\/[^\s]+)/g);a&&(n=a[0]);let o=i.content.match(/(?:position|role|job)[:\s]+(.*?)(?:\.|\,|\n|for|at|$)/i);o&&o[1]&&(r=o[1].trim())}return{companyName:t,companyWebsite:n,jobRole:r}},Re=async e=>{let t=e||{role:`user`,content:i,...d?{fileAttachment:{name:d.name,type:d.type,content:await Be(d)}}:{}};if(!e&&i.trim()===``&&!d)return;if(!e&&d)try{let e=await Be(d);t.fileAttachment={name:d.name,type:d.type,content:e},t.content=i?`${i}\n\nAttached file: ${d.name}`:`Attached file for analysis: ${d.name}`}catch(e){console.error(`Error processing file:`,e),x({title:`Error processing file`,description:`Failed to process the attached file.`,variant:`destructive`});return}let o={...t};o.displayContent&&(o.content=o.displayContent),r(e=>[...e,o]),a(``),f(null),p.current&&(p.current.value=``),s(!0);try{let i=g?.access_token;if(!i)throw Error(`No authentication token found`);let a=t.content.toLowerCase(),o=a.includes(`job description`)||a.includes(`create assessment`)||a.includes(`skills assessment`)||a.includes(`technical test`)||a.includes(`hiring`),s=null,c=e?.metaAction||T;o&&v?.user_type===`organization`&&(s=Le([...n,t]),e?.metaAction&&(c=e.metaAction));let l=null,d=document.getElementById(`canvas-container`);if(console.log(`[Canvas Context Debug] hasCanvasContent:`,se),console.log(`[Canvas Context Debug] canvasContainer exists:`,!!d),d){let e=u.current||(d instanceof HTMLElement?d.innerHTML:``);if(console.log(`[Canvas Context Debug] Canvas HTML length:`,e?.length||0),e&&e.trim()!==``&&e.length>50){let t=document.createElement(`div`);t.innerHTML=e;let n=t.textContent||t.innerText||``,r=t.querySelector(`h1, h2, h3, h4`)?.textContent?.trim()||`Artifact`;console.log(`[Canvas Context Debug] Artifact title:`,r),console.log(`[Canvas Context Debug] Text content length:`,n.length),l={t
137itle:r,html:e.substring(0,2e3),text:n.substring(0,3e3)},console.log(`[Canvas Context Debug] Canvas context created:`,{title:l.title,htmlLength:l.html.length,textLength:l.text.length})}else console.log(`[Canvas Context Debug] Canvas HTML too short or empty, skipping context`)}else console.log(`[Canvas Context Debug] Canvas container not found`);let{data:f,error:p}=await R.functions.invoke(`chat-completion`,{body:{messages:[...De.current,...n,{...t,displayContent:void 0}],model:`gpt-4o`,action:c,fileAttachment:t.fileAttachment,userType:v?.user_type||`job_seeker`,companyInfo:s,canvasContext:l},headers:{Authorization:`Bearer ${i}`}});if(p)throw p;let m={role:`assistant`,content:f.message,contentType:f.contentType||void 0};r(e=>[...e,m]),console.log(`newAssistantMessage:`,m),f.contentType===`visualization`&&(console.log(`Visualization content detected, auto-generating chart...`),setTimeout(()=>{try{let e=Pe(f.message);e&&e.trim()!==``?(console.log(`Chart HTML generated, length:`,e.length),Ye(e),x({title:`Chart Created`,description:`Visualization displayed on canvas!`})):(console.error(`Chart HTML was empty or invalid`),x({title:`Chart Generation Failed`,description:`Unable to render chart. Check console for details.`,variant:`destructive`}))}catch(e){console.error(`Error in chart auto-generation:`,e),x({title:`Chart Error`,description:e instanceof Error?e.message:`Unknown error`,variant:`destructive`})}},500)),f.interactiveHtml&&Ye(f.interactiveHtml),Ue([...n,t,m])}catch(e){console.error(`Error sending message:`,e),x({title:`Error`,description:`Failed to send message: ${e.message||`Unknown error`}`,variant:`destructive`})}finally{s(!1)}},ze=async e=>{if(!g?.access_token){x({title:`Authentication Required`,description:`Please log in to submit your answers.`,variant:`destructive`});return}s(!0);try{let t=`Please evaluate the following interactive content submission: 138 139${Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(` 140`)} 141 142Please provide: 1431. Detailed feedback on each response 1442. Overall performance assessment 1453. Areas for improvement 1464. Recommendations for further learning 147 148Format your response as both a conversational message and provide structured feedback.`,i={role:`system`,content:`Assessment Evaluator: Please analyze the submitted answers and provide comprehensive feedback.`},a={role:`user`,content:t},{data:o,error:s}=await R.functions.invoke(`chat-completion`,{body:{messages:[...n,i,a],model:`gpt-4o`,action:`generate_assessment_feedback`,userType:v?.user_type||`job_seeker`},headers:{Authorization:`Bearer ${g.access_token}`}});if(s)throw s;let c={role:`assistant`,content:o.message};r(e=>[...e,a,c]),o.interactiveHtml&&Ye(o.interactiveHtml),de(e),le(!0),Ue([...n,a,c]),x({title:`Answers Submitted`,description:`Your answers have been evaluated successfully!`})}catch(e){console.error(`Error submitting answers:`,e),x({title:`Submission Error`,description:`Failed to submit answers: ${e.message||`Unknown error`}`,variant:`destructive`})}finally{s(!1)}},Be=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result==`string`){let e=r.result.split(`,`)[1];t(e)}else n(Error(`Failed to read file as base64`))},r.onerror=()=>
148n(r.error),r.readAsDataURL(e)}),Ve=e=>{let t=e.find(e=>e.role===`user`);if(!t)return`Untitled Chat`;let n=t.content;if(n.startsWith(`Attached file for analysis:`))return`Analysis: ${n.replace(`Attached file for analysis:`,``).trim().substring(0,40)}`;let r=n.split(/[.!?]\s+/)[0];return r.length<=40?r:n.substring(0,40)+`...`},Ue=async(e=n,t=!1)=>{if(!(!_||e.length<=1))try{l(!0);let n=Ve(e);if(S){let{error:t}=await R.from(`saved_sessions`).update({title:n,content:JSON.stringify(e),updated_at:new Date().toISOString()}).eq(`id`,S).eq(`user_id`,_.id);if(t)throw t}else{let{data:t,error:r}=await R.from(`saved_sessions`).insert({user_id:_.id,title:n,session_type:`chat`,content:JSON.stringify(e)}).select(`id`).single();if(r)throw r;if(t?.id){let e=new URLSearchParams(window.location.search);e.set(`id`,t.id),e.delete(`action`),window.history.replaceState(null,``,`${window.location.pathname}?${e.toString()}`),C(t.id)}}t&&x({title:`Chat saved`,description:`Your conversation has been saved successfully`})}catch(e){console.error(`Error saving chat:`,e),x({title:`Error`,description:`Failed to save chat: ${e.message||`Unknown error`}`,variant:`destructive`})}finally{l(!1)}},Ge=async()=>{if(n.length===0){x({title:`No messages`,description:`No messages to convert`,variant:`destructive`});return}s(!0);try{console.log(`Searching for interactive content in messages (reversed)...`);let e=[...n].reverse(),t=[/#{2}\s+(Multiple-Choice|Multi-Select|Short\s+Answer|Long\s+Answer)/i,/#{3}\s+Question\s+\d+\./i,/-\s*\[(?:x|X| )\]\s*[A-D]\)/i],r=/```chart\s*\n[\s\S]*?\n```/,i=e=>t.filter(t=>t.test(e)).length>=2,a=e=>r.test(e),o=``,s=null;for(let t=0;t<e.length;t++){let n=e[t];if(n.role===`assistant`&&typeof n.content==`string`){if(console.log(`Checking message ${t}, contentType: ${n.contentType}, content: ${n.content.substring(0,100)}...`),n.contentType===`visualization`){o=n.content,s=`visualization`,console.log(`Found visualization content via contentType metadata!`);break}if(n.contentType===`assessment`){o=n.content,s=`assessment`,console.log(`Found assessment content via contentType metadata!`);break}if(a(n.content)){o=n.content,s=`visualization`,console.log(`Found chart content via pattern matching!`);break}if(i(n.content)){o=n.content,s=`assessment`,console.log(`Found assessment content via pattern matching!`);break}}}if(!o||!s)throw Error(`No interactive content found. Please create an assessment or visualization first.`);console.log(`Generating ${s} HTML from markdown...`);let c=``;if(c=s===`visualization`?Pe(o):Ne(o),!c||c.trim()===``)throw Error(`Failed to parse ${s}. The format may not match the expected structure.`);console.log(`Updating canvas with generated HTML...`),Ye(c),x({title:`Success`,description:s===`visualization`?`Chart visualization generated and displayed on canvas.`:`Interactive assessment generated and displayed on canvas.`})}catch(e){console.error(`Local generation error:`,e);let t=e instanceof Error?e.message:`Failed to generate interactive content`;x({title:`Error`,description:t,variant:`destructive`})}finally{s(!1)}},Ke=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Re())},qe=()=>{let e=document.querySelectorAll(`[data-chart]`);console.log(`initializeCharts called, found`,e.length,`chart containers`),e.forEach(e=>{try{let t=e.getAttribute(`data-chart`);if(!t){console.warn(`Chart container missing data-chart attribute`);return}console.log(`Raw config string:`,t.substring(0,100)+`...`);let{type:n,data:r,colors:i,dataKey:a}=JSON.parse(t.replace(/'/g,`'`));console.log(`Rendering chart - Type:`,n,`Data points:`,r?.length,`DataKey:`,a);let o=Math.max(...r.map(e=>typeof e[a]==`number`?e[a]:0)),s=``;if(n===`bar`)s=`<svg width="${r.length*100}" height="460" style="margin: 0 auto; display: block;"> 149 ${r.map((e,t)=>{let n=typeof e[a]==`number`?e[a]:0,r=n/o*400,s=t*100+40/2,c=400-r;return` 150 <rect x="${s}" y="${c}" width="60" height="${r}" fill="${Array.isArray(i)?i[t%i.length]:i}" rx="4"/> 151 <text x="${s+60/2}" y="420" text-anchor="middle" font-size="14" fill="#6b7280">${e.name}</text> 152 <text x="${s+60/2}" y="${c-8}" text-anchor="middle" font-size="13" font-weight="600" fill="#374151">${n}</text> 153 `}).join(``)} 154 </svg>`;else if(n===`pie`||n===`doughnut`){let e=n===`doughnut`?80:0,t=r.reduce((e,t)=>
154e+(typeof t[a]==`number`?t[a]:0),0),o=-90;s=`<svg width="450" height="400" style="margin: 0 auto; display: block;"> 155 ${r.map((n,r)=>{let s=(typeof n[a]==`number`?n[a]:0)/t*100/100*360,c=o,l=o+s,u=c*Math.PI/180,d=l*Math.PI/180,f=200+150*Math.cos(u),p=200+150*Math.sin(u),m=200+150*Math.cos(d),h=200+150*Math.sin(d),g=+(s>180),_=Array.isArray(i)?i[r%i.length]:i;o=l;let v=`M 200 200 L ${f} ${p} A 150 150 0 ${g} 1 ${m} ${h} Z`;if(e>0){let t=200+e*Math.cos(u),n=200+e*Math.sin(u);v=`M ${f} ${p} A 150 150 0 ${g} 1 ${m} ${h} L ${200+e*Math.cos(d)} ${200+e*Math.sin(d)} A ${e} ${e} 0 ${g} 0 ${t} ${n} Z`}return`<path d="${v}" fill="${_}" stroke="#fff" stroke-width="2"/>`}).join(``)} 156 </svg> 157 <div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 20px;"> 158 ${r.map((e,t)=>`<div style="display: flex; align-items: center; gap: 8px;"> 159 <div style="width: 16px; height: 16px; background: ${Array.isArray(i)?i[t%i.length]:i}; border-radius: 3px;"></div> 160 <span style="font-size: 14px; color: #374151;">${e.name}</span> 161 </div>`).join(``)} 162 </div>`}else s=`<div style="padding: 40px; text-align: center; color: #6b7280;"> 163 <div style="font-size: 48px; margin-bottom: 16px;">ð</div> 164 <div style="font-weight: 600; margin-bottom: 8px;">Chart Type: ${n}</div> 165 <div style="font-size: 14px;">Rendering for this chart type is in progress</div> 166 </div>`;e.innerHTML=`<div style="background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);"> 167 ${s} 168 </div>`}catch(t){console.error(`Error rendering chart:`,t),e.innerHTML=`<div style="padding: 20px; color: #ef4444;">Error rendering chart</div>`}})},Je=e=>{let t=Math.random().toString(36).slice(2,10),n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`[id]`).forEach(e=>{let n=e.getAttribute(`id`);n&&e.setAttribute(`id`,`${n}-${t}`)}),n.querySelectorAll(`style`).forEach(e=>{e.textContent=e.textContent?.replace(/#([A-Za-z0-9_-]+)/g,(e,n)=>`#${n}-${t}`)||``}),n.body.innerHTML},Ye=(e,t)=>{t?.keepOriginal!==!1&&(u.current=e);let n=document.getElementById(`canvas-container`);if(!n)return;n.innerHTML=Je(e),n.setAttribute(`data-generated`,`true`),Mk(),qe(),k(uM(!0));let r=`akito-live-marking-styles`;if(!document.getElementById(r)){let e=document.createElement(`style`);e.id=r,e.textContent=` 169 .ak-correct { background-color: rgba(16,185,129,0.18) !important; outline: 2px solid rgba(16,185,129,0.55); border-radius: 6px; } 170 .ak-incorrect { background-color: rgba(239,68,68,0.12) !important; outline: 2px solid rgba(239,68,68,0.55); border-radius: 6px; } 171 .ak-muted { opacity: 0.55; } 172 .ak-score-banner { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; background: #eefdf6; color: #065f46; font-weight: 600; border: 1px solid #a7f3d0; } 173 .ak-expl { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; background: #f8fafc; color: #0f172a; border: 1px solid #e2e8f0; white-space: pre-wrap; } 174 input[type="radio"].ak-correct, input[type="checkbox"].ak-correct { accent-color: #10b981; } 175 input[type="radio"].ak-incorrect, input[type="checkbox"].ak-incorrect { accent-color: #ef4444; } 176 .ak-expl-panel { position: relative; padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; margin-bottom: 12px; } 177 .ak-expl-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; border: 1px dashed #e5e7eb; margin-top: 8px; cursor: pointer; } 178 .ak-expl-item:hover { background: #f9fafb; } 179 .ak-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin-left: 6px; } 180 .ak-chip-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; } 181 .ak-chip-bad { background: #fef2f2; color: #7f1d1d; border-color: #fecaca; } 182 .validation-error { 183 background-color: rgba(239,68,68,0.08) !important; 184 border: 2px solid rgba(239,68,68,0.4) !important; 185 animation: shake 0.5s ease-in-out; 186 position: relative; 187 } 188 .validation-error::before { 189 content: 'â ï¸ This question is required'; 190 position: absolute; 191 top: -8px; 192 left: 12px; 193 background: #fef2f2; 194 color: #dc2626; 195 padding: 2px 8px; 196 border-radius: 4px; 197 font-size: 12px; 198 font-weight: 600; 199 border: 1px solid #fecaca; 200 } 201 @keyframes shake { 202 0%, 100% { transform: translateX(0); } 203 25% { transform: translateX(-5px); } 204 75% { transform: translateX(5px); } 205 } 206 `,document.head.appendChild(e)}},Xe=e=>{e.preventDefault();let t=e.target,n=new FormData(t),r={};
206n.forEach((e,t)=>{r[t]=e}),console.log(`Form submitted with data:`,r),ze(r)},Ze=()=>{let e=document.getElementById(`canvas-container`);if(!e)return``;let t=e.cloneNode(!0);return t.querySelectorAll(`input`).forEach(e=>{let t=e;t.type===`checkbox`||t.type===`radio`?t.checked?t.setAttribute(`checked`,`checked`):t.removeAttribute(`checked`):t.setAttribute(`value`,t.value||``)}),t.querySelectorAll(`textarea`).forEach(e=>{let t=e;t.textContent=t.value||``}),t.innerHTML},Qe=()=>{let e=new Map,t=document.getElementById(`canvas-container`);if(!t)return e;let n=0;return Array.from(t.querySelectorAll(`div, section, article`)).filter(e=>e.querySelector(`input[type="radio"], input[type="checkbox"], textarea, input[type="text"]`)).forEach(t=>{let r=(t.textContent||``).match(/Correct\s*Answer\s*:\s*([A-D](?:\s*,\s*[A-D])*)/i);if(r){let t=r[1].split(/\s*,\s*/).map(e=>e.trim().toUpperCase());e.set(n,t)}n++}),e},$e=e=>{let t=document.getElementById(`canvas-container`);t&&Array.from(t.querySelectorAll(`div, section, article`)).filter(e=>e.querySelector(`input[type="radio"], input[type="checkbox"]`)).forEach((t,n)=>{let r=e.get(n)||[];Array.from(t.querySelectorAll(`label, .option, p`)).forEach(e=>{let t=(e.textContent||``).trim().match(/^([A-D])[\).\-]/i);if(!t)return;let n=t[1].toUpperCase(),i=e.querySelector(`input`)||e.previousElementSibling,a=i?!!i.checked:!1;e.classList.remove(`ak-correct`,`ak-incorrect`),a&&r.includes(n)?(e.classList.add(`ak-correct`),i&&i.classList.add(`ak-correct`)):a&&!r.includes(n)?(e.classList.add(`ak-incorrect`),i&&i.classList.add(`ak-incorrect`)):!a&&r.includes(n)&&e.classList.add(`ak-correct`,`ak-muted`)});let i=`ak-correct-tag-${n}`,a=t.querySelector(`#${i}`);a||(a=document.createElement(`div`),a.id=i,a.style.fontSize=`12px`,a.style.marginTop=`6px`,a.style.color=`#065f46`,t.appendChild(a)),r.length&&(a.textContent=`Correct: ${r.join(`, `)}`)})},et=()=>{let e=document.getElementById(`canvas-container`);if(!e)return{valid:!1,message:`Canvas not found`};let t=e.querySelectorAll(`.question, article.question`),n=[];if(t.forEach(e=>{e.classList.remove(`validation-error`)}),t.forEach((e,t)=>{let r=!1,i=e.querySelectorAll(`input[type="radio"]`);if(i.length>0){r=Array.from(i).some(e=>e.checked),r||(n.push(t+1),e.classList.add(`validation-error`));return}let a=e.querySelectorAll(`input[type="checkbox"]`);if(a.length>0){r=Array.from(a).some(e=>e.checked),r||(n.push(t+1),e.classList.add(`validation-error`));return}let o=e.querySelectorAll(`input[type="text"], textarea`);if(o.length>0){r=Array.from(o).some(e=>e.value.trim()!==``),r||(n.push(t+1),e.classList.add(`validation-error`));return}}),n.length>0){let e=`Please answer ${n.length===1?`question`:`questions`} ${n.join(`, `)} before submitting.`,r=t[n[0]-1];return r&&r.scrollIntoView({behavior:`smooth`,block:`center`}),{valid:!1,message:e}}return{valid:!0,message:``}},tt=async()=>{if(!g?.access_token){x({title:`Authentication Required`,description:`Please log in to submit your answers.`,variant:`destructive`});return}let e=et();if(!e.valid){x({title:`Incomplete Assessment`,description:e.message,variant:`destructive`});return}window.dispatchEvent(new Event(`assessmentSubmitting`));let t=document.getElementById(`canvas-container`),n=t?.querySelector(`button[type="submit"], .submit`);try{s(!0),n&&(n.disabled=!0,n.style.opacity=`0.5`,n.style.cursor=`not-allowed`),x({title:`Evaluating Assessment`,description:`Your assessment is being evaluated. Please wait...`});let e=Ze(),{data:r,error:i}=await R.functions.invoke(`evaluate-assessment`,{body:{model:`gpt-4o`,submission_snapshot:e},headers:{Authorization:`Bearer ${g.access_token}`}});if(i)throw i;let a=Qe();if(a.size&&$e(a),t&&t.querySelectorAll(`.ak-score-banner, .ak-expl, .ak-expl-panel`).forEach(e=>e.remove()),r?.explanation_to_evaluation){let e=r.explanation_to_evaluation,t=e.split(/\s(?=\d+\.)/).filter(Boolean);pe({score:r.evaluated_score||0,totalScore:r.total_score||100,explanation:e,items:t.length>1?t:null,questions:r.questions||[],raw_earned:r.raw_earned,raw_total:r.raw_total})}x({title:`Submitted`,description:`Evaluation complete. Click "View Results" to see details.`})}catch(e){console.error(`Live assessment submit error:`,e),x({title:`Error`,description:e.message||`Failed to evaluate assessment.`,variant:`destructive`})}finally{n&&(n.disabled=!1,n.style.opacity=`1`,n.style.cursor=`pointer`),s(!1),window.dispatchEvent(new Event(`assessmentSubmitComplete`))}};y.useEffect(()=>{window.handleInteractiveSubmission=tt},[g]);let nt=async()=>
206{if(!_)return;let e=document.getElementById(`canvas-container`);if((!e||e.children.length===0)&&!u.current){x({title:`Cannot Save`,description:`There is no content in the canvas to save`,variant:`destructive`});return}try{l(!0);let t=u.current||(e instanceof HTMLElement?e.innerHTML:``),n=`document`;t.includes(`chart`)||t.includes(`graph`)?n=`chart`:t.includes(`assessment`)||t.includes(`quiz`)?n=`assessment`:t.includes(`resume`)||t.includes(`cv`)?n=`cv_review`:t.includes(`job description`)&&(n=`job_description`);let r=``,i=document.createElement(`div`);i.innerHTML=t;let a=i.querySelector(`h1, h2, h3, h4`),o=null;try{let e=localStorage.getItem(`jobId`),t=ge!==void 0&&ge?ge:e;if(t){let{data:e}=await R.from(`job_listings`).select(`title`).eq(`id`,t).single();o=e?.title||null}}catch{}let s=typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID().slice(0,4):Math.random().toString(36).slice(2,6),c=a&&a.textContent?a.textContent.trim().substring(0,50):n.replace(`_`,` `);r=`${o||c} - ${s}`;let{data:d,error:f}=await R.from(`saved_sessions`).insert({user_id:_.id,title:r,session_type:n,content:t}).select(`id`).single();if(f)throw f;x({title:`Artifact Saved`,description:`Canvas content has been saved successfully`})}catch(e){console.error(`Error saving artifact:`,e),x({title:`Error`,description:`Failed to save artifact: ${e.message||`Unknown error`}`,variant:`destructive`})}finally{l(!1)}},rt=e=>{console.log(`handleInteractiveAction called`,e.target),e.preventDefault(),e.stopPropagation();let t=e.currentTarget,n=t.getAttribute(`data-action`);if(console.log(`Action:`,n,`Target:`,t),n===`submit-assessment`||n===`complete-assessment`||t.textContent?.toLowerCase().includes(`submit`)||t instanceof HTMLInputElement&&t.type===`submit`){console.log(`Handling interactive content submission`),Ae().then(e=>{e&&ze(e.data)});return}if(n===`submit-form`){let e=t.closest(`form`);e&&(console.log(`Submitting form`),e.dispatchEvent(new Event(`submit`,{bubbles:!0})));return}console.log(`No specific handler for action:`,n)},it=async()=>{if(!_||!g?.access_token){x({title:`Authentication Required`,description:`Please log in to publish assessments.`,variant:`destructive`});return}let e=u.current||document.getElementById(`canvas-container`);if(!e||e instanceof HTMLElement&&e.children.length===0){x({title:`Cannot Publish`,description:`There is no content in the canvas to publish`,variant:`destructive`});return}try{j(!0);let t=u.current||(e instanceof HTMLElement?e.innerHTML:``);console.log(`canvasContent:`,t);let n=`assessment`,r;try{let e=localStorage.getItem(`jobId`),i=ae||ge||e,{data:a,error:o}=await R.from(`assessments`).insert({job_id:i,type:n,content:JSON.stringify({html:t})}).select(`id`).single();o?console.warn(`Could not insert assessment:`,o.message):r=a?.id}catch(e){console.error(`Unexpected error inserting assessment:`,e)}let i=te||`Assessment - `+new Date().toLocaleDateString(),{data:a,error:o}=await R.from(`saved_sessions`).insert({user_id:_.id,title:i,session_type:n,content:t}).select(`id`).single();if(o)throw o;let s=a.id,c=crypto.randomUUID().slice(0,8),l=new Date(Date.now()+re*24*60*60*1e3).toISOString(),d=localStorage.getItem(`jobId`),f=ae||ge||d,{error:p}=await R.from(`assessment_links`).insert({job_id:f,link_code:c,expires_at:l,title:te,artifact_id:s,assessment_id:r,is_active:!0});if(p)throw console.error(`Error inserting assessment link:`,p),Error(`Failed to create assessment link`);let m=`${window.location.origin}/assessment/${c}`;N(m)}catch(e){console.error(`Error publishing assessment:`,e),x({title:`Error`,description:`Failed to publish assessment: ${e.message||`Unknown error`}`,variant:`destructive`})}finally{j(!1)}},at=()=>{M&&navigator.clipboard.writeText(M).then(()=>{x({title:`Link Copied`,description:`Assessment link copied to clipboard`})}).catch(e=>{console.error(`Could not copy link:`,e),x({title:`Error`,description:`Could not copy link to clipboard`,variant:`destructive`})})};(0,y.useEffect)(()=>{if(n.length===0&&!S&&v){let e={role:`assistant`,content:``};v.user_type===`organization`?e.content=`ð Hello! I'm Akito, your talent acquisition assistant. I can help you with: 207 208⢠Finding qualified candidates 209⢠Creating job descriptions 210⢠Skills assessment for candidates 211⢠Team building strategies 212⢠Understanding talent market trends 213 214You can upload files like job descriptions, candidate CVs, or skills matrices for analysis! Just click the paperclip icon to attach a file. 215 216How can I assist with your talent needs today?`:v.user_type===`career_tech`?e.content=`ð Hello! I'm Akito, your platform assistant. I can help you with: 217 218⢠Customizing assessments 219⢠Creating educational content 220⢠Integrating career tools 221⢠Monitoring user engagement 222⢠Analyzing platform metrics 223 224You can upload files like program descriptions, assessment frameworks, or curriculum outlines for analysis! Just click the paperclip icon to attach a file. 225 226How would you like to enhance your platform today?`:v.user_type===`admin`?e.content=`ð Hello! I'm Akito, your admin assistant. I can help you with: 227 228⢠System configuration 229⢠User management 230⢠Data source integration 231⢠API and model management 232⢠Platform analytics 233 234You can upload files like configuration specs, data schemas, or integration documentation for analysis! Just click the paperclip icon to attach a file. 235 236What administrative tasks would you like help with today?`:e.content=`ð Hello! I'm Akito, your career guidance assistant. I can help you with: 237 238⢠Career planning and development 239⢠Skills assessment and improvement 240⢠Job search strategies 241⢠Resume and interview preparation 242⢠Professional growth opportunities 243 244You can now upload files like CVs, certificates, or job descriptions for analysis! Just click the paperclip icon to attach a file. 245 246What would you like guidance on today?`,r([e])}},[S,v]),(0,y.useEffect)(()=>{setTimeout(()=>{Me()},200)},[n]),y.useEffect(()=>(window.submitAssessment=ot,window.submitQuiz=ot,window.submitForm=ot,window.completeAssessment=ot,window.provideFeedback=e=>{console.log(`provideFeedback called with:`,e),ot()},()=>{window.submitAssessment=void 0,window.submitQuiz=void 0,window.submitForm=void 0,window.completeAssessment=void 0,window.provideFeedback=void 0}),[]);let ot=()=>{console.log(`handleDirectSubmission called`),Ae().then(e=>{e&&ze(e.data)}).catch(e=>{console.error(`Error in direct submission:`,e),x({title:`Submission Error`,description:`Failed to submit interactive content. Please try again.`,variant:`destructive`})})};return(0,F.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden ${e}`,children:[(0,F.jsxs)(rw,{className:`flex-1 p-4 space-y-4`,ref:h,children:[(0,F.jsx)(zne,{children:n.map((e,t)=>(0,F.jsx)(r_.div,{initial:{opacity:0,y:20}
246,animate:{opacity:1,y:0},className:`flex ${e.role===`user`?`justify-end`:`justify-start`} mb-4`,children:(0,F.jsxs)(V,{className:`max-w-[85%] p-3 ${e.role===`user`?`bg-blue-50 border-blue-100`:`bg-white`}`,children:[(0,F.jsx)(Hse,{className:`prose prose-slate max-w-none 247 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-6 [&_h1]:text-gray-900 [&_h1]:border-b [&_h1]:border-gray-200 [&_h1]:pb-2 248 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-6 [&_h2]:text-gray-800 [&_h2]:border-b [&_h2]:border-gray-100 [&_h2]:pb-1 249 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-4 [&_h3]:text-gray-800 250 [&_h4]:text-base [&_h4]:font-semibold [&_h4]:mb-2 [&_h4]:mt-3 [&_h4]:text-gray-700 251 [&_p]:text-gray-700 [&_p]:leading-relaxed [&_p]:mb-4 [&_p]:text-[15px] 252 [&_strong]:text-gray-900 [&_strong]:font-semibold 253 [&_em]:text-gray-600 [&_em]:italic 254 [&_ul]:my-3 [&_ul]:ml-6 [&_ul]:space-y-2 255 [&_ol]:my-3 [&_ol]:ml-6 [&_ol]:space-y-2 256 [&_li]:text-gray-700 [&_li]:leading-relaxed [&_li]:text-[15px] 257 [&_li>ul]:mt-2 [&_li>ul]:mb-1 258 [&_li>ol]:mt-2 [&_li>ol]:mb-1 259 [&_ul_li]:marker:text-blue-500 260 [&_ol_li]:marker:text-blue-600 [&_ol_li]:marker:font-semibold 261 [&_blockquote]:border-l-4 [&_blockquote]:border-blue-500 [&_blockquote]:bg-blue-50 [&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:my-4 [&_blockquote]:italic [&_blockquote]:text-gray-700 [&_blockquote]:rounded-r 262 [&_code]:bg-gray-100 [&_code]:text-red-600 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono 263 [&_pre]:bg-gray-900 [&_pre]:text-gray-100 [&_pre]:p-4 [&_pre]:rounded-lg [&_pre]:overflow-x-auto [&_pre]:my-4 [&_pre]:border [&_pre]:border-gray-700 264 [&_pre_code]:bg-transparent [&_pre_code]:text-gray-100 [&_pre_code]:p-0 [&_pre_code]:text-sm [&_pre_code]:font-mono 265 [&_table]:w-full [&_table]:my-4 [&_table]:border-collapse [&_table]:text-sm 266 [&_th]:bg-gray-100 [&_th]:px-4 [&_th]:py-2 [&_th]:text-left [&_th]:font-semibold [&_th]:text-gray-900 [&_th]:border [&_th]:border-gray-300 267 [&_td]:px-4 [&_td]:py-2 [&_td]:border [&_td]:border-gray-300 [&_td]:text-gray-700 268 [&_tr:nth-child(even)]:bg-gray-50 269 [&_hr]:my-6 [&_hr]:border-t-2 [&_hr]:border-gray-200 270 [&_a]:text-blue-600 [&_a]:underline [&_a]:hover:text-blue-800 271 [&>*:first-child]:mt-0 272 [&>*:last-child]:mb-0`,remarkPlugins:[eue,rue],children:e.contentType===`visualization`?e.content.replace(/```chart\s*\n[\s\S]*?\n```/g,` 273 274_[Chart will be displayed on canvas when you click "Generate Interactive Content"]_ 275`):e.content}),e.fileAttachment&&(0,F.jsxs)(`div`,{className:`mt-2 flex items-center text-xs text-gray-500 bg-gray-50 p-1 rounded`,children:[(0,F.jsx)(A_,{size:12,className:`mr-1`}),(0,F.jsx)(`span`,{className:`truncate`,children:e.fileAttachment.name})]})]})},`message-${t}`))}),ce&&ue&&(0,F.jsx)(`div`,{className:`mb-4`,children:(0,F.jsx)(upe,{data:ue,questions:[],onFeedbackReceived:e=>{console.log(`Feedback received:`,e)}})}),(0,F.jsx)(`div`,{ref:m}),o&&(0,F.jsx)(`div`,{className:`flex justify-center my-4`,children:(0,F.jsx)(F_,{className:`w-6 h-6 text-gray-400 animate-spin`})})]}),(0,F.jsx)(`div`,{className:`p-4 border-t bg-white shrink-0`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[n.length>1&&(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 flex-wrap`,children:[[...n].reverse().find(e=>e.role===`assistant`&&e.contentType===`assessment`)&&(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:nt,disabled:o||c,className:`text-sm flex items-center gap-1 transition-opacity ${se?`opacity-100`:`opacity-50 hover:opacity-100`}`,children:[c?(0,F.jsx)(F_,{className:`w-3 h-3 animate-spin mr-1`}):(0,F.jsx)(bre,{className:`w-3 h-3 mr-1`}),`Save Artifact`]}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:Ge,disabled:o,className:`text-sm opacity-100`,children:`Generate Interactive
275Content`})]}),d&&(0,F.jsxs)(`div`,{className:`flex items-center p-2 bg-gray-50 rounded mb-1`,children:[(0,F.jsx)(A_,{size:14,className:`mr-2 text-blue-500`}),(0,F.jsx)(`span`,{className:`text-sm truncate flex-1`,children:d.name}),(0,F.jsx)(B,{variant:`ghost`,size:`sm`,className:`p-1 h-auto`,onClick:Ie,children:(0,F.jsx)(Q_,{size:14})})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(SC,{placeholder:v?.user_type===`organization`?`Ask about creating job descriptions, assessments, or talent acquisition...`:`Type your message...`,value:i,onChange:e=>a(e.target.value),onKeyDown:Ke,className:`min-h-[60px] resize-none`,disabled:o}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(B,{variant:`outline`,size:`icon`,className:`rounded-full`,onClick:()=>p.current?.click(),disabled:o||!!d,title:`Upload file`,children:(0,F.jsx)(vre,{className:`w-4 h-4`})}),(0,F.jsx)(`input`,{type:`file`,ref:p,className:`hidden`,onChange:Fe,accept:`.pdf,.doc,.docx,image/jpeg,image/png,image/gif`}),(0,F.jsx)(B,{onClick:()=>Re(),disabled:o||i.trim()===``&&!d,className:`bg-akito-gradient text-white rounded-full`,size:`icon`,children:o?(0,F.jsx)(F_,{className:`w-4 h-4 animate-spin`}):(0,F.jsx)(Zne,{className:`w-4 h-4`})})]})]})]})}),v?.user_type!==`job_seeker`&&(0,F.jsx)(aE,{open:D,onOpenChange:O,children:(0,F.jsxs)(cE,{className:`sm:max-w-[500px]`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Publish Assessment`}),(0,F.jsx)(fE,{children:`Create a shareable link for candidates to take this assessment.`})]}),M?(0,F.jsxs)(`div`,{className:`flex flex-col items-center py-4 gap-4`,children:[(0,F.jsxs)(`div`,{className:`bg-green-50 text-green-800 rounded-lg p-4 w-full text-center`,children:[(0,F.jsx)(h_,{className:`w-6 h-6 mx-auto mb-2`}),(0,F.jsx)(`p`,{children:`Your assessment has been published successfully!`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>ee(M?.replace(window.location.origin,``)||`/`),className:`flex items-center gap-2 w-full bg-gray-50 p-3 rounded-md hover:bg-gray-100`,children:[(0,F.jsx)(P_,{className:`text-blue-500 flex-shrink-0`,size:18}),(0,F.jsx)(`span`,{className:`text-sm break-all flex-grow text-left underline text-blue-600`,children:M}),(0,F.jsx)(B,{variant:`ghost`,size:`sm`,onClick:e=>{e.stopPropagation(),at()},className:`flex-shrink-0`,children:(0,F.jsx)(are,{size:16})})]}),(0,F.jsxs)(`div`,{className:`text-sm text-gray-600`,children:[(0,F.jsx)(`p`,{children:`Share this link with candidates to allow them to take the assessment.`}),(0,F.jsxs)(`p`,{className:`mt-2`,children:[`The link will expire in `,re,` days.`]})]}),(0,F.jsx)(B,{variant:`default`,onClick:()=>O(!1),className:`mt-2`,children:`Close`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsx)(zu,{htmlFor:`title`,className:`text-right`,children:`Title`}),(0,F.jsx)(ku,{id:`title`,value:te,onChange:e=>ne(e.target.value),placeholder:`Assessment Title`,className:`col-span-3`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsxs)(zu,{htmlFor:`job`,className:`text-right`,children:[`Job Listing `,!ge&&(0,F.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,F.jsx)(`div`,{className:`col-span-3`,children:ge?(0,F.jsxs)(`div`,{className:`text-sm text-gray-600 py-2`,children:[`Already linked to:`,` `,(0,F.jsx)(`span`,{className:`font-medium`,children:ve||`Selected Job`})]}):(0,F.jsxs)(Tk,{value:ae,onValueChange:oe,children:[(0,F.jsx)(Dk,{id:`job`,children:(0,F.jsx)(Ek,{placeholder:`Select a job listing`})}),(0,F.jsx)(Ak,{children:Oe&&Oe.length>0?Oe.map(e=>(0,F.jsx)(jk,{value:e.id,children:e.title},e.id)):(0,F.jsx)(jk,{value:`no-jobs`,disabled:!0,children:`No active job listings found`})})]})})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsx)(zu,{htmlFor:`expiry`,className:`text-right`,children:`Expires in`}),(0,F.jsxs)(`div`,{className:`col-span-3 flex items-center gap-2`,children:[(0,F.jsx)(ku,{id:`expiry`,type:`number`,min:1,max:365,value:re,onChange:e=>ie(parseInt(e.target.value)||30)}),(0,F.jsx)(`span`,{children:`days`})]})]})]}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{variant:`outline`,onClick:()=>O(!1),children:`Cancel`}),(0,F.jsxs)(B,{onClick:it,disabled:A||!ge&&!ae,children:[A?(0,F.jsx)(F_,{className:`w-4 h-4 animate-spin mr-2`}):null,`Publish Assessment`]})]})]})]})}),(0,F.jsx)(aE,{open:me,onOpenChange:he,children:(0,F.jsxs)(cE,{className:`sm:max-w-[700px] max-h-[80vh] overflow-y-auto`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Detailed Explanation`}),(0,F.jsx)(fE,{children:`Review the detailed evaluation of your assessment submission.`})]}),fe&&(0,F.jsxs)(`div`,{className:`py-4`,children:[(0,F.jsxs)(`div`,{className:`bg-gradient-to-r from-green-50 to-blue-50 rounded-lg p-6 mb-6 text-center border border-green-200`,children:[(0,F.jsxs)(`div`,{className:`text-3xl font-bold mb-2 text-gray-800`,children:[fe.score,`%`]}),(0,F.jsx)(`div`,{className:`text-sm text-gray-600 mb-1`,children:`Final Score`}),fe.raw_earned!==void 0&&fe.raw_total!==void 0&&(0,F.jsxs)(`div`,{className:`text-xs text-gray-500 mt-2`,children:[`Raw Points: `,fe.raw_earned.toFixed(1),` /`,` `,fe.raw_total.toFixed(0)]})]}),fe.questions&&fe.questions.length>0?(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(`h3`,{className:`font-semibold text-lg mb-3`,children:`Question-by-Question Results:`}),fe.questions.map((e,t)=>{let n=e.result/e.max_points*100,r=n===100,i=n>0&&n<100,a=r?`bg-green-100 text-green-800 border-green-300`:i?`bg-yellow-100 text-yellow-800 border-yellow-300`:`bg-red-100 text-red-800 border-red-300`,o=r?`â Correct`:i?`â Partial`:`â Incorrect`;return(0,F.jsxs)(`div`,{className:`border rounded-lg p-4 hover:shadow-md transition-shadow bg-white`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsxs)(`span`,{className:`text-sm font-bold text-gray-700 bg-gray-100 px-2 py-1 rounded`,children:[`Q`,e.question_number]}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-700 rounded border border-blue-200`,children:{mcq:`MCQ`,"multi-select":`Multi-Select`,"short-q":`Short Answer`,"long-q":`Long Answer`}[e.type]||e.type}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 rounded border font-medium ${a}`,children:o})]}),(0,F.jsxs)(`span`,{className:`text-sm font-semibold text-gray-700`,children:[e.result.toFixed(1),` / `,e.max_points]})]}),(0,F.jsx)(`p`,{className:`text-sm text-gray-700 leading-relaxed mt-2`,children:e.explanation})]},t)})]}):(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsx)(`h3`,{className:`font-semibold text-lg mb-2`,children:`Evaluation Results:`}),fe.items?fe.items.map((e,t)=>
275{let n=e.trim(),r=!1,i=n.match(/Score\s*:\s*(\d+)\s*\/\s*(\d+)/i);return i?r=parseInt(i[1],10)>0:((/partially\s+correct/i.test(n)||/which\s+is\s+correct/i.test(n))&&(r=!0),(/which\s+is\s+incorrect/i.test(n)||/irrelevant/i.test(n))&&(r=!1)),(0,F.jsxs)(`div`,{className:`flex items-start justify-between p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition`,children:[(0,F.jsx)(`div`,{className:`flex-1 text-sm leading-relaxed`,children:n}),(0,F.jsx)(`span`,{className:`ml-3 px-2 py-1 text-xs font-medium rounded-full flex-shrink-0 ${r?`bg-green-100 text-green-800 border border-green-200`:`bg-red-100 text-red-800 border border-red-200`}`,children:r?`OK`:`Check`})]},t)}):(0,F.jsx)(`div`,{className:`p-4 bg-gray-50 rounded-lg border border-gray-200`,children:(0,F.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-wrap`,children:fe.explanation})})]})]}),(0,F.jsx)(uE,{children:(0,F.jsx)(B,{variant:`default`,onClick:()=>he(!1),children:`Close`})})]})})]})},pM=jl(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function mM({className:e,variant:t,...n}){return(0,F.jsx)(`div`,{className:z(pM({variant:t}),e),...n})}function hM(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function gM(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function _M(e,t){let n=hM(e);return isNaN(t)?gM(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function vM(e,t){let n=hM(e);if(isNaN(t))return gM(e,NaN);if(!t)return n;let r=n.getDate(),i=gM(e,n.getTime());return i.setMonth(n.getMonth()+t+1,0),r>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}var yM=365.2425,bM=6048e5,xM=864e5,SM=43200,CM=1440,wM=3600*24;wM*7,wM*yM/12*3;var TM={};function EM(){return TM}function DM(e,t){let n=EM(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=hM(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function OM(e){return DM(e,{weekStartsOn:1})}function kM(e){let t=hM(e),n=t.getFullYear(),r=gM(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=OM(r),a=gM(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=OM(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function AM(e){let t=hM(e);return t.setHours(0,0,0,0),t}function jM(e){let t=hM(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function MM(e,t){let n=AM(e),r=AM(t),i=+n-jM(n),a=+r-jM(r);return Math.round((i-a)/xM)}function NM(e){let t=kM(e),n=gM(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),OM(n)}function PM(e,t){return _M(e,t*7)}function FM(e,t){return vM(e,t*12)}function IM(e){let t;return e.forEach(function(e){let n=hM(e);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function LM(e){let t;return e.forEach(e=>{let n=hM(e);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function RM(e,t){let n=hM(e),r=hM(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function zM(e){return gM(e,Date.now())}function BM(e,t){let n=AM(e),r=AM(t);return+n==+r}function VM(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function HM(e){if(!VM(e)&&typeof e!=`number`)return!1;let t=hM(e);return!isNaN(Number(t))}function UM(e,t){let n=hM(e),r=hM(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function WM(e,t,n){let r=DM(e,n),i=DM(t,n),a=+r-jM(r),o=+i-jM(i);return Math.round((a-o)/bM)}function GM(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function KM(e,t){return hM(e)-+hM(t)}function qM(e){let t=hM(e);return t.setHours(23,59,59,999),t}function JM(e){let t=hM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function wpe(e){let t=hM(e);return+qM(t)==+JM(t)}function Tpe(e,t){let n=hM(e),r=hM(t),i=RM(n,r),a=Math.abs(UM(n,r)),o;if(a<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let t=RM(n,r)===-i;wpe(hM(e))&&a===1&&RM(e,r)===1&&(t=!1),o=i*(a-Number(t))}return o===0?0:o}function Epe(e,t,n){let r=KM(e,t)/1e3;return GM(n?.roundingMethod)(r)}function YM(e){let t=hM(e);return t.setDate(1),t.setHours(0,0,0,0),t}function XM(e){let t=hM(e),n=gM(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ZM(e,t){let n=EM(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=hM(e),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function QM(e){return ZM(e,{weekStartsOn:1}
vendor: 17,299 bytes, line 275
275)}var Dpe={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Ope=(e,t,n)=>{let r,i=Dpe[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function $M(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var kpe={date:$M({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:$M({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:$M({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Ape={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},jpe=(e,t,n,r)=>Ape[e];function eN(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Mpe={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:eN({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:eN({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:eN({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:eN({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:eN({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function tN(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ppe(s,e=>e.test(o)):Npe(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Npe(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ppe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Fpe(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var nN={code:`en-US`,formatDistance:Ope,formatLong:kpe,formatRelative:jpe,localize:Mpe,match:{ordinalNumber:Fpe({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:tN({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:tN({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:tN({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:tN({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:tN({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ipe(e){let t=hM(e);return MM(t,XM(t))+1}function rN(e){let t=hM(e),n=OM(t)-+NM(t);return Math.round(n/bM)+1}function iN(e,t){let n=hM(e),r=n.getFullYear(),i=EM(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=gM(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=DM(o,t),c=gM(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=DM(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Lpe(e,t){let n=EM(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=iN(e,t),a=gM(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),DM(a,t)}function aN(e,t){let n=hM(e),r=DM(n,t)-+Lpe(n,t);return Math.round(r/bM)+1}function oN(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var sN={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return oN(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):oN(n+1,2)},d(e,t){return oN(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return oN(e.getHours()%12||12,t.length)},H(e,t){return oN(e.getHours(),t.length)},m(e,t){return oN(e.getMinutes(),t.length)},s(e,t){return oN(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return oN(Math.trunc(r*10**(n-3)),t.length)}},cN={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},lN={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return sN.y(e,t)},Y:function(e,t,n,r){let i=iN(e,r),a=i>0?i:1-i;return t===`YY`?oN(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):oN(a,t.length)},R:function(e,t){return oN(kM(e),t.length)},u:function(e,t){return oN(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return oN(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return oN(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return sN.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return oN(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=aN(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):oN(i,t.length)},I:function(e,t,n){let r=rN(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):oN(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):sN.d(e,t)},D:function(e,t,n){let r=Ipe(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):oN(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return oN(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return oN(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return oN(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?cN.noon:r===0?cN.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?cN.evening:r>=12?cN.afternoon:r>=4?cN.morning:cN.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return sN.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):sN.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):oN(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):oN(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):sN.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):sN.s(e,t)},S:function(e,t){return sN.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return dN(r);case`XXXX`:case`XX`:return fN(r);default:return fN(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return dN(r);case`xxxx`:case`xx`:return fN(r);default:return fN(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+uN(r,`:`);default:return`GMT`+fN(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+uN(r,`:`);default:return`GMT`+fN(r,`:`)}},t:function(e,t,n){return oN(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return oN(e.getTime(),t.length)}};function uN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+oN(a,2)}function dN(e,t){return e%60==0?(e>0?`-`:`+`)+oN(Math.abs(e)/60,2):fN(e,t)}function fN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=oN(Math.trunc(r/60),2),a=oN(r%60,2);return n+i+t+a}var pN=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},mN=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Rpe={p:mN,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return pN(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,pN(r,t)).replace(`{{time}}`,mN(i,t))}},zpe=/^D+$/,Bpe=/^Y+$/,Vpe=[`D`,`DD`,`YY`,`YYYY`];function Hpe(e){return zpe.test(e)}function Upe(e){return Bpe.test(e)}function Wpe(e,t,n){let r=Gpe(e,t,n);if(console.warn(r),Vpe.includes(e))throw RangeError(r)}function Gpe(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Kpe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qpe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jpe=/^'([^]*?)'?$/,Ype=/''/g,Xpe=/[a-zA-Z]/;function hN(e,t,n){let r=EM(),i=n?.locale??r.locale??nN,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=hM(e);if(!HM(s))throw RangeError(`Invalid time value`);let c=t.match(qpe).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Rpe[t];return n(e,i.formatLong)}return e}).join(``).match(Kpe).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Zpe(e)};if(lN[t])return{isToken:!0,value:e};
275if(t.match(Xpe))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Upe(a)||!n?.useAdditionalDayOfYearTokens&&Hpe(a))&&Wpe(a,t,String(e));let o=lN[a[0]];return o(s,a,i.localize,l)}).join(``)}function Zpe(e){let t=e.match(Jpe);return t?t[1].replace(Ype,`'`):e}function Qpe(e,t,n){let r=EM(),i=n?.locale??r.locale??nN,a=RM(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),s,c;a>0?(s=hM(t),c=hM(e)):(s=hM(e),c=hM(t));let l=Epe(c,s),u=(jM(c)-jM(s))/1e3,d=Math.round((l-u)/60),f;if(d<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):d===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,d,o);if(d<45)return i.formatDistance(`xMinutes`,d,o);if(d<90)return i.formatDistance(`aboutXHours`,1,o);if(d<1440){let e=Math.round(d/60);return i.formatDistance(`aboutXHours`,e,o)}else if(d<2520)return i.formatDistance(`xDays`,1,o);else if(d<43200){let e=Math.round(d/CM);return i.formatDistance(`xDays`,e,o)}else if(d<43200*2)return f=Math.round(d/SM),i.formatDistance(`aboutXMonths`,f,o);if(f=Tpe(c,s),f<12){let e=Math.round(d/SM);return i.formatDistance(`xMonths`,e,o)}else{let e=f%12,t=Math.trunc(f/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function $pe(e,t){return Qpe(e,zM(e),t)}function eme(e){let t=hM(e),n=t.getFullYear(),r=t.getMonth(),i=gM(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function tme(e){return Math.trunc(hM(e)/1e3)}function nme(e){let t=hM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function rme(e,t){return WM(nme(e),YM(e),t)+1}function gN(e,t){let n=hM(e),r=hM(t);return n.getTime()>r.getTime()}function _N(e,t){let n=hM(e),r=hM(t);return+n<+r}function vN(e,t){let n=hM(e),r=hM(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function ime(e,t){let n=hM(e),r=hM(t);return n.getFullYear()===r.getFullYear()}function yN(e,t){return _M(e,-t)}function bN(e,t){let n=hM(e),r=n.getFullYear(),i=n.getDate(),a=gM(e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);let o=eme(a);return n.setMonth(t,Math.min(i,o)),n}function xN(e,t){let n=hM(e);return isNaN(+n)?gM(e,NaN):(n.setFullYear(t),n)}var SN=`Progress`,CN=100,[ame,ome]=EC(SN),[sme,cme]=ame(SN),wN=y.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=lme,...o}=e;(i||i===0)&&!kN(i)&&console.error(ume(`${i}`,`Progress`));let s=kN(i)?i:CN;r!==null&&!AN(r,s)&&console.error(dme(`${r}`,`Progress`));let c=AN(r,s)?r:null,l=ON(c)?a(c,s):void 0;return(0,F.jsx)(sme,{scope:n,value:c,max:s,children:(0,F.jsx)(U.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":ON(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":DN(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});wN.displayName=SN;var TN=`ProgressIndicator`,EN=y.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=cme(TN,n);return(0,F.jsx)(U.div,{"data-state":DN(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});EN.displayName=TN;function lme(e,t){return`${Math.round(e/t*100)}%`}function DN(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function ON(e){return typeof e==`number`}function kN(e){return ON(e)&&!isNaN(e)&&e>0}function AN(e,t){return ON(e)&&!isNaN(e)&&e<=t&&e>=0}function ume(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${CN}\`.`}function dme(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 276 - a positive number 277 - less than the value passed to \`max\` (or ${CN} if no \`max\` prop is set) 278 - \`null\` or \`undefined\` if the progress is indeterminate. 279 280Defaulting to \`null\`.`}var jN=wN,fme=EN,MN=y.forwardRef(({className:e,value:t,indicatorClassName:n,...r},i)=>(0,F.jsx)(jN,{ref:i,className:z(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...r,children:(0,F.jsx)(fme,{className:z(`h-full w-full flex-1 bg-primary transition-all`,n),style:{transform:`translateX(-${100-(t||0)}%)`}})}));MN.displayName=jN.displayName;var pme=({isOpen:e,onClose:t})=>{let{profile:n}=_l(),r=We(),[i,a]=(0,y.useState)(0),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!1),f=()=>({job_seeker:{title:`Welcome to Akito - Job Seeker Guide`,description:`Learn how to use Akito to advance your career and find opportunities`,steps:[{id:`welcome`,title:`Welcome to Akito!`,description:`Your AI-powered career assistant`,content:`Akito is designed to help job seekers like you navigate your career journey. We'll show you how to make the most of our platform.`},{id:`chat`,title:`Start a Conversation`,description:`Chat with your AI career assistant`,route:`/`,target:`[data-tutorial='new-chat-button']`,content:`Click the 'New Chat' button to start conversations with your AI assistant. Ask about career advice, interview preparation, or skill development.`,action:`Click 'New Chat' to begin`,waitForElement:!0},{id:`profile`,title:`Complete Your Profile`,description:`Set up your career information`,route:`/`,target:`[data-tutorial='user-profile']`,content:`Complete your profile with your skills, experience, and career goals. This helps Akito provide personalized advice.`,action:`Click on your profile to update it`,waitForElement:!0},{id:`sidebar`,title:`Navigate Your History`,description:`Access saved chats and artifacts`,route:`/`,target:`[data-tutorial='sidebar']`,content:`Use the sidebar to access your chat history and saved artifacts. Switch between 'Chats' and 'Artifacts' tabs to find your content.`,waitForElement:!0}
280,{id:`canvas`,title:`Interactive Content`,description:`View and interact with generated content`,route:`/`,target:`[data-tutorial='canvas-container']`,content:`The canvas shows interactive content like assessments, career plans, and skill evaluations. You can submit responses and get AI feedback.`,waitForElement:!0}]},organization:{title:`Welcome to Akito - Organization Guide`,description:`Learn how to use Akito for talent management and organizational development`,steps:[{id:`welcome`,title:`Welcome to Akito!`,description:`Your organizational AI assistant`,content:`Akito helps organizations manage talent, create assessments, and develop their workforce effectively.`},{id:`chat`,title:`Strategic Conversations`,description:`Discuss organizational challenges`,route:`/`,target:`[data-tutorial='new-chat-button']`,content:`Start conversations about talent management, team development, or organizational strategy. Akito can help with planning and analysis.`,action:`Click 'New Chat' to begin`,waitForElement:!0},{id:`assessments`,title:`Create Team Assessments`,description:`Build evaluations for your team`,content:`Ask Akito to create skill assessments, performance evaluations, or team-building exercises tailored to your organization.`},{id:`analytics`,title:`View Analytics`,description:`Track team performance and progress`,route:`/`,target:`[data-tutorial='canvas-container']`,content:`Use the canvas to view generated reports, analytics, and insights about your team's development and performance.`,waitForElement:!0}]},career_tech:{title:`Welcome to Akito - Career Tech Guide`,description:`Learn how to use Akito to enhance your career services technology`,steps:[{id:`welcome`,title:`Welcome to Akito!`,description:`Your career technology enhancement platform`,content:`Akito helps career tech companies integrate AI-
280powered features and enhance their existing platforms.`},{id:`integration`,title:`Explore Integration Options`,description:`Learn about API and platform integration`,route:`/`,target:`[data-tutorial='new-chat-button']`,content:`Discuss integration possibilities with Akito's AI capabilities into your existing career technology platforms.`,waitForElement:!0},{id:`custom-solutions`,title:`Custom Solutions`,description:`Build tailored career tech solutions`,content:`Work with Akito to create custom assessments, career guidance tools, and analytics for your platform users.`}]},admin:{title:`Welcome to Akito - Admin Guide`,description:`Learn how to manage the Akito platform`,steps:[{id:`welcome`,title:`Welcome to Akito Admin!`,description:`Your platform management interface`,content:`As an admin, you have access to user management, analytics, and platform configuration tools.`},{id:`admin-dashboard`,title:`Admin Dashboard`,description:`Access administrative functions`,route:`/admin/talent-pipeline`,content:`Navigate to the admin dashboard to manage users and monitor platform usage.`},{id:`user-management`,title:`User Management`,description:`Manage users`,content:`Manage user accounts and monitor platform activity from the admin dashboard.`}]}})[n?.user_type||`job_seeker`],p=async e=>{e&&e!==window.location.pathname&&(d(!0),r(e),await new Promise(e=>setTimeout(e,500)),d(!1))},m=(e,t=5e3)=>new Promise(n=>{let r=document.querySelector(e);if(r){n(r);return}let i=new MutationObserver(()=>{let t=document.querySelector(e);t&&(i.disconnect(),n(t))});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),n(null)},t)}),h=async e=>{try{let t=await m(e,3e3);t?(l(e),t.scrollIntoView({behavior:`smooth`,block:`center`}),t.classList.add(`tutorial-highlight`),setTimeout(()=>{t.classList.remove(`tutorial-highlight`)},3e3)):console.warn(`Tutorial: Could not find element with selector: ${e}`)}catch(e){console.error(`Error highlighting element:`,e)}};if((0,y.useEffect)(()=>{if(e){s(f()),a(0);let e=document.createElement(`style`);return e.textContent=` 281 .tutorial-highlight { 282 animation: tutorialPulse 2s infinite; 283 position: relative; 284 z-index: 1000 !important; 285 } 286 287 @keyframes tutorialPulse { 288 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); } 289 70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); } 290 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } 291 } 292 293 .tutorial-overlay { 294 position: fixed; 295 top: 0; 296 left: 0; 297 right: 0; 298 bottom: 0; 299 background: rgba(0, 0, 0, 0.5); 300 z-index: 999; 301 pointer-events: none; 302 } 303 `,document.head.appendChild(e),()=>{document.head.removeChild(e)}}},[e,n?.user_type]),(0,y.useEffect)(()=>{(async()=>{if(o&&i<o.steps.length&&!u){let e=o.steps[i];e.route&&await p(e.route),e.target?await h(e.target):l(null)}})()},[i,o,u]),!e||!o)return null;let g=(i+1)/o.steps.length*100,_=o.steps[i],v=i===o.steps.length-1,b=()=>{i<o.steps.length-1&&a(i+1)},x=()=>{i>0&&a(i-1)},S=()=>{l(null),document.querySelectorAll(`.tutorial-highlight`).forEach(e=>{e.classList.remove(`tutorial-highlight`)}),t()};return(0,F.jsxs)(F.Fragment,{children:[c&&(0,F.jsx)(`div`,{className:`tutorial-overlay`}),(0,F.jsx)(`div`,{className:`fixed inset-0 z-[1000] flex items-center justify-center p-4`,children:(0,F.jsxs)(V,{className:`max-w-2xl w-full max-h-[90vh] overflow-auto bg-white shadow-2xl`,children:[(0,F.jsxs)(Au,{className:`flex flex-row items-center justify-between space-y-0 pb-4`,children:[(0,F.jsxs)(`div`,{className:`flex-1`,children:[(0,F.jsx)(ju,{className:`text-xl`,children:o.title}),(0,F.jsx)(Mu,{children:o.description})]}),(0,F.jsx)(B,{variant:`ghost`,size:`icon`,onClick:S,children:(0,F.jsx)(Q_,{className:`w-4 h-4`})})]}),(0,F.jsxs)(H,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between text-sm`,children:[(0,F.jsxs)(`span`,{children:[`Step `,i+1,` of `,o.steps.length]}),(0,F.jsxs)(`span`,{children:[Math.round(g),`% Complete`]})]}),(0,F.jsx)(MN,{value:g,className:`h-2`})]}),(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(mM,{variant:`outline`,className:`bg-akito-gradient text-white`,children:i+1}),(0,F.jsx)(`h3`,{className:`text-lg font-semibold`,children:_.title})]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_.description}),(0,F.jsxs)(`div`,{className:`bg-gray-50 p-4 rounded-lg`,children:[(0,F.jsx)(`p`,{children:_.content}),_.action&&(0,F.jsx)(`div`,{className:`mt-3 p-3 bg-blue-50 border border-blue-200 rounded-md`,children:(0,F.jsxs)(`p`,{className:`text-sm font-medium text-blue-800`,children:[(0,F.jsx)(yre,{className:`w-4 h-4 inline mr-1`}),_.action]})}),u&&(0,F.jsx)(`div`,{className:`mt-3 p-3 bg-yellow-50 border border-yellow-200 rounded-md`,children:(0,F.jsx)(`p`,{className:`text-sm font-medium text-yellow-800`,children:`N
303avigating to the right section...`})})]})]}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center pt-4 border-t`,children:[(0,F.jsxs)(B,{variant:`outline`,onClick:x,disabled:i===0,className:`flex items-center gap-2`,children:[(0,F.jsx)(__,{className:`w-4 h-4`}),`Previous`]}),v?(0,F.jsxs)(B,{onClick:S,className:`bg-akito-gradient text-white flex items-center gap-2`,children:[(0,F.jsx)(nre,{className:`w-4 h-4`}),`Complete Tutorial`]}):(0,F.jsxs)(B,{onClick:b,disabled:u,className:`bg-akito-gradient text-white flex items-center gap-2`,children:[`Next`,(0,F.jsx)(v_,{className:`w-4 h-4`})]})]})]})]})})]})},NN=({className:e,refreshTrigger:t=0})=>{let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(256),o=(0,y.useRef)(null),[s,c]=(0,y.useState)(`chats`),[l,u]=(0,y.useState)([]),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(``),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)([]),[S,C]=(0,y.useState)(!1),{user:w}=_l(),T=We(),[E,D]=(0,y.useState)(!1),[O,k]=(0,y.useState)(`chat`),A=()=>{r(!n)},j=e=>{e.preventDefault();let t=e.clientX,n=i,r=e=>{let r=e.clientX-t,i=Math.min(Math.max(n+r,160),480);a(i)},o=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o)},M=e=>{try{return $pe(new Date(e),{addSuffix:!0})}catch{return`Unknown date`}};(0,y.useEffect)(()=>{let e=async()=>{if(w){C(!0);try{let{data:e,error:t}=await R.from(`saved_sessions`).select(`id, title, created_at, updated_at, session_type`).eq(`user_id`,w.id).eq(`session_type`,`chat`).order(`updated_at`,{ascending:!1}).limit(10);if(t)throw t;u(e||[]);let{data:n,error:r}=await R.from(`saved_sessions`).select(`id, title, created_at, session_type`).eq(`user_id`,w.id).not(`session_type`,`eq`,`chat`).order(`created_at`,{ascending:!1}).limit(10);if(r)throw r;let i=n?.map(e=>({id:e.id,title:e.title,created_at:e.created_at,type:e.session_type===`chart`?`chart`:`document`}))||[];x(i)}catch(e){console.error(`Error loading saved sessions:`,e)}finally{C(!1)}}};e();let t=R.channel(`saved_sessions_changes`).on(`postgres_changes`,{event:`*`,schema:`public`,table:`saved_sessions`},t=>{e()}).subscribe();return()=>{R.removeChannel(t)}},[w,t]);let N=()=>{T(`/`,{replace:!0})},ee=(e,t,n=`chat`)=>{v(e),g(t),k(n),m(!0)},te=async()=>{if(!w||!_)return;let e=h.trim();if(e)try{f(_);let{error:t}=await R.from(`saved_sessions`).update({title:e,updated_at:new Date().toISOString()}).eq(`id`,_).eq(`user_id`,w.id);if(t)throw t;O===`chat`?u(t=>t.map(t=>t.id===_?{...t,title:e}:t)):x(t=>t.map(t=>t.id===_?{...t,title:e}:t)),m(!1)}catch(e){console.error(`Rename error:`,e)}finally{f(null)}},ne=e=>{T(`/?id=${e}`)},re=(e,t)=>{T(`/?artifact=${e}&type=${t}`)};return(0,F.jsxs)(`div`,{className:z(`relative flex flex-col h-screen border-r border-gray-200 bg-white transition-all duration-75`,n&&`w-16`,e),style:n?void 0:{width:i},"data-tutorial":`sidebar`,children:[(0,F.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[!n&&(0,F.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,F.jsx)(`img`,{src:`/lovable-uploads/5b073f6e-f01a-41d5-9166-c07f7567d4b7.png`,alt:`Akito Logo`,className:`h-8`}),(0,F.jsx)(mM,{variant:`outline`,className:`bg-amber-100 text-amber-800 text-xs border-amber-300`,children:`Beta`})]}),(0,F.jsx)(B,{variant:`ghost`,size:`icon`,className:`rounded-full ml-auto`,onClick:A,children:n?(0,F.jsx)(v_,{size:18}):(0,F.jsx)(__,{size:18})})]}),(0,F.jsxs)(B,{variant:`default`,className:z(`mx-4 mb-4 bg-akito-gradient hover:opacity-90 text-white`,n&&`p-2`),onClick:N,"data-tutorial":`new-chat-button`,children:[(0,F.jsx)(V_,{size:n?20:16}),!n&&(0,F.jsx)(`span`,{className:`ml-2`,children:`New Chat`})]}),(0,F.jsx)(`div`,{className:`flex mb-4 mx-4`,children:!n&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(B,{variant:`ghost`,className:z(`flex-1 rounded-r-none border-r-0`,s===`chats`?`bg-gray-100`:``),onClick:()=>c(`chats`),children:`Chats`}),(0,F.jsx)(B,{variant:`ghost`,className:z(`flex-1 rounded-l-none`,s===`artifacts`?`bg-gray-100`:``),onClick:()=>c(`artifacts`),children:`Artifacts`})]})}),(0,F.jsx)(rw,{className:`flex-1 px-2`,children:S?(0,F.jsx)(`div`,{className:`flex justify-center items-center h-20`,children:(0,F.jsx)(F_,{className:`h-5 w-5 animate-spin text-akito-teal`})}):(0,F.jsxs)(F.Fragment,{children:[s===`chats`&&(0,F.jsx)(`div`,{className:`space-y-1`,children:n?(0,F.jsx)(`div`,{className:`flex flex-col items-center space-y-4 mt
303-4`,children:l.length>0?l.slice(0,3).map(e=>(0,F.jsx)(z_,{size:20,className:`text-gray-500 hover:text-akito-teal cursor-pointer`,onClick:()=>ne(e.id)},e.id)):(0,F.jsx)(z_,{size:20,className:`text-gray-300`})}):(0,F.jsx)(F.Fragment,{children:l.length>0?l.map(e=>(0,F.jsxs)(`div`,{className:`relative group`,children:[(0,F.jsx)(B,{variant:`ghost`,className:`w-full justify-start text-left h-auto py-3`,onClick:()=>ne(e.id),children:(0,F.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[(0,F.jsx)(z_,{size:16,className:`mr-2 text-gray-500 flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-medium truncate max-w-full`,children:e.title||`Untitled Chat`})]}),(0,F.jsx)(`p`,{className:`text-xs text-gray-500 mt-1 pl-6 truncate`,children:M(e.updated_at||e.created_at)})]})}),(0,F.jsx)(`button`,{className:`absolute top-2 right-3 p-1 rounded hover:bg-gray-200 invisible group-hover:visible`,onClick:t=>{t.stopPropagation(),ee(e.id,e.title)},disabled:d===e.id,title:`Rename Chat`,children:d===e.id?(0,F.jsx)(F_,{className:`w-3 h-3 animate-spin`}):(0,F.jsx)(B_,{className:`w-3 h-3`})})]},e.id)):(0,F.jsxs)(`div`,{className:`text-center py-6 text-gray-400`,children:[(0,F.jsx)(z_,{className:`mx-auto h-8 w-8 mb-2 opacity-20`}),(0,F.jsx)(`p`,{children:`No saved chats yet`})]})})}),s===`artifacts`&&!n&&(0,F.jsx)(`div`,{className:`space-y-1`,children:b.length>0?b.map(e=>(0,F.jsxs)(`div`,{className:`relative group`,children:[(0,F.jsx)(B,{variant:`ghost`,className:`w-full justify-start text-left h-auto py-3`,onClick:()=>re(e.id,e.type),children:(0,F.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[e.type===`chart`?(0,F.jsx)($ne,{size:16,className:`mr-2 text-akito-purple flex-shrink-0`}):(0,F.jsx)(A_,{size:16,className:`mr-2 text-akito-teal flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-medium truncate max-w-full`,children:e.title||`Untitled Artifact`})]}),(0,F.jsx)(`p`,{className:`text-xs text-gray-500 mt-1 pl-6 truncate`,children:M(e.created_at)})]})}),(0,F.jsx)(`button`,{className:`absolute top-2 right-3 p-1 rounded hover:bg-gray-200 invisible group-hover:visible`,onClick:t=>{t.stopPropagation(),ee(e.id,e.title,`artifact`)},disabled:d===e.id,title:`Rename Artifact`,children:d===e.id?(0,F.jsx)(F_,{className:`w-3 h-3 animate-spin`}):(0,F.jsx)(B_,{className:`w-3 h-3`})})]},e.id)):(0,F.jsxs)(`div`,{className:`text-center py-6 text-gray-400`,children:[(0,F.jsx)(A_,{className:`mx-auto h-8 w-8 mb-2 opacity-20`}),(0,F.jsx)(`p`,{children:`No saved artifacts yet`})]})})]})}),(0,F.jsx)(eb,{className:`mt-auto`}),(0,F.jsxs)(`div`,{className:`p-4 bg-white border-t`,children:[(0,F.jsx)(B,{variant:`ghost`,className:`w-full justify-start mb-2`,onClick:()=>{D(!0)},children:n?(0,F.jsx)(j_,{size:20}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(j_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Tutorial`})]})}),(0,F.jsx)(B,{variant:`ghost`,className:`w-full justify-start mb-2`,onClick:()=>{T(`/help-center`)},children:n?(0,F.jsx)(x_,{size:20}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(x_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Help Center`})]})}),(0,F.jsx)(B,{variant:`ghost`,className:`w-full justify-start mt-2`,onClick:()=>T(`/terms/early-access`),children:n?(0,F.jsx)(y_,{size:20}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(y_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`About Early Access`})]})})]}),(0,F.jsx)(pme,{isOpen:E,onClose:()=>D(!1)}),(0,F.jsx)(aE,{open:p,onOpenChange:m,children:(0,F.jsxs)(cE,{children:[(0,F.jsx)(lE,{children:(0,F.jsxs)(dE,{children:[`Rename `,O===`chat`?`Chat`:`Artifact`]})}),(0,F.jsx)(`div`,{className:`grid gap-4 py-4`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsx)(zu,{htmlFor:`item-title`,className:`text-right`,children:`New Title`}),(0,F.jsx)(ku,{id:`item-title`,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>e.key===`Enter`&&te(),className:`col-span-3`,placeholder:O===`chat`?`Chat title`:`Artifact title`,autoFocus:!0})]})}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{variant:`outline`,onClick:()=>m(!1),children:`Cancel`}),(0,F.jsxs)(B,{onClick:te,disabled:d!==null,children:[d?(0,F.jsx)(F_,{className:`w-4 h-4 animate-spin mr-2`}):null,`Save`]})]})]})}),!n&&(0,F.jsx)(`div`,{ref:o,onMouseDown:j,className:`absolute top-0 right-0 w-1 h-full cursor-ew-resize bg-transparent hover:bg-gray-300 transition-colors`})]})},PN=`Collapsible`,[mme,FN]=EC(PN),[hme,IN]=mme(PN),LN=y.forwardRef((e,t)=>
vendor: 4,512 bytes, line 303
303{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c=!1,l]=ow({prop:r,defaultProp:i,onChange:o});return(0,F.jsx)(hme,{scope:n,disabled:a,contentId:aw(),open:c,onOpenToggle:y.useCallback(()=>l(e=>!e),[l]),children:(0,F.jsx)(U.div,{"data-state":HN(c),"data-disabled":a?``:void 0,...s,ref:t})})});LN.displayName=PN;var RN=`CollapsibleTrigger`,zN=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=IN(RN,n);return(0,F.jsx)(U.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":HN(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:K(e.onClick,i.onOpenToggle)})});zN.displayName=RN;var BN=`CollapsibleContent`,VN=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=IN(BN,e.__scopeCollapsible);return(0,F.jsx)(wC,{present:n||i.open,children:({present:e})=>(0,F.jsx)(gme,{...r,ref:t,present:e})})});VN.displayName=BN;var gme=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=IN(BN,n),[s,c]=y.useState(r),l=y.useRef(null),u=bl(t,l),d=y.useRef(0),f=d.current,p=y.useRef(0),m=p.current,h=o.open||s,g=y.useRef(h),_=y.useRef();return y.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),CC(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,F.jsx)(U.div,{"data-state":HN(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function HN(e){return e?`open`:`closed`}var _me=LN,vme=zN,yme=VN,UN=`Accordion`,bme=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[WN,xme,Sme]=pE(UN),[GN,Cme]=EC(UN,[Sme,FN]),KN=FN(),qN=y.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,F.jsx)(WN.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,F.jsx)(Dme,{...a,ref:t}):(0,F.jsx)(Eme,{...i,ref:t})})});qN.displayName=UN;var[JN,wme]=GN(UN),[YN,Tme]=GN(UN,{collapsible:!1}),Eme=y.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=ow({prop:n,defaultProp:r,onChange:i});return(0,F.jsx)(JN,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:c,onItemClose:y.useCallback(()=>a&&c(``),[a,c]),children:(0,F.jsx)(YN,{scope:e.__scopeAccordion,collapsible:a,children:(0,F.jsx)(ZN,{...o,ref:t})})})}),Dme=y.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o=[],s]=ow({prop:n,defaultProp:r,onChange:i}),c=y.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=y.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,F.jsx)(JN,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,F.jsx)(YN,{scope:e.__scopeAccordion,collapsible:!0,children:(0,F.jsx)(ZN,{...a,ref:t})})})}),[Ome,XN]=GN(UN),ZN=y.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=bl(y.useRef(null),t),c=xme(n),l=OC(i)===`ltr`,u=K(e.onKeyDown,e=>{if(!bme.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,F.jsx)(Ome,{scope:n,disabled:r,direction:i,orientation:a,children:(0,F.jsx)(WN.Slot,{scope:n,children:(0,F.jsx)(U.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),QN=`AccordionItem`,[kme,$N]=GN(QN),eP=y.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=XN(QN,n),o=wme(QN,n),s=KN(n),c=aw(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,F.jsx)(kme,{scope:n,open:l,disabled:u,triggerId:c,children:(0,F.jsx)(_me,{"data-orientation":a.orientation,"data-state":sP(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});eP.displayName=QN;var tP=`AccordionHeader`,nP=y.forwardRef((e,t)=>
303{let{__scopeAccordion:n,...r}=e,i=XN(UN,n),a=$N(tP,n);return(0,F.jsx)(U.h3,{"data-orientation":i.orientation,"data-state":sP(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});nP.displayName=tP;var rP=`AccordionTrigger`,iP=y.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=XN(UN,n),a=$N(rP,n),o=Tme(rP,n),s=KN(n);return(0,F.jsx)(WN.ItemSlot,{scope:n,children:(0,F.jsx)(vme,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});iP.displayName=rP;var aP=`AccordionContent`,oP=y.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=XN(UN,n),a=$N(aP,n),o=KN(n);return(0,F.jsx)(yme,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});oP.displayName=aP;function sP(e){return e?`open`:`closed`}var Ame=qN,jme=eP,Mme=nP,cP=iP,lP=oP,uP=Ame,dP=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(jme,{ref:n,className:z(`border-b`,e),...t}));dP.displayName=`AccordionItem`;var fP=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsx)(Mme,{className:`flex`,children:(0,F.jsxs)(cP,{ref:r,className:z(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,F.jsx)(g_,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));fP.displayName=cP.displayName;var pP=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsx)(lP,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,F.jsx)(`div`,{className:z(`pb-4 pt-0`,e),children:t})}));pP.displayName=lP.displayName;var Nme=`DismissableLayer`,mP=`dismissableLayer.update`,Pme=`dismissableLayer.pointerDownOutside`,Fme=`dismissableLayer.focusOutside`,hP,gP=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_P=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(gP),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=Rme(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=zme(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(hP=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vP(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=hP)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vP())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(mP,e),()=>document.removeEventListener(mP,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});_P.displayName=Nme;var Ime=`DismissableLayerBranch`,Lme=y.forwardRef((e,t)=>{let n=y.useContext(gP),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});Lme.displayName=Ime;function Rme(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){yP(Pme,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zme(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&yP(Fme,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vP(){let e=new CustomEvent(mP);document.dispatchEvent(e)}function yP(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var Bme=`Portal`,bP=y.forwardRef((e,t)=>
vendor: 4,307 bytes, lines 303-306
303{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});bP.displayName=Bme;var xP=0;function Vme(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??SP()),document.body.insertAdjacentElement(`beforeend`,e[1]??SP()),xP++,()=>{xP===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),xP--}},[])}function SP(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.cssText=`outline: none; opacity: 0; position: fixed; pointer-events: none`,e}var CP=Uw(),wP=function(){},TP=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:wP,onWheelCapture:wP,onTouchMoveCapture:wP}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,g=e.as,_=g===void 0?`div`:g,v=e.gapMode,b=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bw([n,t]),C=jw(jw({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:CP,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),jw(jw({},C),{ref:S})):y.createElement(_,jw({},C,{className:c,ref:S}),s))});TP.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},TP.classNames={fullWidth:Fw,zeroRight:Pw};var EP=!1;if(typeof window<`u`)try{var DP=Object.defineProperty({},"passive",{get:function(){return EP=!0,!0}});window.addEventListener(`test`,DP,DP),window.removeEventListener(`test`,DP,DP)}catch{EP=!1}var OP=EP?{passive:!1}:!1,Hme=function(e){return e.tagName===`TEXTAREA`},kP=function(e,t){var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Hme(e)&&n[t]===`visible`)},Ume=function(e){return kP(e,`overflowY`)},Wme=function(e){return kP(e,`overflowX`)},AP=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),jP(e,r)){var i=MP(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gme=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kme=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},jP=function(e,t){return e===`v`?Ume(t):Wme(t)},MP=function(e,t){return e===`v`?Gme(t):Kme(t)},qme=function(e,t){return e===`h`&&t===`rtl`?-1:1},Jme=function(e,t,n,r,i){var a=qme(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=MP(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&jP(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},NP=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},PP=function(e){return[e.deltaX,e.deltaY]},FP=function(e){return e&&`current`in e?e.current:e},Yme=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xme=function(e){return` 304 .block-interactivity-${e} {pointer-events: none;} 305 .allow-interactivity-${e} {pointer-events: all;} 306`},Zme=0,IP=[];function Qme(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Zme++)[0],a=y.useState(nT)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(FP),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=NP(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=AP(d,u);if(!f)return!0;
vendor: 4,312 bytes, line 306
306if(f?l=d:(l=d===`v`?`h`:`v`,f=AP(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return Jme(p,t,e,p===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!IP.length||IP[IP.length-1]!==a)){var r=`deltaY`in n?PP(n):NP(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Yme(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(FP).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:$me(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=NP(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,PP(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,NP(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return IP.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,OP),document.addEventListener(`touchmove`,c,OP),document.addEventListener(`touchstart`,u,OP),function(){IP=IP.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,OP),document.removeEventListener(`touchmove`,c,OP),document.removeEventListener(`touchstart`,u,OP)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:Xme(i)}):null,p?y.createElement(dT,{gapMode:e.gapMode}):null)}function $me(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ehe=Gw(CP,Qme),LP=y.forwardRef(function(e,t){return y.createElement(TP,jw({},e,{ref:t,sideCar:ehe}))});LP.classNames=TP.classNames;var RP=`Dialog`,[zP,BP]=EC(RP),[the,VP]=zP(RP),HP=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l=!1,u]=ow({prop:r,defaultProp:i,onChange:a});return(0,F.jsx)(the,{scope:t,triggerRef:s,contentRef:c,contentId:aw(),titleId:aw(),descriptionId:aw(),open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};HP.displayName=RP;var UP=`DialogTrigger`,WP=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=VP(UP,n),a=bl(t,i.triggerRef);return(0,F.jsx)(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":aF(i.open),...r,ref:a,onClick:K(e.onClick,i.onOpenToggle)})});WP.displayName=UP;var GP=`DialogPortal`,[nhe,KP]=zP(GP,{forceMount:void 0}),qP=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=VP(GP,t);return(0,F.jsx)(nhe,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,F.jsx)(wC,{present:n||a.open,children:(0,F.jsx)(bP,{asChild:!0,container:i,children:e})}))})};qP.displayName=GP;var JP=`DialogOverlay`,YP=y.forwardRef((e,t)=>{let n=KP(JP,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=VP(JP,e.__scopeDialog);return a.modal?(0,F.jsx)(wC,{present:r||a.open,children:(0,F.jsx)(rhe,{...i,ref:t})}):null});YP.displayName=JP;var rhe=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=VP(JP,n);return(0,F.jsx)(LP,{as:xl,allowPinchZoom:!0,shards:[i.contentRef],children:(0,F.jsx)(U.div,{"data-state":aF(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),XP=`DialogContent`,ZP=y.forwardRef((e,t)=>{let n=KP(XP,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=VP(XP,e.__scopeDialog);return(0,F.jsx)(wC,{present:r||a.open,children:a.modal?(0,F.jsx)(ihe,{...i,ref:t}):(0,F.jsx)(ahe,{...i,ref:t})})});ZP.displayName=XP;var ihe=y.forwardRef((e,t)=>{let n=VP(XP,e.__scopeDialog),r=y.useRef(null),i=bl(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return kT(e)},[]),(0,F.jsx)(QP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault())})}),ahe=y.forwardRef((e,t)=>
306{let n=VP(XP,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,F.jsx)(QP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),QP=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=VP(XP,n),c=y.useRef(null),l=bl(t,c);return Vme(),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(_P,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":aF(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(she,{titleId:s.titleId}),(0,F.jsx)(lhe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),$P=`DialogTitle`,eF=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=VP($P,n);return(0,F.jsx)(U.h2,{id:i.titleId,...r,ref:t})});eF.displayName=$P;var tF=`DialogDescription`,nF=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=VP(tF,n);return(0,F.jsx)(U.p,{id:i.descriptionId,...r,ref:t})});nF.displayName=tF;var rF=`DialogClose`,iF=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=VP(rF,n);return(0,F.jsx)(U.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});iF.displayName=rF;function aF(e){return e?`open`:`closed`}var oF=`DialogTitleWarning`,[ohe,sF]=sue(oF,{contentName:XP,titleName:$P,docsSlug:`dialog`}),she=({titleId:e})=>{let t=sF(oF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 307 308If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 309 310For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},che=`DialogDescriptionWarning`,lhe=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sF(che).contentName}}.`;return y.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},uhe=HP,dhe=WP,fhe=qP,phe=YP,mhe=ZP,hhe=eF,ghe=nF,cF=iF,lF=`AlertDialog`,[_he,vhe]=EC(lF,[BP]),uF=BP(),dF=e=>{let{__scopeAlertDialog:t,...n}=e,r=uF(t);return(0,F.jsx)(uhe,{...r,...n,modal:!0})};dF.displayName=lF;var yhe=`AlertDialogTrigger`,fF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=uF(n);return(0,F.jsx)(dhe,{...i,...r,ref:t})});fF.displayName=yhe;var bhe=`AlertDialogPortal`,pF=e=>{let{__scopeAlertDialog:t,...n}=e,r=uF(t);return(0,F.jsx)(fhe,{...r,...n})};pF.displayName=bhe;var xhe=`AlertDialogOverlay`,mF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=uF(n);return(0,F.jsx)(phe,{...i,...r,ref:t})});mF.displayName=xhe;var hF=`AlertDialogContent`,[She,Che]=_he(hF),gF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=uF(n),o=y.useRef(null),s=bl(t,o),c=y.useRef(null);return(0,F.jsx)(ohe,{contentName:hF,titleName:_F,docsSlug:`alert-dialog`,children:(0,F.jsx)(She,{scope:n,cancelRef:c,children:(0,F.jsxs)(mhe,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:K(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,F.jsx)(Cl,{children:r}),(0,F.jsx)(The,{contentRef:o})]})})})});gF.displayName=hF;var _F=`AlertDialogTitle`,vF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=uF(n);return(0,F.jsx)(hhe,{...i,...r,ref:t})});vF.displayName=_F;var yF=`AlertDialogDescription`,bF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=uF(n);return(0,F.jsx)(ghe,{...i,...r,ref:t})});bF.displayName=yF;var whe=`AlertDialogAction`,xF=y.forwardRef((e,t)=>
310{let{__scopeAlertDialog:n,...r}=e,i=uF(n);return(0,F.jsx)(cF,{...i,...r,ref:t})});xF.displayName=whe;var SF=`AlertDialogCancel`,CF=y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Che(SF,n),a=uF(n),o=bl(t,i);return(0,F.jsx)(cF,{...a,...r,ref:o})});CF.displayName=SF;var The=({contentRef:e})=>{let t=`\`${hF}\` requires a description for the component to be accessible for screen reader users. 311 312You can add a description to the \`${hF}\` by passing a \`${yF}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 313 314Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${hF}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 315 316For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Ehe=dF,Dhe=fF,Ohe=pF,wF=mF,TF=gF,EF=xF,DF=CF,OF=vF,kF=bF,khe=Ehe,Ahe=Dhe,jhe=Ohe,AF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(wF,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));AF.displayName=wF.displayName;var jF=y.forwardRef(({className:e,...t},n)=>(0,F.jsxs)(jhe,{children:[(0,F.jsx)(AF,{}),(0,F.jsx)(TF,{ref:n,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));jF.displayName=TF.displayName;var MF=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});MF.displayName=`AlertDialogHeader`;var NF=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});NF.displayName=`AlertDialogFooter`;var PF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(OF,{ref:n,className:z(`text-lg font-semibold`,e),...t}));PF.displayName=OF.displayName;var FF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(kF,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));FF.displayName=kF.displayName;var IF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(EF,{ref:n,className:z(Ou(),e),...t}));IF.displayName=EF.displayName;var LF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(DF,{ref:n,className:z(Ou({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));LF.displayName=DF.displayName;var RF=`Avatar`,[Mhe,Nhe]=EC(RF),[Phe,zF]=Mhe(RF),BF=y.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=y.useState(`idle`);return(0,F.jsx)(Phe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,F.jsx)(U.span,{...r,ref:t})})});BF.displayName=RF;var VF=`AvatarImage`,HF=y.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=zF(VF,n),s=Fhe(r),c=DC(e=>{i(e),o.onImageLoadingStatusChange(e)});return CC(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,F.jsx)(U.img,{...a,ref:t,src:r}):null});HF.displayName=VF;var UF=`AvatarFallback`,WF=y.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=zF(UF,n),[o,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,F.jsx)(U.span,{...i,ref:t}):null});WF.displayName=UF;function Fhe(e){let[t,n]=y.useState(`idle`);return CC(()=>{if(!e){n(`error`);return}let t=!0,r=new window.Image,i=e=>()=>{t&&n(e)};return n(`loading`),r.onload=i(`loaded`),r.onerror=i(`error`),r.src=e,()=>{t=!1}},[e]),t}var GF=BF,KF=HF,qF=WF,JF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(GF,{ref:n,className:z(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));JF.displayName=GF.displayName;var YF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(KF,{ref:n,className:z(`aspect-square h-full w-full`,e),...t}));YF.displayName=KF.displayName;var XF=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(qF,{ref:n,className:z(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));XF.displayName=qF.displayName;var ZF=function(){return ZF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ZF.apply(this,arguments)};function Ihe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function QF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;
316r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function $F(e){return e.mode===`multiple`}function eI(e){return e.mode===`range`}function tI(e){return e.mode===`single`}var Lhe={root:`rdp`,multiple_months:`rdp-multiple_months`,with_weeknumber:`rdp-with_weeknumber`,vhidden:`rdp-vhidden`,button_reset:`rdp-button_reset`,button:`rdp-button`,caption:`rdp-caption`,caption_start:`rdp-caption_start`,caption_end:`rdp-caption_end`,caption_between:`rdp-caption_between`,caption_label:`rdp-caption_label`,caption_dropdowns:`rdp-caption_dropdowns`,dropdown:`rdp-dropdown`,dropdown_month:`rdp-dropdown_month`,dropdown_year:`rdp-dropdown_year`,dropdown_icon:`rdp-dropdown_icon`,months:`rdp-months`,month:`rdp-month`,table:`rdp-table`,tbody:`rdp-tbody`,tfoot:`rdp-tfoot`,head:`rdp-head`,head_row:`rdp-head_row`,head_cell:`rdp-head_cell`,nav:`rdp-nav`,nav_button:`rdp-nav_button`,nav_button_previous:`rdp-nav_button_previous`,nav_button_next:`rdp-nav_button_next`,nav_icon:`rdp-nav_icon`,row:`rdp-row`,weeknumber:`rdp-weeknumber`,cell:`rdp-cell`,day:`rdp-day`,day_today:`rdp-day_today`,day_outside:`rdp-day_outside`,day_selected:`rdp-day_selected`,day_disabled:`rdp-day_disabled`,day_hidden:`rdp-day_hidden`,day_range_start:`rdp-day_range_start`,day_range_end:`rdp-day_range_end`,day_range_middle:`rdp-day_range_middle`};function Rhe(e,t){return hN(e,`LLLL y`,t)}function zhe(e,t){return hN(e,`d`,t)}function Bhe(e,t){return hN(e,`LLLL`,t)}function Vhe(e){return`${e}`}function Hhe(e,t){return hN(e,`cccccc`,t)}function Uhe(e,t){return hN(e,`yyyy`,t)}var Whe=Object.freeze({__proto__:null,formatCaption:Rhe,formatDay:zhe,formatMonthCaption:Bhe,formatWeekNumber:Vhe,formatWeekdayName:Hhe,formatYearCaption:Uhe}),Ghe=Object.freeze({__proto__:null,labelDay:function(e,t,n){return hN(e,`do MMMM (EEEE)`,n)},labelMonthDropdown:function(){return`Month: `},labelNext:function(){return`Go to next month`},labelPrevious:function(){return`Go to previous month`},labelWeekNumber:function(e){return`Week n. ${e}`},labelWeekday:function(e,t){return hN(e,`cccc`,t)},labelYearDropdown:function(){return`Year: `}});function Khe(){return{captionLayout:`buttons`,classNames:Lhe,formatters:Whe,labels:Ghe,locale:nN,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:`default`}}function qhe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,a=e.fromDate,o=e.toDate;return r?a=YM(r):t&&(a=new Date(t,0,1)),i?o=JM(i):n&&(o=new Date(n,11,31)),{fromDate:a?AM(a):void 0,toDate:o?AM(o):void 0}}var nI=(0,y.createContext)(void 0);function Jhe(e){var t=e.initialProps,n=Khe(),r=qhe(t),i=r.fromDate,a=r.toDate,o=t.captionLayout??n.captionLayout;o!==`buttons`&&(!i||!a)&&(o=`buttons`);var s;(tI(t)||$F(t)||eI(t))&&(s=t.onSelect);var c=ZF(ZF(ZF({},n),t),{captionLayout:o,classNames:ZF(ZF({},n.classNames),t.classNames),components:ZF({},t.components),formatters:ZF(ZF({},n.formatters),t.formatters),fromDate:i,labels:ZF(ZF({},n.labels),t.labels),mode:t.mode||n.mode,modifiers:ZF(ZF({},n.modifiers),t.modifiers),modifiersClassNames:ZF(ZF({},n.modifiersClassNames),t.modifiersClassNames),onSelect:s,styles:ZF(ZF({},n.styles),t.styles),toDate:a});return(0,F.jsx)(nI.Provider,{value:c,children:e.children})}function rI(){var e=(0,y.useContext)(nI);if(!e)throw Error(`useDayPicker must be used within a DayPickerProvider.`);return e}function iI(e){var t=rI(),n=t.locale,r=t.classNames,i=t.styles,a=t.formatters.formatCaption;return(0,F.jsx)(`div`,{className:r.caption_label,style:i.caption_label,"aria-live":`polite`,role:`presentation`,id:e.id,children:a(e.displayMonth,{locale:n})})}function Yhe(e){return(0,F.jsx)(`svg`,ZF({width:`8px`,height:`8px`,viewBox:`0 0 120 120`,"data-testid":`iconDropdown`},e,{children:(0,F.jsx)(`path`,{d:`M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z`,fill:`currentColor`,fillRule:`nonzero`})}))}function aI(e){var t=e.onChange,n=e.value,r=e.children,i=e.caption,a=e.className,o=e.style,s=rI(),c=s.components?.IconDropdown??Yhe;return(0,F.jsxs)(`div`,{className:a,style:o,children:[(0,F.jsx)(`span`,{className:s.classNames.vhidden,children:e[`aria-label`]}),(0,F.jsx)(`select`,{name:e.name,"aria-label":e[`aria-label`],className:s.classNames.dropdown,style:s.styles.dropdown,value:n,onChange:t,children:r}),(0,F.jsxs)(`div`,{className:s.classNames.caption_label,style:s.styles.caption_label,"aria-hidden":`true`,children:[i,(0,F.jsx)(c,{className:s.classNames.dropdown_icon,style:s.styles.dropdown_icon})]})]})}function Xhe(e){var t=rI(),n=t.fromDate,r=t.toDate,i=t.styles,a=t.locale,o=t.formatters.formatMonthCaption,s=t.classNames,c=t.components,l=t.labels.labelMonthDropdown;if(!n||!r)return(0,F.jsx)(F.Fragment,{});var u=[];
316if(ime(n,r))for(var d=YM(n),f=n.getMonth();f<=r.getMonth();f++)u.push(bN(d,f));else for(var d=YM(new Date),f=0;f<=11;f++)u.push(bN(d,f));return(0,F.jsx)(c?.Dropdown??aI,{name:`months`,"aria-label":l(),className:s.dropdown_month,style:i.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=bN(YM(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:o(e.displayMonth,{locale:a}),children:u.map(function(e){return(0,F.jsx)(`option`,{value:e.getMonth(),children:o(e,{locale:a})},e.getMonth())})})}function Zhe(e){var t=e.displayMonth,n=rI(),r=n.fromDate,i=n.toDate,a=n.locale,o=n.styles,s=n.classNames,c=n.components,l=n.formatters.formatYearCaption,u=n.labels.labelYearDropdown,d=[];if(!r||!i)return(0,F.jsx)(F.Fragment,{});for(var f=r.getFullYear(),p=i.getFullYear(),m=f;m<=p;m++)d.push(xN(XM(new Date),m));return(0,F.jsx)(c?.Dropdown??aI,{name:`years`,"aria-label":u(),className:s.dropdown_year,style:o.dropdown_year,onChange:function(n){var r=xN(YM(t),Number(n.target.value));e.onChange(r)},value:t.getFullYear(),caption:l(t,{locale:a}),children:d.map(function(e){return(0,F.jsx)(`option`,{value:e.getFullYear(),children:l(e,{locale:a})},e.getFullYear())})})}function Qhe(e,t){var n=(0,y.useState)(e),r=n[0],i=n[1];return[t===void 0?r:t,i]}function $he(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,a=e.toDate,o=e.fromDate,s=e.numberOfMonths,c=s===void 0?1:s;return a&&UM(a,i)<0&&(i=vM(a,-1*(c-1))),o&&UM(i,o)<0&&(i=o),YM(i)}function ege(){var e=rI(),t=Qhe($he(e),e.month),n=t[0],r=t[1];return[n,function(t){var n;if(!e.disableNavigation){var i=YM(t);r(i),(n=e.onMonthChange)==null||n.call(e,i)}}]}function tge(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=YM(e),a=UM(YM(vM(i,r)),i),o=[],s=0;s<a;s++){var c=vM(i,s);o.push(c)}return n&&(o=o.reverse()),o}function nge(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,o=r?a:1,s=YM(e);if(!n||!(UM(n,e)<a))return vM(s,o)}}function rge(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,a=r?i===void 0?1:i:1,o=YM(e);if(!n||!(UM(o,n)<=0))return vM(o,-a)}}var oI=(0,y.createContext)(void 0);function ige(e){var t=rI(),n=ege(),r=n[0],i=n[1],a=tge(r,t),o=nge(r,t),s=rge(r,t),c=function(e){return a.some(function(t){return vN(e,t)})},l={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:function(e,n){c(e)||(n&&_N(e,n)?i(vM(e,1+t.numberOfMonths*-1)):i(e))},previousMonth:s,nextMonth:o,isDateDisplayed:c};return(0,F.jsx)(oI.Provider,{value:l,children:e.children})}function sI(){var e=(0,y.useContext)(oI);if(!e)throw Error(`useNavigation must be used within a NavigationProvider`);return e}function cI(e){var t=rI(),n=t.classNames,r=t.styles,i=t.components,a=sI().goToMonth,o=function(t){a(vM(t,e.displayIndex?-e.dis
316playIndex:0))},s=(0,F.jsx)(i?.CaptionLabel??iI,{id:e.id,displayMonth:e.displayMonth});return(0,F.jsxs)(`div`,{className:n.caption_dropdowns,style:r.caption_dropdowns,children:[(0,F.jsx)(`div`,{className:n.vhidden,children:s}),(0,F.jsx)(Xhe,{onChange:o,displayMonth:e.displayMonth}),(0,F.jsx)(Zhe,{onChange:o,displayMonth:e.displayMonth})]})}function age(e){return(0,F.jsx)(`svg`,ZF({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,F.jsx)(`path`,{d:`M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z`,fill:`currentColor`,fillRule:`nonzero`})}))}function oge(e){return(0,F.jsx)(`svg`,ZF({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,F.jsx)(`path`,{d:`M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z`,fill:`currentColor`})}))}var lI=(0,y.forwardRef)(function(e,t){var n=rI(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var o=a.join(` `),s=ZF(ZF({},i.button_reset),i.button);return e.style&&Object.assign(s,e.style),(0,F.jsx)(`button`,ZF({},e,{ref:t,type:`button`,className:o,style:s}))});function sge(e){var t=rI(),n=t.dir,r=t.locale,i=t.classNames,a=t.styles,o=t.labels,s=o.labelPrevious,c=o.labelNext,l=t.components;if(!e.nextMonth&&!e.previousMonth)return(0,F.jsx)(F.Fragment,{});var u=s(e.previousMonth,{locale:r}),d=[i.nav_button,i.nav_button_previous].join(` `),f=c(e.nextMonth,{locale:r}),p=[i.nav_button,i.nav_button_next].join(` `),m=l?.IconRight??oge,h=l?.IconLeft??age;return(0,F.jsxs)(`div`,{className:i.nav,style:a.nav,children:[!e.hidePrevious&&(0,F.jsx)(lI,{name:`previous-month`,"aria-label":u,className:d,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:n===`rtl`?(0,F.jsx)(m,{className:i.nav_icon,style:a.nav_icon}):(0,F.jsx)(h,{className:i.nav_icon,style:a.nav_icon})}),!e.hideNext&&(0,F.jsx)(lI,{name:`next-month`,"aria-label":f,className:p,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:n===`rtl`?(0,F.jsx)(h,{className:i.nav_icon,style:a.nav_icon}):(0,F.jsx)(m,{className:i.nav_icon,style:a.nav_icon})})]})}function uI(e){var t=rI().numberOfMonths,n=sI(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,o=n.displayMonths,s=o.findIndex(function(t){return vN(e.displayMonth,t)}),c=s===0,l=s===o.length-1,u=t>1&&(c||!l),d=t>1&&(l||!c);return(0,F.jsx)(sge,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){i&&a(i)}})}function cge(e){var t=rI(),n=t.classNames,r=t.disableNavigation,i=t.styles,a=t.captionLayout,o=t.components?.CaptionLabel??iI,s=r?(0,F.jsx)(o,{id:e.id,displayMonth:e.displayMonth}):a===`dropdown`?(0,F.jsx)(cI,{displayMonth:e.displayMonth,id:e.id}):a===`dropdown-buttons`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(cI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),(0,F.jsx)(uI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(o,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,F.jsx)(uI,{displayMonth:e.displayMonth,id:e.id})]});return(0,F.jsx)(`div`,{className:n.caption,style:i.caption,children:s})}function lge(e){var t=rI(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?(0,F.jsx)(`tfoot`,{className:i,style:r.tfoot,children:(0,F.jsx)(`tr`,{children:(0,F.jsx)(`td`,{colSpan:8,children:n})})}):(0,F.jsx)(F.Fragment,{})}function uge(e,t,n){for(var r=n?OM(new Date):DM(new Date,{locale:e,weekStartsOn:t}),i=[],a=0;a<7;a++){var o=_M(r,a);i.push(o)}return i}function dge(){var e=rI(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,a=e.weekStartsOn,o=e.ISOWeek,s=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,l=uge(i,a,o);return(0,F.jsxs)(`tr`,{style:n.head_row,className:t.head_row,children:[r&&(0,F.jsx)(`td`,{style:n.head_cell,className:t.head_cell}),l.map(function(e,r){return(0,F.jsx)(`th`,{scope:`col`,className:t.head_cell,style:n.head_cell,"aria-label":c(e,{locale:i}),children:s(e,{locale:i})},r)})]})}
316function fge(){var e=rI(),t=e.classNames,n=e.styles,r=e.components?.HeadRow??dge;return(0,F.jsx)(`thead`,{style:n.head,className:t.head,children:(0,F.jsx)(r,{})})}function pge(e){var t=rI(),n=t.locale,r=t.formatters.formatDay;return(0,F.jsx)(F.Fragment,{children:r(e.date,{locale:n})})}var dI=(0,y.createContext)(void 0);function mge(e){return $F(e.initialProps)?(0,F.jsx)(hge,{initialProps:e.initialProps,children:e.children}):(0,F.jsx)(dI.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function hge(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,a=t.max,o=function(e,n,o){var s,c;if((s=t.onDayClick)==null||s.call(t,e,n,o),!(n.selected&&i&&r?.length===i)&&!(!n.selected&&a&&r?.length===a)){var l=r?QF([],r,!0):[];if(n.selected){var u=l.findIndex(function(t){return BM(e,t)});l.splice(u,1)}else l.push(e);(c=t.onSelect)==null||c.call(t,l,e,n,o)}},s={disabled:[]};r&&s.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return BM(t,e)});return!!(t&&!n)});var c={selected:r,onDayClick:o,modifiers:s};return(0,F.jsx)(dI.Provider,{value:c,children:n})}function fI(){var e=(0,y.useContext)(dI);if(!e)throw Error(`useSelectMultiple must be used within a SelectMultipleProvider`);return e}function gge(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?BM(i,e)&&BM(r,e)?void 0:BM(i,e)?{from:i,to:void 0}:BM(r,e)?void 0:gN(r,e)?{from:e,to:i}:{from:r,to:e}:i?gN(e,i)?{from:i,to:e}:{from:e,to:i}:r?_N(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var pI=(0,y.createContext)(void 0);function _ge(e){return eI(e.initialProps)?(0,F.jsx)(vge,{initialProps:e.initialProps,children:e.children}):(0,F.jsx)(pI.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function vge(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},a=i.from,o=i.to,s=t.min,c=t.max,l=function(e,n,i){var a,o;(a=t.onDayClick)==null||a.call(t,e,n,i);var s=gge(e,r);(o=t.onSelect)==null||o.call(t,s,e,n,i)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(u.range_start=[a],o?(u.range_end=[o],BM(a,o)||(u.range_middle=[{after:a,before:o}])):u.range_end=[a]):o&&(u.range_start=[o],u.range_end=[o]),s&&(a&&!o&&u.disabled.push({after:yN(a,s-1),before:_M(a,s-1)}),a&&o&&u.disabled.push({after:a,before:_M(a,s-1)}),!a&&o&&u.disabled.push({after:yN(o,s-1),before:_M(o,s-1)})),c){if(a&&!o&&(u.disabled.push({before:_M(a,-c+1)}),u.disabled.push({after:_M(a,c-1)})),a&&o){var d=c-(MM(o,a)+1);u.disabled.push({before:yN(a,d)}),u.disabled.push({after:_M(o,d)})}!a&&o&&(u.disabled.push({before:_M(o,-c+1)}),u.disabled.push({after:_M(o,c-1)}))}return(0,F.jsx)(pI.Provider,{value:{selected:r,onDayClick:l,modifiers:u},children:n})}function mI(){var e=(0,y.useContext)(pI);if(!e)throw Error(`useSelectRange must be used within a SelectRangeProvider`);return e}function hI(e){return Array.isArray(e)?QF([],e,!0):e===void 0?[]:[e]}function yge(e){var t={};return Object.entries(e).forEach(function(e){var n=e[0],r=e[1];t[n]=hI(r)}),t}var gI;(function(e){e.Outside=`outside`,e.Disabled=`disabled`,e.Selected=`selected`,e.Hidden=`hidden`,e.Today=`today`,e.RangeStart=`range_start`,e.RangeEnd=`range_end`,e.RangeMiddle=`range_middle`})(gI||={});var bge=gI.Selected,_I=gI.Disabled,xge=gI.Hidden,Sge=gI.Today,vI=gI.RangeEnd,yI=gI.RangeMiddle,bI=gI.RangeStart,Cge=gI.Outside;function wge(e,t,n){var r,i=(r={},r[bge]=hI(e.selected),r[_I]=hI(e.disabled),r[xge]=hI(e.hidden),r[Sge]=[e.today],r[vI]=[],r[yI]=[],r[bI]=[],r[Cge]=[],r);return e.fromDate&&i[_I].push({before:e.fromDate}),e.toDate&&i[_I].push({after:e.toDate}),$F(e)?i[_I]=i[_I].concat(t.modifiers[_I]):eI(e)&&(i[_I]=i[_I].concat(n.modifiers[_I]),i[bI]=n.modifiers[bI],i[yI]=n.modifiers[yI],i[vI]=n.modifiers[vI]),i}var xI=(0,y.createContext)(void 0);function Tge(e){var t=rI(),n=wge(t,fI(),mI()),r=yge(t.modifiers),i=ZF(ZF({},n),r);return(0,F.jsx)(xI.Provider,{value:i,children:e.children})}function SI(){var e=(0,y.useContext)(xI);if(!e)throw Error(`useModifiers must be used within a ModifiersProvider`);return e}function Ege(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function Dge(e){return!!(e&&typeof e==`object`&&`from`in e)}function Oge(e){return!!(e&&typeof e==`object`&&`after`in e)}function kge(e){return!!(e&&typeof e==`object`&&`before`in e)}function Age(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function jge(e,t){var n,r=t.from,i=t.to;return r&&i?(MM(i,r)<0&&(n=[i,r],r=n[0],i=n[1]),MM(e,r)>=0&&MM(i,e)>=0):i?BM(i,e):r?BM(r,e):!1}function Mge(e){return VM(e)}function Nge(e){return Array.isArray(e)&&e.every(VM)}function Pge(e,t){return t.some(function(t){if(typeof t==`boolean`)return t;if(Mge(t))return BM(e,t);if(Nge(t))return t.includes(e);if(Dge(t))return jge(e,t);if(Age(t))return t.dayOfWeek.includes(e.getDay());if(Ege(t)){var n=MM(t.before,e),r=MM(t.after,e),i=n>0,a=r<0;return gN(t.before,t.after)?a&&i:i||a}
316return Oge(t)?MM(e,t.after)>0:kge(t)?MM(t.before,e)>0:typeof t==`function`&&t(e)})}function CI(e,t,n){var r=Object.keys(t).reduce(function(n,r){var i=t[r];return Pge(e,i)&&n.push(r),n},[]),i={};return r.forEach(function(e){return i[e]=!0}),n&&!vN(e,n)&&(i.outside=!0),i}function Fge(e,t){for(var n=YM(e[0]),r=JM(e[e.length-1]),i,a,o=n;o<=r;){var s=CI(o,t);if(!(!s.disabled&&!s.hidden)){o=_M(o,1);continue}if(s.selected)return o;s.today&&!a&&(a=o),i||=o,o=_M(o,1)}return a||i}var Ige=365;function wI(e,t){var n=t.moveBy,r=t.direction,i=t.context,a=t.modifiers,o=t.retry,s=o===void 0?{count:0,lastFocused:e}:o,c=i.weekStartsOn,l=i.fromDate,u=i.toDate,d=i.locale,f={day:_M,week:PM,month:vM,year:FM,startOfWeek:function(e){return i.ISOWeek?OM(e):DM(e,{locale:d,weekStartsOn:c})},endOfWeek:function(e){return i.ISOWeek?QM(e):ZM(e,{locale:d,weekStartsOn:c})}}[n](e,r===`after`?1:-1);r===`before`&&l?f=IM([l,f]):r===`after`&&u&&(f=LM([u,f]));var p=!0;if(a){var m=CI(f,a);p=!m.disabled&&!m.hidden}return p?f:s.count>Ige?s.lastFocused:wI(f,{moveBy:n,direction:r,context:i,modifiers:a,retry:ZF(ZF({},s),{count:s.count+1})})}var TI=(0,y.createContext)(void 0);function Lge(e){var t=sI(),n=SI(),r=(0,y.useState)(),i=r[0],a=r[1],o=(0,y.useState)(),s=o[0],c=o[1],l=Fge(t.displayMonths,n),u=i??(s&&t.isDateDisplayed(s))?s:l,d=function(){c(i),a(void 0)},f=function(e){a(e)},p=rI(),m=function(e,r){if(i){var a=wI(i,{moveBy:e,direction:r,context:p,modifiers:n});BM(i,a)||(t.goToDate(a,i),f(a))}},h={focusedDay:i,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return m(`day`,`after`)},focusDayBefore:function(){return m(`day`,`before`)},focusWeekAfter:function(){return m(`week`,`after`)},focusWeekBefore:function(){return m(`week`,`before`)},focusMonthBefore:function(){return m(`month`,`before`)},focusMonthAfter:function(){return m(`month`,`after`)},focusYearBefore:function(){return m(`year`,`before`)},focusYearAfter:function(){return m(`year`,`after`)},focusStartOfWeek:function(){return m(`startOfWeek`,`before`)},focusEndOfWeek:function(){return m(`endOfWeek`,`after`)}};return(0,F.jsx)(TI.Provider,{value:h,children:e.children})}function EI(){var e=(0,y.useContext)(TI);if(!e)throw Error(`useFocusContext must be used within a FocusProvider`);return e}function Rge(e,t){return CI(e,SI(),t)}var DI=(0,y.createContext)(void 0);function zge(e){return tI(e.initialProps)?(0,F.jsx)(Bge,{initialProps:e.initialProps,children:e.children}):(0,F.jsx)(DI.Provider,{value:{selected:void 0},children:e.children})}function Bge(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var i,a,o;if((i=t.onDayClick)==null||i.call(t,e,n,r),n.selected&&!t.required){(a=t.onSelect)==null||a.call(t,void 0,e,n,r);return}(o=t.onSelect)==null||o.call(t,e,e,n,r)}};return(0,F.jsx)(DI.Provider,{value:r,children:n})}function OI(){var e=(0,y.useContext)(DI);if(!e)throw Error(`useSelectSingle must be used within a SelectSingleProvider`);return e}function Vge(e,t){var n=rI(),r=OI(),i=fI(),a=mI(),o=EI(),s=o.focusDayAfter,c=o.focusDayBefore,l=o.focusWeekAfter,u=o.focusWeekBefore,d=o.blur,f=o.focus,p=o.focusMonthBefore,m=o.focusMonthAfter,h=o.focusYearBefore,g=o.focusYearAfter,_=o.focusStartOfWeek,v=o.focusEndOfWeek;return{onClick:function(o){var s,c,l,u;tI(n)?(s=r.onDayClick)==null||s.call(r,e,t,o):$F(n)?(c=i.onDayClick)==null||c.call(i,e,t,o):eI(n)?(l=a.onDayClick)==null||l.call(a,e,t,o):(u=n.onDayClick)==null||u.call(n,e,t,o)},onFocus:function(r){var i;f(e),(i=n.onDayFocus)==null||i.call(n,e,t,r)},onBlur:function(r){var i;d(),(i=n.onDayBlur)==null||i.call(n,e,t,r)},onKeyDown:function(r){var i;switch(r.key){case`ArrowLeft`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?s():c();break;case`ArrowRight`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?c():s();break;case`ArrowDown`:r.preventDefault(),r.stopPropagation(),l();break;case`ArrowUp`:r.preventDefault(),r.stopPropagation(),u();break;case`PageUp`:r.preventDefault(),r.stopPropagation(),r.shiftKey?h():p();break;case`PageDown`:r.preventDefault(),r.stopPropagation(),r.shiftKey?g():m();break;case`Home`:r.preventDefault(),r.stopPropagation(),_();break;case`End`:r.preventDefault(),r.stopPropagation(),v();break}(i=n.onDayKeyDown)==null||i.call(n,e,t,r)},onKeyUp:function(r){var i;(i=n.onDayKeyUp)==null||i.call(n,e,t,r)},onMouseEnter:function(r){var i;(i=n.onDayMouseEnter)==null||i.call(n,e,t,r)},onMouseLeave:function(r){var i;(i=n.onDayMouseLeave)==null||i.call(n,e,t,r)},onPointerEnter:function(r){var i;(i=n.onDayPointerEnter)==null||i.call(n,e,t,r)},onPointerLeave:function(r){var i;(i=n.onDayPointerLeave)==null||i.call(n,e,t,r)},onTouchCancel:function(r){var i;(i=n.onDayTouchCancel)==null||i.call(n,e,t,r)},onTouchEnd:function(r){var i;(i=n.onDayTouchEnd)==null||i.call(n,e,t,r)},onTouchMove:function(r){var i;(i=n.onDayTouchMove)==null||i.call(n,e,t,r)},onTouchStart:function(r){var i;(i=n.onDayTouchStart)==null||i.call(n,e,t,r)}}}function Hge(){var e=rI(),t=OI(),n=fI(),r=mI();return tI(e)?t.selected:$F(e)?n.selected:eI(e)?r.selected:void 0}function Uge(e){return Object.values(gI).includes(e)}function Wge(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(Uge(t)){var i=e.classNames[`day_${t}`];i&&n.push(i)}}),n}function Gge(e,t){var n=ZF({},e.styles.day);return Object.keys(t).forEach(function(t){n=ZF(ZF({},n),e.modifiersStyles?.[t])}),n}function Kge(e,t,n){var r,i=rI(),a=EI(),o=Rge(e,t),s=Vge(e,o),c=Hge(),l=!!(i.onDayCl
316ick||i.mode!=="default");(0,y.useEffect)(function(){var t;o.outside||a.focusedDay&&l&&BM(a.focusedDay,e)&&((t=n.current)==null||t.focus())},[a.focusedDay,e,n,l,o.outside]);var u=Wge(i,o).join(` `),d=Gge(i,o),f=!!(o.outside&&!i.showOutsideDays||o.hidden),p={style:d,className:u,children:(0,F.jsx)(i.components?.DayContent??pge,{date:e,displayMonth:t,activeModifiers:o}),role:`gridcell`},m=a.focusTarget&&BM(a.focusTarget,e)&&!o.outside,h=a.focusedDay&&BM(a.focusedDay,e);return{isButton:l,isHidden:f,activeModifiers:o,selectedDays:c,buttonProps:ZF(ZF(ZF({},p),(r={disabled:o.disabled,role:`gridcell`},r[`aria-selected`]=o.selected,r.tabIndex=h||m?0:-1,r)),s),divProps:p}}function qge(e){var t=(0,y.useRef)(null),n=Kge(e.date,e.displayMonth,t);return n.isHidden?(0,F.jsx)(`div`,{role:`gridcell`}):n.isButton?(0,F.jsx)(lI,ZF({name:`day`,ref:t},n.buttonProps)):(0,F.jsx)(`div`,ZF({},n.divProps))}function Jge(e){var t=e.number,n=e.dates,r=rI(),i=r.onWeekNumberClick,a=r.styles,o=r.classNames,s=r.locale,c=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,u=l(Number(t),{locale:s});if(!i)return(0,F.jsx)(`span`,{className:o.weeknumber,style:a.weeknumber,children:u});var d=c(Number(t),{locale:s});return(0,F.jsx)(lI,{name:`week-number`,"aria-label":d,className:o.weeknumber,style:a.weeknumber,onClick:function(e){i(t,n,e)},children:u})}function Yge(e){var t=rI(),n=t.styles,r=t.classNames,i=t.showWeekNumber,a=t.components,o=a?.Day??qge,s=a?.WeekNumber??Jge,c;return i&&(c=(0,F.jsx)(`td`,{className:r.cell,style:n.cell,children:(0,F.jsx)(s,{number:e.weekNumber,dates:e.dates})})),(0,F.jsxs)(`tr`,{className:r.row,style:n.row,children:[c,e.dates.map(function(t){return(0,F.jsx)(`td`,{className:r.cell,style:n.cell,role:`presentation`,children:(0,F.jsx)(o,{displayMonth:e.displayMonth,date:t})},tme(t))})]})}function kI(e,t,n){for(var r=n?.ISOWeek?QM(t):ZM(t,n),i=n?.ISOWeek?OM(e):DM(e,n),a=MM(r,i),o=[],s=0;s<=a;s++)o.push(_M(i,s));return o.reduce(function(e,t){var r=n?.ISOWeek?rN(t):aN(t,n),i=e.find(function(e){return e.weekNumber===r});return i?(i.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)},[])}function Xge(e,t){var n=kI(YM(e),JM(e),t);if(t?.useFixedWeeks){var r=rme(e,t);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],o=PM(a,6-r),s=kI(PM(a,1),o,t);n.push.apply(n,s)}}return n}function Zge(e){var t=rI(),n=t.locale,r=t.classNames,i=t.styles,a=t.hideHead,o=t.fixedWeeks,s=t.components,c=t.weekStartsOn,l=t.firstWeekContainsDate,u=t.ISOWeek,d=Xge(e.displayMonth,{useFixedWeeks:!!o,ISOWeek:u,locale:n,weekStartsOn:c,firstWeekContainsDate:l}),f=s?.Head??fge,p=s?.Row??Yge,m=s?.Footer??lge;return(0,F.jsxs)(`table`,{id:e.id,className:r.table,style:i.table,role:`grid`,"aria-labelledby":e[`aria-labelledby`],children:[!a&&(0,F.jsx)(f,{}),(0,F.jsx)(`tbody`,{className:r.tbody,style:i.tbody,children:d.map(function(t){return(0,F.jsx)(p,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),(0,F.jsx)(m,{displayMonth:e.displayMonth})]})}function Qge(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var $ge=Qge()?y.useLayoutEffect:y.useEffect,AI=!1,e_e=0;function jI(){return`react-day-picker-${++e_e}`}function t_e(e){var t=(0,y.useState)(e??(AI?jI():null)),n=t[0],r=t[1];return $ge(function(){n===null&&r(jI())},[]),(0,y.useEffect)(function(){AI===!1&&(AI=!0)},[]),e??n??void 0}function n_e(e){var t,n=rI(),r=n.dir,i=n.classNames,a=n.styles,o=n.components,s=sI().displayMonths,c=t_e(n.id?`${n.id}-${e.displayIndex}`:void 0),l=n.id?`${n.id}-grid-${e.displayIndex}`:void 0,u=[i.month],d=a.month,f=e.displayIndex===0,p=e.displayIndex===s.length-1,m=!f&&!p;r===`rtl`&&(t=[f,p],p=t[0],f=t[1]),f&&(u.push(i.caption_start),d=ZF(ZF({},d),a.caption_start)),p&&(u.push(i.caption_end),d=ZF(ZF({},d),a.caption_end)),m&&(u.push(i.caption_between),d=ZF(ZF({},d),a.caption_between));var h=o?.Caption??cge;return(0,F.jsxs)(`div`,{className:u.join(` `),style:d,children:[(0,F.jsx)(h,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,F.jsx)(Zge,{id:l,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function r_e(e){var t=rI(),n=t.classNames,r=t.styles;return(0,F.jsx)(`div`,{className:n.months,style:r.months,children:e.children})}function i_e(e){var t=e.initialProps,n=rI(),r=EI(),i=sI(),a=(0,y.useState)(!1),o=a[0],s=a[1];(0,y.useEffect)(function(){n.initialFocus&&r.focusTarget&&(o||(r.focus(r.focusTarget),s(!0)))},[n.initialFocus,o,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var l=ZF(ZF({},n.styles.root),n.style),u=Object.keys(t).filter(function(e){return e.startsWith(`data-`)}).reduce(function(e,n){var r;return ZF(ZF({},e),(r={},r[n]=t[n],r))},{}),d=t.components?.Months??r_e;return(0,F.jsx)(`div`,ZF({className:c.join(` `),style:l,dir:n.dir,id:n.id,nonce:t.nonce,title:t.title,lang:t.lang},u,{children:(0,F.jsx)(d,{children:i.displayMonths.map(function(e,t){return(0,F.jsx)(n_e,{displayIndex:t,displayMonth:e},t)})})}))}function a_e(e){var t=e.children,n=Ihe(e,[`children`]);return(0,F.jsx)(Jhe,{initialProps:n,children:(0,F.jsx)(ige,{children:(0,F.jsx)(zge,{initialProps:n,children:(0,F.jsx)(mge,{initialProps:n,children:(0,F.jsx)(_ge,{initialProps:n,children:(0,F.jsx)(Tge,{children:(0,F.jsx)(Lge,{children:t})})})})})})})}function o_e(e){return(0,F.jsx)(a_e,ZF({},e,{children:(0,F.jsx)(i_e,{initialProps:e})}))}function s_e({className:e,classNames:t,showOutsideDays:n=!0,...r}){return(0,F.jsx)(o_e,{showOutsideDays:n,className:z(`p-3`,e),classNames:{months:`flex flex-col sm:flex-row space-y-4 sm:sp
316ace-x-4 sm:space-y-0`,month:`space-y-4`,caption:`flex justify-center pt-1 relative items-center`,caption_label:`text-sm font-medium`,nav:`space-x-1 flex items-center`,nav_button:z(Ou({variant:`outline`}),`h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100`),nav_button_previous:`absolute left-1`,nav_button_next:`absolute right-1`,table:`w-full border-collapse space-y-1`,head_row:`flex`,head_cell:`text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]`,row:`flex w-full mt-2`,cell:`h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20`,day:z(Ou({variant:`ghost`}),`h-9 w-9 p-0 font-normal aria-selected:opacity-100`),day_range_end:`day-range-end`,day_selected:`bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground`,day_today:`bg-accent text-accent-foreground`,day_outside:`day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30`,day_disabled:`text-muted-foreground opacity-50`,day_range_middle:`aria-selected:bg-accent aria-selected:text-accent-foreground`,day_hidden:`invisible`,...t},components:{IconLeft:({...e})=>(0,F.jsx)(__,{className:`h-4 w-4`}),IconRight:({...e})=>(0,F.jsx)(v_,{className:`h-4 w-4`})},...r})}s_e.displayName=`Calendar`;var MI=`Checkbox`,[c_e,l_e]=EC(MI),[u_e,d_e]=c_e(MI),NI=y.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,...u}=e,[d,f]=y.useState(null),p=bl(t,e=>f(e)),m=y.useRef(!1),h=!d||!!d.closest(`form`),[g=!1,_]=ow({prop:i,defaultProp:a,onChange:l}),v=y.useRef(g);return y.useEffect(()=>{let e=d?.form;if(e){let t=()=>_(v.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[d,_]),(0,F.jsxs)(u_e,{scope:n,state:g,disabled:s,children:[(0,F.jsx)(U.button,{type:`button`,role:`checkbox`,"aria-checked":II(g)?`mixed`:g,"aria-required":o,"data-state":LI(g),"data-disabled":s?``:void 0,disabled:s,value:c,...u,ref:p,onKeyDown:K(e.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:K(e.onClick,e=>{_(e=>II(e)?!0:!e),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,F.jsx)(f_e,{control:d,bubbles:!m.current,name:r,value:c,checked:g,required:o,disabled:s,style:{transform:`translateX(-100%)`}})]})});NI.displayName=MI;var PI=`CheckboxIndicator`,FI=y.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=d_e(PI,n);return(0,F.jsx)(wC,{present:r||II(a.state)||a.state===!0,children:(0,F.jsx)(U.span,{"data-state":LI(a.state),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});FI.displayName=PI;var f_e=e=>{let{control:t,checked:n,bubbles:r=!0,...i}=e,a=y.useRef(null),o=uO(n),s=KD(t);return y.useEffect(()=>{let e=a.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(o!==n&&i){let t=new Event(`click`,{bubbles:r});e.indeterminate=II(n),i.call(e,!II(n)&&n),e.dispatchEvent(t)}},[o,n,r]),(0,F.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:!II(n)&&n,...i,tabIndex:-1,ref:a,style:{...e.style,...s,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})};function II(e){return e===`indeterminate`}function LI(e){return II(e)?`indeterminate`:e?`checked`:`unchecked`}var RI=NI,p_e=FI,zI=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(RI,{ref:n,className:z(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,F.jsx)(p_e,{className:z(`flex items-center justify-center text-current`),children:(0,F.jsx)(h_,{className:`h-4 w-4`})})}));zI.displayName=RI.displayName;var m_e=`DismissableLayer`,BI=`dismissableLayer.update`,h_e=`dismissableLayer.pointerDownOutside`,g_e=`dismissableLayer.focusOutside`,VI,HI=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),UI=y.forwardRef((e,t)=>
vendor: 4,188 bytes, line 316
316{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(HI),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=y_e(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=b_e(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(VI=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),WI(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=VI)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),WI())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(BI,e),()=>document.removeEventListener(BI,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});UI.displayName=m_e;var __e=`DismissableLayerBranch`,v_e=y.forwardRef((e,t)=>{let n=y.useContext(HI),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});v_e.displayName=__e;function y_e(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){GI(h_e,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function b_e(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&GI(g_e,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function WI(){let e=new CustomEvent(BI);document.dispatchEvent(e)}function GI(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var KI=0;function x_e(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??qI()),document.body.insertAdjacentElement(`beforeend`,e[1]??qI()),KI++,()=>{KI===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),KI--}},[])}function qI(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.cssText=`outline: none; opacity: 0; position: fixed; pointer-events: none`,e}var S_e=`Portal`,JI=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});JI.displayName=S_e;var YI=`rovingFocusGroup.onEntryFocus`,C_e={bubbles:!1,cancelable:!0},XI=`RovingFocusGroup`,[ZI,QI,w_e]=pE(XI),[T_e,$I]=EC(XI,[w_e]),[E_e,D_e]=T_e(XI),eL=y.forwardRef((e,t)=>(0,F.jsx)(ZI.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(ZI.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(O_e,{...e,ref:t})})}));eL.displayName=XI;var O_e=y.forwardRef((e,t)=>
316{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),p=bl(t,f),m=OC(a),[h=null,g]=ow({prop:o,defaultProp:s,onChange:c}),[_,v]=y.useState(!1),b=DC(l),x=QI(n),S=y.useRef(!1),[C,w]=y.useState(0);return y.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(YI,b),()=>e.removeEventListener(YI,b)},[b]),(0,F.jsx)(E_e,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:y.useCallback(e=>g(e),[g]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:y.useCallback(()=>w(e=>e-1),[]),children:(0,F.jsx)(U.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:K(e.onMouseDown,()=>{S.current=!0}),onFocus:K(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(YI,C_e);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);rL([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:K(e.onBlur,()=>v(!1))})})}),tL=`RovingFocusGroupItem`,nL=y.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=aw(),c=a||s,l=D_e(tL,n),u=l.currentTabStopId===c,d=QI(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return y.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),(0,F.jsx)(ZI.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:(0,F.jsx)(U.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:K(e.onMouseDown,e=>{r?l.onItemFocus(c):e.preventDefault()}),onFocus:K(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:K(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=j_e(e,l.orientation,l.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=d().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?M_e(n,r+1):n.slice(r+1)}setTimeout(()=>rL(n))}})})})});nL.displayName=tL;var k_e={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function A_e(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function j_e(e,t,n){let r=A_e(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return k_e[r]}function rL(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function M_e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var iL=eL,aL=nL,oL=Uw(),sL=function(){},cL=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:sL,onWheelCapture:sL,onTouchMoveCapture:sL}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,g=e.as,_=g===void 0?`div`:g,v=e.gapMode,b=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bw([n,t]),C=jw(jw({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:oL,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),jw(jw({},C),{ref:S})):y.createElement(_,jw({},C,{className:c,ref:S}),s))});cL.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cL.classNames={fullWidth:Fw,zeroRight:Pw};var lL=!1;if(typeof window<`u`)try{var uL=Object.defineProperty({},"passive",{get:function(){return lL=!0,!0}});window.addEventListener(`test`,uL,uL),window.removeEventListener(`test`,uL,uL)}catch{lL=!1}var dL=lL?{passive:!1}:!1,N_e=function(e){return e.tagName===`TEXTAREA`},fL=function(e,t){var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!N_e(e)&&n[t]===`visible`)},P_e=function(e){return fL(e,`overflowY`)}
vendor: 2,803 bytes, lines 316-319
316,F_e=function(e){return fL(e,`overflowX`)},pL=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),mL(e,r)){var i=hL(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},I_e=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},L_e=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},mL=function(e,t){return e===`v`?P_e(t):F_e(t)},hL=function(e,t){return e===`v`?I_e(t):L_e(t)},R_e=function(e,t){return e===`h`&&t===`rtl`?-1:1},z_e=function(e,t,n,r,i){var a=R_e(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=hL(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&mL(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},gL=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_L=function(e){return[e.deltaX,e.deltaY]},vL=function(e){return e&&`current`in e?e.current:e},B_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},V_e=function(e){return` 317 .block-interactivity-${e} {pointer-events: none;} 318 .allow-interactivity-${e} {pointer-events: all;} 319`},H_e=0,yL=[];function U_e(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(H_e++)[0],a=y.useState(nT)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(vL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=gL(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=pL(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=pL(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return z_e(p,t,e,p===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!yL.length||yL[yL.length-1]!==a)){var r=`deltaY`in n?_L(n):gL(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&B_e(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(vL).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>
3190?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:W_e(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=gL(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,_L(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,gL(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return yL.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,dL),document.addEventListener(`touchmove`,c,dL),document.addEventListener(`touchstart`,u,dL),function(){yL=yL.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,dL),document.removeEventListener(`touchmove`,c,dL),document.removeEventListener(`touchstart`,u,dL)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:V_e(i)}):null,p?y.createElement(dT,{gapMode:e.gapMode}):null)}function W_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var G_e=Gw(oL,U_e),bL=y.forwardRef(function(e,t){return y.createElement(cL,jw({},e,{ref:t,sideCar:G_e}))});bL.classNames=cL.classNames;var xL=[`Enter`,` `],K_e=[`ArrowDown`,`PageUp`,`Home`],SL=[`ArrowUp`,`PageDown`,`End`],q_e=[...K_e,...SL],J_e={ltr:[...xL,`ArrowRight`],rtl:[...xL,`ArrowLeft`]},Y_e={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},CL=`Menu`,[wL,X_e,Z_e]=pE(CL),[TL,EL]=EC(CL,[Z_e,YD,$I]),DL=YD(),OL=$I(),[kL,AL]=TL(CL),[Q_e,jL]=TL(CL),ML=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=DL(t),[c,l]=y.useState(null),u=y.useRef(!1),d=DC(a),f=OC(i);return y.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,F.jsx)(aO,{...s,children:(0,F.jsx)(kL,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,F.jsx)(Q_e,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ML.displayName=CL;var $_e=`MenuAnchor`,NL=y.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=DL(n);return(0,F.jsx)(oO,{...i,...r,ref:t})});NL.displayName=$_e;var PL=`MenuPortal`,[eve,FL]=TL(PL,{forceMount:void 0}),IL=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=AL(PL,t);return(0,F.jsx)(eve,{scope:t,forceMount:n,children:(0,F.jsx)(wC,{present:n||a.open,children:(0,F.jsx)(JI,{asChild:!0,container:i,children:r})})})};IL.displayName=PL;var LL=`MenuContent`,[tve,RL]=TL(LL),zL=y.forwardRef((e,t)=>{let n=FL(LL,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=AL(LL,e.__scopeMenu),o=jL(LL,e.__scopeMenu);return(0,F.jsx)(wL.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(wC,{present:r||a.open,children:(0,F.jsx)(wL.Slot,{scope:e.__scopeMenu,children:o.modal?(0,F.jsx)(nve,{...i,ref:t}):(0,F.jsx)(rve,{...i,ref:t})})})})}),nve=y.forwardRef((e,t)=>{let n=AL(LL,e.__scopeMenu),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return kT(e)},[]),(0,F.jsx)(BL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rve=y.forwardRef((e,t)=>{let n=AL(LL,e.__scopeMenu);return(0,F.jsx)(BL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),BL=y.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=AL(LL,n),_=jL(LL,n),v=DL(n),b=OL(n),x=X_e(n),[S,C]=y.useState(null),w=y.useRef(null),T=bl(t,w,g.onContentChange),E=y.useRef(0),D=y.useRef(``),O=y.useRef(0),k=y.useRef(null),A=y.useRef(`right`),j=y.useRef(0),M=m?bL:y.Fragment,N=m?{as:xl,allowPinchZoom:!0}:void 0,ee=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=gve(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>
vendor: 12,500 bytes, line 319
319o.focus())};y.useEffect(()=>()=>window.clearTimeout(E.current),[]),x_e();let te=y.useCallback(e=>A.current===k.current?.side&&vve(e,k.current?.area),[]);return(0,F.jsx)(tve,{scope:n,searchRef:D,onItemEnter:y.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:y.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:y.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:O,onPointerGraceIntentChange:y.useCallback(e=>{k.current=e},[]),children:(0,F.jsx)(M,{...N,children:(0,F.jsx)(bw,{asChild:!0,trapped:i,onMountAutoFocus:K(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,F.jsx)(UI,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,F.jsx)(iL,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:K(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(sO,{role:`menu`,"aria-orientation":`vertical`,"data-state":lR(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:K(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!q_e.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);SL.includes(e.key)&&a.reverse(),mve(a)}),onBlur:K(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:K(e.onPointerMove,fR(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})});zL.displayName=LL;var ive=`MenuGroup`,VL=y.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(U.div,{role:`group`,...r,ref:t})});VL.displayName=ive;var ave=`MenuLabel`,HL=y.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(U.div,{...r,ref:t})});HL.displayName=ave;var UL=`MenuItem`,WL=`menu.itemSelect`,GL=y.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=jL(UL,e.__scopeMenu),s=RL(UL,e.__scopeMenu),c=bl(t,a),l=y.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(WL,{bubbles:!0,cancelable:!0});e.addEventListener(WL,e=>r?.(e),{once:!0}),Pu(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,F.jsx)(KL,{...i,ref:c,disabled:n,onClick:K(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:K(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:K(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||xL.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});GL.displayName=UL;var KL=y.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=RL(UL,n),s=OL(n),c=y.useRef(null),l=bl(t,c),[u,d]=y.useState(!1),[f,p]=y.useState(``);return y.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,F.jsx)(wL.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,F.jsx)(aL,{asChild:!0,...s,focusable:!r,children:(0,F.jsx)(U.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:K(e.onPointerMove,fR(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,fR(e=>o.onItemLeave(e))),onFocus:K(e.onFocus,()=>d(!0)),onBlur:K(e.onBlur,()=>d(!1))})})})}),ove=`MenuCheckboxItem`,qL=y.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,F.jsx)($L,{scope:e.__scopeMenu,checked:n,children:(0,F.jsx)(GL,{role:`menuitemcheckbox`,"aria-checked":uR(n)?`mixed`:n,...i,ref:t,"data-state":dR(n),onSelect:K(i.onSelect,()=>r?.(uR(n)?!0:!n),{checkForDefaultPrevented:!1})})})});qL.displayName=ove;var JL=`MenuRadioGroup`,[sve,cve]=TL(JL,{value:void 0,onValueChange:()=>{}}),YL=y.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=DC(r);return(0,F.jsx)(sve,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,F.jsx)(VL,{...i,ref:t})})});YL.displayName=JL;var XL=`MenuRadioItem`,ZL=y.forwardRef((e,t)=>{let{value:n,...r}=e,i=cve(XL,e.__scopeMenu),a=n===i.value;return(0,F.jsx)($L,{scope:e.__scopeMenu,checked:a,children:(0,F.jsx)(GL,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":dR(a),onSelect:K(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ZL.displayName=XL;var QL=`MenuItemIndicator`,[$L,lve]=TL(QL,{checked:!1}),eR=y.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=lve(QL,n);return(0,F.jsx)(wC,{present:r||uR(a.checked)||a.checked===!0,children:(0,F.jsx)(U.span,{...i,ref:t,"data-state":dR(a.checked)})})});eR.displayName=QL;var uve=`MenuSeparator`,tR=y.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(U.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});tR.displayName=uve;var dve=`MenuArrow`,nR=y.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=DL(n);return(0,F.jsx)(cO,{...i,...r,ref:t})});nR.displayName=dve;var rR=`MenuSub`,[fve,iR]=TL(rR),pve=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=AL(rR,t),o=DL(t),[s,c]=y.useState(null),[l,u]=y.useState(null),d=DC(i);return y.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,F.jsx)(aO,{...o,children:(0,F.jsx)(kL,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,F.jsx)(fve,{scope:t,contentId:aw(),triggerId:aw(),trigger:s,onTriggerChange:c,children:n})})})};pve.displayName=rR;var aR=`MenuSubTrigger`,oR=y.forwardRef((e,t)=>{let n=AL(aR,e.__scopeMenu),r=jL(aR,e.__scopeMenu),i=iR(aR,e.__scopeMenu),a=RL(aR,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>u,[u]),y.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,F.jsx)(NL,{asChild:!0,...l,children:(0,F.jsx)(KL,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":lR(n.open),...e,ref:yl(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,fR(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:K(e.onPointerLeave,fR(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:K(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||J_e[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});oR.displayName=aR;var sR=`MenuSubContent`,cR=y.forwardRef((e,t)=>{let n=FL(LL,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=AL(LL,e.__scopeMenu),o=jL(LL,e.__scopeMenu),s=iR(sR,e.__scopeMenu),c=y.useRef(null),l=bl(t,c);return(0,F.jsx)(wL.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(wC,{present:r||a.open,children:(0,F.jsx)(wL.Slot,{scope:e.__scopeMenu,children:(0,F.jsx)(BL,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:K(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:K(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:K(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Y_e[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});cR.displayName=sR;function lR(e){return e?`open`:`closed`}function uR(e){return e===`indeterminate`}function dR(e){return uR(e)?`indeterminate`:e?`checked`:`unchecked`}function mve(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function hve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function gve(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=hve(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function _ve(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function vve(e,t){return t?_ve({x:e.clientX,y:e.clientY},t):!1}function fR(e){return t=>t.pointerType===`mouse`?e(t):void 0}var yve=ML,bve=NL,xve=IL,Sve=zL,Cve=VL,wve=HL,Tve=GL,Eve=qL,Dve=YL,Ove=ZL,kve=eR,Ave=tR,jve=nR,Mve=oR,Nve=cR,pR=`DropdownMenu`,[Pve,Fve]=EC(pR,[EL]),mR=EL(),[Ive,hR]=Pve(pR),gR=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=mR(t),l=y.useRef(null),[u=!1,d]=ow({prop:i,defaultProp:a,onChange:o});return(0,F.jsx)(Ive,{scope:t,triggerId:aw(),triggerRef:l,contentId:aw(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,F.jsx)(yve,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};gR.displayName=pR;var _R=`DropdownMenuTrigger`,vR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=hR(_R,n),o=mR(n);return(0,F.jsx)(bve,{asChild:!0,...o,children:(0,F.jsx)(U.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:yl(t,a.triggerRef),onPointerDown:K(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:K(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});vR.displayName=_R;var Lve=`DropdownMenuPortal`,yR=e=>{let{__scopeDropdownMenu:t,...n}=e,r=mR(t);return(0,F.jsx)(xve,{...r,...n})};yR.displayName=Lve;var bR=`DropdownMenuContent`,xR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=hR(bR,n),a=mR(n),o=y.useRef(!1);return(0,F.jsx)(Sve,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:K(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});xR.displayName=bR;var Rve=`DropdownMenuGroup`,zve=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Cve,{...i,...r,ref:t})});zve.displayName=Rve;var Bve=`DropdownMenuLabel`,SR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(wve,{...i,...r,ref:t})});SR.displayName=Bve;var Vve=`DropdownMenuItem`,CR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Tve,{...i,...r,ref:t})});CR.displayName=Vve;var Hve=`DropdownMenuCheckboxItem`,wR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Eve,{...i,...r,ref:t})});wR.displayName=Hve;var Uve=`DropdownMenuRadioGroup`,Wve=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Dve,{...i,...r,ref:t})});Wve.displayName=Uve;var Gve=`DropdownMenuRadioItem`,TR=y.forwardRef((e,t)=>
319{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Ove,{...i,...r,ref:t})});TR.displayName=Gve;var Kve=`DropdownMenuItemIndicator`,ER=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(kve,{...i,...r,ref:t})});ER.displayName=Kve;var qve=`DropdownMenuSeparator`,DR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Ave,{...i,...r,ref:t})});DR.displayName=qve;var Jve=`DropdownMenuArrow`,Yve=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(jve,{...i,...r,ref:t})});Yve.displayName=Jve;var Xve=`DropdownMenuSubTrigger`,OR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Mve,{...i,...r,ref:t})});OR.displayName=Xve;var Zve=`DropdownMenuSubContent`,kR=y.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mR(n);return(0,F.jsx)(Nve,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});kR.displayName=Zve;var AR=gR,jR=vR,MR=yR,NR=xR,PR=SR,FR=CR,IR=wR,LR=TR,RR=ER,zR=DR,BR=OR,VR=kR,HR=AR,UR=jR,WR=y.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,F.jsxs)(BR,{ref:i,className:z(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent`,t&&`pl-8`,e),...r,children:[n,(0,F.jsx)(v_,{className:`ml-auto h-4 w-4`})]}));WR.displayName=BR.displayName;var GR=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(VR,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));GR.displayName=VR.displayName;var KR=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,F.jsx)(MR,{children:(0,F.jsx)(NR,{ref:r,sideOffset:t,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));KR.displayName=NR.displayName;var qR=y.forwardRef(({className:e,inset:t,...n},r)=>(0,F.jsx)(FR,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));qR.displayName=FR.displayName;var JR=y.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,F.jsxs)(IR,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,F.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,F.jsx)(RR,{children:(0,F.jsx)(h_,{className:`h-4 w-4`})})}),t]}));JR.displayName=IR.displayName;var YR=y.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(LR,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,F.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,F.jsx)(RR,{children:(0,F.jsx)(w_,{className:`h-2 w-2 fill-current`})})}),t]}));YR.displayName=LR.displayName;var XR=y.forwardRef(({className:e,inset:t,...n},r)=>(0,F.jsx)(PR,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));XR.displayName=PR.displayName;var ZR=y.forwardRef(({className:e,...t},n)=>
vendor: 23,824 bytes, line 319
319(0,F.jsx)(zR,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));ZR.displayName=zR.displayName;var QR=({className:e,...t})=>(0,F.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest opacity-60`,e),...t});QR.displayName=`DropdownMenuShortcut`;var $R=e=>e.type===`checkbox`,ez=e=>e instanceof Date,tz=e=>e==null,nz=e=>typeof e==`object`,rz=e=>!tz(e)&&!Array.isArray(e)&&nz(e)&&!ez(e),iz=e=>rz(e)&&e.target?$R(e.target)?e.target.checked:e.target.value:e,az=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,oz=(e,t)=>e.has(az(t)),sz=e=>{let t=e.constructor&&e.constructor.prototype;return rz(t)&&t.hasOwnProperty(`isPrototypeOf`)},cz=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function lz(e){let t,n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(cz&&(e instanceof Blob||e instanceof FileList))&&(n||rz(e)))if(t=n?[]:{},!n&&!sz(e))t=e;else for(let n in e)e.hasOwnProperty(n)&&(t[n]=lz(e[n]));else return e;return t}var uz=e=>Array.isArray(e)?e.filter(Boolean):[],dz=e=>e===void 0,q=(e,t,n)=>{if(!t||!rz(e))return n;let r=uz(t.split(/[,[\].]+?/)).reduce((e,t)=>tz(e)?e:e[t],e);return dz(r)||r===e?dz(e[t])?n:e[t]:r},fz=e=>typeof e==`boolean`,pz=e=>/^\w*$/.test(e),mz=e=>uz(e.replace(/["|']|\]/g,``).split(/\.|\[/)),hz=(e,t,n)=>{let r=-1,i=pz(t)?[t]:mz(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=rz(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`)return;e[t]=a,e=e[t]}return e},gz={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`},_z={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},vz={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},yz=y.createContext(null),bz=()=>y.useContext(yz),xz=e=>{let{children:t,...n}=e;return y.createElement(yz.Provider,{value:n},t)},Sz=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==_z.all&&(t._proxyFormState[i]=!r||_z.all),n&&(n[i]=!0),e[i]}});return i},Cz=e=>rz(e)&&!Object.keys(e).length,wz=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return Cz(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||_z.all))},Tz=e=>Array.isArray(e)?e:[e],Ez=(e,t,n)=>!e||!t||e===t||Tz(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function Dz(e){let t=y.useRef(e);t.current=e,y.useEffect(()=>{let n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Oz(e){let t=bz(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,s]=y.useState(n._formState),c=y.useRef(!0),l=y.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=y.useRef(i);return u.current=i,Dz({disabled:r,next:e=>c.current&&Ez(u.current,e.name,a)&&wz(e,l.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),y.useEffect(()=>(c.current=!0,l.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),Sz(o,n,l.current,!1)}var kz=e=>typeof e==`string`,Az=(e,t,n,r,i)=>kz(e)?(r&&t.watch.add(e),q(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),q(n,e))):(r&&(t.watchAll=!0),n);function jz(e){let t=bz(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o}=e||{},s=y.useRef(r);s.current=r,Dz({disabled:a,subject:n._subjects.values,next:e=>{Ez(s.current,e.name,o)&&l(lz(Az(s.current,n._names,e.values||n._formValues,!1,i)))}});let[c,l]=y.useState(n._getWatch(r,i));return y.useEffect(()=>n._removeUnmounted()),c}function Mz(e){let t=bz(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,o=oz(i._names.array,n),s=jz({control:i,name:n,defaultValue:q(i._formValues,n,q(i._defaultValues,n,e.defaultValue)),exact:!0}),c=Oz({control:i,name:n,exact:!0}),l=y.useRef(i.register(n,{...e.rules,value:s,...fz(e.disabled)?{disabled:e.disabled}:{}}));return y.useEffect(()=>{let e=i._options.shouldUnregister||a,t=(e,t)=>{let n=q(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=lz(q(i._options.defaultValues,n));hz(i._defaultValues,n,e),dz(q(i._formValues,n))&&hz(i._formValues,n,e)}return()=>{(o?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,o,a]),y.useEffect(()=>{q(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:q(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:s,...fz(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:y.useCallback(e=>l.current.onChange({target:{value:iz(e),name:n},type:gz.CHANGE}),[n]),onBlur:y.useCallback(()=>l.current.onBlur({target:{value:q(i._formValues,n),name:n},type:gz.BLUR}),[n,i]),ref:y.useCallback(e=>{let t=q(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[i._fields,n])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!q(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!q(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!q(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!q(c.validatingFields,n)},error:{enumerable:!0,get:()=>q(c.errors,n)}})}}var Nz=e=>e.render(Mz(e)),Pz=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Fz=e=>({isOnSubmit:!e||e===_z.onSubmit,isOnBlur:e===_z.onBlur,isOnChange:e===_z.onChange,isOnAll:e===_z.all,isOnTouch:e===_z.onTouched}),Iz=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),Lz=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=q(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(Lz(a,t))break}else if(rz(a)&&Lz(a,t))break}}},Rz=(e,t,n)=>{let r=Tz(q(e,n));return hz(r,`root`,t[n]),hz(e,n,r),e},zz=e=>e.type===`file`,Bz=e=>typeof e==`function`,Vz=e=>{if(!cz)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hz=e=>kz(e),Uz=e=>e.type===`radio`,Wz=e=>e instanceof RegExp,Gz={value:!1,isValid:!1},Kz={value:!0,isValid:!0},qz=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!dz(e[0].attributes.value)?dz(e[0].value)||e[0].value===``?Kz:{value:e[0].value,isValid:!0}:Kz:Gz}return Gz},Jz={isValid:!1,value:null},Yz=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Jz):Jz;function Xz(e,t,n=`validate`){if(Hz(e)||Array.isArray(e)&&e.every(Hz)||fz(e)&&!e)return{type:n,message:Hz(e)?e:``,ref:t}}var Zz=e=>rz(e)&&!Wz(e)?e:{value:e,message:``},Qz=async(e,t,n,r,i)=>{let{ref:a,refs:o,required:s,maxLength:c,minLength:l,min:u,max:d,pattern:f,validate:p,name:m,valueAsNumber:h,mount:g,disabled:_}=e._f,v=q(t,m);if(!g||_)return{};let y=o?o[0]:a,b=e=>{r&&y.reportValidity&&(y.setCustomValidity(fz(e)?``:e||``),y.reportValidity())},x={},S=Uz(a),C=$R(a),w=S||C,T=(h||zz(a))&&dz(a.value)&&dz(v)||Vz(a)&&a.value===``||v===``||Array.isArray(v)&&!v.length,E=Pz.bind(null,m,n,x),D=(e,t,n,r=vz.maxLength,i=vz.minLength)=>{let o=e?t:n;x[m]={type:e?r:i,message:o,ref:a,...E(e?r:i,o)}};if(i?!Array.isArray(v)||!v.length:s&&(!w&&(T||tz(v))||fz(v)&&!v||C&&!qz(o).isValid||S&&!Yz(o).isValid)){let{value:e,message:t}=Hz(s)?{value:!!s,message:s}:Zz(s);if(e&&(x[m]={type:vz.required,message:t,ref:y,...E(vz.required,t)},!n))return b(t),x}if(!T&&(!tz(u)||!tz(d))){let e,t,r=Zz(d),i=Zz(u);if(!tz(v)&&!isNaN(v)){let n=a.valueAsNumber||v&&+v;tz(r.value)||(e=n>r.value),tz(i.value)||(t=n<i.value)}else{let n=a.valueAsDate||new Date(v),o=e=>new Date(new Date().toDateString()+` `+e),s=a.type==`time`,c=a.type==`week`;kz(r.value)&&v&&(e=s?o(v)>o(r.value):c?v>r.value:n>new Date(r.value)),kz(i.value)&&v&&(t=s?o(v)<o(i.value):c?v<i.value:n<new Date(i.value))}if((e||t)&&(D(!!e,r.message,i.message,vz.max,vz.min),!n))return b(x[m].message),x}if((c||l)&&!T&&(kz(v)||i&&Array.isArray(v))){let e=Zz(c),t=Zz(l),r=!tz(e.value)&&v.length>+e.value,i=!tz(t.value)&&v.length<+t.value;if((r||i)&&(D(r,e.message,t.message),!n))return b(x[m].message),x}if(f&&!T&&kz(v)){let{value:e,message:t}=Zz(f);if(Wz(e)&&!v.match(e)&&(x[m]={type:vz.pattern,message:t,ref:a,...E(vz.pattern,t)},!n))return b(t),x}if(p){if(Bz(p)){let e=Xz(await p(v,t),y);if(e&&(x[m]={...e,...E(vz.validate,e.message)},!n))return b(e.message),x}else if(rz(p)){let e={};for(let r in p){if(!Cz(e)&&!n)break;let i=Xz(await p[r](v,t),y,r);i&&(e={...i,...E(r,i.message)},b(i.message),n&&(x[m]=e))}if(!Cz(e)&&(x[m]={ref:y,...e},!n))return x}}return b(!0),x};function $z(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;)e=dz(e)?r++:e[t[r++]];return e}function eB(e){for(let t in e)if(e.hasOwnProperty(t)&&!dz(e[t]))return!1;return!0}function tB(e,t){let n=Array.isArray(t)?t:pz(t)?[t]:mz(t),r=n.length===1?e:$z(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(rz(r)&&Cz(r)||Array.isArray(r)&&eB(r))&&tB(e,n.slice(0,-1)),e}var nB=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},rB=e=>tz(e)||!nz(e);function iB(e,t){if(rB(e)||rB(t))return e===t;if(ez(e)&&ez(t))return e.getTime()===t.getTime();let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n){let n=e[i];if(!r.includes(i))return!1;if(i!==`ref`){let e=t[i];if(ez(n)&&ez(e)||rz(n)&&rz(e)||Array.isArray(n)&&Array.isArray(e)?!iB(n,e):n!==e)return!1}}return!0}var aB=e=>e.type===`select-multiple`,oB=e=>Uz(e)||$R(e),sB=e=>Vz(e)&&e.isConnected,cB=e=>{for(let t in e)if(Bz(e[t]))return!0;return!1};function lB(e,t={}){let n=Array.isArray(e);if(rz(e)||n)for(let n in e)Array.isArray(e[n])||rz(e[n])&&!cB(e[n])?(t[n]=Array.isArray(e[n])?[]:{},lB(e[n],t[n])):tz(e[n])||(t[n]=!0);return t}function uB(e,t,n){let r=Array.isArray(e);if(rz(e)||r)for(let r in e)Array.isArray(e[r])||rz(e[r])&&!cB(e[r])?dz(t)||rB(n[r])?n[r]=Array.isArray(e[r])?lB(e[r],[]):{...lB(e[r])}:uB(e[r],tz(t)?{}:t[r],n[r]):n[r]=!iB(e[r],t[r]);return n}var dB=(e,t)=>uB(e,t,lB(t)),fB=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>dz(e)?e:t?e===``?NaN:e&&+e:n&&kz(e)?new Date(e):r?r(e):e;function pB(e){let t=e.ref;if(!(e.refs?e.refs.every(e=>e.disabled):t.disabled))return zz(t)?t.files:Uz(t)?Yz(e.refs).value:aB(t)?[...t.selectedOptions].map(({value:e})=>e):$R(t)?qz(e.refs).value:fB(dz(t.value)?e.ref.value:t.value,e)}var mB=(e,t,n,r)=>{let i={};for(let n of e){let e=q(t,n);e&&hz(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},hB=e=>dz(e)?e:Wz(e)?e.source:rz(e)?Wz(e.value)?e.value.source:e.value:e,gB=`AsyncFunction`,_B=e=>(!e||!e.validate)&&!!(Bz(e.validate)&&e.validate.constructor.name===gB||rz(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===gB)),vB=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function yB(e,t,n){let r=q(e,n);if(r||pz(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=q(t,r),o=q(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};i.pop()}return{name:n}}var bB=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,xB=(e,t)=>!uz(q(e,t)).length&&tB(e,t),SB={mode:_z.onSubmit,reValidateMode:_z.onChange,shouldFocusError:!0};function CB(e={}){let t={...SB,...e},n={submitCount:0,isDirty:!1,isLoading:Bz(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(rz(t.defaultValues)||rz(t.values))&&lz(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:lz(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:nB(),array:nB(),state:nB()},f=Fz(t.mode),p=Fz(t.reValidateMode),m=t.criteriaMode===_z.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(u.isValid||e){let e=t.resolver?Cz((await w()).errors):await E(r,!0);e!==n.isValid&&d.state.next({isValid:e})}},_=(e,t)=>{(u.isValidating||u.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(t?hz(n.validatingFields,e,t):tB(n.validatingFields,e))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Cz(n.validatingFields)}))},v=(e,t=[],s,c,l=!0,f=!0)=>{if(c&&s){if(o.action=!0,f&&Array.isArray(q(r,e))){let t=s(q(r,e),c.argA,c.argB);l&&hz(r,e,t)}if(f&&Array.isArray(q(n.errors,e))){let t=s(q(n.errors,e),c.argA,c.argB);l&&hz(n.errors,e,t),xB(n.errors,e)}if(u.touchedFields&&f&&Array.isArray(q(n.touchedFields,e))){let t=s(q(n.touchedFields,e),c.argA,c.argB);l&&hz(n.touchedFields,e,t)}u.dirtyFields&&(n.dirtyFields=dB(i,a)),d.state.next({name:e,isDirty:O(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else hz(a,e,t)},y=(e,t)=>{hz(n.errors,e,t),d.state.next({errors:n.errors})},b=e=>{n.errors=e,d.state.next({errors:n.errors,isValid:!1})},x=(e,t,n,s)=>{let c=q(r,e);if(c){let r=q(a,e,dz(n)?q(i,e):n);dz(r)||s&&s.defaultChecked||t?hz(a,e,t?r:pB(c._f)):j(e,r),o.mount&&g()}},S=(e,t,a,o,s)=>{let c=!1,l=!1,f={name:e},p=!!(q(r,e)&&q(r,e)._f&&q(r,e)._f.disabled);if(!a||o){u.isDirty&&(l=n.isDirty,n.isDirty=f.isDirty=O(),c=l!==f.isDirty);let r=p||iB(q(i,e),t);l=!!(!p&&q(n.dirtyFields,e)),r||p?tB(n.dirtyFields,e):hz(n.dirtyFields,e,!0),f.dirtyFields=n.dirtyFields,c||=u.dirtyFields&&l!==!r}if(a){let t=q(n.touchedFields,e);t||(hz(n.touchedFields,e,a),f.touchedFields=n.touchedFields,c||=u.touchedFields&&t!==a)}return c&&s&&d.state.next(f),c?f:{}},C=(t,r,i,a)=>{let o=q(n.errors,t),s=u.isValid&&fz(r)&&n.isValid!==r;if(e.delayError&&i?(c=h(()=>y(t,i)),c(e.delayError)):(clearTimeout(l),c=null,i?hz(n.errors,t,i):tB(n.errors,t)),(i?!iB(o,i):o)||!Cz(a)||s){let e={...a,...s&&fz(r)?{isValid:r}:{},errors:n.errors,name:t};n={...n,...e},d.state.next(e)}},w=async e=>{_(e,!0);let n=await t.resolver(a,t.context,mB(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return _(e),n},T=async e=>{let{errors:t}=await w(e);if(e)for(let r of e){let e=q(t,r);e?hz(n.errors,r,e):tB(n.errors,r)}else n.errors=t;return t},E=async(e,r,i={valid:!0})=>{for(let o in e){let c=e[o];if(c){let{_f:e,...l}=c;if(e){let l=s.array.has(e.name),d=c._f&&_B(c._f);d&&u.validatingFields&&_([o],!0);let f=await Qz(c,a,m,t.shouldUseNativeValidation&&!r,l);if(d&&u.validatingFields&&_([o]),f[e.name]&&(i.valid=!1,r))break;!r&&(q(f,e.name)?l?Rz(n.errors,f,e.name):hz(n.errors,e.name,f[e.name]):tB(n.errors,e.name))}!Cz(l)&&await E(l,r,i)}}return i.valid},D=()=>{for(let e of s.unMount){let t=q(r,e);t&&(t._f.refs?t._f.refs.every(e=>!sB(e)):!sB(t._f.ref))&&ce(e)}s.unMount=new Set},O=(e,t)=>(e&&t&&hz(a,e,t),!iB(re(),i)),k=(e,t,n)=>Az(e,s,{...o.mount?a:dz(t)?i:kz(e)?{[e]:t}:t},n,t),A=t=>uz(q(o.mount?a:i,t,e.shouldUnregister?q(i,t,[]):[])),j=(e,t,n={})=>{let i=q(r,e),o=t;if(i){let n=i._f;n&&(!n.disabled&&hz(a,e,fB(t,n)),o=Vz(n.ref)&&tz(t)?``:t,aB(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?$R(n.ref)?n.refs.length>1?n.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find(t=>t===e.value):o===e.value)):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach(e=>e.checked=e.value===o):zz(n.ref)?n.ref.value=``:(n.ref.value=o,n.ref.type||d.values.next({name:e,values:{...a}})))}(n.shouldDirty||n.shouldTouch)&&S(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&ne(e)},M=(e,t,n)=>{for(let i in t){let a=t[i],o=`${e}.${i}`,c=q(r,o);(s.array.has(e)||!rB(a)||c&&!c._f)&&!ez(a)?M(o,a,n):j(o,a,n)}},N=(e,t,c={})=>{let l=q(r,e),f=s.array.has(e),p=lz(t);hz(a,e,p),f?(d.array.next({name:e,values:{...a}}),(u.isDirty||u.dirtyFields)&&c.shouldDirty&&d.state.next({name:e,dirtyFields:dB(i,a),isDirty:O(e,p)})):l&&!l._f&&!tz(p)?M(e,p,c):j(e,p,c),Iz(e,s)&&d.state.next({...n}),d.values.next({name:o.mount?e:void 0,values:{...a}})},ee=async i=>{o.mount=!0;let l=i.target,h=l.name,v=!0,y=q(r,h),b=()=>l.type?pB(y._f):iz(i),x=e=>{v=Number.isNaN(e)||iB(e,q(a,h,e))};if(y){let o,l,T=b(),D=i.type===gz.BLUR||i.type===gz.FOCUS_OUT,O=!vB(y._f)&&!t.resolver&&!q(n.errors,h)&&!y._f.deps||bB(D,q(n.touchedFields,h),n.isSubmitted,p,f),k=Iz(h,s,D);hz(a,h,T),D?(y._f.onBlur&&y._f.onBlur(i),c&&c(0)):y._f.onChange&&y._f.onChange(i);let A=S(h,T,D,!1),j=!Cz(A)||k;if(!D&&d.values.next({name:h,type:i.type,values:{...a}}),O)return u.isValid&&(e.mode===`onBlur`?D&&g():g()),j&&d.state.next({name:h,...k?{}:A});if(!D&&k&&d.state.next({...n}),t.resolver){let{errors:e}=await w([h]);if(x(T),v){let t=yB(n.errors,r,h),i=yB(e,r,t.name||h);o=i.error,h=i.name,l=Cz(e)}}else _([h],!0),o=(await Qz(y,a,m,t.shouldUseNativeValidation))[h],_([h]),x(T),v&&(o?l=!1:u.isValid&&(l=await E(r,!0)));v&&(y._f.deps&&ne(y._f.deps),C(h,l,o,A))}},te=(e,t)=>{if(q(n.errors,t)&&e.focus)return e.focus(),1},ne=async(e,i={})=>{let a,o,c=Tz(e);if(t.resolver){let t=await T(dz(e)?e:c);a=Cz(t),o=e?!c.some(e=>q(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=q(r,e);return await E(t&&t._f?{[e]:t}:t)}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await E(r);return d.state.next({...!kz(e)||u.isValid&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&Lz(r,te,e?c:s.mount),o},re=e=>{let t={...o.mount?a:i};return dz(e)?t:kz(e)?q(t,e):e.map(e=>q(t,e))},ie=(e,t)=>({invalid:!!q((t||n).errors,e),isDirty:!!q((t||n).dirtyFields,e),error:q((t||n).errors,e),isValidating:!!q(n.validatingFields,e),isTouched:!!q((t||n).touchedFields,e)}),ae=e=>{e&&Tz(e).forEach(e=>tB(n.errors,e)),d.state.next({errors:e?n.errors:{}})},oe=(e,t,i)=>{let a=(q(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=q(n.errors,e)||{};hz(n.errors,e,{...l,...t,ref:a}),d.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},se=(e,t)=>Bz(e)?d.values.subscribe({next:n=>e(k(void 0,t),n)}):k(e,t,!0),ce=(e,o={})=>{for(let c of e?Tz(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(tB(r,c),tB(a,c)),!o.keepError&&tB(n.errors,c),!o.keepDirty&&tB(n.dirtyFields,c),!o.keepTouched&&tB(n.touchedFields,c),!o.keepIsValidating&&tB(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&tB(i,c);d.values.next({values:{...a}}),d.state.next({...n,...o.keepDirty?{isDirty:O()}:{}}),!o.keepIsValid&&g()},le=({disabled:e,name:t,field:n,fields:r,value:i})=>{if(fz(e)&&o.mount||e){let o=e?void 0:dz(i)?pB(n?n._f:q(r,t)._f):i;hz(a,t,o),S(t,o,!1,!1,!0)}},ue=(n,a={})=>{let c=q(r,n),l=fz(a.disabled)||fz(e.disabled);return hz(r,n,{...c||{},_f:{...c&&c._f?c._f:{ref:{name:n}},name:n,mount:!0,...a}}),s.mount.add(n),c?le({field:c,disabled:fz(a.disabled)?a.disabled:e.disabled,name:n,value:a.value}):x(n,!0,a.value),{...l?{disabled:a.disabled||e.disabled}:{},...t.progressive?{required:!!a.required,min:hB(a.min),max:hB(a.max),minLength:hB(a.minLength),maxLength:hB(a.maxLength),pattern:hB(a.pattern)}:{},name:n,onChange:ee,onBlur:ee,ref:e=>{if(e){ue(n,a),c=q(r,n);let t=dz(e.value)&&e.querySelectorAll&&e.querySelectorAll(`input,select,textarea`)[0]||e,o=oB(t),s=c._f.refs||[];if(o?s.find(e=>e===t):t===c._f.ref)return;hz(r,n,{_f:{...c._f,...o?{refs:[...s.filter(sB),t,...Array.isArray(q(i,n))?[{}]:[]],ref:{type:t.type,name:n}}:{ref:t}}}),x(n,!1,void 0,t)}else c=q(r,n,{}),c._f&&(c._f.mount=!1),(t.shouldUnregister||a.shouldUnregister)&&!(oz(s.array,n)&&o.action)&&s.unMount.add(n)}}},de=()=>t.shouldFocusError&&Lz(r,te,s.mount),fe=e=>{fz(e)&&(d.state.next({disabled:e}),Lz(r,(t,n)=>{let i=q(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},pe=(e,i)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=lz(a);if(d.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await w();n.errors=e,c=t}else await E(r);if(tB(n.errors,`root`),Cz(n.errors)){d.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else i&&await i({...n.errors},o),de(),setTimeout(de);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Cz(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},me=(e,t={})=>{q(r,e)&&(dz(t.defaultValue)?N(e,lz(q(i,e))):(N(e,t.defaultValue),hz(i,e,lz(t.defaultValue))),t.keepTouched||tB(n.touchedFields,e),t.keepDirty||(tB(n.dirtyFields,e),n.isDirty=t.defaultValue?O(e,lz(q(i,e))):O()),t.keepError||(tB(n.errors,e),u.isValid&&g()),d.state.next({...n}))},he=(t,c={})=>{let l=t?lz(t):i,f=lz(l),p=Cz(t),m=p?i:f;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues)for(let e of s.mount)q(n.dirtyFields,e)?hz(m,e,q(a,e)):N(e,q(m,e));else{if(cz&&dz(t))for(let e of s.mount){let t=q(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Vz(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}r={}}a=e.shouldUnregister?c.keepDefaultValues?lz(i):{}:lz(m),d.array.next({values:{...m}}),d.values.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!u.isValid||!!c.keepIsValid||!!c.keepDirtyValues,o.watch=!!e.shouldUnregister,d.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:p?!1:c.keepDirty?n.isDirty:!!(c.keepDefaultValues&&!iB(t,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:p?{}:c.keepDirtyValues?c.keepDefaultValues&&a?dB(i,a):n.dirtyFields:c.keepDefaultValues&&t?dB(i,t):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ge=(e,t)=>he(Bz(e)?e(a):e,t);return{control:{register:ue,unregister:ce,getFieldState:ie,handleSubmit:pe,setError:oe,_executeSchema:w,_getWatch:k,_getDirty:O,_updateValid:g,_removeUnmounted:D,_updateFieldArray:v,_updateDisabledField:le,_getFieldArray:A,_reset:he,_resetDefaultValues:()=>Bz(t.defaultValues)&&t.defaultValues().then(e=>{ge(e,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:e=>{n={...n,...e}},_disableForm:fe,_subjects:d,_proxyFormState:u,_setErrors:b,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},set _formState(e){n=e},get _options(){return t},set _options(e){t={...t,...e}}},trigger:ne,register:ue,handleSubmit:pe,watch:se,setValue:N,getValues:re,reset:ge,resetField:me,clearErrors:ae,unregister:ce,setError:oe,setFocus:(e,t={})=>{let n=q(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:ie}}function wB(e={}){let t=y.useRef(),n=y.useRef(),[r,i]=y.useState({isDirty:!1,isValidating:!1,isLoading:Bz(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Bz(e.defaultValues)?void 0:e.defaultValues});t.current||={...CB(e),formState:r};let a=t.current.control;return a._options=e,Dz({subject:a._subjects.state,next:e=>{wz(e,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),y.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),y.useEffect(()=>{if(a._proxyFormState.isDirty){let e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}},[a,r.isDirty]),y.useEffect(()=>{e.values&&!iB(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i(e=>({...e}))):a._resetDefaultValues()},[e.values,a]),y.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),y.useEffect(()=>
vendor: 5,440 bytes, line 319
319{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),y.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),t.current.formState=Sz(r,a),t.current}var TB=xz,EB=y.createContext({}),DB=({...e})=>(0,F.jsx)(EB.Provider,{value:{name:e.name},children:(0,F.jsx)(Nz,{...e})}),OB=()=>{let e=y.useContext(EB),t=y.useContext(kB),{getFieldState:n,formState:r}=bz(),i=n(e.name,r);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},kB=y.createContext({}),AB=y.forwardRef(({className:e,...t},n)=>{let r=y.useId();return(0,F.jsx)(kB.Provider,{value:{id:r},children:(0,F.jsx)(`div`,{ref:n,className:z(`space-y-2`,e),...t})})});AB.displayName=`FormItem`;var jB=y.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=OB();return(0,F.jsx)(zu,{ref:n,className:z(r&&`text-destructive`,e),htmlFor:i,...t})});jB.displayName=`FormLabel`;var MB=y.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=OB();return(0,F.jsx)(xl,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});MB.displayName=`FormControl`;var NB=y.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=OB();return(0,F.jsx)(`p`,{ref:n,id:r,className:z(`text-sm text-muted-foreground`,e),...t})});NB.displayName=`FormDescription`;var PB=y.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=OB(),o=i?String(i?.message):t;return o?(0,F.jsx)(`p`,{ref:r,id:a,className:z(`text-sm font-medium text-destructive`,e),...n,children:o}):null});PB.displayName=`FormMessage`;var FB=`DismissableLayer`,IB=`dismissableLayer.update`,LB=`dismissableLayer.pointerDownOutside`,RB=`dismissableLayer.focusOutside`,zB,BB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),VB=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(BB),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=WB(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=GB(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(zB=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),KB(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=zB)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),KB())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(IB,e),()=>document.removeEventListener(IB,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});VB.displayName=FB;var HB=`DismissableLayerBranch`,UB=y.forwardRef((e,t)=>{let n=y.useContext(BB),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});UB.displayName=HB;function WB(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){qB(LB,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function GB(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&qB(RB,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function KB(){let e=new CustomEvent(IB);document.dispatchEvent(e)}function qB(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var JB=0;function YB(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??XB()),document.body.insertAdjacentElement(`beforeend`,e[1]??XB()),JB++,()=>{JB===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e
vendor: 4,068 bytes, lines 319-322
319=>e.remove()),JB--}},[])}function XB(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.cssText=`outline: none; opacity: 0; position: fixed; pointer-events: none`,e}var ZB=`Portal`,QB=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});QB.displayName=ZB;var $B=Uw(),eV=function(){},tV=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:eV,onWheelCapture:eV,onTouchMoveCapture:eV}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,g=e.as,_=g===void 0?`div`:g,v=e.gapMode,b=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bw([n,t]),C=jw(jw({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:$B,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),jw(jw({},C),{ref:S})):y.createElement(_,jw({},C,{className:c,ref:S}),s))});tV.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},tV.classNames={fullWidth:Fw,zeroRight:Pw};var nV=!1;if(typeof window<`u`)try{var rV=Object.defineProperty({},"passive",{get:function(){return nV=!0,!0}});window.addEventListener(`test`,rV,rV),window.removeEventListener(`test`,rV,rV)}catch{nV=!1}var iV=nV?{passive:!1}:!1,aV=function(e){return e.tagName===`TEXTAREA`},oV=function(e,t){var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!aV(e)&&n[t]===`visible`)},sV=function(e){return oV(e,`overflowY`)},cV=function(e){return oV(e,`overflowX`)},lV=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),fV(e,r)){var i=pV(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uV=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},dV=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},fV=function(e,t){return e===`v`?sV(t):cV(t)},pV=function(e,t){return e===`v`?uV(t):dV(t)},mV=function(e,t){return e===`h`&&t===`rtl`?-1:1},hV=function(e,t,n,r,i){var a=mV(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=pV(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&fV(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},gV=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_V=function(e){return[e.deltaX,e.deltaY]},vV=function(e){return e&&`current`in e?e.current:e},yV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bV=function(e){return` 320 .block-interactivity-${e} {pointer-events: none;} 321 .allow-interactivity-${e} {pointer-events: all;} 322`},xV=0,SV=[];function CV(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(xV++)[0],a=y.useState(nT)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(vV),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=gV(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=lV(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=lV(d,u)),!f)return!1;
322if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return hV(p,t,e,p===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!SV.length||SV[SV.length-1]!==a)){var r=`deltaY`in n?_V(n):gV(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&yV(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(vV).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:wV(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=gV(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,_V(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,gV(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return SV.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,iV),document.addEventListener(`touchmove`,c,iV),document.addEventListener(`touchstart`,u,iV),function(){SV=SV.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,iV),document.removeEventListener(`touchmove`,c,iV),document.removeEventListener(`touchstart`,u,iV)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:bV(i)}):null,p?y.createElement(dT,{gapMode:e.gapMode}):null)}function wV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var TV=Gw($B,CV),EV=y.forwardRef(function(e,t){return y.createElement(tV,jw({},e,{ref:t,sideCar:TV}))});EV.classNames=tV.classNames;var DV=`Popover`,[OV,Qve]=EC(DV,[YD]),kV=YD(),[AV,jV]=OV(DV),MV=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=kV(t),c=y.useRef(null),[l,u]=y.useState(!1),[d=!1,f]=ow({prop:r,defaultProp:i,onChange:a});return(0,F.jsx)(aO,{...s,children:(0,F.jsx)(AV,{scope:t,contentId:aw(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:o,children:n})})};MV.displayName=DV;var NV=`PopoverAnchor`,PV=y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jV(NV,n),a=kV(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return y.useEffect(()=>(o(),()=>s()),[o,s]),(0,F.jsx)(oO,{...a,...r,ref:t})});PV.displayName=NV;var FV=`PopoverTrigger`,IV=y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jV(FV,n),a=kV(n),o=bl(t,i.triggerRef),s=(0,F.jsx)(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":XV(i.open),...r,ref:o,onClick:K(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(oO,{asChild:!0,...a,children:s})});IV.displayName=FV;var LV=`PopoverPortal`,[RV,zV]=OV(LV,{forceMount:void 0}),BV=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=jV(LV,t);return(0,F.jsx)(RV,{scope:t,forceMount:n,children:(0,F.jsx)(wC,{present:n||a.open,children:(0,F.jsx)(QB,{asChild:!0,container:i,children:r})})})};BV.displayName=LV;var VV=`PopoverContent`,HV=y.forwardRef((e,t)=>{let n=zV(VV,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=jV(VV,e.__scopePopover);return(0,F.jsx)(wC,{present:r||a.open,children:a.modal?(0,F.jsx)(UV,{...i,ref:t}):(0,F.jsx)(WV,{...i,ref:t})})});HV.displayName=VV;var UV=y.forwardRef((e,t)=>{let n=jV(VV,e.__scopePopover),r=y.useRef(null),i=bl(t,r),a=y.useRef(!1);return y.useEffect(()=>{let e=r.current;if(e)return kT(e)},[]),(0,F.jsx)(EV,{as:xl,allowPinchZoom:!0,children:(0,F.jsx)(GV,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),WV=y.forwardRef((e,t)=>
322{let n=jV(VV,e.__scopePopover),r=y.useRef(!1),i=y.useRef(!1);return(0,F.jsx)(GV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),GV=y.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=jV(VV,n),p=kV(n);return YB(),(0,F.jsx)(bw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(VB,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,F.jsx)(sO,{"data-state":XV(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),KV=`PopoverClose`,qV=y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jV(KV,n);return(0,F.jsx)(U.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});qV.displayName=KV;var JV=`PopoverArrow`,YV=y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=kV(n);return(0,F.jsx)(cO,{...i,...r,ref:t})});YV.displayName=JV;function XV(e){return e?`open`:`closed`}var ZV=BV,QV=HV,$V=y.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,F.jsx)(ZV,{children:(0,F.jsx)(QV,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...r})}));$V.displayName=QV.displayName;var eH=$T,tH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(eE,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));tH.displayName=eE.displayName;var nH=jl(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),rH=y.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,F.jsxs)(eH,{children:[(0,F.jsx)(tH,{}),(0,F.jsxs)(tE,{ref:i,className:z(nH({side:e}),t),...r,children:[n,(0,F.jsxs)(iE,{className:`absolute right-4 top-4 roun
322ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,F.jsx)(Q_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));rH.displayName=tE.displayName;var iH=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});iH.displayName=`SheetHeader`;var aH=({className:e,...t})=>(0,F.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});aH.displayName=`SheetFooter`;var oH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(nE,{ref:n,className:z(`text-lg font-semibold text-foreground`,e),...t}));oH.displayName=nE.displayName;var sH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(rE,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));sH.displayName=rE.displayName;var cH=`Tabs`,[lH,$ve]=EC(cH,[$I]),uH=$I(),[dH,fH]=lH(cH),pH=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=OC(s),[d,f]=ow({prop:r,onChange:i,defaultProp:a});return(0,F.jsx)(dH,{scope:n,baseId:aw(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,F.jsx)(U.div,{dir:u,"data-orientation":o,...l,ref:t})})});pH.displayName=cH;var mH=`TabsList`,hH=y.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=fH(mH,n),o=uH(n);return(0,F.jsx)(iL,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,F.jsx)(U.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});hH.displayName=mH;var gH=`TabsTrigger`,_H=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=fH(gH,n),s=uH(n),c=bH(o.baseId,r),l=xH(o.baseId,r),u=r===o.value;return(0,F.jsx)(aL,{asChild:!0,...s,focusable:!i,active:u,children:(0,F.jsx)(U.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:K(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:K(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:K(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});_H.displayName=gH;var vH=`TabsContent`,yH=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=fH(vH,n),c=bH(s.baseId,r),l=xH(s.baseId,r),u=r===s.value,d=y.useRef(u);return y.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,F.jsx)(wC,{present:i||u,children:({present:n})=>(0,F.jsx)(U.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});yH.displayName=vH;function bH(e,t){return`${e}-trigger-${t}`}function xH(e,t){return`${e}-content-${t}`}var SH=pH,CH=hH,wH=_H,TH=yH,EH=SH,DH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(CH,{ref:n,className:z(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));DH.displayName=CH.displayName;var OH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(wH,{ref:n,className:z(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,e),...t}));OH.displayName=wH.displayName;var kH=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(TH,{ref:n,className:z(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));kH.displayName=TH.displayName;var AH=`DismissableLayer`,jH=`dismissableLayer.update`,MH=`dismissableLayer.pointerDownOutside`,NH=`dismissableLayer.focusOutside`,PH,FH=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),IH=y.forwardRef((e,t)=>
vendor: 4,109 bytes, line 322
322{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(FH),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=zH(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=BH(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(PH=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),VH(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=PH)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),VH())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(jH,e),()=>document.removeEventListener(jH,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});IH.displayName=AH;var LH=`DismissableLayerBranch`,RH=y.forwardRef((e,t)=>{let n=y.useContext(FH),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});RH.displayName=LH;function zH(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){HH(MH,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function BH(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&HH(NH,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function VH(){let e=new CustomEvent(jH);document.dispatchEvent(e)}function HH(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var UH=IH,WH=RH,GH=`Portal`,KH=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});KH.displayName=GH;var qH=`ToastProvider`,[JH,YH,XH]=pE(`Toast`),[ZH,eye]=EC(`Toast`,[XH]),[QH,$H]=ZH(qH),eU=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=y.useState(null),[l,u]=y.useState(0),d=y.useRef(!1),f=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qH}\`. Expected non-empty \`string\`.`),(0,F.jsx)(JH.Provider,{scope:t,children:(0,F.jsx)(QH,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:y.useCallback(()=>u(e=>e+1),[]),onToastRemove:y.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};eU.displayName=qH;var tU=`ToastViewport`,nU=[`F8`],rU=`toast.viewportPause`,iU=`toast.viewportResume`,aU=y.forwardRef((e,t)=>
vendor: 8,304 bytes, line 322
322{let{__scopeToast:n,hotkey:r=nU,label:i=`Notifications ({hotkey})`,...a}=e,o=$H(tU,n),s=YH(n),c=y.useRef(null),l=y.useRef(null),u=y.useRef(null),d=y.useRef(null),f=bl(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;y.useEffect(()=>{let e=e=>{r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),y.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(rU);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(iU);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=y.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...MU(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return y.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);NU(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,F.jsxs)(WH,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,F.jsx)(sU,{ref:l,onFocusFromOutsideViewport:()=>{NU(h({tabbingDirection:`forwards`}))}}),(0,F.jsx)(JH.Slot,{scope:n,children:(0,F.jsx)(U.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,F.jsx)(sU,{ref:u,onFocusFromOutsideViewport:()=>{NU(h({tabbingDirection:`backwards`}))}})]})});aU.displayName=tU;var oU=`ToastFocusProxy`,sU=y.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=$H(oU,n);return(0,F.jsx)(dO,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});sU.displayName=oU;var cU=`Toast`,lU=`toast.swipeStart`,uU=`toast.swipeMove`,dU=`toast.swipeCancel`,fU=`toast.swipeEnd`,pU=y.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s=!0,c]=ow({prop:r,defaultProp:i,onChange:a});return(0,F.jsx)(wC,{present:n||s,children:(0,F.jsx)(gU,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:DC(e.onPause),onResume:DC(e.onResume),onSwipeStart:K(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:K(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:K(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:K(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});pU.displayName=cU;var[mU,hU]=ZH(cU,{onClose(){}}),gU=y.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=$H(cU,n),[g,_]=y.useState(null),v=bl(t,e=>_(e)),x=y.useRef(null),S=y.useRef(null),C=i||h.duration,w=y.useRef(0),T=y.useRef(C),E=y.useRef(0),{onToastAdd:D,onToastRemove:O}=h,k=DC(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),A=y.useCallback(e=>{!e||e===1/0||(window.clearTimeout(E.current),w.current=new Date().getTime(),E.current=window.setTimeout(k,e))},[k]);y.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{A(T.current),l?.()},n=()=>{let e=new Date().getTime()-w.current;T.current-=e,window.clearTimeout(E.current),c?.()};return e.addEventListener(rU,n),e.addEventListener(iU,t),()=>{e.removeEventListener(rU,n),e.removeEventListener(iU,t)}}},[h.viewport,C,c,l,A]),y.useEffect(()=>{a&&!h.isClosePausedRef.current&&A(C)},[a,C,h.isClosePausedRef,A]),y.useEffect(()=>(D(),()=>O()),[D,O]);let j=y.useMemo(()=>g?DU(g):null,[g]);return h.viewport?(0,F.jsxs)(F.Fragment,{children:[j&&(0,F.jsx)(_U,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,"aria-atomic":!0,children:j}),(0,F.jsx)(mU,{scope:n,onClose:k,children:b.createPortal((0,F.jsx)(JH.ItemSlot,{scope:n,children:(0,F.jsx)(UH,{asChild:!0,onEscapeKeyDown:K(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||k(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,F.jsx)(U.li,{role:`status`,"aria-live":`off`,"aria-atomic":!0,tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:K(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:K(e.onPointerDown,e=>{e.button===0&&(x.current={x:e.clientX,y:e.clientY})}),onPointerMove:K(e.onPointerMove,e=>{if(!x.current)return;let t=e.clientX-x.current.x,n=e.clientY-x.current.y,r=!!S.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(S.current=l,OU(uU,d,f,{discrete:!1})):kU(l,h.swipeDirection,c)?(S.current=l,OU(lU,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(x.current=null)}),onPointerUp:K(e.onPointerUp,e=>{let t=S.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),S.current=null,x.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};kU(t,h.swipeDirection,h.swipeThreshold)?OU(fU,p,r,{discrete:!0}):OU(dU,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),_U=e=>{let{__scopeToast:t,children:n,...r}=e,i=$H(cU,t),[a,o]=y.useState(!1),[s,c]=y.useState(!1);return AU(()=>o(!0)),y.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,F.jsx)(KH,{asChild:!0,children:(0,F.jsx)(dO,{...r,children:a&&(0,F.jsxs)(F.Fragment,{children:[i.label,` `,n]})})})},vU=`ToastTitle`,yU=y.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,F.jsx)(U.div,{...r,ref:t})});yU.displayName=vU;var bU=`ToastDescription`,xU=y.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,F.jsx)(U.div,{...r,ref:t})});xU.displayName=bU;var SU=`ToastAction`,CU=y.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,F.jsx)(EU,{altText:n,asChild:!0,children:(0,F.jsx)(TU,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${SU}\`. Expected non-empty \`string\`.`),null)});CU.displayName=SU;var wU=`ToastClose`,TU=y.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=hU(wU,n);return(0,F.jsx)(EU,{asChild:!0,children:(0,F.jsx)(U.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,i.onClose)})})});TU.displayName=wU;var EU=y.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,F.jsx)(U.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function DU(e){let t=[];
322return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),jU(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...DU(e))}}),t}function OU(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var kU=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function AU(e=()=>{}){let t=DC(e);CC(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function jU(e){return e.nodeType===e.ELEMENT_NODE}function MU(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NU(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var PU=eU,FU=aU,IU=pU,LU=yU,RU=xU,zU=CU,BU=TU,VU=PU,HU=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(FU,{ref:n,className:z(`fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));HU.displayName=FU.displayName;var UU=jl(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),WU=y.forwardRef(({className:e,variant:t,...n},r)=>(0,F.jsx)(IU,{ref:r,className:z(UU({variant:t}),e),...n}));WU.displayName=IU.displayName;var GU=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(zU,{ref:n,className:z(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive`,e),...t}));GU.displayName=zU.displayName;var KU=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(BU,{ref:n,className:z(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,F.jsx)(Q_,{className:`h-4 w-4`})}));KU.displayName=BU.displayName;var qU=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(LU,{ref:n,className:z(`text-sm font-semibold`,e),...t}));qU.displayName=LU.displayName;var JU=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(RU,{ref:n,className:z(`text-sm opacity-90`,e),...t}));JU.displayName=RU.displayName;function YU(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=y.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>y.createContext(e));return function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,XU(i,...t)]}function XU(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function ZU(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var QU=e=>{let{present:t,children:n}=e,r=$U(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=bl(r.ref,tW(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null};QU.displayName=`Presence`;function $U(e){let[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef(`none`),[o,s]=ZU(e?`mounted`:`unmounted`,{mou
322nted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{let e=eW(r.current);a.current=o===`mounted`?e:`none`},[o]),CC(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=eW(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),CC(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=eW(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=eW(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:y.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function eW(e){return e?.animationName||`none`}function tW(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var[nW,tye]=YU(`Tooltip`,[YD]),rW=YD(),iW=`TooltipProvider`,aW=700,oW=`tooltip.open`,[sW,cW]=nW(iW),lW=e=>{let{__scopeTooltip:t,delayDuration:n=aW,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[o,s]=y.useState(!0),c=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(sW,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(l.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:y.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:a})};lW.displayName=iW;var uW=`Tooltip`,[dW,fW]=nW(uW),pW=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=cW(uW,e.__scopeTooltip),l=rW(t),[u,d]=y.useState(null),f=aw(),p=y.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=y.useRef(!1),[_=!1,v]=ow({prop:r,defaultProp:i,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(oW))):c.onClose(),a?.(e)}}),b=y.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=y.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),S=y.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return y.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,F.jsx)(aO,{...l,children:(0,F.jsx)(dW,{scope:t,contentId:f,open:_,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayed?C():x()},[c.isOpenDelayed,C,x]),onTriggerLeave:y.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};pW.displayName=uW;var mW=`TooltipTrigger`,hW=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=fW(mW,n),a=cW(mW,n),o=rW(n),s=bl(t,y.useRef(null),i.onTriggerChange),c=y.useRef(!1),l=y.useRef(!1),u=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,F.jsx)(oO,{asChild:!0,...o,children:(0,F.jsx)(U.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:K(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:K(e.onPointerDown,()=>{c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:K(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:K(e.onBlur,i.onClose),onClick:K(e.onClick,i.onClose)})})});hW.displayName=mW;var gW=`TooltipPortal`,[_W,vW]=nW(gW,{forceMount:void 0}),yW=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=fW(gW,t);return(0,F.jsx)(_W,{scope:t,forceMount:n,children:(0,F.jsx)(QU,{present:n||a.open,children:(0,F.jsx)(Ew,{asChild:!0,container:i,children:r})})})};yW.displayName=gW;var bW=`TooltipContent`,xW=y.forwardRef((e,t)=>
vendor: 4,186 bytes, line 322
322{let n=vW(bW,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=fW(bW,e.__scopeTooltip);return(0,F.jsx)(QU,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(TW,{side:i,...a,ref:t}):(0,F.jsx)(SW,{side:i,...a,ref:t})})}),SW=y.forwardRef((e,t)=>{let n=fW(bW,e.__scopeTooltip),r=cW(bW,e.__scopeTooltip),i=y.useRef(null),a=bl(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=kW(r,OW(r,n.getBoundingClientRect())),a=AW(t.getBoundingClientRect()),o=MW([...i,...a]);s(o),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!jW(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,F.jsx)(TW,{...e,ref:a})}),[CW,wW]=nW(uW,{isInside:!1}),TW=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=fW(bW,n),l=rW(n),{onClose:u}=c;return y.useEffect(()=>(document.addEventListener(oW,u),()=>document.removeEventListener(oW,u)),[u]),y.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,F.jsx)(pw,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,F.jsxs)(sO,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(Cl,{children:r}),(0,F.jsx)(CW,{scope:n,isInside:!0,children:(0,F.jsx)(_fe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});xW.displayName=bW;var EW=`TooltipArrow`,DW=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=rW(n);return wW(EW,n).isInside?null:(0,F.jsx)(cO,{...i,...r,ref:t})});DW.displayName=EW;function OW(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function kW(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function AW(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jW(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function MW(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),NW(t)}function NW(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var PW=lW,FW=pW,IW=hW,LW=xW,RW=PW,zW=FW,BW=IW,VW=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
322(0,F.jsx)(LW,{ref:r,sideOffset:t,className:z(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n}));VW.displayName=LW.displayName;var HW=`Radio`,[UW,WW]=EC(HW),[GW,KW]=UW(HW),qW=y.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,...l}=e,[u,d]=y.useState(null),f=bl(t,e=>d(e)),p=y.useRef(!1),m=!u||!!u.closest(`form`);return(0,F.jsxs)(GW,{scope:n,checked:i,disabled:o,children:[(0,F.jsx)(U.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":ZW(i),"data-disabled":o?``:void 0,disabled:o,value:s,...l,ref:f,onClick:K(e.onClick,e=>{i||c?.(),m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})}),m&&(0,F.jsx)(XW,{control:u,bubbles:!p.current,name:r,value:s,checked:i,required:a,disabled:o,style:{transform:`translateX(-100%)`}})]})});qW.displayName=HW;var JW=`RadioIndicator`,YW=y.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=KW(JW,n);return(0,F.jsx)(wC,{present:r||a.checked,children:(0,F.jsx)(U.span,{"data-state":ZW(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});YW.displayName=JW;var XW=e=>{let{control:t,checked:n,bubbles:r=!0,...i}=e,a=y.useRef(null),o=uO(n),s=KD(t);return y.useEffect(()=>{let e=a.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(o!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[o,n,r]),(0,F.jsx)(`input`,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:a,style:{...e.style,...s,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})};function ZW(e){return e?`checked`:`unchecked`}var QW=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],$W=`RadioGroup`,[eG,nye]=EC($W,[$I,WW]),tG=$I(),nG=WW(),[rG,iG]=eG($W),aG=y.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=tG(n),m=OC(l),[h,g]=ow({prop:a,defaultProp:i,onChange:d});return(0,F.jsx)(rG,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,F.jsx)(iL,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,F.jsx)(U.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});aG.displayName=$W;var oG=`RadioGroupItem`,sG=y.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=iG(oG,n),o=a.disabled||r,s=tG(n),c=nG(n),l=y.useRef(null),u=bl(t,l),d=a.value===i.value,f=y.useRef(!1);return y.useEffect(()=>{let e=e=>{QW.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,F.jsx)(aL,{asChild:!0,...s,focusable:!o,active:d,children:(0,F.jsx)(qW,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:K(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:K(i.onFocus,()=>{f.current&&l.current?.click()})})})});sG.displayName=oG;var cG=`RadioGroupIndicator`,lG=y.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,F.jsx)(YW,{...nG(n),...r,ref:t})});lG.displayName=cG;var uG=aG,dG=sG,rye=lG,fG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(uG,{className:z(`grid gap-2`,e),...t,ref:n}));fG.displayName=uG.displayName;var pG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(dG,{ref:n,className:z(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,F.jsx)(rye,{className:`flex items-center justify-center`,children:(0,F.jsx)(w_,{className:`h-2.5 w-2.5 fill-current text-current`})})}));pG.displayName=dG.displayName;var iye=y.forwardRef(({className:e,size:t=`md`,color:n=`primary`,...r},i)=>(0,F.jsx)(`div`,{className:z(`inline-block animate-spin rounded-full border-solid border-current border-t-transparent`,{sm:`h-4 w-4 border-2`,md:`h-6 w-6 border-2`,lg:`h-8 w-8 border-3`}[t],{primary:`text-primary`,secondary:`text-secondary`,accent:`text-accent`,white:`text-white`}[n],e),ref:i,role:`status`,"aria-label":`loading`,...r}));iye.displayName=`Spinner`;var mG=({className:e})=>{let{user:t,profile:n,signOut:r}=_l(),i=We(),a=()=>
322{if(!n)return`Individual Plan`;switch(n.user_type){case`job_seeker`:return`Job Seeker`;case`organization`:return`Organization`;case`career_tech`:return`Career Tech`;case`admin`:return`Admin`;default:return`Individual Plan`}},o=()=>{if(!n?.full_name)return`U`;let e=n.full_name.split(` `);return e.length>=2?`${e[0][0]}${e[1][0]}`.toUpperCase():e[0][0].toUpperCase()},s=()=>!n||n.tokens_limit===null||n.tokens_used===null?0:Math.min(Math.round(n.tokens_used/n.tokens_limit*100),100);return t?(0,F.jsx)(`div`,{className:e,children:(0,F.jsxs)(HR,{children:[(0,F.jsx)(UR,{asChild:!0,children:(0,F.jsxs)(B,{variant:`ghost`,className:`flex items-center gap-2 px-3 h-10`,children:[(0,F.jsx)(JF,{className:`w-8 h-8`,children:n?.avatar_url?(0,F.jsx)(YF,{src:n.avatar_url,alt:n?.full_name||`User`}):(0,F.jsx)(XF,{className:`bg-akito-teal text-white`,children:o()})}),(0,F.jsxs)(`div`,{className:`hidden md:block text-left`,children:[(0,F.jsx)(`div`,{className:`font-medium text-sm`,children:n?.full_name||t.email}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:a()})]})]})}),(0,F.jsxs)(KR,{align:`end`,className:`w-64`,children:[(0,F.jsxs)(`div`,{className:`p-2 text-center border-b`,children:[(0,F.jsx)(`div`,{className:`font-medium`,children:n?.full_name||t.email}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:t.email}),(0,F.jsx)(mM,{className:`mt-2 bg-akito-gradient`,children:a()})]}),n?.tokens_used!==null&&n?.tokens_limit!==null&&(0,F.jsxs)(`div`,{className:`p-2 border-b`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium mb-1`,children:`Token Usage`}),(0,F.jsx)(MN,{value:s(),className:`h-2`,indicatorClassName:(()=>{let e=s();return e>=90?`bg-red-500`:e>=75?`bg-amber-500`:`bg-green-500`})()}),(0,F.jsxs)(`div`,{className:`flex justify-between mt-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:!n||n.tokens_limit===null||n.tokens_used===null?`0/0 tokens`:`${n.tokens_used.toLocaleString()}/${n.tokens_limit.toLocaleString()} tokens`}),(0,F.jsxs)(`span`,{className:`text-xs font-medium`,children:[s(),`%`]})]})]}),(0,F.jsx)(XR,{children:`Account`}),(0,F.jsxs)(qR,{onClick:()=>i(`/settings/profile`),children:[(0,F.jsx)(X_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Profile`})]}),(0,F.jsxs)(qR,{onClick:()=>i(`/settings/account`),children:[(0,F.jsx)(W_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Account settings`})]}),(0,F.jsxs)(qR,{onClick:()=>i(`/subscription`),children:[(0,F.jsx)(ore,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Subscription`})]}),(0,F.jsxs)(qR,{onClick:()=>i(`/terms/conditions`),children:[(0,F.jsx)(G_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Terms & Conditions`})]}),(0,F.jsx)(ZR,{}),(0,F.jsx)(XR,{children:`Support`}),(0,F.jsxs)(qR,{onClick:()=>i(`/help-center`),children:[(0,F.jsx)(x_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Help Center`})]}),(0,F.jsxs)(qR,{onClick:()=>i(`/help-center/feedback`),children:[(0,F.jsx)(M_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Feedback`})]}),(0,F.jsxs)(qR,{onClick:()=>i(`/privacy-policy`),children:[(0,F.jsx)(G_,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Privacy`})]}),(0,F.jsx)(ZR,{}),(0,F.jsxs)(qR,{className:`text-red-500`,onClick:()=>r(),children:[(0,F.jsx)(pre,{size:16,className:`mr-2`}),(0,F.jsx)(`span`,{children:`Log Out`})]})]})]})}):null},hG=({profile:e,renderViewModeButtons:t,userProfileTutorial:n})=>{let r=We();return(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[t(),(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>r(e?.user_type?ev(e.user_type):`/job-seeker/jobs`),className:`flex items-center gap-2`,children:[(0,F.jsx)(W_,{className:`w-4 h-4`}),`Dashboard`]}),(0,F.jsx)(eb,{orientation:`vertical`,className:`h-6`}),(0,F.jsx)(mG,{"data-tutorial":n})]})},gG=[`split`,`chat`,`canvas`],aye=()=>{let[e,t]=Bt(),n=e.get(`view`),[r,i]=(0,y.useState)(n&&gG.includes(n)?n:`split`),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(!1),{user:h,profile:g}=_l(),_=We(),v=Gk(e=>e.canvas.hasCanvasContent),b=e.get(`id`),x=e.get(`artifact`),S=!!(b||x);(0,y.useEffect)(()=>{let t=e.get(`view`);t&&gG.includes(t)&&i(t)},[e]);let C=n=>{i(n);let r=new URLSearchParams(e);r.set(`view`,n),t(r,{replace:!0})};(0,y.useEffect)(()=>{Mk();let e=new MutationObserver(()=>{Mk()}),t=document.getElementById(`canvas-container`);return t&&e.observe(t,{childList:!0,subtree:!0,attributes:!0}),()=>e.disconnect()},[]);let w=()=>{document.fullscreenElement?(document.exitFullscreen(),o(!1)):(document.documentElement.requestFullscreen(),o(!0))};(0,y.useEffect)(()=>{let e=()=>{o(!!document.fullscreenElement)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,y.useEffect)(()=>
322{if(v){c(!0);let e=setTimeout(()=>c(!1),12e3);return()=>clearTimeout(e)}else c(!1)},[v]),(0,y.useEffect)(()=>{let e=()=>{u(!0),setTimeout(()=>{f(!0)},500)};return window.addEventListener(`evaluationResultsAvailable`,e),()=>window.removeEventListener(`evaluationResultsAvailable`,e)},[]),(0,y.useEffect)(()=>{let e=()=>{c(!1),f(!1),m(!0)},t=()=>{m(!1)};return window.addEventListener(`assessmentSubmitting`,e),window.addEventListener(`assessmentSubmitComplete`,t),()=>{window.removeEventListener(`assessmentSubmitting`,e),window.removeEventListener(`assessmentSubmitComplete`,t)}},[]);let T=()=>{let t=new URLSearchParams,n=e.get(`view`);n&&t.set(`view`,n);let r=t.toString();_(r?`/?${r}`:`/`,{replace:!0})},E=()=>(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[(0,F.jsxs)(B,{variant:r===`split`?`default`:`outline`,size:`sm`,onClick:()=>C(`split`),className:`flex items-center gap-2`,children:[(0,F.jsx)(_re,{className:`w-4 h-4`}),`Split`]}),(0,F.jsxs)(B,{variant:r===`chat`?`default`:`outline`,size:`sm`,onClick:()=>C(`chat`),className:`flex items-center gap-2`,children:[(0,F.jsx)(hre,{className:`w-4 h-4`}),`Chat`]}),(0,F.jsxs)(B,{variant:r===`canvas`?`default`:`outline`,size:`sm`,onClick:()=>C(`canvas`),className:`flex items-center gap-2`,children:[(0,F.jsx)(k_,{className:`w-4 h-4`}),`Canvas`]}),(0,F.jsx)(eb,{orientation:`vertical`,className:`h-6`}),(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:w,className:`flex items-center gap-2`,children:[a?(0,F.jsx)(gre,{className:`w-4 h-4`}):(0,F.jsx)(mre,{className:`w-4 h-4`}),a?`Exit`:`Full`]})]}),D=()=>{let e=document.getElementById(`canvas-container`),t=e?.querySelector(`form`)!==null||e?.innerHTML.includes(`assessment-form`)||e?.innerHTML.includes(`question-`),n=e?.querySelector(`[data-chart-present="true"]`)!==null,r=v&&t&&!n;return(0,F.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b bg-white`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(k_,{className:`w-5 h-5 text-gray-600`}),(0,F.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Canvas`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>{f(!1),window.dispatchEvent(new Event(`openResultsDialog`))},onMouseEnter:()=>f(!1),title:`View evaluation results`,disabled:p,className:`relative flex items-center gap-2 transition ${d?`animate-bounce ring-2 ring-blue-400/40`:``}`,children:[d&&(0,F.jsxs)(`span`,{className:`absolute -top-1 -right-1 flex h-3 w-3`,children:[(0,F.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75`}),(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-3 w-3 bg-blue-500`})]}),(0,F.jsx)(cre,{className:`w-4 h-4`}),`View Results`]}),g?.user_type!==`job_seeker`&&r&&(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>{c(!1),window.dispatchEvent(new Event(`openPublishDialog`))},onMouseEnter:()=>c(!1),title:`Publish your assessment to share a link`,disabled:p,className:`relative flex items-center gap-2 transition ${s?`animate-bounce ring-2 ring-akito-teal/40`:``}`,children:[s&&(0,F.jsxs)(`span`,{className:`absolute -top-1 -right-1 flex h-3 w-3`,children:[(0,F.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-teal-400 opacity-75`}),(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-3 w-3 bg-teal-500`})]}),(0,F.jsx)(xre,{className:`w-4 h-4`}),`Publish`]})]})]}),(0,F.jsx)(rw,{className:`flex-1 p-4`,id:`canvas-container-scroll`,children:(0,F.jsx)(`div`,{id:`canvas-container`,className:`min-h-full bg-white rounded-lg border p-6`,"data-tutorial":`canvas-container`,children:(0,F.jsxs)(`div`,{className:`text-center text-gray-500 py-12`,children:[(0,F.jsx)(k_,{className:`w-12 h-12 mx-auto mb-4 text-gray-300`}),(0,F.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:`Canvas Preview`}),(0,F.jsx)(`p`,{children:`Interactive content will appear here when generated.`}),(0,F.jsx)(`p`,{className:`text-sm mt-2`,children:`Start a conversation and ask to create interactive content like assessments, forms, or visualizations.`})]})})})]})};return h?S?(0,F.jsxs)(`div`,{className:`h-screen bg-gray-50 overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`bg-white border-b px-4 py-3 flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:T,className:`flex items-center gap-2 text-gray-600 hover:text-gray-800`,children:[(0,F.jsx)(u_,{className:`w-4 h-4`}),`Back to Home`]}),(0,F.jsx)(eb,{orientation:`vertical`,className:`h-6`}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold text-gray-800`,children:`Akito`}),(0,F.jsx)(`div`,{className:`text-sm text-gray-500`,children:b?`Chat Session`:x?`Artifact View`:``})]}),(0,F.jsx)(`div`,{className:`flex items-center gap-4`,children:(0,F.jsx)(hG,{profile:g,renderViewModeButtons:E,userProfileTutorial:`user-profile`})})]}),(0,F.jsx)(`div`,{className:`flex-1 h-[calc(100vh-60px)]`,children:r===`split`?(0,F.jsxs)(Jy,{direction:`horizontal`,className:`h-full`,children:[(0,F.jsx)(Yy,{defaultSize:50,minSize:30,children:(0,F.jsx)(fM,{className:`h-full border-r`,viewMode:r})}),(0,F.jsx)(Xy,{}),(0,F.jsx)(Yy,{defaultSize:50,minSize:30,children:D()})]}):r===`chat`?(0,F.jsx)(fM,{className:`h-full`,viewMode:r}):D()})]}):(0,F.jsxs)(`div`,{className:`h-screen bg-gray-50 overflow-hidden flex w-full`,children:[(0,F.jsx)(NN,{}),(0,F.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,F.jsxs)(`div`,{className:`bg-white border-b px-4 py-3 flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold text-gray-800`,children:`Akito`}),(0,F.jsxs)(`div`,{className:`text-sm text-gray-500`,children:[`Welcome back, `,g?.full_name]})]}),(0,F.jsx)(`div`,{className:`flex items-center gap-4`,children:(0,F.jsx)(hG,{profile:g,renderViewModeButtons:E,userProfileTutorial:`user-profile`})})]}),(0,F.jsx)(`div`,{className:`flex-1 h-[calc(100vh-60px)]`,children:r===`split`?(0,F.jsxs)(Jy,{direction:`horizontal`,className:`h-full`,children:[(0,F.jsx)(Yy,{defaultSize:50,minSize:30,children:(0,F.jsx)(fM,{className:`h-full border-r`,viewMode:r})}),(0,F.jsx)(Xy,{}),(0,F.jsx)(Yy,{defaultSize:50,minSize:30,children:D()})]}):r===`chat`?(0,F.jsx)(fM,{className:`h-full`,viewMode:r}):D()})]})]}):(0,F.jsx)(`div`,{className:`min-h-screen bg-gradient-to-br from-purple-50 to-blue-50 flex items-center justify-center p-4`,children:(0,F.jsxs)(V,{className:`max-w-md w-full p-8 text-center`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold mb-4 text-gray-800`,children:`Welcome to Akito`}),(0,F.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`Please sign in to access your AI assistant and start creating interactive content.`}),(0,F.jsx)(B,{onClick:()=>window.location.href=`/auth`,className:`w-full bg-akito-gradient text-white`,children:`Sign In`})]})})},oye=()=>{let e=He();return(0,y.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,F.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-100`,children:(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(`h1`,{className:`text-4xl font-bold mb-4`,children:`404`}),(0,F.jsx)(`p`,{className:`text-xl text-gray-600 mb-4`,children:`Oops! Page not found`}),(0,F.jsx)(`a`,{href:`/`,className:`text-blue-500 hover:text-blue-700 underline`,children:`Return to Home`})]})})},sye=({isOpen:e,onClose:t})=>{let n=We();return(0,F.jsx)(aE,{open:e,onOpenChange:e=>{e||t()},children:(0,F.jsxs)(cE,{className:`sm:max-w-md`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Complete Your Profile`}),(0,F.jsx)(fE,{children:`Please complete your profile to access all features of the platform.`})]}),(0,F.jsx)(`div`,{className:`p-4 bg-amber-50 rounded-md text-amber-800 text-sm`,children:(0,F.jsx)(`p`,{children:`Your profile is incomplete. Adding more information will help us personalize your experience.`})}),(0,F.jsxs)(uE,{className:`flex flex-col space-y-2 sm:space-y-0 sm:flex-row sm:justify-between`,children:[(0,F.jsxs)(B,{variant:`outline`,onClick:()=>{n(`/terms/early-access`),t()},className:`w-full sm:w-auto flex items-center gap-2`,children:[(0,F.jsx)(y_,{className:`h-4 w-4`}),`About Early Access`]}),(0,F.jsxs)(B,{onClick:()=>{n(`/settings/profile`),t()},className:`w-full sm:w-auto bg-akito-teal hover:bg-akito-teal-deep`,children:[`Complete Profile `,(0,F.jsx)(Yne,{className:`ml-2 h-4 w-4`})]})]})]})})},_G=e=>!!e?.some(e=>e.trim().length>0);function vG(e){if(!e||(e.full_name?.trim().length??0)<2||!e.about?.trim()||!e.location?.trim())return!1;switch(e.user_type){case`job_seeker`:return!!(_G(e.skills)&&_G(e.education)&&_G(e.experience)&&e.career_goals?.trim());case`career_tech`:return!!((e.company_name?.trim().length??0)>=2&&_G(e.services));case`organization`:case`admin`:return!0;default:return!1}}function cye(e){return e?.organization_id?!!((e.organization_name?.trim().length??0)>
322=2&&e.organization_industry?.trim()&&e.organization_company_size?.trim()&&_G(e.organization_services)):!1}var yG=({children:e})=>{let{user:t,profile:n,loading:r}=_l(),i=He(),[a,o]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!r&&t&&n){let e=`profile_modal_shown_${t.id}`,r=!vG(n),a=i.pathname.startsWith(`/settings`),s=sessionStorage.getItem(e)===`true`;r?a?o(!1):!a&&!s&&(o(!0),sessionStorage.setItem(e,`true`)):o(!1)}},[t,n,r,i.pathname]),r?(0,F.jsx)(tv,{}):t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(sye,{isOpen:a,onClose:()=>o(!1)}),e]}):(0,F.jsx)(mt,{to:`/auth`,state:{from:i},replace:!0})};function lye(){let{toasts:e}=pl();return(0,F.jsxs)(VU,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,F.jsxs)(WU,{...i,children:[(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,F.jsx)(qU,{children:t}),n&&(0,F.jsx)(JU,{children:n})]}),r,(0,F.jsx)(KU,{})]},e)}),(0,F.jsx)(HU,{})]})}async function bG(e){if(!e)return{closed:!1};try{let{data:t,error:n}=await R.rpc(`check_assessments_closed_for_link`,{p_link_id:e});if(n)return console.error(`Error checking assessments_closed:`,n),{closed:!0,error:n.message};let r=t;return r?{closed:r.closed,error:r.error}:{closed:!0,error:`Unexpected response from server`}}catch(e){return console.error(`Unexpected error checking assessments_closed:`,e),{closed:!0,error:`Unexpected error`}}}var uye=` 323 html { color-scheme: light; } 324 body { 325 margin: 0; 326 padding: 1rem 1.25rem; 327 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; 328 font-size: 16px; 329 line-height: 1.6; 330 color: hsl(222.2 84% 4.9%); 331 background: #fff; 332 -webkit-font-smoothing: antialiased; 333 } 334 h1, h2, h3 { font-weight: 600; color: hsl(222.2 84% 4.9%); } 335 h1 { font-size: 1.75rem; margin: 0 0 0.75rem; } 336 h2 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid hsl(214.3 31.8% 91.4%); } 337 h3 { font-size: 1.05rem; margin: 1rem 0 0.5rem; } 338 input, textarea, select, button { font: inherit; } 339 input[type="text"], textarea { 340 width: 100%; 341 max-width: 100%; 342 box-sizing: border-box; 343 border: 1px solid hsl(214.3 31.8% 91.4%); 344 border-radius: 0.5rem; 345 padding: 0.5rem 0.75rem; 346 background: hsl(210 40% 98%); 347 color: hsl(222.2 84% 4.9%); 348 } 349 textarea { 350 min-height: 5rem; 351 resize: none; 352 pointer-events: none; 353 } 354 input[type="radio"], input[type="checkbox"] { 355 accent-color: hsl(169 30% 26%); 356 } 357 .model-answer { display: none !important; } 358 .submit-section, 359 button[type="submit"], 360 input[type="submit"], 361 [data-action="submit-assessment"], 362 [data-action="complete-assessment"], 363 button[data-assessment-button="true"] { 364 display: none !important; 365 } 366`;function dye(e){let t=`<style>${uye}</style>`,n=e.trim();return n&&(/<\/head>/i.test(n)?n.replace(/<\/head>/i,`${t}</head>`):/<head[^>]*>/i.test(n)?n.replace(/<head[^>]*>/i,e=>`${e}${t}`):/^<!DOCTYPE/i.test(n)||/<html[\s>]/i.test(n)?n.replace(/<html([^>]*)>/i,`<html$1><head><meta charset="utf-8"/>${t}</head>`):`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/>${t}</head><body>${n}</body></html>`)}var fye=()=>{let{linkCode:e}=Ye(),{user:t,profile:n,loading:r}=_l(),i=We(),a=He(),{toast:o}=pl(),[s,c]=(0,y.useState)(!0),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)(null),[O,k]=(0,y.useState)(null);(0,y.useEffect)(()=>{!r&&!t&&(sessionStorage.setItem(`redirectAfterLogin`,a.pathname),i(`/auth`,{replace:!0}))},[r,t,a.pathname,i]),(0,y.useEffect)(()=>{(async()=>{if(!(!e||!t||r))try{c(!0);let r=!1;if(t?.id){let n=await R.from(`assessment_submissions`).select(`submission_snapshot, created_at`).eq(`link_code`,e).eq(`user_id`,t.id).limit(1),i=n.data;!n.error&&i&&i.length>0&&(r=!0,T(!0),D(i[0]))}let{data:i,error:a}=await R.from(`assessment_links`).select(`id, artifact_id, assessment_id, title, is_active, expires_at, job_listings(organization_id, status, organizations(name))`).eq(`link_code`,e).single();if(a||!i){console.error(`Link error:`,a),a?.code===`PGRST116`?g(`This assessment link does not exist or has been removed. Please contact the organization for a valid link.`):g(`This assessment link is invali
366d or has been removed.`),c(!1);return}f(i.title||null),k(i.id||null);let o=i.job_listings?.organizations?.name??null;if(!o&&i.id){let{data:e}=await R.from(`riipen_matches`).select(`riipen_projects(riipen_organizations(organizations(name)))`).eq(`assessment_link_id`,i.id).maybeSingle();o=(e?.riipen_projects)?.riipen_organizations?.organizations?.name??null}if(m(o),r){c(!1);return}await R.rpc(`increment_link_clicks`,{link_code:e});let s=i.job_listings?.status;if(s===`closed`||s===`draft`){g(`This position is no longer accepting applications. The job has been closed.`),c(!1);return}if(!i.is_active){g(`This assessment link has been deactivated.`),c(!1);return}let l=new Date,d=new Date(i.expires_at||``);if(i.expires_at&&l>d){g(`This assessment link has expired.`),c(!1);return}if(n?.user_type!==`admin`&&(await bG(i.id)).closed){g(`This experience is no longer accepting assessment submissions.`),c(!1);return}let p=``;if(i.assessment_id){let{data:e,error:t}=await R.from(`assessments`).select(`content`).eq(`id`,i.assessment_id).maybeSingle();if(!t&&e&&e.content!==void 0){let t=e.content,n=``;try{if(typeof t==`string`){let e=JSON.parse(t);n=typeof e?.html==`string`?e.html:t}else typeof t==`object`&&t&&(n=typeof t.html==`string`?t.html:JSON.stringify(t))}catch{n=typeof t==`string`?t:JSON.stringify(t)}p=A(n)}}if(!p){if(!i.artifact_id){g(`The assessment content could not be loaded (missing artifact).`),c(!1);return}let{data:e,error:t}=await R.from(`saved_sessions`).select(`content`).eq(`id`,i.artifact_id).maybeSingle();if(t||!e){console.error(`Artifact error:`,t),g(`The assessment content could not be loaded.`),c(!1);return}let n=typeof e.content==`string`?e.content:JSON.stringify(e.content);p=A(n)}u(p)}catch(e){console.error(`Error loading assessment:`,e),g(`An error occurred while loading the assessment.`)}finally{c(!1)}})()},[e,i,t?.id,w,r,n?.user_type]);let A=e=>e?e.replace(/```html\s*/g,``).replace(/```\s*$/g,``).replace(/```javascript\s*/g,``).replace(/```css\s*/g,``).replace(/```jsx\s*/g,``).replace(/```tsx\s*/g,``).replace(/```\s*/g,``):``;(0,y.useEffect)(()=>{if(!l)return;window.submitAssessment=ee;let e=window.setTimeout(()=>{let e=document.getElementById(`assessment-content`);e&&(e.classList.add(`assessment-content`),e.setAttribute(`data-assessment-isolated`,`true`),e.querySelectorAll(`form`).forEach(e=>{e.addEventListener(`submit`,te)}),e.querySelectorAll(`[data-action="submit-assessment"], [data-action="complete-assessment"], [type="submit"]`).forEach(e=>{e.addEventListener(`click`,j),e.setAttribute(`data-assessment-button`,`true`)}),e.querySelectorAll(`[onclick]`).forEach(e=>{let t=e.getAttribute(`onclick`);if(t&&((t.includes(`showAssessment`)||t.includes(`undefined`))&&(e.removeAttribute(`onclick`),e.addEventListener(`click`,j)),t.includes(`showAssessment`))){let n=t.replace(/showAssessment/g,`submitAssessment`);e.setAttribute(`onclick`,n)}}),document.querySelectorAll(`#canvas-container button`).forEach(e=>{e.hasAttribute(`data-action`)||e.addEventListener(`click`,j)}))},100);return()=>{window.clearTimeout(e),window.submitAssessment=void 0}},[l]),(0,y.useEffect)(()=>{let e=document.getElementById(`assessment-content`);e&&e.querySelectorAll(`[data-action="submit-assessment"], [data-action="complete-assessment"], [type="submit"], button[data-assessment-button="true"]`).forEach(e=>{if(_){e.disabled=!0,e.style.opacity=`0.5`,e.style.cursor=`not-allowed`;let t=e.textContent||e.value||``;t&&!e.hasAttribute(`data-original-text`)&&(e.setAttribute(`data-original-text`,t),e.tagName===`INPUT`?e.value=`Submitting...`:e.textContent=`Submitting...`)}else{e.disabled=!1,e.style.opacity=`1`,e.style.cursor=`pointer`;let t=e.getAttribute(`data-original-text`);t&&(e.tagName===`INPUT`?e.value=t:e.textContent=t,e.removeAttribute(`data-original-text`))}})},[_]);let j=e=>{if(_){e.preventDefault();return}let t=e.currentTarget.closest(`form`);t?(e.preventDefault(),N(t)):(e.preventDefault(),ee())},M=e=>{let t={};return e.querySelectorAll(`input, select, textarea`).forEach((e,n)=>{let r=e.name||e.id||`question_${n+1}`;if(r){if(e instanceof HTMLInputElement){let n=(e.type||``).toLowerCase();if(n===`radio`)e.checked&&(t[r]=e.value);else if(n===`checkbox`){if(e.checked){let n=t[r];Array.isArray(n)?n.push(e.value):typeof n==`string`?t[r]=[n,e.value]:t[r]=[e.value]}}else n!==`file`&&(t[r]=e.value)}else if(e instanceof HTMLTextAreaElement)t[r]=e.value;else if(e instanceof HTMLSelectElement)if(e.multiple){let n=Array.from(e.selectedOptions).map(e=>e.value);n.length&&(t[r]=n)}else t[r]=e.value}}),t},N=e=>{if(_||!ae())return;let t=M(e);C(t),x(!0)},ee=()=>{if(_||!ae())return;let e=document.getElementById(`assessment-content`);if(!e)return;let t={};e.querySelectorAll(`input, select, textarea`).forEach((e,n)=>
366{let r=e.name||e.id||`question_${n+1}`;if(r){if(e instanceof HTMLInputElement){let n=(e.type||``).toLowerCase();if(n===`radio`)e.checked&&(t[r]=e.value);else if(n===`checkbox`){if(e.checked){let n=t[r];Array.isArray(n)?n.push(e.value):typeof n==`string`?t[r]=[n,e.value]:t[r]=[e.value]}}else n!==`file`&&(t[r]=e.value)}else if(e instanceof HTMLTextAreaElement)t[r]=e.value;else if(e instanceof HTMLSelectElement)if(e.multiple){let n=Array.from(e.selectedOptions).map(e=>e.value);n.length&&(t[r]=n)}else t[r]=e.value}}),C(t),x(!0)},te=async t=>{if(typeof t?.preventDefault==`function`&&t.preventDefault(),!(!e||_))try{if(!ae())return;let e=t.target,n=M(e);C(n),x(!0)}catch(e){console.error(`Error handling form submit:`,e),o({title:`Error`,description:`There was a problem submitting your assessment. Please try again.`,variant:`destructive`})}},ne=async n=>{if(!(!e||_))try{if(v(!0),(await bG(O)).closed){o({title:`Submissions Closed`,description:`This experience is no longer accepting assessment submissions.`,variant:`destructive`}),v(!1);return}console.log(`Assessment submission:`,n);let r=null,a=100,s=``,c=[],u=``;try{let e=d||`Assessment`,t=document.getElementById(`assessment-content`),r=document.createElement(`div`);t?r.appendChild(t.cloneNode(!0)):r.innerHTML=l??``;try{r.querySelectorAll(`input`).forEach(e=>{let t=e,r=t.name||t.id;if(!r)return;let i=n[r];if(i===void 0)return;let a=(t.type||``).toLowerCase();if(a===`radio`)t.checked=String(i)===String(t.value),t.checked?t.setAttribute(`checked`,`checked`):t.removeAttribute(`checked`);else if(a===`checkbox`){let e=!1;e=Array.isArray(i)?i.map(e=>String(e)).includes(String(t.value)):i===!0||String(i)===`true`||String(i)===String(t.value),t.checked=e,t.checked?t.setAttribute(`checked`,`checked`):t.removeAttribute(`checked`)}else a!==`file`&&(t.value=String(i),t.setAttribute(`value`,String(i)))}),r.querySelectorAll(`textarea`).forEach(e=>{let t=e,r=t.name||t.id;if(!r)return;let i=n[r];i!==void 0&&(t.value=String(i),t.textContent=String(i))}),r.querySelectorAll(`select`).forEach(e=>{let t=e,r=t.name||t.id;if(!r)return;let i=n[r];if(i!==void 0)if(t.multiple){let e=Array.isArray(i)?i.map(e=>String(e)):[String(i)];t.querySelectorAll(`option`).forEach(t=>{let n=t,r=e.includes(String(n.value));n.selected=r,r?n.setAttribute(`selected`,`selected`):n.removeAttribute(`selected`)})}else t.value=String(i),t.querySelectorAll(`option`).forEach(e=>{let t=e;String(t.value)===String(i)?t.setAttribute(`selected`,`selected`):t.removeAttribute(`selected`)})})}catch(e){console.warn(`Could not pre-fill snapshot inputs:`,e)}u=`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${e} - Submission</title></head><body> 367 <section> 368 <div>${r.innerHTML}</div> 369 </section> 370 </body></html>`}catch(e){console.warn(`Could not build submission snapshot:`,e)}try{let{data:e,error:t}=await R.functions.invoke(`evaluate-assessment`,{body:{submission_snapshot:u,model:`gpt-4o`}});t?console.warn(`Evaluation error:`,t):e&&(r=typeof e.evaluated_score==`number`?e.evaluated_score:null,a=100,s=typeof e.explanation_to_evaluation==`string`?e.explanation_to_evaluation:``,c=Array.isArray(e.questions)?e.questions:[],console.log(`Evaluation results:`,{evaluated_score:r,total_score:a,questions_count:c.length,raw_earned:e.raw_earned,raw_total:e.raw_total}))}catch(e){console.warn(`Unexpected evaluation error:`,e)}let{error:f}=await R.from(`assessment_submissions`).insert({link_code:e,user_id:t?.id||null,answers:JSON.stringify(n),evaluated_score:r,total_score:a,explanation_to_evaluation:s,submission_snapshot:u,questions_data:c.length>0?c:null});if(f){if(f.code===`23505`){i(`/assessment-already-submitted`,{replace:!0});return}console.error(`Submission failed:`,f),o({title:`Submission Failed`,description:f.message||`There was a problem submitting your assessment.`,variant:`destructive`});return}await R.rpc(`increment_link_submissions`,{link_code:e}),o({title:`Assessment Submitted`,description:`Your assessment has been submitted successfully!`}),setTimeout(()=>i(`/assessment-success`),500)}catch(e){console.error(`Error submitting assessment:`,e),o({title:`Error`,description:`There was a problem submitting your assessment. Please try again.`,variant:`destructive`})}finally{v(!1)}},re=()=>{S&&(x(!1),ne(S),C(null))},ie=()=>{x(!1),C(null)},ae=()=>{let e=document.getElementById(`assessment-content`);if(!e)return!1;let t=!0,n=[],r=e.querySelectorAll(`input, select, textarea`),i=new Map;
370if(r.forEach(e=>{let t=e,n=t.name||t.id;n&&(i.has(n)||i.set(n,[]),i.get(n)?.push(t))}),i.forEach((e,r)=>{let i=e[0],a=i.type?.toLowerCase(),o=!1;if(a===`radio`||a===`checkbox`)o=e.some(e=>e.checked),o?e.forEach(e=>{e.classList.remove(`validation-error-radio-checkbox`);let t=e.closest(`.question-container, .form-group, div[class*="question"], fieldset, div[class*="Question"], .question, .mcq-question, .multi-select-question`);t||=e.parentElement?.parentElement,t&&t.classList.remove(`validation-error`);let n=e.closest(`label`)||e.parentElement?.querySelector(`label`);n&&n.classList.remove(`validation-error-label`)}):e.forEach(e=>{e.classList.add(`validation-error-radio-checkbox`);let t=e.closest(`.question-container, .form-group, div[class*="question"], fieldset, div[class*="Question"], .question, .mcq-question, .multi-select-question`);t||=e.parentElement?.parentElement,t&&t.classList.add(`validation-error`);let n=e.closest(`label`)||e.parentElement?.querySelector(`label`);n&&n.classList.add(`validation-error-label`)});else if(a===`text`||a===`textarea`||i.tagName.toLowerCase()===`textarea`)if(o=i.value.trim()!==``,o){i.classList.remove(`validation-error-input`);let e=i.closest(`.question-container, .form-group, div[class*="question"]`);e&&e.classList.remove(`validation-error`)}else{i.classList.add(`validation-error-input`);let e=i.closest(`.question-container, .form-group, div[class*="question"]`);e&&e.classList.add(`validation-error`)}else if(i.tagName.toLowerCase()===`select`)if(o=i.value!==``&&i.value!==`none`&&i.value!==`select`,o){i.classList.remove(`validation-error-input`);let e=i.closest(`.question-container, .form-group, div[class*="question"]`);e&&e.classList.remove(`validation-error`)}else{i.classList.add(`validation-error-input`);let e=i.closest(`.question-container, .form-group, div[class*="question"]`);e&&e.classList.add(`validation-error`)}o||(t=!1,n.push(r))}),!t){let t=e.querySelector(`.validation-error`);t&&t.scrollIntoView({behavior:`smooth`,block:`center`}),o({title:`Incomplete Assessment`,description:`Please answer all questions before submitting. ${n.length} question${n.length>1?`s`:``} still need${n.length===1?`s`:``} an answer.`,variant:`destructive`})}return t};return s?(0,F.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-gray-50`,children:(0,F.jsxs)(V,{className:`p-8 max-w-md w-full text-center`,children:[(0,F.jsx)(F_,{className:`w-12 h-12 animate-spin mx-auto text-akito-teal-deep`}),(0,F.jsx)(`h2`,{className:`mt-4 text-xl font-semibold`,children:`Loading Assessment...`}),(0,F.jsx)(`p`,{className:`mt-2 text-gray-600`,children:`Please wait while we prepare your assessment.`})]})}):h?(0,F.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-gray-50`,children:(0,F.jsxs)(V,{className:`p-8 max-w-md w-full text-center`,children:[(0,F.jsx)(`div`,{className:`w-12 h-12 mx-auto bg-red-100 rounded-full flex items-center justify-center`,children:(0,F.jsx)(E_,{className:`w-6 h-6 text-red-600`})}),(0,F.jsx)(`h2`,{className:`mt-4 text-xl font-semibold`,children:`Assessment Unavailable`}),(0,F.jsx)(`p`,{className:`mt-2 text-gray-600`,children:h}),(0,F.jsx)(B,{onClick:()=>i(`/`),className:`mt-6`,children:`Return to Home`})]})}):w&&E?(0,F.jsx)(`div`,{className:`min-h-screen bg-gray-50 py-8 px-4`,children:(0,F.jsxs)(`div`,{className:`max-w-4xl mx-auto`,children:[(0,F.jsx)(`div`,{className:`mb-4`,children:(0,F.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:()=>i(-1),children:[(0,F.jsx)(u_,{className:`h-4 w-4 mr-1`}),`Back`]})}),(0,F.jsxs)(`header`,{className:`mb-8`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-center gap-3 mb-2`,children:[(0,F.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-green-100 flex items-center justify-center`,children:(0,F.jsx)(b_,{className:`w-5 h-5 text-green-600`})}),(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold`,children:d||`Assessment`}),(0,F.jsx)(`p`,{className:`text-sm font-medium text-green-700 mt-1`,children:`Assessment submitted`})]})]}),p&&(0,F.jsxs)(`p`,{className:`text-gray-600 text-center`,children:[`Presented by `,p]}),(0,F.jsx)(`div`,{className:`flex items-center justify-center gap-4 mt-4`,children:(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Submitted on `,new Date(E.created_at).toLocaleDateString(`en-US`,{year:`numeric`,month:`long`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})]})})]}),E.submission_snapshot&&(0,F.jsxs)(V,{className:`p-6 mb-6`,children:[(0,F.jsx)(`h3`,{className:`font-semibold mb-4`,children:`Your Submitted Answers`}),(0,F.jsx)(`div`,{className:`border rounded-lg overflow-hidden`,children:(0,F.jsx)(`iframe`,{title:`submission-snapshot`,srcDoc:dye(E.submission_snapshot),className:`w-full min-h-[480px] h-[70vh] max-h-[900px] border-0 bg-white`,sandbox:``})})]}),(0,F.jsx)(`div`,{className:`flex justify-center gap-4`,children:(0,F.jsx)(B,{variant:`outline`,onClick:()=>i(n?.user_type?ev(n.user_type):`/job-seeker/jobs`),children:`Go to Dashboard`})})]})}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{children:` 371 .validation-error { 372 border: 2px solid #ef4444 !important; 373 border-radius: 8px; 374 padding: 12px; 375 background-color: #fef2f2 !important; 376 animation: shake 0.3s; 377 margin: 8px 0 !important; 378 } 379 380 .validation-error-input { 381 border: 2px solid #ef4444 !important; 382 background-color: #fef2f2 !important; 383 } 384 385 .validation-error-radio-checkbox { 386 outline: 2px solid #ef4444 !important; 387 outline-offset: 2px; 388 } 389 390 .validation-error-label { 391 color: #ef4444 !important; 392 font-weight: 600 !important; 393 } 394 395 @keyframes shake { 396 0%, 100% { transform: translateX(0); } 397 25% { transform: translateX(-5px); } 398 75% { transform: translateX(5px); } 399 } 400 401 .validation-error::before { 402 content: "â ï¸ Please answer this question"; 403 display: block; 404 color: #ef4444; 405 font-weight: 600; 406 font-size: 0.875rem; 407 margin-bottom: 8px; 408 } 409 410 /* Additional styling for radio/checkbox groups */ 411 .validation-error input[type="radio"], 412 .validation-error input[type="checkbox"] { 413 outline: 2px solid #ef4444 !important; 414 outline-offset: 2px; 415 } 416 417 .validation-error label { 418 color: #dc2626 !important; 419 } 420 `}),(0,F.jsx)(`div`,{className:`min-h-screen bg-gray-50 py-8 px-4`,children:(0,F.jsxs)(`div`,{className:`max-w-4xl mx-auto`,children:[(0,F.jsxs)(`header`,{className:`mb-8 text-center`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold mb-2`,children:d||`Assessment`}),p&&(0,F.jsxs)(`p`,{className:`text-gray-600`,children:[`Presented by `,p]})]}),(0,F.jsxs)(V,{className:`p-6 mb-8`,children:[(0,F.jsx)(rw,{className:`assessment-content-wrapper`,children:(0,F.jsx)(`div`,{id:`assessment-content`,dangerouslySetInnerHTML:{__html:l||``}})}),_&&(0,F.jsxs)(`div`,{className:`mt-6 flex items-center justify-center`,children:[(0,F.jsx)(F_,{className:`w-5 h-5 animate-spin mr-2`}),(0,F.jsx)(`span`,{children:`Submitting your assessment...`})]})]})]})}),(0,F.jsx)(aE,{open:b,onOpenChange:x,children:(0,F.jsxs)(cE,{children:[(0,F.jsxs)(lE,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,F.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-amber-100 flex items-center justify-center`,children:(0,F.jsx)(y_,{className:`w-5 h-5 text-amber-600`})}),(0,F.jsx)(dE,{children:`Confirm Submission`})]}),(0,F.jsx)(fE,{className:`text-base`,children:`Are you sure you want to submit your assessment? Once submitted, you will not be able to make any changes.`})]}),(0,F.jsxs)(uE,{className:`gap-2 sm:gap-0`,children:[(0,F.jsx)(B,{variant:`outline`,onClick:ie,disabled:_,children:`Cancel`}),(0,F.jsx)(B,{onClick:re,disabled:_,className:`bg-akito-gradient hover:opacity-90`,children:_?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(F_,{className:`w-4 h-4 animate-spin mr-2`}),`Submitting...`]}):`Yes, Submit`})]})]})})]})},pye=()=>{let e=We();return(0,F.jsx)(`div`,{className:`min-h-screen bg-gray-50 flex items-center justify-center p-4`,children:(0,F.jsxs)(V,{className:`max-w-md w-full`,children:[(0,F.jsxs)(Au,{className:`text-center`,children:[(0,F.jsx)(`div`,{className:`flex justify-center mb-4`,children:(0,F.jsx)(`div`,{className:`h-16 w-16 bg-green-100 rounded-full flex items-center justify-center`,children:(0,F.jsx)(h_,{className:`h-8 w-8 text-green-600`})})}),(0,F.jsx)(ju,{className:`text-2xl`,children:`Application Submitted!`}),(0,F.jsx)(Mu,{className:`text-lg`,children:`Thank you for your application`})]}),(0,F.jsx)(H,{className:`text-center`,children:(0,F.jsx)(`p`,{className:`mb-4`,children:`Your application has been successfully submitted. The employer will review your application and contact you if they think you're a good match for the position.`})}),(0,F.jsx)(Nu,{className:`flex flex-col space-y-2`,children:(0,F.jsx)(B,{variant:`outline`,className:`w-full`,onClick:()=>e(`/`),children:`Return to Homepage`})})]})})},mye=()=>{let e=We();return(0,F.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-gray-50`,children:(0,F.jsxs)(V,{className:`p-8 max-w-md w-full text-center`,children:[(0,F.jsx)(`div`,{className:`w-16 h-16 mx-auto bg-blue-100 rounded-full flex items-center justify-center`,children:(0,F.jsx)(b_,{className:`w-8 h-8 text-blue-600`})}),(0,F.jsx)(`h2`,{className:`mt-4 text-xl font-semibold`,children:`Assessment Already Submitted`}),(0,F.jsx)(`p`,{className:`mt-2 text-gray-600`,children:`Our records show you have already submitted this assessment.`}),(0,F.jsx)(B,{className:`mt-6 w-full`,onClick:()=>e(`/`),children:`Go to Home`})]})})},hye=()=>{let[e,t]=(0,y.useState)(`verifying`),[n,r]=(0,y.useState)(`Signing you in...`),i=We(),a=He();return(0,y.useEffect)(()=>{(async()=>{try{let e=new URLSearchParams(a.search),n=window.location.hash.substring(1),o=new URLSearchParams(n),s=e.get(`type`)||o.get(`type`),c=e.get(`code`)||o.get(`code`),l=e.get(`access_token`)||o.get(`access_token`),u=e.get(`refresh_token`)||o.get(`refresh_token`);if(c){let{error:e}=await R.auth.exchangeCodeForSession(c);if(e)throw console.error(`[EMAIL_VERIFICATION] exchangeCodeForSession:`,e),e}else if(l&&u){let{error:e}=await R.auth.setSession({access_token:l,refresh_token:u});if(e)throw e}let{data:{session:d}}=await R.auth.getSession();if(s===`email_change`){i(`/settings/account`);return}if(d?.user){i(`/`);return}if(s===`signup`){i(`/auth`);return}
420t(`error`),r(`This link is invalid or has expired. Please request a new sign-in link.`)}catch(e){console.error(`[EMAIL_VERIFICATION] Error:`,e),t(`error`),r(`Something went wrong. Please try again or request a new sign-in link.`)}})()},[a,i]),(0,F.jsxs)(`div`,{className:`min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4`,children:[(0,F.jsx)(`div`,{className:`mb-8`,children:(0,F.jsx)(`img`,{src:`/lovable-uploads/5b073f6e-f01a-41d5-9166-c07f7567d4b7.png`,alt:`Akito Logo`,className:`h-16 mx-auto`})}),(0,F.jsxs)(`div`,{className:`w-full max-w-md p-8 space-y-6 bg-white rounded-lg shadow-md`,children:[(0,F.jsxs)(`div`,{className:`text-center`,children:[e===`verifying`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`flex justify-center mb-4`,children:(0,F.jsx)(L_,{className:`h-12 w-12 text-akito-teal animate-pulse`})}),(0,F.jsx)(`div`,{className:`flex justify-center`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-akito-teal`})})]}),e===`error`&&(0,F.jsx)(C_,{className:`h-16 w-16 text-red-500 mx-auto`}),(0,F.jsx)(`h1`,{className:`text-2xl font-bold mt-6 bg-clip-text text-transparent bg-akito-gradient`,children:e===`verifying`?`Checking your link`:`Link issue`}),(0,F.jsx)(`p`,{className:`mt-4 text-gray-600 leading-relaxed`,children:n}),e===`verifying`&&(0,F.jsx)(`p`,{className:`mt-2 text-sm text-gray-500`,children:`This should only take a moment.`}),e===`error`&&(0,F.jsx)(`div`,{className:`mt-4 p-4 bg-red-50 rounded-lg`,children:(0,F.jsxs)(`p`,{className:`text-sm text-red-800`,children:[(0,F.jsx)(`strong`,{children:`Need help?`}),` Try the most recent email first. Older links may no longer work.`]})})]}),(0,F.jsx)(`div`,{className:`flex justify-center mt-6 gap-3`,children:(0,F.jsx)(B,{onClick:()=>i(`/auth`),variant:e===`error`?`default`:`outline`,className:e===`error`?`bg-akito-gradient hover:opacity-90`:``,children:e===`error`?`Back to sign in`:`Go to sign in`})})]}),(0,F.jsx)(`div`,{className:`mt-8 text-center`,children:(0,F.jsx)(`p`,{className:`text-sm text-gray-500`,children:`For your security, sign-in links expire after a short time.`})})]})},gye=()=>{let e=We(),t=()=>{window.location.href=`mailto:[email protected]`};return(0,F.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-gray-50`,children:[(0,F.jsx)(NN,{}),(0,F.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white`,children:[(0,F.jsxs)(B,{variant:`ghost`,onClick:()=>e(-1),className:`gap-2`,children:[(0,F.jsx)(u_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Back`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Privacy Policy`}),(0,F.jsx)(`div`,{className:`w-[72px]`})]}),(0,F.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsxs)(`div`,{className:`max-w-3xl mx-auto bg-white rounded-lg p-8 shadow-sm`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold mb-6`,children:`Privacy Policy`}),(0,F.jsx)(`p`,{className:`mb-4 text-sm text-gray-500`,children:`Last Updated: May 21, 2025`}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Introduction`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`Welcome to Akito ("we," "our," or "us"), an AI platform operated by Advancerite Technologies Inc., an Alberta corporation. We respect your privacy and are committed to protecting your personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our platform.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Information We Collect`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We collect several types of information from and about users of our platform, including:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`Personal Data:`}),` We may collect personally identifiable information such as your name, email address, job title, employer, and location when you register or use our services.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`Profile Data:`}),` Information you provide in your user profile, including skills, career goals, and professional experiences.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`Usage Data:`}),` Information about how you use our platform, including your interactions with our AI assistant.`]}
420),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`Chat and Assessment Data:`}),` Content from your conversations with our AI system and results from assessments.`]})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`How We Use Your Information`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We use the information we collect for various purposes, including:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`Providing and improving our AI services`}),(0,F.jsx)(`li`,{children:`Personalizing your experience on our platform`}),(0,F.jsx)(`li`,{children:`Training and improving our AI models`}),(0,F.jsx)(`li`,{children:`Processing and completing transactions`}),(0,F.jsx)(`li`,{children:`Communicating with you about our services`}),(0,F.jsx)(`li`,{children:`Complying with legal obligations`})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`LLM and AI-Specific Privacy Considerations`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`As a platform using large language models (LLMs) and AI technology, we want to ensure you understand specific privacy considerations:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`AI Training:`}),` We may use anonymized conversation data to improve our AI systems. Personal identifiers are removed before any data is used for training purposes.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`Model Inputs:`}),` Information you share with our AI assistant is processed to generate responses. This processing is automated and occurs in real-time.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`AI-Generated Content:`}),` Our platform generates content based on your inputs, which may be saved as part of your user history.`]})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Data Sharing and Disclosure`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We may share your information with:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`Service providers who perform services on our behalf`}),(0,F.jsx)(`li`,{children:`Partners with whom we offer co-branded services or promotions`}),(0,F.jsx)(`li`,{children:`Law enforcement or other authorities if required by law`})]}),(0,F.jsx)(`p`,{children:`We do not sell your personal information to third parties.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Data Security`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We implement appropriate security measures to protect your personal information. However, please note that no method of transmission over the Internet or electronic storage is 100% secure.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Your Privacy Rights`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`Depending on your location, you may have the right to:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`Access the personal data we hold about you`}),(0,F.jsx)(`li`,{children:`Request correction or deletion of your personal data`}),(0,F.jsx)(`li`,{children:`Object to our processing of your data`}),(0,F.jsx)(`li`,{children:`Request restriction of processing your data`}),(0,F.jsx)(`li`,{children:`Request transfer of your data`}),(0,F.jsx)(`li`,{children:`Withdraw consent`})]}),(0,F.jsxs)(`p`,{children:[`To exercise these rights, please contact us at`,` `,(0,F.jsx)(B,{onClick:t,variant:`link`,className:`p-0 h-auto text-akito-teal`,children:`[email protected]`}),`.`]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Changes to This Privacy Policy`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We may update our Privacy Policy from time to time. The updated version will be indicated by an updated "Last Updated" date.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Contact Us`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`If you have any questions about this Privacy Policy, or to request access to or deleti
420on of your account information, please contact us at:`}),(0,F.jsx)(`div`,{className:`bg-gray-50 p-4 rounded-md inline-block`,children:(0,F.jsxs)(B,{onClick:t,variant:`outline`,className:`gap-2`,children:[(0,F.jsx)(L_,{className:`h-4 w-4`}),`[email protected]`]})})]})]})})]})]})},_ye=()=>{let e=We(),[t,n]=(0,y.useState)(`monthly`),r=[{name:`Career Seeker`,description:`For individuals looking to advance their career`,forUserType:`Job Seekers`,monthlyPrice:15,annualPrice:144,features:[{name:`AI Career Assistant`,included:!0},{name:`Skill Assessment`,included:!0},{name:`Career Path Planning`,included:!0},{name:`Resume Analysis`,included:!0},{name:`Job Matching`,included:!0},{name:`Priority Support`,included:!0}]},{name:`Organization Suite`,description:`For companies looking to find and manage talent`,forUserType:`Organizations`,highlight:!0,monthlyPrice:79,annualPrice:790,features:[{name:`Talent Matching`,included:!0},{name:`Skill Gap Analysis`,included:!0},{name:`Custom Assessments`,included:!0},{name:`Team Management`,included:!0},{name:`Analytics Dashboard`,included:!0},{name:`Priority Support`,included:!0}]},{name:`Career Tech Pro`,description:`For career tech professionals and consultants`,forUserType:`HR & Career Tech`,monthlyPrice:49,annualPrice:468,features:[{name:`Client Management`,included:!0},{name:`Career Coaching Tools`,included:!0},{name:`White-label Reports`,included:!0},{name:`Custom Assessments`,included:!0},{name:`Integration APIs`,included:!0},{name:`Priority Support`,included:!0}]}],i=()=>{e(`/contact`)};return(0,F.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-gray-50`,children:[(0,F.jsx)(NN,{}),(0,F.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white`,children:[(0,F.jsxs)(B,{variant:`ghost`,onClick:()=>e(-1),className:`gap-2`,children:[(0,F.jsx)(u_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Back`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Subscription Plans`}),(0,F.jsx)(`div`,{className:`w-[72px]`})]}),(0,F.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,F.jsxs)(`div`,{className:`text-center mb-10`,children:[(0,F.jsx)(`h2`,{className:`text-3xl font-bold bg-clip-text text-transparent bg-akito-gradient`,children:`Choose the Perfect Plan for Your Needs`}),(0,F.jsxs)(`p`,{className:`text-gray-600 max-w-2xl mx-auto mt-2`,children:[`Whether you're an individual seeking career growth or an organization looking for talent`,(0,F.jsx)(`br`,{}),`We have a plan that fits your needs.`]})]}),(0,F.jsx)(`div`,{className:`flex items-center justify-center gap-2`,children:(0,F.jsxs)(`div`,{className:`inline-flex items-center rounded-full bg-gray-100 p-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(`monthly`),className:`px-4 py-1.5 text-sm rounded-full transition ${t===`monthly`?`bg-white shadow text-gray-900`:`text-gray-600`}`,children:`Billed monthly`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(`annual`),className:`px-4 py-1.5 text-sm rounded-full transition ${t===`annual`?`bg-white shadow text-gray-900`:`text-gray-600`}`,children:`Billed annually`})]})}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-6 mt-8`,children:r.map((e,n)=>(0,F.jsxs)(V,{className:`overflow-hidden ${e.highlight?`border-akito-teal shadow-lg`:``}`,children:[(0,F.jsxs)(Au,{className:`${e.highlight?`bg-akito-teal text-white`:`bg-gray-50`}`,children:[(0,F.jsx)(ju,{className:`text-xl`,children:e.name}),(0,F.jsx)(Mu,{className:e.highlight?`text-white/90`:``,children:e.description}),(0,F.jsxs)(`div`,{className:`mt-2 inline-block px-3 py-1 rounded-full text-xs font-medium bg-white/20`,children:[`For `,e.forUserType]})]}),(0,F.jsxs)(H,{className:`pt-6`,children:[(0,F.jsx)(`div`,{className:`mb-5`,children:t===`monthly`?(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-3xl font-bold`,children:[`$`,e.monthlyPrice]}),(0,F.jsx)(`span`,{className:`text-gray-500 mb-1`,children:`/month`})]}):(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-3xl font-bold`,children:[`$`,e.annualPrice]}),(0,F.jsx)(`span`,{className:`text-gray-500 mb-1`,children:`/year`})]}),(0,F.jsxs)(`span`,{className:`text-xs text-green-600 mt-1`,children:[`Save $`,Math.max(0,e.monthlyPrice*12-e.annualPrice),` per year`]})]})}),(0,F.jsx)(`ul`,{className:`space-y-3`,children:e.features.map((e,t)=>(0,F.jsxs)(`li`,{className:`flex items-start`,children:[(0,F.jsx)(h_,{className:`mr-3 h-5 w-5 flex-shrink-0 ${e.included?`text-green-500`:`text-gray-300`}`}),(0,F.jsx)(`span`,{className:e.included?``:`text-gray-400 line-through`,children:e.name})]},t))})]}),(0,F.jsx)(Nu,{className:`flex flex-col items-stretch`,children:(0,F.jsxs)(B,{onClick:i,variant:e.highlight?`default`:`outline`,className:`w-full`,children:[t===`monthly`?`Contact for Monthly`:`Contact for Annual`,(0,F.jsx)(O_,{className:`ml-2 h-4 w-4`})]})})]},n))}),(0,F.jsxs)(`div`,{className:`mt-16 text-center border-t pt-8`,children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold mb-3`,children:`Need a custom solution?`}),(0,F.jsx)(`p`,{className:`text-gray-600 mb-4`,children:`We offer tailored plans for enterprises and educational institutions.`}),(0,F.jsxs)(B,{onClick:i,variant:`outline`,className:`gap-2`,children:[`Get in Touch`,(0,F.jsx)(O_,{className:`h-4 w-4`})]})]})]})})]})]})},vye=()=>{let{toast:e}=pl(),[t,n]=(0,y.useState)({name:``,email:``,phone:``,subject:``,message:``}),[r,i]=(0,y.useState)(!1),a=We(),o=e=>{n({...t,[e.target.name]:e.target.value})};return(0,F.jsxs)(`div`,{className:`flex flex-col min-h-screen bg-gray-50`,children:[(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white`,children:[(0,F.jsxs)(B,{variant:`ghost`,onClick:()=>a(-1),className:`gap-2`,children:[(0,F.jsx)(u_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Back`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Contact Us`}),(0,F.jsx)(`div`,{className:`w-[72px]`})]}),(0,F.jsx)(`div`,{className:`flex-1 overflow-auto p-8`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto`,children:[(0,F.jsx)(`p`,{className:`text-gray-600 mb-10 max-w-2xl`,children:`Get in touch with our team to learn more about how Akito can help you achieve your goals.`}),(0,F.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-10`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-2xl font-bold mb-4`,children:`Get In Touch`}),(0,F.jsx)(`p`,{className:`text-gray-600 mb-8`,children:`Have questions about our services or want to discu
420ss how we can help you? Fill out the form and one of our team members will get back to you as soon as possible.`}),(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-3`,children:(0,F.jsx)(L_,{className:`w-5 h-5 text-akito-teal`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`font-medium`,children:`Email`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`[email protected]`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-3`,children:(0,F.jsx)(R_,{className:`w-5 h-5 text-akito-teal`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`font-medium`,children:`Locations`}),(0,F.jsxs)(`p`,{className:`text-gray-600`,children:[`Fishcreek Executive Centre`,(0,F.jsx)(`br`,{}),`Calgary, AB, Canada`]}),(0,F.jsxs)(`p`,{className:`text-gray-600 mt-2`,children:[`Tecconnect`,(0,F.jsx)(`br`,{}),`Lethbridge, AB, Canada`]})]})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-akito-teal/10 p-3`,children:(0,F.jsx)(ure,{className:`w-5 h-5 text-akito-teal`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`font-medium`,children:`Connect`}),(0,F.jsx)(`a`,{href:`https://www.linkedin.com/company/staque`,className:`text-akito-teal hover:underline`,target:`_blank`,rel:`noreferrer`,children:`LinkedIn`})]})]})]})]}),(0,F.jsxs)(`form`,{onSubmit:async r=>{if(r.preventDefault(),!t.name||!t.email||!t.phone||!t.subject){e({title:`Missing fields`,description:`Please fill out all required fields.`,variant:`destructive`});return}try{i(!0);let{error:r}=await R.functions.invoke(`send-contact-email`,{body:t});if(r)throw r;e({title:`Message sent`,description:`We will get back to you soon.`}),n({name:``,email:``,phone:``,subject:``,message:``})}catch(e){console.error(e),window.location.href=`mailto:[email protected]?subject=${encodeURIComponent(t.subject)}&body=${encodeURIComponent(t.message)}`}finally{i(!1)}},className:`bg-white p-6 rounded-lg shadow-sm border`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-6`,children:`Send Us a Message`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`name`,children:`Full Name*`}),(0,F.jsx)(ku,{id:`name`,name:`name`,value:t.name,onChange:o,required:!0})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`email`,children:`Email Address*`}),(0,F.jsx)(ku,{id:`email`,name:`email`,type:`email`,value:t.email,onChange:o,required:!0})]}),(0,F.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`phone`,children:`Phone Number*`}),(0,F.jsx)(ku,{id:`phone`,name:`phone`,value:t.phone,onChange:o,required:!0})]}),(0,F.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`subject`,children:`Subject*`}),(0,F.jsx)(ku,{id:`subject`,name:`subject`,value:t.subject,onChange:o,required:!0})]}),(0,F.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`message`,children:`Message`}),(0,F.jsx)(SC,{id:`message`,name:`message`,rows:5,value:t.message,onChange:o})]})]}),(0,F.jsx)(B,{type:`submit`,className:`mt-6 w-full`,disabled:r,children:r?`Sending...`:`Send Message`})]})]})]})})]})},xG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yye(){if(typeof window>`u`)return{matchId:null,experienceId:null};let e=new URLSearchParams(window.location.search),t=e.get(`matchId`),n=e.get(`experienceId`);return{matchId:t&&xG.test(t)?t:null,experienceId:n&&xG.test(n)?n:null}}var bye=()=>{let{user:e,profile:t,loading:n}=_l(),r=We(),[{matchId:i,experienceId:a}]=(0,y.useState)(yye),[o,s]=(0,y.useState)(()=>typeof window<`u`&&window.location.hash.includes(`access_token`));return(0,y.useEffect)(()=>{if(!window.location.hash.includes(`access_token`)){s(!1);return}let{data:{subscription:e}}=R.auth.onAuthStateChange((e,t)=>{t?.user&&(e===`SIGNED_IN`||e===`INITIAL_SESSION`||e===`TOKEN_REFRESHED`)&&s(!1)}),t=window.setTimeout(()=>s(!1),1e4);return()=>{e.unsubscribe(),window.clearTimeout(t)}},[]),(0,y.useEffect)(()=>
420{if(!n&&!o)if(e&&t?.user_type){let e=Dre(t.user_type),n=e;a?n=`${e}/experience/${a}`:i&&(n=`${e}/matches/${i}`),r(n,{replace:!0})}else e||r(`/auth`)},[e,t?.user_type,n,o,r,i,a]),(0,y.useEffect)(()=>{e&&window.location.hash.includes(`access_token`)&&window.history.replaceState(null,``,window.location.pathname)},[e]),(0,F.jsx)(tv,{className:`bg-gray-50`})},SG=`Switch`,[xye,Sye]=EC(SG),[Cye,wye]=xye(SG),CG=y.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,...u}=e,[d,f]=y.useState(null),p=bl(t,e=>f(e)),m=y.useRef(!1),h=!d||!!d.closest(`form`),[g=!1,_]=ow({prop:i,defaultProp:a,onChange:l});return(0,F.jsxs)(Cye,{scope:n,checked:g,disabled:s,children:[(0,F.jsx)(U.button,{type:`button`,role:`switch`,"aria-checked":g,"aria-required":o,"data-state":EG(g),"data-disabled":s?``:void 0,disabled:s,value:c,...u,ref:p,onClick:K(e.onClick,e=>{_(e=>!e),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,F.jsx)(Tye,{control:d,bubbles:!m.current,name:r,value:c,checked:g,required:o,disabled:s,style:{transform:`translateX(-100%)`}})]})});CG.displayName=SG;var wG=`SwitchThumb`,TG=y.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=wye(wG,n);return(0,F.jsx)(U.span,{"data-state":EG(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});TG.displayName=wG;var Tye=e=>{let{control:t,checked:n,bubbles:r=!0,...i}=e,a=y.useRef(null),o=uO(n),s=KD(t);return y.useEffect(()=>{let e=a.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(o!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[o,n,r]),(0,F.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:a,style:{...e.style,...s,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})};function EG(e){return e?`checked`:`unchecked`}var DG=CG,Eye=TG,OG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(DG,{className:z(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,F.jsx)(Eye,{className:z(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));OG.displayName=DG.displayName;var kG=`undefined/functions/v1/riipen-webhook`,AG=void 0,jG=()=>Math.random().toString(36).substring(2,10),MG=()=>Date.now(),Dye=()=>{let{toast:e}=pl(),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)([]),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)({experienceId:`exp_${jG()}`,portalId:`portal_${jG()}`,projectId:`proj_${jG()}`,companyId:`comp_${jG()}`}),[l,u]=(0,y.useState)({experienceName:`Data Analytics Bootcamp - Spring 2026`,projectName:`Customer Churn Prediction Model`,projectDetails:`<p>Build a machine learning model to predict customer churn for a SaaS company. You will work with real customer data to identify patterns and create actionable insights.</p>`,projectDeliverables:`<p>1. EDA Report with visualizations<br>2. Feature engineering notebook<br>3. Model training code and evaluation<br>4. Final presentation deck</p>`,projectCategories:`Machine learning, Data analysis, Predictive modeling`,experienceCategories:`Technology, Data Science`,companyName:`TechCorp Analytics`,skills:`Python, Pandas, Scikit-learn, Data Visualization, Machine Learning`}),[d,f]=(0,y.useState)({email:`[email protected]`,firstName:`Chris`,lastName:`Hayes`}),[p,m]=(0,y.useState)({details:`<p>Used for integration testing purposes. Build a complete data analytics pipeline.</p>`,state:`published`,previousAttributes:JSON.stringify({state:`in_review`,open:`false`,opened_at:null,published_at:null},null,2)}),h=()=>{c({experienceId:`exp_${jG()}`,portalId:`portal_${jG()}`,projectId:`proj_${jG()}`,companyId:`comp_${jG()}`})},g=async(t,r,a)=>{n(t);let o=Date.now();try{let n={"Content-Type":`application/json`,Authorization:`Bearer ${AG}`,apikey:AG};a?.mockAssessment&&(n[`X-Akito-Mock-Assessment`]=`true`);let s=await fetch(kG,{method:`POST`,headers:n,body:JSON.stringify(r)}),c=await s.json(),l={success:s.ok,status:s.status,data:c,timestamp:new Date().toISOString()};return i(e=>[l,...e.slice(0,9)]),s.ok?e({title:`Webhook sent successfully`,description:`${t} completed in ${Date.now()-o}ms`}):e({title:`Webhook failed`,description:c.error||`Unknown error`,variant:`destructive`}),l}catch(t){let n={success:!1,status:0,data:{error:t instanceof Error?t.message:`Network error`},timestamp:new Date().toISOString()};return i(e=>[n,...e.slice(0,9)]),e({title:`Webhook failed`,description:`Network error - is the Supabase function running?`,variant:`destructive`}),n}finally{n(null)}},_=e=>e.split(`,`).map(e=>
420e.trim()).filter(Boolean),v=async()=>{let e=MG(),t={id:`evt_${e}_match`,type:`match_request.accepted`,created_at:new Date().toISOString(),data:{object:{id:`mr_${e}`,experience:{id:s.experienceId,name:l.experienceName,portal_id:s.portalId,hours:40,skill_list:l.skills.split(`,`).map(e=>e.trim()),category_list:_(l.experienceCategories),state:`approved`},project:{id:s.projectId,name:l.projectName,details:l.projectDetails,deliverables:l.projectDeliverables,skill_list:l.skills.split(`,`).map(e=>e.trim()),category_list:_(l.projectCategories)},company:{id:s.companyId,name:l.companyName}}},...a?{_akito_mock_assessment:!0}:{}};return g(`match_request.accepted`,t,{mockAssessment:a})},b=async()=>{let e=MG(),t={id:`evt_${e}_member`,type:`member.created`,created_at:new Date().toISOString(),data:{object:{id:`mem_${e}`,user_id:`user_${e}`,memberable_type:`Experience`,memberable_id:s.experienceId,memberable:{id:s.experienceId,name:l.experienceName,portal_id:s.portalId,entity_type:`Experience`},user:{id:`user_${e}`,email:d.email,first_name:d.firstName,last_name:d.lastName}}}};return g(`member.created`,t)},x=async()=>{n(`both`),(await v()).success&&(await new Promise(e=>setTimeout(e,1e3)),await b()),n(null)},S=()=>{let e=new Date().toISOString();return{id:s.experienceId,entity_type:`Experience`,created_at:e,updated_at:e,portal_id:s.portalId,name:l.experienceName,details:p.details,state:p.state,category_list:_(l.experienceCategories),skill_list:_(l.skills),hours:40,open:p.state===`published`,published_at:p.state===`published`?e:null,portal:{id:s.portalId,entity_type:`Portal`,name:`Akito Test Portal`,state:`active`}}},C=async()=>{let e={id:`evt_${MG()}_exp_pub`,type:`experience.published`,created_at:new Date().toISOString(),data:{object:S(),previous_attributes:{state:`in_review`,open:`false`,opened_at:null,published_at:null}}};return g(`experience.published`,e)},w=async()=>{let t={};try{let e=p.previousAttributes.trim()?JSON.parse(p.previousAttributes):{};if(e&&typeof e==`object`&&!Array.isArray(e))t=e;else throw Error(`previous_attributes must be a JSON object`)}catch(t){return e({title:`Invalid previous_attributes JSON`,description:t instanceof Error?t.message:`Could not parse JSON`,variant:`destructive`}),null}let n={id:`evt_${MG()}_exp_upd`,type:`experience.updated`,created_at:new Date().toISOString(),data:{object:S(),previous_attributes:t}};return g(`experience.updated`,n)};return(0,F.jsxs)(`div`,{className:`container mx-auto py-8 px-4 max-w-4xl`,children:[(0,F.jsxs)(`div`,{className:`mb-8`,children:[(0,F.jsx)(`h1`,{className:`text-3xl font-bold mb-2`,children:`Riipen Webhook Tester`}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`Simulate Riipen webhook events against your local Supabase environment.`}),(0,F.jsxs)(`div`,{className:`mt-2 text-sm`,children:[(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Target: `}),(0,F.jsx)(`code`,{className:`bg-muted px-2 py-1 rounded text-xs`,children:kG})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-4 rounded-lg border bg-muted/30 px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,F.jsx)(zu,{htmlFor:`mock-assessment`,className:`text-base font-medium cursor-pointer`,children:`Mock assessment (skip OpenAI)`}),(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Sends `,(0,F.jsx)(`code`,{className:`text-xs`,children:`_akito_mock_assessment: true`}),` in the JSON body (and a header). Uses fixed assessment HTML for`,` `,(0,F.jsx)(`code`,{className:`text-xs`,children:`match_request.accepted`}),`. Works with `,(0,F.jsx)(`code`,{className:`text-xs`,children:`supabase start`}),` (edge uses internal URLs like`,` `,(0,F.jsx)(`code`,{className:`text-xs`,children:`kong:8000`}),`). For hosted Supabase only, set secret`,` `,(0,F.jsx)(`code`,{className:`text-xs`,children:`AKITO_ALLOW_MOCK_ASSESSMENT=true`}),`.`]})]}),(0,F.jsx)(OG,{id:`mock-assessment`,checked:a,onCheckedChange:o})]})]}),(0,F.jsxs)(V,{className:`mb-6`,children:[(0,F.jsx)(Au,{className:`pb-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ju,{className:`text-lg`,children:`Shared IDs`}),(0,F.jsx)(Mu,{children:`These IDs link the webhooks together. The member.created and experience.* events all reuse the Experience ID from match_request.accepted so they hit the same row.`})]}),(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:h,children:[(0,F.jsx)(H_,{className:`h-4 w-4 mr-1`}),`Regenerate`]})]})}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`experienceId`,children:`Experience ID`}),(0,F.jsx)(ku,{id:`experienceId`,value:s.experienceId,onChange:e=>c(t=>({...t,experienceId:e.target.value})),className:`font-mono text-sm`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`portalId`,children:`Portal ID`}),(0,F.jsx)(ku,{id:`portalId`,value:s.portalId,onChange:e=>c(t=>({...t,portalId:e.target.value})),className:`font-mono text-sm`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`projectId`,children:`Project ID`}),(0,F.jsx)(ku,{id:`projectId`,value:s.projectId,onChange:e=>c(t=>({...t,projectId:e.target.value})),className:`font-mono text-sm`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`companyId`,children:`Company ID`}),(0,F.jsx)(ku,{id:`companyId`,value:s.companyId,onChange:e=>c(t=>({...t,companyId:e.target.value})),className:`font-mono text-sm`})]})]})})]}),(0,F.jsxs)(EH,{defaultValue:`match`,className:`mb-6`,children:[(0,F.jsxs)(DH,{className:`grid w-full grid-cols-5`,children:[(0,F.jsx)(OH,{value:`match`,children:`Match Request Accepted`}),(0,F.jsx)(OH,{value:`member`,children:`Member Created`}),(0,F.jsx)(OH,{value:`experience-published`,children:`Experience Published`}),(0,F.jsx)(OH,{value:`experience-updated`,children:`Experience Updated`}),(0,F.jsx)(OH,{value:`quick`,children:`Quick Actions`})]}),(0,F.jsx)(kH,{value:`match`,children:(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{className:`flex items-center gap-2`,children:(0,F.jsx)(mM,{variant:`secondary`,children:`match_request.accepted`})}),(0,F.jsx)(Mu,{children:`Creates an experience, project, job listing, and assessment. Requires OpenAI unless "Mock asse
420ssment" is on above.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experienceName`,children:`Experience Name`}),(0,F.jsx)(ku,{id:`experienceName`,value:l.experienceName,onChange:e=>u(t=>({...t,experienceName:e.target.value}))})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`projectName`,children:`Project Name`}),(0,F.jsx)(ku,{id:`projectName`,value:l.projectName,onChange:e=>u(t=>({...t,projectName:e.target.value}))})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`projectCategories`,children:`Project categories (comma-separated)`}),(0,F.jsx)(ku,{id:`projectCategories`,value:l.projectCategories,onChange:e=>u(t=>({...t,projectCategories:e.target.value})),placeholder:`e.g. Machine learning, Data analysis, SaaS`}),(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Maps to `,(0,F.jsx)(`span`,{className:`font-mono`,children:`project.category_list`}),` in the webhook (shown first under Project scope in the app).`]})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experienceCategories`,children:`Experience categories (comma-separated)`}),(0,F.jsx)(ku,{id:`experienceCategories`,value:l.experienceCategories,onChange:e=>u(t=>({...t,experienceCategories:e.target.value}))})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`projectDetails`,children:`Project Details (HTML)`}),(0,F.jsx)(SC,{id:`projectDetails`,value:l.projectDetails,onChange:e=>u(t=>({...t,projectDetails:e.target.value})),rows:3})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`projectDeliverables`,children:`Project Deliverables (HTML)`}),(0,F.jsx)(SC,{id:`projectDeliverables`,value:l.projectDeliverables,onChange:e=>u(t=>({...t,projectDeliverables:e.target.value})),rows:2})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`companyName`,children:`Company Name`}),(0,F.jsx)(ku,{id:`companyName`,value:l.companyName,onChange:e=>u(t=>({...t,companyName:e.target.value}))})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`skills`,children:`Skills (comma-separated)`}),(0,F.jsx)(ku,{id:`skills`,value:l.skills,onChange:e=>u(t=>({...t,skills:e.target.value}))})]})]}),(0,F.jsxs)(B,{onClick:v,disabled:t!==null,className:`w-full`,children:[t===`match_request.accepted`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Send match_request.accepted`]})]})]})}),(0,F.jsx)(kH,{value:`member`,children:(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{className:`flex items-center gap-2`,children:(0,F.jsx)(mM,{variant:`secondary`,children:`member.created`})}),(0,F.jsx)(Mu,{children:`Invites a user to an experience. Creates/links user account and sends welcome email. Uses the Experience ID from shared IDs above.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`email`,children:`Email`}),(0,F.jsx)(ku,{id:`email`,type:`email`,value:d.email,onChange:e=>f(t=>({...t,email:e.target.value}))})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`firstName`,children:`First Name`}),(0,F.jsx)(ku,{id:`firstName`,value:d.firstName,onChange:e=>f(t=>({...t,firstName:e.target.value}))})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`lastName`,children:`Last Name`}),(0,F.jsx)(ku,{id:`lastName`,value:d.lastName,onChange:e=>f(t=>({...t,lastName:e.target.value}))})]})]}),(0,F.jsx)(`div`,{className:`bg-muted/50 rounded-lg p-3 text-sm`,children:(0,F.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Will link to Experience: `,(0,F.jsx)(`code`,{className:`bg-background px-1 rounded`,children:s.experienceId})]})}),(0,F.jsxs)(B,{onClick:b,disabled:t!==null,className:`w-full`,children:[t===`member.created`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Send member.created`]})]})]})}),(0,F.jsx)(kH,{value:`experience-published`,children:(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{className:`flex items-center gap-2`,children:(0,F.jsx)(mM,{variant:`secondary`,children:`experience.published`})}),(0,F.jsxs)(Mu,{children:[`Upserts a `,(0,F.jsx)(`code`,{className:`text-xs`,children:`riipen_experiences`}),` row keyed on the shared Experience ID. Uses the Experience name from the Match Request tab.`]})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experiencePublishedName`,children:`Experience Name`}),(0,F.jsx)(ku,{id:`experiencePublishedName`,value:l.experienceName,onChange:e=>u(t=>({...t,experienceName:e.target.value}))}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Synced with the name on the Match Request Accepted tab.`})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experienceDetails`,children:`Details (HTML)`}),(0,F.jsx)(SC,{id:`experienceDetails`,value:p.details,onChange:e=>m(t=>({...t,details:e.target.value})),rows:3})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`experienceState`,children:`State`}),(0,F.jsx)(ku,{id:`experienceState`,value:p.state,onChange:e=>m(t=>({...t,state:e.target.value})),placeholder:`published`})]})]}),(0,F.jsx)(`div`,{className:`bg-muted/50 rounded-lg p-3 text-sm`,children:(0,F.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Will upsert Experience:`,` `,(0,F.jsx)(`code`,{className:`bg-background px-1 rounded`,children:s.experienceId}),` `,`(portal`,` `,(0,F.jsx)(`code`,{className:`bg-background px-1 rounded`,children:s.portalId}),`)`]})}),(0,F.jsxs)(B,{onClick:C,disabled:t!==null,className:`w-full`,children:[t===`experience.published`?
420(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Send experience.published`]})]})]})}),(0,F.jsx)(kH,{value:`experience-updated`,children:(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{className:`flex items-center gap-2`,children:(0,F.jsx)(mM,{variant:`secondary`,children:`experience.updated`})}),(0,F.jsxs)(Mu,{children:[`Refreshes the cached `,(0,F.jsx)(`code`,{className:`text-xs`,children:`riipen_experiences`}),` row and logs the changed fields from `,(0,F.jsx)(`code`,{className:`text-xs`,children:`previous_attributes`}),`. Self-heals by creating the row if it doesn't exist.`]})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experienceUpdatedName`,children:`Experience Name`}),(0,F.jsx)(ku,{id:`experienceUpdatedName`,value:l.experienceName,onChange:e=>u(t=>({...t,experienceName:e.target.value}))})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experienceUpdatedDetails`,children:`Details (HTML)`}),(0,F.jsx)(SC,{id:`experienceUpdatedDetails`,value:p.details,onChange:e=>m(t=>({...t,details:e.target.value})),rows:3})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{htmlFor:`experienceUpdatedState`,children:`State`}),(0,F.jsx)(ku,{id:`experienceUpdatedState`,value:p.state,onChange:e=>m(t=>({...t,state:e.target.value}))})]}),(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(zu,{htmlFor:`experiencePreviousAttributes`,children:`previous_attributes (JSON)`}),(0,F.jsx)(SC,{id:`experiencePreviousAttributes`,value:p.previousAttributes,onChange:e=>m(t=>({...t,previousAttributes:e.target.value})),rows:6,className:`font-mono text-xs`}),(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Riipen sends the prior values for fields that changed. The handler logs these as the "changed" fields. Use `,(0,F.jsx)(`code`,{children:`{}`}),` for no-op updates.`]})]})]}),(0,F.jsx)(`div`,{className:`bg-muted/50 rounded-lg p-3 text-sm`,children:(0,F.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Will upsert Experience:`,` `,(0,F.jsx)(`code`,{className:`bg-background px-1 rounded`,children:s.experienceId})]})}),(0,F.jsxs)(B,{onClick:w,disabled:t!==null,className:`w-full`,children:[t===`experience.updated`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Send experience.updated`]})]})]})}),(0,F.jsx)(kH,{value:`quick`,children:(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Quick Actions`}),(0,F.jsx)(Mu,{children:`Common webhook sequences for testing.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`border rounded-lg p-4`,children:[(0,F.jsx)(`h4`,{className:`font-medium mb-2`,children:`Full Flow: Create Experience + Invite User`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:`Sends match_request.accepted followed by member.created with the same experience ID. This simulates a complete Riipen onboarding flow.`}),(0,F.jsxs)(B,{onClick:x,disabled:t!==null,className:`w-full bg-gradient-to-r from-teal-500 to-teal-600 hover:from-teal-600 hover:to-teal-700`,children:[t===`both`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Run Full Flow`]})]}),(0,F.jsxs)(`div`,{className:`border rounded-lg p-4`,children:[(0,F.jsx)(`h4`,{className:`font-medium mb-2`,children:`Invite to Existing Experience`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:`Just send member.created to invite a new user to an existing experience. Make sure to set the correct Experience ID in shared IDs.`}),(0,F.jsxs)(B,{onClick:b,disabled:t!==null,variant:`outline`,className:`w-full`,children:[t===`member.created`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Send member.created Only`]})]}),(0,F.jsxs)(`div`,{className:`border rounded-lg p-4`,children:[(0,F.jsx)(`h4`,{className:`font-medium mb-2`,children:`Experience Lifecycle: Publish + Upd
420ate`}),(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:[`Sends experience.published, then experience.updated against the same Experience ID. Useful for verifying upsert behavior on the`,` `,(0,F.jsx)(`code`,{className:`text-xs`,children:`riipen_experiences`}),` table.`]}),(0,F.jsxs)(B,{onClick:async()=>{n(`experience-lifecycle`),(await C())?.success&&(await new Promise(e=>setTimeout(e,1e3)),await w()),n(null)},disabled:t!==null,variant:`outline`,className:`w-full`,children:[t===`experience-lifecycle`?(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}):(0,F.jsx)(U_,{className:`h-4 w-4 mr-2`}),`Run Experience Lifecycle`]})]})]})]})})]}),r.length>0&&(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(ju,{className:`text-lg`,children:`Recent Results`}),(0,F.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>i([]),children:`Clear`})]})}),(0,F.jsx)(H,{children:(0,F.jsx)(`div`,{className:`space-y-3 max-h-96 overflow-y-auto`,children:r.map((e,t)=>(0,F.jsxs)(`div`,{className:`border rounded-lg p-3 ${e.success?`border-green-200 bg-green-50`:`border-red-200 bg-red-50`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.success?(0,F.jsx)(b_,{className:`h-4 w-4 text-green-600`}):(0,F.jsx)(C_,{className:`h-4 w-4 text-red-600`}),(0,F.jsxs)(`span`,{className:`font-medium text-sm`,children:[`Status: `,e.status]})]}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:new Date(e.timestamp).toLocaleTimeString()})]}),(0,F.jsx)(`pre`,{className:`text-xs bg-background rounded p-2 overflow-x-auto`,children:JSON.stringify(e.data,null,2)})]},t))})})]})]})},NG=({allowedRoles:e,children:t})=>{let{user:n,profile:r,loading:i}=_l(),a=He();return i?(0,F.jsx)(tv,{}):n?!r?.user_type||!e.includes(r.user_type)?(0,F.jsx)(mt,{to:ev(r?.user_type),replace:!0}):(0,F.jsx)(F.Fragment,{children:t}):(0,F.jsx)(mt,{to:`/auth`,state:{from:a},replace:!0})},Oye=({items:e})=>(0,F.jsx)(`nav`,{className:`border-b bg-white p-2 px-6`,children:(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2 sm:w-auto w-full`,children:e.map(({path:e,label:t,icon:n,end:r})=>(0,F.jsxs)(Ft,{to:e,end:r,className:({isActive:e})=>z(`inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all border`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e?`bg-background text-foreground shadow-sm border-input`:`text-muted-foreground hover:bg-muted/60 border-transparent`),children:[(0,F.jsx)(n,{size:16}),(0,F.jsx)(`span`,{children:t})]},e))})}),PG=`akito_impersonation_data`;function FG(){let{session:e,profile:t}=_l(),{toast:n}=pl(),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=sessionStorage.getItem(PG);if(e)try{o(JSON.parse(e))}catch{sessionStorage.removeItem(PG)}},[]);let s=(0,y.useCallback)(async r=>{if(!e?.access_token||!e?.refresh_token){n({title:`Error`,description:`You must be logged in to impersonate users`,variant:`destructive`});return}if(t?.user_type!==`admin`){n({title:`Error`,description:`Only administrators can impersonate users`,variant:`destructive`});return}i(!0);try{let{data:t,error:n}=await R.functions.invoke(`admin-impersonate-user`,{method:`POST`,headers:{Authorization:`Bearer ${e.access_token}`},body:{targetUserId:r}});if(n||t?.error)throw Error(t?.error||n?.message||`Failed to start impersonation`);if(!t?.data)throw Error(`Invalid response from impersonation service`);let{magicLink:i,adminReturnLink:a,targetUserName:s,targetUserType:c}=t.data,l={adminReturnLink:a,targetUserName:s,targetUserType:c};sessionStorage.setItem(PG,JSON.stringify(l)),o(l),window.location.href=i}catch(e){console.error(`Impersonation error:`,e),n({title:`Impersonation failed`,description:e instanceof Error?e.message:`An unexpected error occurred`,variant:`destructive`})}finally{i(!1)}},[e,t,n]),c=(0,y.useCallback)(()=>{a&&(sessionStorage.removeItem(PG),window.location.href=a.adminReturnLink)},[a]);return{isImpersonating:a!==null,impersonationData:a,startImpersonation:s,stopImpersonation:c,isLoading:r}}var kye=()=>{let{isImpersonating:e,impersonationData:t,stopImpersonation:n}=FG();return!e||!t?null:(0,F.jsxs)(`div`,{className:`bg-amber-500 text-white px-4 py-2 flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(wre,{className:`h-4 w-4`}),(0,F.jsxs)(`span`,{className:`text-sm font-medium`,children:[`Viewing as: `,(0,F.jsx)(`strong`,{children:t.targetUserName||`User`}),(0,F.jsxs)(`span`,{className:`ml-2 opacity-75`,children:[`(`,t.targetUserType,`)`]})]})]}),(0,F.jsx)(B,{variant:`secondary`,size:`sm`,onClick:n,className:`h-7 text-xs`,children:`Stop Impersonating`})]})},IG=({header:e,children:t,columnClassName:n})=>(0,F.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-gray-50`,children:[(0,F.jsx)(NN,{}),(0,F.jsxs)(`div`,{className:z(`flex-1 flex flex-col overflow-hidden`,n),children:[(0,F.jsx)(kye,{}),e,t]})]}),LG=({title:e=`Dashboard`,navItems:t})=>{let n=We();return(0,F.jsx)(IG,{header:(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white shrink-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,
420width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-akito-teal-deep`,children:[(0,F.jsx)(`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4`}),(0,F.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2v-4`}),(0,F.jsx)(`path`,{d:`M19 3h-4`}),(0,F.jsx)(`path`,{d:`M19 21h-4`}),(0,F.jsx)(`path`,{d:`M9 3v18`}),(0,F.jsx)(`path`,{d:`M17 9h.01`}),(0,F.jsx)(`path`,{d:`M17 15h.01`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold text-akito-teal-deep`,children:e})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(B,{onClick:()=>n(`/`),variant:`outline`,size:`sm`,className:`flex items-center gap-2`,children:[(0,F.jsx)(__,{className:`w-4 h-4`}),`Back to App`]}),(0,F.jsx)(mG,{})]})]}),children:(0,F.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col min-h-0`,children:[(0,F.jsx)(Oye,{items:t}),(0,F.jsx)(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:(0,F.jsx)(rw,{className:`h-full`,children:(0,F.jsx)(`div`,{className:`p-6`,children:(0,F.jsx)(ht,{})})})})]})})};function RG(){let{user:e,profile:t}=_l(),{data:n,isLoading:r}=sr({queryKey:[`riipen-access`,e?.id],enabled:!!e?.id&&t?.user_type===`job_seeker`,queryFn:async()=>{let{data:t,error:n}=await R.from(`riipen_experience_members`).select(`id, experience_id, riipen_experience_id, riipen_portal_id`).eq(`profile_id`,e.id).limit(1);return n?(console.error(`Error checking Riipen access:`,n),null):t&&t.length>0?t[0]:null}});return t?.user_type===`admin`||t?.user_type===`organization`||t?.user_type===`career_tech`?{hasAccess:!0,isLoading:!1,memberRecord:null}:{hasAccess:!!n,isLoading:r,memberRecord:n||null}}var Aye=()=>{let{hasAccess:e}=RG();return(0,F.jsx)(LG,{navItems:(0,y.useMemo)(()=>[{path:`/job-seeker/jobs`,label:`Available Jobs`,icon:f_,end:!0},{path:`/job-seeker/applications`,label:`Jobs Applied`,icon:ire,end:!0},{path:`/job-seeker/courses`,label:`Recommendations`,icon:d_,end:!0},...e?[{path:`/job-seeker/riipen`,label:`Riipen`,icon:j_,end:!1}]:[]],[e])})},jye=[{path:`/organization/talent-pipeline`,label:`Talent Pipeline`,icon:Z_},{path:`/organization/courses`,label:`Recommendations`,icon:d_}],Mye=()=>(0,F.jsx)(LG,{navItems:jye}),Nye=[{path:`/admin/talent-pipeline`,label:`Talent Pipeline`,icon:Z_},{path:`/admin/courses`,label:`Recommendations`,icon:d_,end:!0},{path:`/admin/riipen`,label:`Riipen`,icon:j_},{path:`/admin/analytics`,label:`Analytics`,icon:m_},{path:`/admin/users`,label:`Users`,icon:J_}],Pye=()=>(0,F.jsx)(LG,{navItems:Nye}),Fye=({isActive:e})=>z(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e&&`bg-background text-foreground shadow-sm`),zG=({items:e,className:t})=>(0,F.jsx)(`nav`,{className:z(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,t),children:e.map(({to:e,label:t,end:n,icon:r})=>(0,F.jsx)(Ft,{to:e,className:Fye,end:n??!0,children:r?(0,F.jsxs)(`span`,{className:`flex items-center`,children:[(0,F.jsx)(r,{size:16,className:`mr-2`}),t]}):t},e))}),Iye=()=>{let{user:e,profile:t}=_l(),n=We(),{toast:r}=pl(),i=t?.user_type===`admin`,[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(``),{data:l,isLoading:u}=sr({queryKey:[`job-listings`,`for-select`,e?.id,i],enabled:(i||!!e?.id)&&a,queryFn:async()=>{if(!i&&!e?.id)return[];let t=R.from(`job_listings`).select(`id, title, description, requirements, skills_required, organization_id, organizations(name)`).eq(`status`,`active`).order(`created_at`,{ascending:!1});if(!i){if(!e?.id)return[];t=t.eq(`created_by`,e.id)}let{data:n,error:r}=await t;if(r)throw r;return(n??[]).map(e=>({...e,organization_name:e.organizations?.name??null}))}});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(B,{onClick:()=>o(!0),className:`bg-akito-gradient text-white`,children:[(0,F.jsx)(S_,{className:`mr-2 h-4 w-4`}),`Create Assessment with AI`]}),(0,F.jsx)(aE,{open:a,onOpenChange:o,children:(0,F.jsxs)(cE,{children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Select Job Listing`}),(0,F.jsx)(fE,{children:`Choose the job you want to create an assessment for.`})]}),u?(0,F.jsx)(`div`,{className:`text-center py-8`,children:`Loading jobs...`}):(0,F.jsxs)(Tk,{value:s,onValueChange:e=>{c(e);let t=l?.find(t=>
420t.id===e);t&&(localStorage.setItem(`jobId`,t.id),localStorage.setItem(`jobTitle`,t.title??``),localStorage.setItem(`jobDescription`,t.description??``),localStorage.setItem(`jobRequirements`,t.requirements??``),localStorage.setItem(`jobSkillsRequired`,JSON.stringify(t.skills_required??[])),localStorage.setItem(`OrganizationId`,t.organization_id??``),localStorage.setItem(`OrganizationName`,t.organization_name??``))},children:[(0,F.jsx)(Dk,{children:(0,F.jsx)(Ek,{placeholder:`Select a job listing`})}),(0,F.jsx)(Ak,{children:l&&l.length>0?l.map(e=>(0,F.jsx)(jk,{value:e.id,children:e.title},e.id)):(0,F.jsx)(`div`,{className:`p-2 text-sm text-muted-foreground`,children:`No job listings found.`})})]}),(0,F.jsxs)(uE,{className:`mt-6`,children:[(0,F.jsx)(B,{variant:`outline`,onClick:()=>o(!1),children:`Cancel`}),(0,F.jsx)(B,{onClick:()=>{s&&(n(`/?action=create_assessment&job_id=${s}`),r({title:`Assessment Creator`,description:`Opened AI assessment creation assistant`}),o(!1))},disabled:!s,children:`Continue`})]})]})})]})},BG=[`talent-stats`];function Lye(){let{user:e,profile:t}=_l(),n=t?.user_type===`admin`,r=e?.id;return sr({queryKey:[...BG,r],enabled:n||!!r,queryFn:async()=>{if(!n&&!r)return console.warn(`SECURITY: Non-admin user has no user_id, returning zero stats`),{jobs:0,candidates:0,assessments:0};let e=R.from(`job_listings`).select(`*`,{count:`exact`,head:!0}).eq(`status`,`active`);if(!n){if(!r)return console.error(`SECURITY BREACH PREVENTED: Attempted to query jobs stats without user_id`),{jobs:0,candidates:0,assessments:0};e=e.eq(`created_by`,r)}let t=R.from(`candidates`).select(`user_id, job_listings!inner(created_by)`,{count:`exact`,head:!1});if(!n){if(!r)return console.error(`SECURITY BREACH PREVENTED: Attempted to query candidates stats without user_id`),{jobs:0,candidates:0,assessments:0};t=t.eq(`job_listings.created_by`,r)}let{data:i,error:a}=await t;if(a)throw a;let o=new Set((i??[]).map(e=>e.user_id)).size,s=R.from(`assessment_links`).select(`id, job_listings!inner(created_by)`,{count:`exact`,head:!1});if(!n){if(!r)return console.error(`SECURITY BREACH PREVENTED: Attempted to query assessment stats without user_id`),{jobs:0,candidates:0,assessments:0};s=s.eq(`job_listings.created_by`,r)}let c=await s,[l]=await Promise.all([e]);return{jobs:l.count??0,candidates:o??0,assessments:c.count??0}}})}function VG(e){e.invalidateQueries({queryKey:BG})}var Rye=[{to:`job-listings`,label:`Job Listings`,end:!0,icon:A_},{to:`candidates`,label:`Candidates`,icon:Z_},{to:`assessment-links`,label:`Assessment Links`,icon:ere}],HG=()=>{let{data:e,isLoading:t}=Lye();return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-2xl font-bold mb-2`,children:`Talent Pipeline Management`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mb-6`,children:`Create job listings, manage candidates, and generate assessment links.`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-4 mb-6`,children:(0,F.jsx)(Iye,{})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4 mb-6`,children:[(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`pt-6`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:t?`...`:e?.jobs??0}),(0,F.jsx)(`div`,{className:`text-muted-foreground`,children:`Active Job Listings`})]})}),(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`pt-6`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:t?`...`:e?.candidates??0}),(0,F.jsx)(`div`,{className:`text-muted-foreground`,children:`Total Candidates`})]})}),(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`pt-6`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:t?`...`:e?.assessments??0}),(0,F.jsx)(`div`,{className:`text-muted-foreground`,children:`Assessment Links`})]})})]}),(0,F.jsx)(zG,{items:Rye,className:`mb-4`})]}),(0,F.jsx)(ht,{})]})},zye=[{to:`users`,label:`User Analytics`,end:!0,icon:J_},{to:`aggregate`,label:`Aggregate Analytics`,icon:m_}],Bye=()=>(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-center mb-6`,children:[(0,F.jsx)(m_,{size:24,className:`mr-2 text-akito-teal`}),(0,F.jsx)(`h2`,{className:`text-2xl font-semibold`,children:`Analytics Dashboard`})]}),(0,F.jsx)(zG,{items:zye,className:`grid grid-cols-2 w-[400px] mb-6`}),(0,F.jsx)(ht,{})]});function UG(e=20){let{session:t}=_l(),[n,r]=(0,y.useState)([]),[i,a]=(0,y.useState)(0),[o,s]=(0,y.useState)(1),[c]=(0,y.useState)(e),[l,u]=(0,y.useState)(`all`),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(o),v=(0,y.useRef)(l);return _.current=o,v.current=l,{users:n,total:i,page:o,perPage:c,filter:l,isLoading:d,error:h,fetchUsers:(0,y.useCallback)(async e=>{if(!t?.access_token)return;f(!0),g(null);let n=e?.page??_.current,i=e?.filter??v.current;try{let{data:e,error:o}=await R.functions.invoke(`admin-list-users`,{method:`POST`,headers:{Authorization:`Bearer ${t.access_token}`},body:{page:n,perPage:c,filter:i}});if(o)throw o;let l=e,d=l.users?.map(e=>({id:e.id,email:e.email??null,emailConfirmedAt:e.email_confirmed_at??null,lastSignInAt:e.last_sign_in_at??null,fullName:e.full_name??null,userType:e.user_type??null}))??[];
420r(d),a(l.total??d.length),s(l.page??n),u(i)}catch(e){console.error(`useAdminUsers.fetchUsers error`,e),g(e instanceof Error?e:Error(`Failed to load users`))}finally{f(!1)}},[t?.access_token,c]),inviteUser:(0,y.useCallback)(async e=>{if(t?.access_token){m(!0),g(null);try{let{data:n,error:r}=await R.functions.invoke(`admin-invite-user`,{method:`POST`,headers:{Authorization:`Bearer ${t.access_token}`},body:{email:e.email,userType:e.userType??`admin`,fullName:e.fullName}});if(n?.error)throw Error(n.error);if(r){if(r instanceof mr){let e=await r.context.json();throw Error(e?.error||r.message)}throw r}}catch(e){console.error(`useAdminUsers.inviteUser error`,e);let t=e instanceof Error?e:Error(`Failed to invite user`);throw g(t),t}finally{m(!1)}}},[t?.access_token]),isInviting:p}}var Vye=({onInvited:e})=>{let{inviteUser:t,isInviting:n}=UG(),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(`admin`),d=()=>{o(``),c(``),u(`admin`)};return(0,F.jsxs)(aE,{open:r,onOpenChange:i,children:[(0,F.jsx)(oE,{asChild:!0,children:(0,F.jsxs)(B,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Y_,{className:`h-4 w-4`}),`Invite User`]})}),(0,F.jsxs)(cE,{className:`sm:max-w-[450px]`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Invite a new user`}),(0,F.jsx)(fE,{children:`Send an invitation email to grant access to Akito. You can choose the user's role.`})]}),(0,F.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault();let r=a.trim();if(!r){fl({title:`Email required`,description:`Please enter an email address.`,variant:`destructive`});return}try{await t({email:r,userType:l,fullName:s.trim()||void 0}),fl({title:`Invite sent`,description:`An invite has been sent to ${r}.`}),d(),i(!1),e?.()}catch(e){fl({title:`Failed to send invite`,description:e?.message||`Could not send invite. Please check the email and try again.`,variant:`destructive`})}},className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`invite-email`,children:`Email`}),(0,F.jsx)(ku,{id:`invite-email`,type:`email`,autoComplete:`email`,placeholder:`[email protected]`,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`invite-full-name`,children:`Full name (optional)`}),(0,F.jsx)(ku,{id:`invite-full-name`,type:`text`,autoComplete:`name`,placeholder:`John Doe`,value:s,onChange:e=>c(e.target.value)})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`invite-role`,children:`Role`}),(0,F.jsxs)(Tk,{value:l??`admin`,onValueChange:e=>u(e),children:[(0,F.jsx)(Dk,{id:`invite-role`,children:(0,F.jsx)(Ek,{placeholder:`Select role`})}),(0,F.jsxs)(Ak,{children:[(0,F.jsx)(jk,{value:`admin`,children:`Admin (default)`}),(0,F.jsx)(jk,{value:`organization`,children:`Organization`}),(0,F.jsx)(jk,{value:`career_tech`,children:`Career Tech`}),(0,F.jsx)(jk,{value:`job_seeker`,children:`Job Seeker`})]})]})]}),(0,F.jsx)(uE,{children:(0,F.jsx)(B,{type:`submit`,disabled:n,className:`w-full`,children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}),`Sending invite...`]}):`Send invite`})})]})]})]})},Hye=[{to:`all`,label:`All Users`,end:!0,icon:Z_},{to:`pending`,label:`Pending Invites`,icon:L_}],Uye=()=>{let e=UG(),{users:t,isLoading:n,page:r,perPage:i,total:a,fetchUsers:o,filter:s}=e,{startImpersonation:c}=FG(),[l,u]=y.useState(null),d=async e=>{u(e);try{await c(e)}finally{u(null)}},f=(r-1)*i+1,p=Math.min(f+t.length-1,a),m=()=>{o({page:s===`pending`?r:1,filter:s}).catch(()=>{})},h=e=>{let t=e===`prev`?Math.max(1,r-1):r+1;o({page:t}).catch(()=>{})},g=p<a;return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Z_,{className:`h-5 w-5 text-akito-teal`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900`,children:`User Management`}),(0,F.jsx)(`p`,{className:`text-sm text-gray-500`,children:`View all users, monitor invites, and bring new teammates into Akito.`})]})]}),(0,F.jsx)(Vye,{onInvited:m})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-2`,children:(0,F.jsx)(ju,{className:`text-base font-medium`,children:`Users`})}),(0,F.jsxs)(H,{children:[(0,F.jsx)(zG,{items:Hye,className:`mb-4`}),(0,F.jsx)(ht,{context:{...e,onImpersonate:d,impersonatingUserId:l}}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center mt-4`,children:[(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:a>0?`${f}â${p} of ${a}`:`No users`}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>h(`prev`),disabled:n||r<=1,children:`Previous`}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>h(`next`),disabled:n||!g,children:`Next`})]})]})]})]})]})}
420,WG=[`profile-demographics`];function GG(){let{user:e}=_l(),t=Gn(),n=sr({queryKey:[...WG,e?.id],enabled:!!e?.id,queryFn:async()=>{if(!e?.id)return null;let{data:t,error:n}=await R.from(`profile_demographics`).select(`*`).eq(`user_id`,e.id).maybeSingle();if(n)throw console.error(`[useDemographics] Error fetching demographics:`,n),n;return t}}),r=cr({mutationFn:async t=>{if(!e?.id)throw Error(`Not authenticated`);let{data:n,error:r}=await R.from(`profile_demographics`).upsert({user_id:e.id,...t,updated_at:new Date().toISOString()},{onConflict:`user_id`}).select().single();if(r)throw console.error(`[useDemographics] Error saving demographics:`,r),r;return n},onSuccess:()=>{t.invalidateQueries({queryKey:WG}),fl({title:`Saved`,description:`Your information has been updated.`})},onError:e=>{console.error(`[useDemographics] Mutation error:`,e),fl({title:`Save failed`,description:e instanceof Error?e.message:`Failed to save your information`,variant:`destructive`})}});return{demographics:n.data,isLoading:n.isLoading,isError:n.isError,error:n.error,refetchDemographics:n.refetch,saveDemographics:r.mutate,saveDemographicsAsync:r.mutateAsync,isSaving:r.isPending}}var KG=({to:e,icon:t,label:n,status:r})=>(0,F.jsxs)(Ft,{to:e,className:({isActive:e})=>z(`flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors`,e?`bg-accent text-accent-foreground`:`text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground`),children:[(0,F.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),r]}),qG=({complete:e})=>(0,F.jsx)(`span`,{className:z(`whitespace-nowrap text-[10px] font-medium`,e?`text-emerald-700`:`text-amber-700`),children:e?`Complete`:`Incomplete`}),JG=({title:e,children:t})=>(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(`h3`,{className:`px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70`,children:e}),(0,F.jsx)(`div`,{className:`space-y-0.5`,children:t})]}),Wye=()=>{let e=We();return(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white shrink-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:()=>e(`/`),className:`gap-2`,children:[(0,F.jsx)(u_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Back`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Settings`}),(0,F.jsx)(mM,{variant:`outline`,className:`bg-amber-100 text-amber-800 border-amber-300`,children:`Early Access Beta`})]})]}),(0,F.jsx)(mG,{})]})},Gye=()=>{let{profile:e}=_l(),{demographics:t,isLoading:n,isError:r}=GG(),i=(0,y.useMemo)(()=>e?e.user_type===`organization`||!!e.organization_id:!1,[e]),a=(0,y.useMemo)(()=>t?[!!(t.gender&&(t.gender!==`other`||t.gender_other?.trim())),!!t.age_band,!!t.province,!!t.employment_status].every(Boolean):!1,[t]);return(0,F.jsx)(IG,{header:(0,F.jsx)(Wye,{}),children:(0,F.jsxs)(`div`,{className:`flex-1 flex overflow-hidden min-h-0`,children:[(0,F.jsx)(`aside`,{className:`w-56 border-r bg-muted/30 flex-shrink-0 overflow-hidden`,children:(0,F.jsx)(rw,{className:`h-full py-6 px-3`,children:(0,F.jsxs)(`nav`,{className:`space-y-6`,children:[(0,F.jsxs)(JG,{title:`Personal`,children:[(0,F.jsx)(KG,{to:`profile`,icon:X_,label:`Profile`,status:e?(0,F.jsx)(qG,{c
420omplete:vG(e)}):null}),(0,F.jsx)(KG,{to:`demographics`,icon:rre,label:`About You`,status:n||r?null:(0,F.jsx)(qG,{complete:a})})]}),i&&(0,F.jsxs)(JG,{title:`Organization`,children:[(0,F.jsx)(KG,{to:`organization/profile`,icon:p_,label:`Profile`,status:e?(0,F.jsx)(qG,{complete:cye(e)}):null}),(0,F.jsx)(KG,{to:`organization/team`,icon:Z_,label:`Team`})]}),(0,F.jsx)(JG,{title:`Account`,children:(0,F.jsx)(KG,{to:`account`,icon:W_,label:`General`})})]})})}),(0,F.jsx)(`main`,{className:`relative flex-1 overflow-auto min-h-0`,children:(0,F.jsx)(`div`,{className:`p-8 max-w-3xl`,children:(0,F.jsx)(ht,{})})})]})})},YG=({title:e,titleAccessory:t})=>{let n=We();return(0,F.jsxs)(`header`,{className:`h-16 min-h-16 border-b flex items-center justify-between px-6 bg-white shrink-0`,children:[(0,F.jsxs)(B,{variant:`ghost`,onClick:()=>n(-1),className:`gap-2`,children:[(0,F.jsx)(u_,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Back`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold`,children:e}),t]}),(0,F.jsx)(`div`,{className:`w-[72px]`})]})},Kye=[{to:`feedback`,label:`Feedback`},{to:`faq`,label:`FAQ`}],qye=()=>(0,F.jsx)(IG,{header:(0,F.jsx)(YG,{title:`Help Center`}),children:(0,F.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsxs)(`div`,{className:`max-w-4xl mx-auto`,children:[(0,F.jsxs)(V,{className:`mb-8`,children:[(0,F.jsxs)(Au,{className:`text-center`,children:[(0,F.jsx)(ju,{className:`text-2xl`,children:`Help Center & Support`}),(0,F.jsx)(Mu,{children:`Resources and assistance to help you get the most out of our platform`})]}),(0,F.jsx)(H,{className:`text-center`,children:(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center`,children:[(0,F.jsx)(`div`,{className:`bg-gray-50 rounded-full p-4 mb-4`,children:(0,F.jsx)(lre,{className:`h-10 w-10 text-akito-teal`})}),(0,F.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:`Coming Soon!`}),(0,F.jsxs)(`p`,{className:`text-gray-500 mb-6`,children:[`Our comprehensive help center is currently under development.`,(0,F.jsx)(`br`,{}),`In the meantime, please reach out to our team for assistance.`]}),(0,F.jsxs)(B,{onClick:()=>{window.open(`https://advancerite.io/contact`,`_blank`)},className:`gap-2`,children:[(0,F.jsx)(z_,{className:`h-4 w-4`}),`Contact Our Team`,(0,F.jsx)(O_,{className:`h-4 w-4 ml-1`})]})]})})]}),(0,F.jsx)(zG,{items:[...Kye],className:`grid grid-cols-2 w-[400px] mx-auto mb-6`}),(0,F.jsx)(ht,{})]})})}),Jye=[{to:`conditions`,label:`Terms & Conditions`},{to:`early-access`,label:`About Early Access`}],Yye=()=>(0,F.jsx)(IG,{header:(0,F.jsx)(YG,{title:`Terms & Conditions`,titleAccessory:(0,F.jsx)(mM,{variant:`outline`,className:`bg-amber-100 text-amber-800 border-amber-300`,children:`Early Access Beta`})}),children:(0,F.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsxs)(`div`,{className:`max-w-3xl mx-auto`,children:[(0,F.jsx)(zG,{items:[...Jye],className:`grid w-full max-w-md mx-auto mb-8 grid-cols-2`}),(0,F.jsx)(ht,{})]})})}),XG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,F.jsx)(`table`,{ref:n,className:z(`w-full caption-bottom text-sm`,e),...t})}));XG.displayName=`Table`;var ZG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`thead`,{ref:n,className:z(`[&_tr]:border-b`,e),...t}));ZG.displayName=`TableHeader`;var QG=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tbody`,{ref:n,className:z(`[&_tr:last-child]:border-0`,e),...t}));QG.displayName=`TableBody`;var Xye=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tfoot`,{ref:n,className:z(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));Xye.displayName=`TableFooter`;var $G=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tr`,{ref:n,className:z(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));$G.displayName=`TableRow`;var J=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`th`,{ref:n,className:z(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));J.displayName=`TableHead`;var Y=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`td`,{ref:n,className:z(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));Y.displayName=`TableCell`;var Zye=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`caption`,{ref:n,className:z(`mt-4 text-sm text-muted-foreground`,e),...t}));Zye.displayName=`TableCaption`;var Qye=()=>{let{user:e,profile:t}=_l(),n=Gn(),r=We(),[i,a]=y.useState(!1),[o,s]=y.useState(null),[c,l]=y.useState(null),[u,d]=y.useState(``),[f,p]=y.useState(``),[m,h]=y.useState(null),{data:g}=sr({queryKey:[`applied-job-ids`],queryFn:async()=>
420{if(!e?.id)return[];let{data:t,error:n}=await R.from(`candidates`).select(`job_id`).eq(`user_id`,e.id);if(n)throw n;return(t??[]).map(e=>e.job_id)}}),{data:_,isLoading:v}=sr({queryKey:[`available-jobs`],queryFn:async()=>{try{let{data:e,error:t}=await R.from(`job_listings`).select(`id, title, location, organization_id, organizations(name), created_at, description, requirements, salary_range, skills_required`).eq(`status`,`active`).order(`created_at`,{ascending:!1});if(t)throw t;return console.log(`Available Jobs`,e),(e||[]).map(e=>({...e,organization_name:e.organizations?.name||null}))}catch(e){return console.error(`Error fetching job listings:`,e),[]}},select:e=>g?e.filter(e=>!g.includes(e.id)):e}),b=cr({mutationFn:async({jobId:t,resumeFile:n,coverLetter:r,skillsText:i})=>{console.log(`Starting application mutation for job:`,t,`resumeFile?`,!!n,n?.name);let{data:a}=await R.from(`assessment_links`).select(`link_code`).eq(`job_id`,t).eq(`is_active`,!0).maybeSingle(),o=a?`/assessment/${a.link_code}`:null,s=null;if(n){let e=`candidates_resume`,t=n.name.replace(/[^a-zA-Z0-9._-]/g,`_`),r=`resume/${`${crypto.randomUUID()}_${t}`}`;console.log(`Uploading resume to bucket/path:`,e,r),fl({title:`Uploading resumeâ¦`,description:`Please wait while we upload your file`,duration:1e5});let{data:i,error:a}=await R.storage.from(e).upload(r,n,{contentType:n.type,upsert:!0});if(console.log(`Upload finished. Error?`,a,`Data:`,i),a)throw console.error(`Resume upload error`,a),fl({title:`Upload failed`,description:`Could not upload resume. You can try again later.`,variant:`destructive`}),a;let{data:o}=R.storage.from(e).getPublicUrl(r);s=o.publicUrl,console.log(`Resume uploaded to path:`,r,`publicUrl:`,s,`uploadData:`,i),fl({title:`Resume uploaded`,description:`Your resume was uploaded successfully.`})}else console.log(`No resume file provided; skipping upload.`);let c=i.trim()?`{${i.split(`,`).map(e=>e.trim()).join(`,`)}}`:null,{error:l}=await R.from(`candidates`).insert({job_id:t,user_id:e?.id,status:`inprogress`,remarks:o||``,cover_letter:r||null,skills:c,resume_url:s});if(l)throw l;return o},onSuccess:e=>{e?(fl({title:`Application & Assessment`,description:`Application submitted. An assessment is required. Redirectingâ¦`}),setTimeout(()=>r(e),1e3)):fl({title:`Applied`,description:`Your application has been submitted.`}),n.invalidateQueries({queryKey:[`available-jobs`]}),n.invalidateQueries({queryKey:[`candidates-applied`]}),n.invalidateQueries({queryKey:[`applied-job-ids`]}),a(!1),l(null),d(``),p(``),h(null)},onError:e=>{console.error(`Apply mutation error:`,e),fl({title:`Error`,description:e.message,variant:`destructive`})}});return(0,F.jsxs)(V,{children:[(0,F.jsx)(H,{className:`p-0`,children:v?(0,F.jsx)(`div`,{className:`p-6`,children:`Loadingâ¦`}):_&&_.length?(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Title`}),(0,F.jsx)(J,{children:`Organization`}),(0,F.jsx)(J,{children:`Location`}),(0,F.jsx)(J,{})]})}),(0,F.jsx)(QG,{children:_.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:e.title}),(0,F.jsx)(Y,{children:e.organization_name}),(0,F.jsx)(Y,{children:e.location}),(0,F.jsx)(Y,{children:(0,F.jsx)(B,{size:`sm`,onClick:()=>{console.log(`Apply clicked for job:`,e.id),s(e.id),l(e),a(!0)},disabled:b.isPending,children:`Apply`})})]},e.id))})]}):(0,F.jsx)(`div`,{className:`p-6`,children:`No jobs available.`})}),(0,F.jsx)(aE,{open:i,onOpenChange:a,children:(0,F.jsxs)(cE,{className:`w-[95vw] max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{className:`px-6 pt-6 text-xl`,children:`Confirm Application`})}),c&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6 px-6 pb-6 flex-1 overflow-y-auto`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-semibold text-lg mb-1`,children:c.title}),(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[c.organization_name,` ⢠`,c.location]}),c.description&&(0,F.jsxs)(`div`,{className:`mt-4`,children:[(0,F.jsx)(`h4`,{className:`font-semibold mb-2`,children:`Description`}),(0,F.jsx)(`p`,{className:`text-sm whitespace-pre-line leading-6`,children:c.description})]}),c.requirements&&(0,F.jsxs)(`div`,{className:`mt-4`,children:[(0,F.jsx)(`h4`,{className:`font-semibold mb-2`,children:`Requirements`}),(0,F.jsx)(`p`,{className:`text-sm whitespace-pre-line leading-6`,children:c.requirements})]}),c.skills_required&&c.skills_required.length>0&&(0,F.jsxs)(`div`,{className:`mt-4`,children:[(0,F.jsx)(`h4`,{className:`font-semibold mb-2`,children:`Skills Required`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:c.skills_required.map(e=>(0,F.jsx)(`span`,{className:`bg-gray-100 px-2 py-1 rounded text-xs`,children:e},e))})]}),c.salary_range&&(0,F.jsxs)(`p`,{className:`text-sm mt-2`,children:[`Salary: `,c.salary_range]})]}),(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`font-medium text-sm`,children:`Cover Letter`}),(0,F.jsx)(SC,{value:u,onChange:e=>d(e.target.value),rows:8,className:`min-h-[160px]`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`font-medium text-sm`,children:`Skills (comma separated)`}),(0,F.jsx)(ku,{value:f,onChange:e=>p(e.target.value),placeholder:`e.g. React, TypeScript`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`font-medium text-sm`,children:`Resume (PDF or Doc)`}),(0,F.jsx)(ku,{type:`file`,accept:`application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document`,onChange:e=>{let t=e.target.files?.[0]||null;if(!t){h(null);return}if(!new Set([`application/pdf`,`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`]).has(t.type)){fl
420({title:`Invalid file type`,description:`Please select a PDF or Word document.`,variant:`destructive`}),e.currentTarget.value=``,h(null);return}if(t.size>10*1024*1024){fl({title:`File too large`,description:`Maximum size is 10 MB.`,variant:`destructive`}),e.currentTarget.value=``,h(null);return}h(t)}}),m&&(0,F.jsx)(`p`,{className:`text-xs mt-1`,children:m.name})]})]})]})]}),(0,F.jsxs)(`div`,{className:`px-6 py-4 flex justify-end gap-2 border-t bg-white sticky bottom-0`,children:[(0,F.jsx)(B,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),(0,F.jsx)(B,{onClick:()=>{o&&b.mutate({jobId:o,resumeFile:m,coverLetter:u,skillsText:f})},disabled:b.isPending,children:b.isPending?`Submittingâ¦`:`Confirm`})]})]})})]})},$ye=()=>{let{user:e}=_l(),t=e=>{switch(e){case`selected`:return`bg-green-100 text-green-800`;case`inprogress`:return`bg-yellow-100 text-yellow-800`;case`rejected`:return`bg-red-100 text-red-800`;case`submitted`:return`bg-blue-100 text-blue-800`;default:return`bg-gray-100 text-gray-800`}},{data:n,isLoading:r}=sr({queryKey:[`candidates-applied`],queryFn:async()=>{let{data:t,error:n}=await R.from(`candidates`).select(`id, status, remarks, job_id, job:job_id(title, location, organization_id, organizations(name))`).eq(`user_id`,e?.id??``);if(n)throw n;let r=t??[];if(!r.length)return r;let i=Array.from(new Set(r.map(e=>e.job_id).filter(Boolean))),a=new Map;if(i.length){let{data:e,error:t}=await R.from(`assessment_links`).select(`job_id, link_code, is_active, created_at`).in(`job_id`,i).order(`created_at`,{ascending:!1});t||e?.forEach(e=>{!e.job_id||!e.is_active||a.has(e.job_id)||a.set(e.job_id,e.link_code)})}let o=new Set;if(e?.id){let{data:t}=await R.from(`assessment_submissions`).select(`link_code`).eq(`user_id`,e.id);t?.forEach(e=>{e?.link_code&&o.add(e.link_code)})}return r.map(e=>{let t=e.job_id?a.get(e.job_id)??null:null;return{...e,assessment_link_code:t,assessment_submitted:t?o.has(t):!1}})}});return(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:r?(0,F.jsx)(`div`,{className:`p-6`,children:`Loadingâ¦`}):n&&n.length?(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Title`}),(0,F.jsx)(J,{children:`Organization`}),(0,F.jsx)(J,{children:`Location`}),(0,F.jsx)(J,{children:`Assessment Status`}),(0,F.jsx)(J,{children:`Application Status`})]})}),(0,F.jsx)(QG,{children:n.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:e.job?.title}),(0,F.jsx)(Y,{children:e.job?.organization_name}),(0,F.jsx)(Y,{children:e.job?.location}),(0,F.jsx)(Y,{children:e.assessment_link_code?e.assessment_submitted?(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${t(`submitted`)}`,children:`submitted`}):(0,F.jsx)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,F.jsx)(`a`,{href:`/assessment/${e.assessment_link_code}`,children:`Take Assessment`})}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`N/A`})}),(0,F.jsx)(Y,{children:(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${t(e.status)}`,children:e.status})})]},e.id))})]}):(0,F.jsx)(`div`,{className:`p-6`,children:`You haven't applied to any jobs yet.`})})})},ebe=`Portal`,eK=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);CC(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?b.createPortal((0,F.jsx)(U.div,{...r,ref:t}),o):null});eK.displayName=ebe;var tbe=`DismissableLayer`,tK=`dismissableLayer.update`,nbe=`dismissableLayer.pointerDownOutside`,rbe=`dismissableLayer.focusOutside`,nK,rK=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iK=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(rK),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=bl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=obe(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=sbe(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sw(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(nK=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),aK(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nK)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),aK())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(tK,e),()=>document.removeEventListener(tK,e)},[]),(0,F.jsx)(U.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,C.onFocusCapture),onBlurCapture:K(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,S.onPointerDownCapture)})});iK.displayName=tbe;var ibe=`DismissableLayerBranch`,abe=y.forwardRef((e,t)=>
420{let n=y.useContext(rK),r=y.useRef(null),i=bl(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(U.div,{...e,ref:i})});abe.displayName=ibe;function obe(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){oK(nbe,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sbe(e,t=globalThis?.document){let n=DC(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&oK(rbe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function aK(){let e=new CustomEvent(tK);document.dispatchEvent(e)}function oK(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pu(i,a):i.dispatchEvent(a)}var sK,cK=`HoverCard`,[lK,cbe]=EC(cK,[YD]),uK=YD(),[lbe,dK]=lK(cK),fK=e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:a,openDelay:o=700,closeDelay:s=300}=e,c=uK(t),l=y.useRef(0),u=y.useRef(0),d=y.useRef(!1),f=y.useRef(!1),[p=!1,m]=ow({prop:r,defaultProp:i,onChange:a}),h=y.useCallback(()=>{clearTimeout(u.current),l.current=window.setTimeout(()=>m(!0),o)},[o,m]),g=y.useCallback(()=>{clearTimeout(l.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),s))},[s,m]),_=y.useCallback(()=>m(!1),[m]);return y.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)},[]),(0,F.jsx)(lbe,{scope:t,open:p,onOpenChange:m,onOpen:h,onClose:g,onDismiss:_,hasSelectionRef:d,isPointerDownOnContentRef:f,children:(0,F.jsx)(aO,{...c,children:n})})};fK.displayName=cK;var pK=`HoverCardTrigger`,mK=y.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=dK(pK,n),a=uK(n);return(0,F.jsx)(oO,{asChild:!0,...a,children:(0,F.jsx)(U.a,{"data-state":i.open?`open`:`closed`,...r,ref:t,onPointerEnter:K(e.onPointerEnter,vK(i.onOpen)),onPointerLeave:K(e.onPointerLeave,vK(i.onClose)),onFocus:K(e.onFocus,i.onOpen),onBlur:K(e.onBlur,i.onClose),onTouchStart:K(e.onTouchStart,e=>e.preventDefault())})})});mK.displayName=pK;var hK=`HoverCardPortal`,[ube,dbe]=lK(hK,{forceMount:void 0}),fbe=e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,a=dK(hK,t);return(0,F.jsx)(ube,{scope:t,forceMount:n,children:(0,F.jsx)(wC,{present:n||a.open,children:(0,F.jsx)(eK,{asChild:!0,container:i,children:r})})})};fbe.displayName=hK;var gK=`HoverCardContent`,_K=y.forwardRef((e,t)=>{let n=dbe(gK,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,a=dK(gK,e.__scopeHoverCard);return(0,F.jsx)(wC,{present:r||a.open,children:(0,F.jsx)(pbe,{"data-state":a.open?`open`:`closed`,...i,onPointerEnter:K(e.onPointerEnter,vK(a.onOpen)),onPointerLeave:K(e.onPointerLeave,vK(a.onClose)),ref:t})})});_K.displayName=gK;var pbe=y.forwardRef((e,t)=>{let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,...s}=e,c=dK(gK,n),l=uK(n),u=y.useRef(null),d=bl(t,u),[f,p]=y.useState(!1);return y.useEffect(()=>{if(f){let e=document.body;return sK=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect=`none`,e.style.webkitUserSelect=`none`,()=>{e.style.userSelect=sK,e.style.webkitUserSelect=sK}}},[f]),y.useEffect(()=>{if(u.current){let e=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==``&&(c.hasSelectionRef.current=!0)})};return document.addEventListener(`pointerup`,e),()=>{document.removeEventListener(`pointerup`,e),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),y.useEffect(()=>
420{u.current&&gbe(u.current).forEach(e=>e.setAttribute(`tabindex`,`-1`))}),(0,F.jsx)(iK,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:K(a,e=>{e.preventDefault()}),onDismiss:c.onDismiss,children:(0,F.jsx)(sO,{...l,...s,onPointerDown:K(s.onPointerDown,e=>{e.currentTarget.contains(e.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?`text`:void 0,WebkitUserSelect:f?`text`:void 0,"--radix-hover-card-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-hover-card-content-available-width":`var(--radix-popper-available-width)`,"--radix-hover-card-content-available-height":`var(--radix-popper-available-height)`,"--radix-hover-card-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-hover-card-trigger-height":`var(--radix-popper-anchor-height)`}})})}),mbe=`HoverCardArrow`,hbe=y.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=uK(n);return(0,F.jsx)(cO,{...i,...r,ref:t})});hbe.displayName=mbe;function vK(e){return t=>t.pointerType===`touch`?void 0:e()}function gbe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var _be=fK,vbe=mK,yK=_K,ybe=_be,bbe=vbe,bK=y.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,F.jsx)(yK,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...r}));bK.displayName=yK.displayName;var xK={title:``,description:``,audience:`both`,thumbnail:``,href:``},SK=`https://developers.elementor.com/docs/assets/img/elementor-placeholder-image.png`,CK=()=>{let{user:e,profile:t}=_l(),n=t?.user_type===`admin`,r=t?.user_type===`organization`||t?.user_type===`career_tech`,i=n||r,a=t?.organization_id,[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!1),{toast:f,dismiss:p}=pl(),m=e=>!!(n||r&&e.organization_id===a),h=()=>{s(null),l(null),v?S.reset({title:v.title,description:v.description??``,audience:v.audience,thumbnail:v.thumbnail??``,href:v.href??``}):S.reset(xK)};(0,y.useEffect)(()=>{if(o){let e=URL.createObjectURL(o);return l(e),()=>URL.revokeObjectURL(e)}l(null)},[o]);let[g,_]=(0,y.useState)(!1),[v,b]=(0,y.useState)(null),x=Gn(),S=wB({defaultValues:xK});(0,y.useEffect)(()=>{v?S.reset({title:v.title??``,description:v.description??``,audience:v.audience,thumbnail:v.thumbnail??``,href:v.href??``}):S.reset(xK)},[v]);let{data:C,isLoading:w}=sr({queryKey:[`courses`,n,r,a,t?.user_type],queryFn:async()=>{let{data:e,error:t}=await R.from(`courses`).select(` 421 *, 422 organizations ( 423 name 424 ) 425 `).order(`created_at`,{ascending:!1});if(t)throw t;return e??[]}}),T=cr({mutationFn:async e=>{let t={...e,organization_id:n?null:a},{error:r}=await R.from(`courses`).insert(t);if(r)throw r},onSuccess:()=>{VG(x),x.invalidateQueries({queryKey:[`courses`]}),f({title:`Course created`}),s(null),_(!1)},onError:e=>f({title:`Error`,description:String(e),variant:`destructive`})}),E=cr({mutationFn:async e=>{let{error:t}=await R.from(`courses`).update(e.values).eq(`id`,e.id);if(t)throw t},onSuccess:()=>{VG(x),x.invalidateQueries({queryKey:[`courses`]}),f({title:`Course updated`}),s(null),b(null),_(!1)},onError:e=>f({title:`Error`,description:String(e),variant:`destructive`})}),D=cr({mutationFn:async e=>{let{error:t}=await R.from(`courses`).delete().eq(`id`,e);if(t)throw t},onSuccess:()=>{VG(x),x.invalidateQueries({queryKey:[`courses`]}),f({title:`Course deleted`})},onError:e=>f({title:`Error`,description:String(e),variant:`destructive`})}),O=async e=>{d(!0);let t=f({title:`Uploading imageâ¦`,description:`Please wait`,duration:1e6});try{let t=e.thumbnail;if(o){let e=`akito-images`,n=o.name.replace(/[^a-zA-Z0-9._-]/g,`_`),r=`courses/${`${crypto.randomUUID()}_${n}`}`,{error:i}=await R.storage.from(e).upload(r,o,{contentType:o.type,upsert:!0});if(i)throw i;let{data:a}=R.storage.from(e).getPublicUrl(r);t=a.publicUrl}let n={...e,thumbnail:t};v?E.mutate({id:v.id,values:n}):T.mutate(n)}catch(e){{let n=e?.message||e?.error||String(e);t.update({id:t.id,title:`Upload error`,description:n,variant:`destructive`})}}finally{d(!1),t.update({id:t.id,title:`Upload complete`}),setTimeout(()=>t.dismiss(),2e3)}},k=C?.filter(e=>n?!0:r&&e.organization_id===a)||[],A=C?.filter(e=>r&&e.organization_id!==a)||[];return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Programs`}),i&&(0,F.jsxs)(B,{onClick:()=>{b(null),h(),_(!0)},children:[(0,F.jsx)(V_,{className:`h-4 w-4 mr-2`}),` Add Course`]})]}),w?(0,F.jsx)(`p`,{children:`Loadingâ¦`}):(0,F.jsxs)(F.Fragment,{children:[i&&k.length>0&&(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsx)(`h4`,{className:`text-lg font-semibold`,children:n?`All Courses`:`Your Organization Courses`}),(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Thumbnail`}),(0,F.jsx)(J,{children:`Title`}),(0,F.jsx)(J,{children:`Organization`}),(0,F.jsx)(J,{children:`Audience`}),(0,F.jsx)(J,{children:`Href`}),(0,F.jsx)(J,{children:`Created`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:k.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:(0,F.jsxs)(ybe,{children:[(0,F.jsx)(bbe,{asChild:!0,children:e.thumbnail?(0,F.jsx)(`img`,{src:e.thumbnail,alt:e.title,onError:e=>{e.currentTarget.src=SK},className:`h-10 w-10 object-cover rounded cursor-pointer`}):(0,F.jsx)(`img`,{src:SK,alt:`placeholder`,className:`h-10 w-10 object-cover rounded cursor-pointer`})}),(0,F.jsx)(bK,{className:`p-0 w-auto`,children:(0,F.jsx)(`img`,{src:e.thumbnail||SK,alt:e.title,onError:e=>{e.currentTarget.src=SK},className:`h-56 w-56 object-cover rounded`})})]})}),(0,F.jsx)(Y,{children:e.title}),(0,F.jsx)(Y,{children:e.organizations?.name||(e.organization_id?`Unknown`:`Admin`)}),(0,F.jsx)(Y,{children:e.audience}),(0,F.jsx)(Y,{children:e.href}),(0,F.jsx)(Y,{children:new Date(e.created_at).toLocaleDateString()}),(0,F.jsx)(Y,{className:`space-x-2`,children:m(e)?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>{b(e),h(),_(!0)},children:(0,F.jsx)(B_,{className:`h-4 w-4`})}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>{window.confirm(`Delete course?`)&&D.mutate(e.id)},children:(0,F.jsx)(K_,{className:`h-4 w-4`})})]}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`View only`})})]},e.id))})]})})})]}),(r&&A.length>0||!i&&C&&C.length>0)&&(0,F.jsxs)(`div`,{className:`space-y-3`,children:[r&&(0,F.jsx)(`h4`,{className:`text-lg font-semibold`,children:`Other Courses`}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`,children:(r?A:C||[]).map(e=>(0,F.jsxs)(`div`,{className:`bg-white rounded shadow overflow-hidden`,children:[(0,F.jsx)(`img`,{src:e.thumbnail||SK,alt:e.title,onError:e=>{e.currentTarget.src=SK},onClick:()=>{window.open(e.href,`_blank`)},className:`h-48 w-full object-cover cursor-pointer transition-transform duration-300 hover:scale-105 hover:opacity-80`}),(0,F.jsx)(`div`,{className:`p-2`,children:(0,F.jsx)(`p`,{className:`text-center font-medium truncate`,children:e.title})})]},e.id))})]}),C&&C.length===0&&(0,F.jsx)(`p`,{children:`No programs yet.`})]}),i&&(0,F.jsx)(aE,{open:g,onOpenChange:e=>{_(e),e||(h(),b(null))},children:(0,F.jsxs)(cE,{className:`sm:max-w-[500px]`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:v?`Edit Program`:`Create Program`})}),(0,F.jsx)(TB,{...S,children:(0,F.jsxs)(`form`,{onSubmit:S.handleSubmit(O),className:`space-y-4`,children:[(0,F.jsx)(DB,{control:S.control,name:`title`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Title`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:S.control,name:`description`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Description`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{className:`min-h-[100px]`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:S.control,name:`audience`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Audience`}),(0,F.jsx)(MB,{children:(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border px-3 py-1 text-sm`,...e,children:[(0,F.jsx)(`option`,{value:`job_seeker`,children:`Job Seeker`}),(0,F.jsx)(`option`,{value:`organization`,children:`Employer`}),(0,F.jsx)(`option`,{value:`both`,children:`Both`})]})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:S.control,name:`href`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Link`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(jB,{children:`Thumbnail`}),(0,F.jsxs)(`div`,{className:`flex flex-col items-center space-y-2`,children:[(0,F.jsxs)(`div`,{className:`relative w-32 h-32 rounded overflow-hidden bg-muted flex items-center justify-center`,children:[(0,F.jsx)(`img`,{src:c??v?.thumbnail??SK,alt:`thumbnail preview`,className:`object-cover w-full h-full`}),(c||v?.thumbnail)&&c!==SK&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{s(null),l(null),S.setValue(`thumbnail`,``)},className:`absolute top-1 right-1 p-1 bg-white/80 hover:bg-white rounded-full`,children:(0,F.jsx)(Q_,{className:`h-4 w-4 text-red-500`})})]}),(0,F.jsxs)(`label`,{className:`relative inline-flex items-center justify-center`,children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,className:`curs
425or-pointer`,children:`Browseâ¦`}),(0,F.jsx)(`input`,{type:`file`,accept:`image/*`,className:`absolute inset-0 opacity-0 cursor-pointer`,onChange:e=>s(e.target.files?.[0]??null)})]}),o&&(0,F.jsx)(`p`,{className:`text-xs`,children:o.name})]})]}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>{_(!1),h(),b(null)},children:`Cancel`}),(0,F.jsx)(B,{type:`submit`,disabled:T.isPending||E.isPending,children:v?E.isPending?`Savingâ¦`:`Save Changes`:T.isPending?`Savingâ¦`:`Create`})]})]})})]})})]})},wK=()=>{let[e,t]=(0,y.useState)(!1),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(null),o=Gn(),{toast:s}=pl(),{user:c,profile:l}=_l(),u=l?.organization_id,d=l?.organization_name,f=l?.user_type===`admin`,p=wB({defaultValues:{title:``,description:``,requirements:``,location:``,skills_required:``,status:`active`}}),m=wB({defaultValues:{title:``,description:``,requirements:``,location:``,skills_required:``,status:`active`}}),{data:h,isLoading:g}=sr({queryKey:[`job-listings`,u,f,c?.id],enabled:f||!!c?.id,queryFn:async()=>{try{if(!f&&!c?.id)return console.warn(`SECURITY: Non-admin user has no user_id, returning empty results`),[];let e=R.from(`job_listings`).select(`*, organizations(name)`).order(`created_at`,{ascending:!1});if(!f){if(!c?.id)return console.error(`SECURITY BREACH PREVENTED: Attempted to query jobs without user_id`),[];e=e.eq(`created_by`,c.id)}let{data:t,error:n}=await e;if(n)throw n;return(t||[]).map(e=>({...e,skills_required:e.skills_required||[],organization_name:e.organizations?.name||e.organization_name||null}))}catch(e){return console.error(`Error fetching job listings:`,e),[]}}}),_=cr({mutationFn:async e=>{let t=e.skills_required?e.skills_required.split(`,`).map(e=>e.trim()):[],{data:n,error:r}=await R.from(`job_listings`).insert({title:e.title,description:e.description,requirements:e.requirements,location:e.location,skills_required:t,status:e.status,organization_id:u,created_by:c?.id});if(r)throw r;return VG(o),o.invalidateQueries({queryKey:[`job-listings`]}),n},onSuccess:()=>{VG(o),o.invalidateQueries({queryKey:[`job-listings`]}),s({title:`Job Created`,description:`Your job listing has been created successfully.`}),p.reset(),t(!1)},onError:e=>{s({title:`Error`,description:`Failed to create job: ${e.message}`,variant:`destructive`})}}),v=cr({mutationFn:async e=>{let t=e.skills_required?e.skills_required.split(`,`).map(e=>e.trim()):[],n={title:e.title,description:e.description,requirements:e.requirements,location:e.location,skills_required:t,status:e.status,organization_id:u},r=R.from(`job_listings`).update(n).eq(`id`,e.id);!f&&c?.id&&(r=r.eq(`created_by`,c.id));let{data:i,error:a,count:o}=await r.select();if(a)throw a;if(o===0||!i||i.length===0)throw Error(`Job not found or you don't have permission to edit this job`);return i},onSuccess:()=>{VG(o),o.invalidateQueries({queryKey:[`job-listings`]}),s({title:`Job Updated`,description:`Your job listing has been updated successfully.`}),m.reset(),r(!1),a(null)},onError:e=>{s({title:`Error`,description:`Failed to update job: ${e.message}`,variant:`destructive`})}}),b=cr({mutationFn:async e=>{let{error:t}=await R.functions.invoke(`admin-delete-job`,{body:{job_id:e}});if(t)throw t},onSuccess:()=>{VG(o),o.invalidateQueries({queryKey:[`job-listings`]}),s({title:`Job Deleted`,description:`The job listing has been deleted.`})},onError:e=>{s({title:`Error`,description:`Failed to delete job: ${e.message}`,variant:`destructive`})}}),x=e=>{_.mutate(e)},S=e=>{i&&v.mutate({...e,id:i.id})},C=e=>{a(e),m.reset({title:e.title,description:e.description,requirements:e.requirements,location:e.location,skills_required:e.skills_required?e.skills_required.join(`, `):``,status:e.status}),r(!0)},w=e=>{window.confirm(`Are you sure you want to delete this job posting, it will remove all associated assessment links and submissions?`)&&b.mutate(e)};return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Job Listings`}),(0,F.jsxs)(B,{onClick:()=>t(!0),children:[(0,F.jsx)(V_,{className:`mr-2 h-4 w-4`}),` Add New Job`]})]}),g?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):h&&h.length>0?(0,F.jsx)(F.Fragment,{children:(()=>{let e=f?h.reduce((e,t)=>
425{let n=t.organization_name||`Unknown Organization`;return(e[n]=e[n]||[]).push(t),e},{}):{[d||`Jobs`]:h};return Object.entries(e).map(([e,t])=>(0,F.jsx)(V,{className:`mb-6`,children:(0,F.jsxs)(H,{className:`p-0`,children:[(0,F.jsx)(`div`,{className:`px-4 py-3 border-b bg-gray-50 text-sm font-medium`,children:e}),(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Title`}),(0,F.jsx)(J,{children:`Location`}),(0,F.jsx)(J,{children:`Skills Required`}),(0,F.jsx)(J,{children:`Date Posted`}),(0,F.jsx)(J,{children:`Status`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:t.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.title}),(0,F.jsx)(Y,{children:e.location}),(0,F.jsx)(Y,{children:e.skills_required&&e.skills_required.map((e,t)=>(0,F.jsx)(`span`,{className:`inline-block bg-gray-100 px-2 py-1 rounded text-xs mr-1 mb-1`,children:e},t))}),(0,F.jsx)(Y,{children:hN(new Date(e.created_at),`MMM d, yyyy`)}),(0,F.jsx)(Y,{children:(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${e.status===`active`?`bg-green-100 text-green-800`:e.status===`draft`?`bg-gray-100 text-gray-800`:`bg-yellow-100 text-yellow-800`}`,children:e.status})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex space-x-2`,children:[(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:(0,F.jsx)(B_,{className:`h-4 w-4`})}),f&&(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>w(e.id),children:(0,F.jsx)(K_,{className:`h-4 w-4`})})]})})]},e.id))})]})]})},e))})()}):(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:`No job listings found.`}),(0,F.jsx)(B,{onClick:()=>t(!0),children:`Create Your First Job Posting`})]})}),(0,F.jsx)(aE,{open:e,onOpenChange:t,children:(0,F.jsxs)(cE,{className:`sm:max-w-[600px] max-h-[85vh] overflow-auto`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Create New Job Listing`})}),(0,F.jsx)(TB,{...p,children:(0,F.jsxs)(`form`,{onSubmit:p.handleSubmit(x),className:`space-y-4`,children:[(0,F.jsx)(DB,{control:p.control,name:`title`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Job Title`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`e.g. Senior Software Engineer`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:p.control,name:`location`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Location`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`e.g. Remote, New York, NY`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:p.control,name:`description`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Job Description`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`Describe the role, responsibilities, and team...`,className:`min-h-[120px]`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:p.control,name:`requirements`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Requirements`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`List key qualifications and experience needed...`,className:`min-h-[100px]`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:p.control,name:`skills_required`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Skills Required`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`e.g. React, TypeScript, Node.js`,...e})}),(0,F.jsx)(NB,{children:`Enter skills separated by commas`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:p.control,name:`status`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Status`}),(0,F.jsx)(MB,{children:(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,...e,children:[(0,F.jsx)(`option`,{value:`active`,children:`Active`}),(0,F.jsx)(`option`,{value:`draft`,children:`Draft`}),(0,F.jsx)(`option`,{value:`closed`,children:`Closed`})]})}),(0,F.jsx)(PB,{})]})}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,F.jsx)(B,{type:`submit`,disabled:_.isPending,children:_.isPending?`Creating...`:`Create Job`})]})]})})]})}),(0,F.jsx)(aE,{open:n,onOpenChange:r,children:(0,F.jsxs)(cE,{className:`sm:max-w-[600px] max-h-[85vh] overflow-auto`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Edit Job Listing`})}),(0,F.jsx)(TB,{...m,children:(0,F.jsxs)(`form`,{onSubmit:m.handleSubmit(S),className:`space-y-4`,children:[(0,F.jsx)(DB,{control:m.control,name:`title`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Job Title`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:m.control,name:`location`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Location`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:m.control,name:`description`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Job Description`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{className:`min-h-[120px]`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:m.control,name:`requirements`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Requirements`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{className:`min-h-[100px]`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:m.control,name:`skills_required`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Skills Required`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e})}),(0,F.jsx)(NB,{children:`Enter skills separated by commas`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:m.control,name:`status`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Status`}),(0,F.jsx)(MB,{children:(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,...e,children:[(0,F.jsx)(`option`,{value:`active`,children:`Active`}),(0,F.jsx)(`option`,{value:`draft`,children:`Draft`}),(0,F.jsx)(`option`,{value:`closed`,children:`Closed`})]})}),(0,F.jsx)(PB,{})]})}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>r(!1),children:`Cancel`}),(0,F.jsx)(B,{type:`submit`,disabled:v.isPending,children:v.isPending?`Saving...`:`Save Changes`})]})]})})]})})]})},TK=()=>{let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(`inprogress`),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(`date`),[v,b]=(0,y.useState)(`desc`),[x,S]=(0,y.useState)(`all`),{user:C,profile:w}=_l(),T=Gn(),{toast:E}=pl(),{data:D,isLoading:O}=sr({queryKey:[`candidates`,C?.id,w?.user_type],enabled:w?.user_type===`admin`||w?.user_type===`organization`&&!!C?.id,queryFn:async()=>{try{if(w?.user_type===`organization`&&!C?.id)return console.warn(`SECURITY: Organization user has no user_id, returning empty results`),[];let e=R.from(`candidates`).select(`id, user_id, job_id, resume_url, cover_letter, skills, status, created_at, assessment_score, 426 job_listings!inner ( title, created_by, organization_id, organizations(name) )`).order(`created_at`,{ascending:!1});if(w?.user_type===`organization`){if(!C?.id)return console.error(`SECURITY BREACH PREVENTED: Attempted to query without user_id`),[];e=e.eq(`job_listings.created_by`,C.id)}let{data:t,error:n}=await e;if(console.log(t),n)throw n;let r=t.map(e=>({...e,job_title:e.job_listings?.title||`No Job Specified`,org_name:e.job_listings?.organizations?.name||null,full_name:``,email:null})),i=Array.from(new Set(r.map(e=>e.user_id)));console.log(`Base candidates user IDs:`,i);let a=[];if(w?.user_type===`organization`)if(!C?.id)console.error(`SECURITY: No user_id for organization user, skipping submissions fetch`),a=[];else{let{data:e,error:t}=await R.from(`assessment_links`).select(`link_code, job_listings!inner(id, created_by)`).eq(`job_listings.created_by`,C.id);if(t)console.error(`Error fetching user assessment links:`,t),a=[];else{let t=(e||[]).map(e=>
426e.link_code).filter(Boolean);if(t.length>0){let{data:e,error:n}=await R.from(`assessment_submissions`).select(` 427 user_id, 428 link_code, 429 evaluated_score, 430 total_score, 431 explanation_to_evaluation, 432 questions_data, 433 created_at, 434 profiles!inner(id, full_name) 435 `).in(`link_code`,t);n?(console.warn(`Could not load assessment submissions for user:`,n),a=[]):a=e||[]}}}else{let{data:e,error:t}=await R.from(`assessment_submissions`).select(` 436 user_id, 437 link_code, 438 evaluated_score, 439 total_score, 440 explanation_to_evaluation, 441 questions_data, 442 created_at, 443 profiles!inner(id, full_name) 444 `);t?console.warn(`Could not load assessment submissions for candidates:`,t):a=e||[]}console.log(`Filtered submissions:`,a);let o=new Map,s=new Map;console.log(`ðµ Attempting to fetch user emails via RPC...`);try{let{data:e,error:t}=await R.rpc(`get_all_user_emails`);console.log(`ðµ RPC Response:`,{data:e,error:t}),!t&&e&&Array.isArray(e)?(e.forEach(e=>{e.user_id&&e.user_email&&s.set(e.user_id,e.user_email)}),console.log(`â Fetched emails for`,e.length,`users`)):t?console.error(`â Could not fetch user emails:`,t):console.warn(`â ï¸ Email data is empty or not an array:`,e)}catch(e){console.error(`â Error fetching user emails:`,e)}i.length>0&&(await R.from(`profiles`).select(`id, full_name`).in(`id`,i)).data?.forEach(e=>{e?.id&&o.set(e.id,e.full_name||``)}),a?.forEach(e=>{let t=e?.profiles?.full_name||``;e?.user_id&&t&&o.set(e.user_id,t)}),console.log(`ID to Name map:`,o.size,`entries`),console.log(`ID to Email map:`,s.size,`entries`);let c=a??[],l=Array.from(new Set(c.map(e=>
444e.link_code).filter(Boolean)));console.log(`Link codes from submissions:`,l);let u=new Map,d=new Map;if(l.length>0){let{data:e}=await R.from(`assessment_links`).select(`link_code, job_id, title`).in(`link_code`,l);console.log(`Assessment links data:`,e),e?.forEach(e=>{e.link_code&&e.job_id&&u.set(e.link_code,e.job_id),e.link_code&&e.title&&d.set(e.link_code,e.title)})}console.log(`Link code to Job ID map:`,Object.fromEntries(u));let f=Array.from(new Set(Array.from(u.values()).filter(Boolean))),p=new Map,m=new Map;if(f.length>0){let{data:e}=await R.from(`job_listings`).select(`id, title, organization_id, organizations(name)`).in(`id`,f);e?.forEach(e=>{p.set(e.id,e.title),m.set(e.id,e.organizations?.name??null)})}let h=new Map;c.forEach(e=>{if(!e||!e.user_id||!e.link_code)return;let t=u.get(e.link_code)||null;if(!t)return;let n=`${e.user_id}:${t}:${e.link_code}`,r=null;typeof e.evaluated_score==`number`&&typeof e.total_score==`number`&&e.total_score>0&&(r=Math.round(e.evaluated_score/e.total_score*100));let i=d.get(e.link_code)||null,a=e.questions_data||null;h.set(n,{scorePct:r,explanation:e.explanation_to_evaluation??null,evaluated:e.evaluated_score??null,total:e.total_score??null,linkCode:e.link_code??null,created_at:e.created_at??null,assessmentTitle:i,questionsData:a})});let g=r.map(e=>{let t=e.remarks?.startsWith(`assessment:`)?e.remarks.substring(11):null,n=null;if(t){let r=`${e.user_id}:${e.job_id??``}:${t}`;n=h.get(r)}if(!n){for(let[t,r]of h.entries())if(t.startsWith(`${e.user_id}:${e.job_id??``}:`)){n=r;break}}return{...e,full_name:o.get(e.user_id)||``,email:s.get(e.user_id)||null,assessment_score:n?.scorePct??e.assessment_score??null,assessment_explanation:n?.explanation??null,assessment_evaluated_score:n?.evaluated??null,assessment_total_score:n?.total??null,assessment_link_code:n?.linkCode??t,assessment_title:n?.assessmentTitle??null,questions_data:n?.questionsData??null}}),_=new Map;return g.forEach(e=>{if(e.assessment_link_code){let t=`${e.user_id}:${e.job_id??``}:${e.assessment_link_code}`;_.set(t,!0),console.log(`Marked as existing:`,t)}}),console.log(`Existing submissions count:`,_.size),console.log(`Processing`,c.length,`submission rows for pseudo-candidates`),c.forEach(e=>{if(!e?.user_id||!e?.link_code){console.log(`Skipping row - missing user_id or link_code:`,e);return}let t=u.get(e.link_code||``)||null;if(!t){console.log(`Skipping row - no jobId found for link_code:`,e.link_code);return}let n=`${e.user_id}:${t}:${e.link_code}`;if(_.has(n)){console.log(`Skipping row - already has candidate record:`,n);return}console.log(`Adding pseudo-candidate for:`,n);let r=h.get(n),i=m.get(t)||null;g.push({id:`${e.user_id}-${t}-${e.link_code}`,user_id:e.user_id,job_id:t,full_name:o.get(e.user_id)||``,email:s.get(e.user_id)||null,resume_url:null,cover_letter:null,status:`inprogress`,created_at:r?.created_at||new Date().toISOString(),skills:[],assessment_score:r?.scorePct??null,job_title:p.get(t)||`Unknown Job`,org_name:i,assessment_explanation:r?.explanation??null,assessment_evaluated_score:r?.evaluated??null,assessment_total_score:r?.total??null,assessment_link_code:r?.linkCode??null,assessment_title:r?.assessmentTitle??null,questions_data:r?.questionsData??null}),_.set(n,!0)}),console.log(`Total enriched candidates:`,g.length),console.log(`Final candidate data:`,g.map(e=>({name:e.full_name,email:e.email,job:e.job_title,score:e.assessment_score,link_code:e.assessment_link_code}))),g}catch(e){return console.error(`Error fetching candidates:`,e),[]}}}),k=e=>{t(e),r(!0)},A=e=>{s(e),l(e.status||`inprogress`),a(!0)},j=cr({mutationFn:async()=>{if(!o)return;let e=o.id.split(`-`).length>5;if(console.log(`Updating candidate:`,{id:o.id,isPseudo:e,newStatus:c,user_id:o.user_id,job_id:o.job_id}),e){let e=o.assessment_link_code?`assessment:${o.assessment_link_code}`:null,t=null,n=null;if(e){let r=await R.from(`candidates`).select(`id, remarks`).eq(`user_id`,o.user_id).eq(`job_id`,o.job_id).eq(`remarks`,e).maybeSingle();t=r.data,n=r.error}if(!t&&e){let e=await R.from(`candidates`).select(`id, remarks`).eq(`user_id`,o.user_id).eq(`job_id`,o.job_id).or(`remarks.is.null,remarks.not.like.assessment:%`);e.data&&e.data.length>0&&console.log(`Found candidates without markers:`,e.data),t=null,n=e.error}if(n)throw n;if(console.log(`Pseudo-candidate existing record:`,t,`linkCodeMarker:`,e),t){let{data:n,error:r}=await R.from(`candidates`).update({status:c,remarks:e}).eq(`id`,t.id).select();if(console.log(`Update result:`,{data:n,error:r}),r)throw r}else{let{data:t,error:n}=await R.from(`candidates`).insert({user_id:o.user_id,job_id:o.job_id,status:c,resume_url:o.resume_url,cover_letter:o.cover_letter,skills:o.skills||[],assessment_score:o.assessment_score,remarks:e}).select();if(console.log(`Insert result:`,{data:t,error:n}),n)throw n}}else{let{data:e,error:t}=await R.from(`candidates`).update({status:c}).eq(`id`,o.id).select();if(console.log(`Real candidate update result:`,{data:e,error:t}),t)throw t}},onSuccess:()=>{E({title:`Candidate updated`,description:`Status has been updated.`}
444),T.invalidateQueries({queryKey:[`candidates`,w?.organization_id,w?.user_type]}),a(!1),s(null)},onError:e=>{E({title:`Update failed`,description:String(e),variant:`destructive`})}}),M=()=>{if(!D||D.length===0){E({title:`No data`,description:`No candidates to export.`,variant:`destructive`});return}let e=[`Full Name`,`Email`,`Job Title`,`Assessment Title`,`Assessment Score`,`Status`,`Applied Date`],t=D.map(e=>[e.full_name||`N/A`,e.email||`N/A`,e.job_title||`N/A`,e.assessment_title||`N/A`,e.assessment_score===null?`Not assessed`:`${e.assessment_score}%`,e.status||`N/A`,hN(new Date(e.created_at),`MMM d, yyyy`)]),n=[e.join(`,`),...t.map(e=>e.map(e=>`"${String(e).replace(/"/g,`""`)}"`).join(`,`))].join(` 445`),r=new Blob([n],{type:`text/csv;charset=utf-8;`}),i=document.createElement(`a`),a=URL.createObjectURL(r);i.setAttribute(`href`,a),i.setAttribute(`download`,`candidates_export_${hN(new Date,`yyyy-MM-dd_HH-mm`)}.csv`),i.style.visibility=`hidden`,document.body.appendChild(i),i.click(),document.body.removeChild(i),E({title:`Export successful`,description:`Exported ${D.length} candidate records.`})},N=y.useMemo(()=>{if(!D)return[];let e=new Set(D.map(e=>e.assessment_title||e.job_title).filter(Boolean));return Array.from(e).sort()},[D]),ee=y.useMemo(()=>{if(!D)return[];let e=D;return x!==`all`&&(e=D.filter(e=>(e.assessment_title||e.job_title)===x)),[...e].sort((e,t)=>{let n=0;switch(g){case`name`:n=(e.full_name||``).localeCompare(t.full_name||``);break;case`score`:n=(e.assessment_score||0)-(t.assessment_score||0);break;case`date`:n=new Date(e.created_at).getTime()-new Date(t.created_at).getTime();break}return v===`asc`?n:-n})},[D,x,g,v]),te=async e=>{try{if(p(null),h(!0),d(!0),!e?.assessment_link_code){h(!1),p(null),E({title:`No snapshot`,description:`No assessment link found for this candidate.`,variant:`destructive`});return}let{data:t,error:n}=await R.from(`assessment_submissions`).select(`submission_snapshot`).eq(`user_id`,e.user_id).eq(`link_code`,e.assessment_link_code).maybeSingle();if(n)console.error(`Error fetching submission snapshot:`,n),E({title:`Error`,description:`Could not load submission snapshot.`,variant:`destructive`}),p(null);else{let e=t&&t.submission_snapshot!==void 0&&t.submission_snapshot!==null?String(t.submission_snapshot):null;p(e),e||E({title:`No snapshot`,description:`No submission snapshot was found for this candidate.`})}}finally{h(!1)}},ne=e=>{switch(e.toLowerCase()){case`inprogress`:return`bg-blue-100 text-blue-800`;case`selected`:return`bg-green-600 text-green-800`;case`rejected`:return`bg-red-100 text-red-800`;default:return`bg-gray-100 text-gray-800`}};return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`h3`,{className:`text-xl font-semibold`,children:`Candidate Management`}),(0,F.jsxs)(B,{onClick:M,variant:`outline`,className:`flex items-center gap-2`,disabled:!D||D.length===0,children:[(0,F.jsx)(D_,{className:`h-4 w-4`}),`Export to CSV`]})]}),D&&D.length>0&&(0,F.jsxs)(`div`,{className:`flex gap-4 items-end flex-wrap`,children:[(0,F.jsxs)(`div`,{className:`flex-1 min-w-[200px]`,children:[(0,F.jsx)(zu,{htmlFor:`filter-assessment`,className:`text-sm font-medium mb-2 block`,children:`Filter by Assessment/Job`}),(0,F.jsxs)(Tk,{value:x,onValueChange:S,children:[(0,F.jsx)(Dk,{id:`filter-assessment`,children:(0,F.jsx)(Ek,{placeholder:`All Assessments`})}),(0,F.jsxs)(Ak,{children:[(0,F.jsx)(jk,{value:`all`,children:`All Assessments`}),N.map(e=>(0,F.jsx)(jk,{value:e,children:e},e))]})]})]}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-[200px]`,children:[(0,F.jsx)(zu,{htmlFor:`sort-by`,className:`text-sm font-medium mb-2 block`,children:`Sort by`}),(0,F.jsxs)(Tk,{value:g,onValueChange:e=>_(e),children:[(0,F.jsx)(Dk,{id:`sort-by`,children:(0,F.jsx)(Ek,{})}),(0,F.jsxs)(Ak,{children:[(0,F.jsx)(jk,{value:`name`,children:`Name`}),(0,F.jsx)(jk,{value:`score`,children:`Score`}),(0,F.jsx)(jk,{value:`date`,children:`Date`})]})]})]}),(0,F.jsx)(B,{variant:`outline`,size:`icon`,onClick:()=>b(v===`asc`?`desc`:`asc`),title:`Sort ${v===`asc`?`Descending`:`Ascending`}`,children:(0,F.jsx)(Xne,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Showing `,ee.length,` of `,D.length,` candidates`]})]}),O?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):ee&&ee.length>0?(0,F.jsx)(F.Fragment,{children:(()=>{let e=w?.user_type===`admin`?ee.reduce((e,t)=>
445{let n=t.org_name||`Unknown Organization`;return(e[n]=e[n]||[]).push(t),e},{}):{[w?.organization_name||`Your Organization`]:ee};return Object.entries(e).map(([e,t])=>{let n=t.reduce((e,t)=>{let n=t.job_title||`No Job Specified`;return(e[n]=e[n]||[]).push(t),e},{});return(0,F.jsx)(V,{className:`mb-6`,children:(0,F.jsxs)(H,{className:`p-6`,children:[(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(`h4`,{className:`text-lg font-semibold`,children:e}),(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[t.length,` total submission`,t.length===1?``:`s`]})]}),(0,F.jsx)(uP,{type:`multiple`,className:`w-full`,children:Object.entries(n).map(([e,t])=>(0,F.jsxs)(dP,{value:e,children:[(0,F.jsx)(fP,{className:`hover:no-underline`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between w-full pr-4`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[t.length,` submission`,t.length===1?``:`s`]})]})}),(0,F.jsx)(pP,{children:(0,F.jsx)(`div`,{className:`pt-4`,children:(()=>{let e=t.reduce((e,t)=>{let n=t.user_id||`unknown`;return(e[n]=e[n]||[]).push(t),e},{});return(0,F.jsx)(uP,{type:`multiple`,className:`w-full space-y-2`,children:Object.entries(e).map(([e,t])=>{let n=t.length>1,r=t[0];return(0,F.jsx)(dP,{value:e,className:n?`border rounded-lg`:`border-0`,children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(fP,{className:`hover:no-underline px-4`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between w-full pr-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,children:r.full_name||`Unknown`}),r.email&&(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:r.email})]}),(0,F.jsxs)(`span`,{className:`text-xs px-2 py-1 bg-purple-100 text-purple-700 rounded`,children:[t.length,` submissions`]})]}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Avg:`,` `,Math.round(t.reduce((e,t)=>e+(t.assessment_score||0),0)/t.length),`%`]})]})}),(0,F.jsx)(pP,{children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Assessment Name`}),(0,F.jsx)(J,{children:`Skills`}),(0,F.jsx)(J,{children:`Assessment Score`}),(0,F.jsx)(J,{children:`Evaluation Explanation`}),(0,F.jsx)(J,{children:`Status`}),(0,F.jsx)(J,{children:`Applied Date`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:t.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:(0,F.jsx)(`div`,{className:`max-w-[200px]`,children:e.assessment_title?(0,F.jsx)(`span`,{className:`text-sm font-medium`,children:e.assessment_title}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`â`})})}),(0,F.jsx)(Y,{children:e.skills&&e.skills.map((e,t)=>(0,F.jsx)(`span`,{className:`inline-block bg-gray-100 px-2 py-1 rounded text-xs mr-1 mb-1`,children:e},t))}),(0,F.jsx)(Y,{children:e.assessment_score===null?(0,F.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Not assessed`}):(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`${e.assessment_score>=75?`text-green-600`:e.assessment_score>=50?`text-yellow-600`:`text-red-600`} font-medium`,children:[e.assessment_score,`%`]}),e.assessment_evaluated_score!==null&&e.assessment_total_score!==null&&(0,F.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`(`,e.assessment_evaluated_score,`/`,e.assessment_total_score,`)`]})]})}),(0,F.jsx)(Y,{className:`max-w-[320px] truncate text-sm text-muted-foreground`,children:e.assessment_explanation??`â`}),(0,F.jsx)(Y,{children:(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${ne(e.status||``)}`,children:e.status})}),(0,F.jsx)(Y,{className:`text-sm`,children:hN(new Date(e.created_at),`MMM d, yyyy`)}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>k(e),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),` `,`View`]}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>A(e),children:`Edit`})]})})]},e.id))})]})})]}):(0,F.jsx)(`div`,{className:`border-0`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Candidate`}),(0,F.jsx)(J,{children:`Assessment Name`}),(0,F.jsx)(J,{children:`Skills`}),(0,F.jsx)(J,{children:`Assessment Score`}),(0,F.jsx)(J,{children:`Evaluation Explanation`}),(0,F.jsx)(J,{children:`Status`}),(0,F.jsx)(J,{children:`Applied Date`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:t.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{children:e.full_name||`â`}),e.email&&(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.email})]})}),(0,F.jsx)(Y,{children:(0,F.jsx)(`div`,{className:`max-w-[200px]`,children:e.assessment_title?(0,F.jsx)(`span`,{className:`text-sm`,children:e.assessment_title}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`â`})})}),(0,F.jsx)(Y,{children:e.skills&&e.skills.map((e,t)=>(0,F.jsx)(`span`,{className:`inline-block bg-gray-100 px-2 py-1 rounded text-xs mr-1 mb-1`,children:e},t))}),(0,F.jsx)(Y,{children:e.assessment_score===null?(0,F.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Not assessed`}):(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`${e.assessment_score>=75?`text-green-600`:e.assessment_score>=50?`text-yellow-600`:`text-red-600`} font-medium`,children:[e.assessment_score,`%`]}),e.assessment_evaluated_score!==null&&e.assessment_total_score!==null&&(0,F.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`(`,e.assessment_evaluated_score,`/`,e.assessment_total_score,`)`]})]})}),(0,F.jsx)(Y,{className:`max-w-[320px] truncate text-sm text-muted-foreground`,children:e.assessment_explanation??`â`}),(0,F.jsx)(Y,{children:(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${ne(e.status||``)}`,children:e.status})}),(0,F.jsx)(Y,{className:`text-sm`,children:hN(new Date(e.created_at),`MM
445M d, yyyy`)}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>k(e),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),` View`]}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>A(e),children:`Edit`})]})})]},e.id))})]})})},e)})})})()})})]},e))})]})},e)})})()}):(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:`No candidates have applied yet.`}),(0,F.jsx)(`p`,{className:`text-sm text-center max-w-md`,children:`Create job listings and assessment links to start receiving candidates.`})]})}),(0,F.jsx)(aE,{open:n,onOpenChange:r,children:(0,F.jsxs)(cE,{className:`sm:max-w-[800px] max-h-[85vh] overflow-auto`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Candidate Profile`})}),e&&(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(`div`,{className:`rounded-md border bg-gray-50 p-4`,children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Candidate`}),(0,F.jsx)(`div`,{className:`text-base font-medium`,children:e.full_name}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.email})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Applied For`}),(0,F.jsx)(`div`,{className:`text-base`,children:e.job_title})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${ne(e.status||``)}`,children:[` `,e.status,` `]}),(0,F.jsx)(`span`,{className:`inline-block px-2 py-1 rounded text-xs ${e.assessment_score===null?`bg-gray-100 text-gray-800`:e.assessment_score>=75?`bg-green-100 text-green-800`:e.assessment_score>=50?`bg-yellow-100 text-yellow-800`:`bg-red-100 text-red-800`}`,children:e.assessment_score===null?`Not assessed`:`${e.assessment_score}%`})]}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:hN(new Date(e.created_at),`MMMM d, yyyy`)})]})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Skills`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.skills&&e.skills.map((e,t)=>(0,F.jsx)(`span`,{className:`bg-gray-100 px-3 py-1 rounded-full text-sm`,children:e},t)),(!e.skills||e.skills.length===0)&&(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`â`})]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Resume`}),e.resume_url?(0,F.jsx)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,F.jsx)(`a`,{href:e.resume_url,target:`_blank`,rel:`noopener noreferrer`,children:`View Resume`})}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No resume provided`})]}),e.assessment_title&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Assessment`}),(0,F.jsx)(`div`,{className:`text-sm`,children:e.assessment_title})]}),e.cover_letter&&(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Cover Letter`}),(0,F.jsx)(`div`,{className:`bg-gray-50 p-4 rounded border text-sm max-h-[200px] overflow-y-auto`,children:(0,F.jsx)(`p`,{className:`whitespace-pre-line`,children:e.cover_letter})})]}),e.questions_data&&e.questions_data.length>0?(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-3`,children:`Per-Question Evaluation`}),(0,F.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto space-y-3`,children:e.questions_data.map((e,t)=>{let n=e.result/e.max_points*100,r=n===100,i=n>0&&n<100,a=r?`bg-green-100 text-green-800 border-green-300`:i?`bg-yellow-100 text-yellow-800 border-yellow-300`:`bg-red-100 text-red-800 border-red-300`,o=r?`â Correct`:i?`â Partial`:`â Incorrect`;return(0,F.jsxs)(`div`,{className:`border rounded-lg p-3 bg-white hover:shadow-sm transition-shadow`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-xs font-bold text-gray-700 bg-gray-100 px-2 py-1 rounded`,children:[`Q`,e.question_number]}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-700 rounded border border-blue-200`,children:{mcq:`MCQ`,"multi-select":`Multi-Select`,"short-q":`Short Answer`,"long-q":`Long Answer`}[e.type]||e.type}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 rounded border font-medium ${a}`,children:o})]}),(0,F.jsxs)(`span`,{className:`text-xs font-semibold text-gray-700`,children:[e.result.toFixed(1),` / `,e.max_points]})]}),(0,F.jsx)(`p`,{className:`text-xs text-gray-700 leading-relaxed`,children:e.explanation})]},t)})})]}):e.assessment_explanation?(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Evaluation Explanation`}),(0,F.jsx)(`div`,{className:`bg-gray-50 p-4 rounded border text-sm max-h-[240px] overflow-y-auto whitespace-pre-wrap`,children:e.assessment_explanation})]}):null,e.assessment_link_code&&(0,F.jsxs)(`div`,{className:`col-span-2`,children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`User's Completed Solution`}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`code`,{className:`bg-gray-100 px-2 py-1 rounded text-xs break-all`,children:`${window.location.origin}
445/assessment/${e.assessment_link_code}`}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>te(e),children:`View Solution`})]})]})]}),(0,F.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,F.jsx)(B,{variant:`outline`,onClick:()=>r(!1),children:`Close`})})]})]})}),(0,F.jsx)(aE,{open:u,onOpenChange:d,children:(0,F.jsx)(cE,{className:`sm:max-w-[900px] max-h-[80vh] overflow-auto`,children:m?(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading snapshotâ¦`}):f?(0,F.jsx)(`div`,{className:`border rounded p-2`,children:(0,F.jsx)(`iframe`,{title:`submission-snapshot`,srcDoc:f,className:`w-full h-[70vh] border-0`})}):(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No snapshot available.`})})}),(0,F.jsx)(aE,{open:i,onOpenChange:a,children:(0,F.jsxs)(cE,{className:`sm:max-w-[500px]`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Edit Candidate`})}),o&&(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(zu,{className:`mb-1 inline-block`,children:`Status`}),(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,value:c,onChange:e=>l(e.target.value),children:[(0,F.jsx)(`option`,{value:`inprogress`,children:`In Progress`}),(0,F.jsx)(`option`,{value:`selected`,children:`Selected`}),(0,F.jsx)(`option`,{value:`rejected`,children:`Rejected`})]})]}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(B,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),(0,F.jsx)(B,{onClick:()=>j.mutate(),disabled:j.isPending,children:j.isPending?`Savingâ¦`:`Save Changes`})]})]})]})})]})},EK=()=>{let[e,t]=(0,y.useState)(!1),n=Gn(),{toast:r}=pl(),{user:i,profile:a}=_l();a?.organization_id;let o=a?.user_type===`admin`,s=wB({defaultValues:{job_id:``,expires_days:`30`}}),{data:c}=sr({queryKey:[`job-listings-active`,i?.id,o],enabled:o||!!i?.id,queryFn:async()=>{try{if(console.log(`ð [AssessmentLinks] Fetching jobs dropdown`),console.log(` user?.id:`,i?.id),console.log(` isAdmin:`,o),console.log(` profile?.user_type:`,a?.user_type),!o&&!i?.id)return console.warn(`â ï¸ SECURITY: Non-admin user has no user_id, returning empty results`),[];let e=R.from(`job_listings`).select(`id, title`).eq(`status`,`active`).order(`title`);if(o)console.log(` ð Admin: Fetching all jobs`);else{if(!i?.id)return console.error(`ð¨ SECURITY BREACH PREVENTED: Attempted to query jobs without user_id`),[];console.log(` ð Filtering by created_by:`,i.id),e=e.eq(`created_by`,i.id)}let{data:t,error:n}=await e;if(n)throw console.error(`â Error fetching job listings:`,n),n;return console.log(`â Jobs fetched:`,t?.length||0),t||[]}catch(e){return console.error(`Error fetching job listings:`,e),[]}}}),{data:l,isLoading:u}=sr({queryKey:[`assessment-links`,i?.id,o],enabled:o||!!i?.id,queryFn:async()=>{try{if(!o&&!i?.id)return console.warn(`SECURITY: Non-admin user has no user_id, returning empty results`),[];let e=R.from(`assessment_links`).select(` 446 id, 447 job_id, 448 link_code, 449 title, 450 created_at, 451 expires_at, 452 link_metrics:assessment_link_metrics!assessment_link_metrics_assessment_link_id_fkey ( 453 clicks, 454 submissions 455 ), 456 job_listings!inner ( 457 title, 458 created_by, 459 organization_id, 460 organizations ( 461 name 462 ) 463 ) 464 `).order(`created_at`,{ascending:!1});if(!o){if(!i?.id)return console.error(`SECURITY BREACH PREVENTED: Attempted to query assessment links without user_id`),[];e=e.eq(`job_listings.created_by`,i.id)}let{data:t,error:n}=await e;if(n)throw n;return(t??[]).map(e=>({id:e.id,job_id:e.job_id,link_code:e.link_code,title:e.title||`Untitled Assessment`,created_at:e.created_at,expires_at:e.expires_at,clicks:e.link_metrics?.clicks??0,submissions:e.link_metrics?.submissions??0,job_title:e.job_listings?.title||`Unknown Job`,org_name:e.job_listings?.organizations?.name||null}))}catch(e){return console.error(`Error fetching assessment links:`,e),[]}}}),d=cr({mutationFn:async e=>{let t=Math.random().toString(36).substring(2,10),n=new Date;n.setDate(n.getDate()+parseInt(e.expires_days));let{data:r,error:i}=await R.from(`assessment_links`).insert({job_id:e.job_id,link_code:t,expires_at:n.toISOString(),clicks:0,submissions:0});if(i)throw i;return r},onSuccess:()=>{n.invalidateQueries({queryKey:[`assessment-links`]}),VG(n),r({title:`Assessment Link Created`,description:`Your assessment link has been created successfully.`}),s.reset(),t(!1)},onError:e=>{r({title:`Error`,description:`Failed to create assessment link: ${e.message}`,variant:`destructive`})}}),f=cr({mutationFn:async e=>{let{error:t}=await R.from(`assessment_links`).delete().eq(`id`,e);if(t)throw t},onSuccess:()=>{n.invalidateQueries({queryKey:[`assessment-links`]}),VG(n),r({title:`Link Deleted`,description:`The assessment link has been deleted.`})},onError:e=>{r({title:`Error`,description:`Failed to delete link: ${e.message}`,variant:`destructive`})}}),p=e=>{d.mutate(e)},m=e=>{window.confirm(`Are you sure you want to delete this assessment link?`)&&f.mutate(e)},h=e=>{let t=`${window.location.origin}/assessment/${e}`;navigator.clipboard.writeText(t),r({title:`Link Copied`,description:`Assessment link has been copied to clipboard.`})},g=e=>e?new Date(e)<new Date:!1;return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[u?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):l&&l.length>0?(0,F.jsx)(F.Fragment,{children:(()=>{let e=o?l.reduce((e,t)=>
464{let n=t.org_name||`Unknown Organization`;return(e[n]=e[n]||[]).push(t),e},{}):{[a?.organization_name||`Assessment Links`]:l};return Object.entries(e).map(([e,t])=>(0,F.jsx)(V,{className:`mb-6`,children:(0,F.jsxs)(H,{className:`p-0`,children:[(0,F.jsx)(`div`,{className:`px-4 py-3 border-b bg-gray-50 text-sm font-medium`,children:e}),(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Assessment Title`}),(0,F.jsx)(J,{children:`Link Code`}),(0,F.jsx)(J,{children:`Created`}),(0,F.jsx)(J,{children:`Expires`}),(0,F.jsx)(J,{children:`Stats`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:t.map(e=>(0,F.jsxs)($G,{className:g(e.expires_at)?`bg-gray-50`:``,children:[(0,F.jsxs)(Y,{children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,F.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[`Job: `,e.job_title]})]}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,F.jsx)(`code`,{className:`bg-gray-100 p-1 rounded text-xs`,children:e.link_code}),(0,F.jsx)(B,{variant:`ghost`,size:`icon`,onClick:()=>h(e.link_code),children:(0,F.jsx)(P_,{className:`h-4 w-4`})})]})}),(0,F.jsx)(Y,{children:hN(new Date(e.created_at),`MMM d, yyyy`)}),(0,F.jsx)(Y,{children:e.expires_at?(0,F.jsxs)(`span`,{className:g(e.expires_at)?`text-red-500`:``,children:[hN(new Date(e.expires_at),`MMM d, yyyy`),g(e.expires_at)&&` (Expired)`]}):`Never`}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`text-xs`,children:[(0,F.jsxs)(`div`,{children:[`Clicks: `,e.clicks]}),(0,F.jsxs)(`div`,{children:[`Submissions: `,e.submissions]})]})}),(0,F.jsx)(Y,{children:(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>m(e.id),children:(0,F.jsx)(K_,{className:`h-4 w-4`})})})]},e.id))})]})]})},e))})()}):(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`flex flex-col items-center justify-center py-12`,children:(0,F.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:`No assessment links found.`})})}),(0,F.jsx)(aE,{open:e,onOpenChange:t,children:(0,F.jsxs)(cE,{className:`sm:max-w-[500px]`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Create Assessment Link`})}),(0,F.jsx)(TB,{...s,children:(0,F.jsxs)(`form`,{onSubmit:s.handleSubmit(p),className:`space-y-4`,children:[(0,F.jsx)(DB,{control:s.control,name:`job_id`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Select Job`}),(0,F.jsx)(MB,{children:(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,...e,children:[(0,F.jsx)(`option`,{value:``,children:`Select a job position...`}),c?.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.title},e.id))]})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`expires_days`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Expire After (Days)`}),(0,F.jsx)(MB,{children:(0,F.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,...e,children:[(0,F.jsx)(`option`,{value:`7`,children:`7 days`}),(0,F.jsx)(`option`,{value:`14`,children:`14 days`}),(0,F.jsx)(`option`,{value:`30`,children:`30 days`}),(0,F.jsx)(`option`,{value:`60`,children:`60 days`}),(0,F.jsx)(`option`,{value:`90`,children:`90 days`}),(0,F.jsx)(`option`,{value:`0`,children:`Never expires`})]})}),(0,F.jsx)(NB,{children:`How long this assessment link will remain active`}),(0,F.jsx)(PB,{})]})}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,F.jsx)(B,{type:`submit`,disabled:d.isPending,children:d.isPending?`Creating...`:`Create Link`})]})]})})]})})]})},DK=[`#0088FE`,`#00C49F`,`#FFBB28`,`#FF8042`,`#8884d8`];
464function xbe(e,t){return e===null||t===null||t===0?`0%`:`${Math.min(Math.round(e/t*100),100)}%`}function Sbe(e,t){return e===null||t===null||t===0?0:Math.min(Math.round(e/t*100),100)}function Cbe(e,t){if(e===null||t===null||t===0)return`bg-green-500`;let n=e/t*100;return n>=90?`bg-red-500`:n>=75?`bg-amber-500`:`bg-green-500`}function wbe(e,t){let n=e.length,r=e.reduce((e,t)=>e+(t.tokens_used||0),0),i=n>0?Math.round(r/n):0,a={};e.forEach(e=>{a[e.user_type]=(a[e.user_type]||0)+1});let o=Object.entries(a).map(([e,t])=>({name:e,value:t})),s={};return e.forEach(e=>{s[e.user_type]=(s[e.user_type]||0)+(e.tokens_used||0)}),{totalUsers:n,totalTokensUsed:r,avgTokensPerUser:i,userTypeDistribution:o,tokenUsageByType:Object.entries(s).map(([e,t])=>({name:e,tokens:t})),dailyActiveUsers:t||Array.from({length:7}).map((e,t)=>{let r=new Date;return r.setDate(r.getDate()-(6-t)),{date:r.toISOString().split(`T`)[0],count:Math.floor(n*.8*Math.random())+Math.ceil(n*.1)}})}}function OK(){let{session:e}=_l();return sr({queryKey:[`admin-user-analytics`],queryFn:async()=>{let{data:t,error:n}=await R.from(`profiles`).select(`*`);if(n)throw n;let r=await R.functions.invoke(`admin-get-user-emails`,{method:`POST`,headers:{Authorization:`Bearer ${e?.access_token}`},body:{}});if(r.error)throw console.error(`Error fetching user emails:`,r.error),Error(`Failed to fetch user emails`);let i=r.data?.users||[],a=new Map,o=new Map;return i.forEach(e=>{a.set(e.id,e.email),o.set(e.id,e.last_sign_in_at)}),t.map(e=>({id:e.id,full_name:e.full_name,email:a.get(e.id)||`No email found`,user_type:e.user_type,tokens_used:e.tokens_used,tokens_limit:e.tokens_limit,created_at:e.created_at,last_sign_in_at:o.get(e.id)??null}))},enabled:!!e?.access_token})}var Tbe=({open:e,onOpenChange:t,tokenAdjustmentData:n,setTokenAdjustmentData:r,accessToken:i,onSuccess:a})=>{let o=cr({mutationFn:async e=>{let t=await R.functions.invoke(`admin-update-user-tokens`,{method:`POST`,headers:{Authorization:`Bearer ${i}`},body:{userId:e.userId,tokenAdjustment:e.tokenAdjustment,adjustmentType:e.adjustmentType}});if(t.error)throw Error(`Failed to adjust tokens: ${t.error.message}`);return t.data},onSuccess:()=>{fl({title:`Tokens updated successfully`,description:`The user's tokens have been updated.`}),t(!1),r(null),a()},onError:e=>{fl({title:`Failed to update tokens`,description:`${e}`,variant:`destructive`})}});return(0,F.jsx)(aE,{open:e,onOpenChange:t,children:(0,F.jsxs)(cE,{className:`sm:max-w-[425px]`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:n?.adjustmentType===`add_limit`?`Add Tokens to Limit`:n?.adjustmentType===`reset_usage`?`Reset Token Usage`:`Set Token Limit`}),(0,F.jsxs)(fE,{children:[n?.userName||`User`,` (`,n?.userEmail,`)`]})]}),(0,F.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsx)(zu,{htmlFor:`adjustment-type`,className:`text-right`,children:`Action`}),(0,F.jsxs)(fG,{className:`col-span-3`,value:n?.adjustmentType,onValueChange:e=>r(t=>t?{...t,adjustmentType:e}:null),children:[(0,F.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,F.jsx)(pG,{value:`add_limit`,id:`add_limit`}),(0,F.jsx)(zu,{htmlFor:`add_limit`,children:`Add to token limit`})]}),(0,F.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,F.jsx)(pG,{value:`reset_usage`,id:`reset_usage`}),(0,F.jsx)(zu,{htmlFor:`reset_usage`,children:`Reset usage amount`})]}),(0,F.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,F.jsx)(pG,{value:`set_limit`,id:`set_limit`}),(0,F.jsx)(zu,{htmlFor:`set_limit`,children:`Set absolute limit`})]})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,F.jsx)(zu,{htmlFor:`token-amount`,className:`text-right`,children:`Amount`}),(0,F.jsx)(ku,{id:`token-amount`,type:`number`,className:`col-span-3`,value:n?.tokenAdjustment??``,onChange:e=>r(t=>t?{...t,tokenAdjustment:parseInt(e.target.value,10)||0}:null)})]})]}),(0,F.jsx)(uE,{children:(0,F.jsx)(B,{type:`submit`,onClick:()=>{if(!n||!n.tokenAdjustment){fl({title:`Invalid input`,description:`Please enter a valid token adjustment amount.`,variant:`destructive`});return}o.mutate(n)},disabled:o.isPending,children:o.isPending?`Processing...`:`Save changes`})})]})})},Ebe=()=>{let{session:e}=_l(),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),{data:a,isLoading:o,refetch:s}=OK(),c=(e,t)=>{n({userId:e.id,userName:e.full_name,userEmail:e.email,tokenAdjustment:t===`reset_usage`?e.tokens_used||0:1e4,adjustmentType:t}),i(!0)};return o?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`User Token Usage`}),(0,F.jsx)(Mu,{children:`Track token consumption by individual users`})]}),(0,F.jsx)(H,{children:a?.length===0?(0,F.jsxs)(`div`,{className:`py-6 text-center text-muted-foreground`,children:[(0,F.jsx)(y_,{className:`mx-auto h-8 w-8 text-muted-foreground mb-2`}),(0,F.jsx)(`p`,{children:`No user data available.`})]}):(0,F.jsx)(`div`,{className:`rounded-md border`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`N
464ame`}),(0,F.jsx)(J,{children:`Email`}),(0,F.jsx)(J,{children:`User Type`}),(0,F.jsx)(J,{children:`Token Usage`}),(0,F.jsx)(J,{className:`text-right`,children:`Usage %`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:a?.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.full_name||`Unnamed User`}),(0,F.jsx)(Y,{children:e.email}),(0,F.jsx)(Y,{children:(0,F.jsx)(`span`,{className:`capitalize`,children:e.user_type})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`w-full`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between text-xs mb-1`,children:[(0,F.jsx)(`span`,{children:e.tokens_used?.toLocaleString()||0}),(0,F.jsx)(`span`,{children:e.tokens_limit?.toLocaleString()||0})]}),(0,F.jsx)(MN,{value:Sbe(e.tokens_used,e.tokens_limit),className:`h-2`,indicatorClassName:Cbe(e.tokens_used,e.tokens_limit)})]})}),(0,F.jsx)(Y,{className:`text-right`,children:xbe(e.tokens_used,e.tokens_limit)}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex space-x-2`,children:[(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>c(e,`add_limit`),title:`Add tokens to limit`,children:(0,F.jsx)(S_,{className:`h-4 w-4`})}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>c(e,`reset_usage`),title:`Reset token usage`,children:(0,F.jsx)(H_,{className:`h-4 w-4`})}),(0,F.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>c(e,`set_limit`),title:`Set absolute token limit`,children:(0,F.jsx)(Z_,{className:`h-4 w-4`})})]})})]},e.id))})]})})})]}),(0,F.jsx)(Tbe,{open:r,onOpenChange:i,tokenAdjustmentData:t,setTokenAdjustmentData:n,accessToken:e?.access_token,onSuccess:()=>s()})]})},kK=s(((e,t)=>{t.exports=Array.isArray})),AK=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),jK=s(((e,t)=>{var n=AK(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),MK=s(((e,t)=>{t.exports=jK().Symbol})),Dbe=s(((e,t)=>{var n=MK(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Obe=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),NK=s(((e,t)=>{var n=MK(),r=Dbe(),i=Obe(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),PK=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),FK=s(((e,t)=>{var n=NK(),r=PK(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),IK=s(((e,t)=>{var n=kK(),r=FK(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),LK=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),RK=s(((e,t)=>{var n=NK(),r=LK(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),kbe=s(((e,t)=>{t.exports=jK()[`__core-js_shared__`]})),Abe=s(((e,t)=>{var n=kbe(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),zK=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),jbe=s(((e,t)=>{var n=RK(),r=Abe(),i=LK(),a=zK(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Mbe=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),BK=s(((e,t)=>{var n=jbe(),r=Mbe();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),VK=s(((e,t)=>{t.exports=BK()(Object,`create`)})),Nbe=s(((e,t)=>{var n=VK();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Pbe=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Fbe=s(((e,t)=>{var n=VK(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ibe=s(((e,t)=>{var n=VK(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Lbe=s(((e,t)=>{var n=VK(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Rbe=s(((e,t)=>{var n=Nbe(),r=Pbe(),i=Fbe(),a=Ibe(),o=Lbe();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),zbe=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),HK=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),UK=s(((e,t)=>{var n=HK();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Bbe=s(((e,t)=>{var n=UK(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Vbe=s(((e,t)=>{var n=UK();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Hbe=s(((e,t)=>{var n=UK();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ube=s(((e,t)=>{var n=UK();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),WK=s(((e,t)=>{var n=zbe(),r=Bbe(),i=Vbe(),a=Hbe(),o=Ube();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),GK=s(((e,t)=>{t.exports=BK()(jK(),`Map`)})),Wbe=s(((e,t)=>{var n=Rbe(),r=WK(),i=GK();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Gbe=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),KK=s(((e,t)=>{var n=Gbe();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Kbe=s(((e,t)=>{var n=KK();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),qbe=s(((e,t)=>{var n=KK();function r(e){return n(this,e).get(e)}t.exports=r})),Jbe=s(((e,t)=>{var n=KK();function r(e){return n(this,e).has(e)}t.exports=r})),Ybe=s(((e,t)=>{var n=KK();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),qK=s(((e,t)=>{var n=Wbe(),r=Kbe(),i=qbe(),a=Jbe(),o=Ybe();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),JK=s(((e,t)=>{var n=qK(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}
464i.Cache=n,t.exports=i})),Xbe=s(((e,t)=>{var n=JK(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Zbe=s(((e,t)=>{var n=Xbe(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),YK=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Qbe=s(((e,t)=>{var n=MK(),r=YK(),i=kK(),a=FK(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),XK=s(((e,t)=>{var n=Qbe();function r(e){return e==null?``:n(e)}t.exports=r})),ZK=s(((e,t)=>{var n=kK(),r=IK(),i=Zbe(),a=XK();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),QK=s(((e,t)=>{var n=FK(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),$K=s(((e,t)=>{var n=ZK(),r=QK();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),eq=s(((e,t)=>{var n=$K();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),$be=s(((e,t)=>{function n(e){return e==null}t.exports=n})),exe=s(((e,t)=>{var n=NK(),r=kK(),i=PK(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),txe=s((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.memo`):60115,m=t?Symbol.for(`react.lazy`):60116;function h(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case m:case p:case s:return e;default:return t}}case r:return t}}}e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isFragment=function(e){return h(e)===i}})),nxe=s(((e,t)=>{t.exports=txe()})),tq=s(((e,t)=>{var n=NK(),r=PK(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),rxe=s(((e,t)=>{var n=tq();function r(e){return n(e)&&e!=+e}t.exports=r})),nq=u(exe()),rq=u(rxe()),iq=u(eq()),ixe=u(tq()),aq=function(e){return e===0?0:e>0?1:-1},oq=function(e){return(0,nq.default)(e)&&e.indexOf(`%`)===e.length-1},X=function(e){return(0,ixe.default)(e)&&!(0,rq.default)(e)},sq=function(e){return X(e)||(0,nq.default)(e)},axe=0,cq=function(e){var t=++axe;return`${e||``}${t}`},lq=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!X(e)&&!(0,nq.default)(e))return n;var i;if(oq(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,rq.default)(i)&&(i=n),r&&i>t&&(i=t),i},uq=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},oxe=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},dq=function(e,t){return X(e)&&X(t)?function(n){return e+n*(t-e)}:function(){return t}};function fq(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,iq.default)(e,t))===n})}function pq(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}var mq=u(LK());function hq(e){"@babel/helpers - typeof";return hq=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hq(e)}var sxe=[`viewBox`,`children`],cxe=`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRen
464dering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`),gq=[`points`,`pathLength`],lxe={svg:sxe,polygon:gq,polyline:gq},_q=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`),vq=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,y.isValidElement)(e)&&(n=e.props),!(0,mq.default)(n))return null;var r={};
464return Object.keys(n).forEach(function(e){_q.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},uxe=function(e,t,n){return function(r){return e(t,n,r),null}},yq=function(e,t,n){if(!(0,mq.default)(e)||hq(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];_q.includes(i)&&typeof a==`function`&&(r||={},r[i]=uxe(a,t,n))}),r},bq=u($be()),xq=u(RK()),Sq=nxe(),dxe=[`children`],fxe=[`children`];function Cq(e,t){if(e==null)return{};var n=pxe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pxe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var wq={click:`onClick`,mousedown:`onMouseDown`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mousemove:`onMouseMove`,mouseout:`onMouseOut`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,touchcancel:`onTouchCancel`,touchend:`onTouchEnd`,touchmove:`onTouchMove`,touchstart:`onTouchStart`},Tq=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},Eq=null,Dq=null,Oq=function e(t){if(t===Eq&&Array.isArray(Dq))return Dq;var n=[];return y.Children.forEach(t,function(t){(0,bq.default)(t)||((0,Sq.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),Dq=n,Eq=t,n};function kq(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return Tq(e)}):[Tq(t)],Oq(e).forEach(function(e){var t=(0,iq.default)(e,`type.displayName`)||(0,iq.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function Aq(e,t){var n=kq(e,t);return n&&n[0]}var jq=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!X(n)||n<=0||!X(r)||r<=0)},mxe=`a.altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColormatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-url.foreignObject.g.glyph.glyphRef.hkern.image.line.lineGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tref.tspan.use.view.vkern`.split(`.`),hxe=function(e){return e&&e.type&&(0,nq.default)(e.type)&&mxe.indexOf(e.type)>=0},gxe=function(e,t,n,r){var i=lxe?.[r]??[];return!(0,xq.default)(e)&&(r&&i.includes(t)||cxe.includes(t))||n&&_q.includes(t)},Mq=function(e,t,n){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var r=e;if((0,y.isValidElement)(e)&&(r=e.props),!(0,mq.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){gxe(r?.[e],e,t,n)&&(i[e]=r[e])}),i},Nq=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Pq(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!Pq(a,o))return!1}return!0},Pq=function(e,t){if((0,bq.default)(e)&&(0,bq.default)(t))return!0;if(!(0,bq.default)(e)&&!(0,bq.default)(t)){var n=e.props||{},r=n.children,i=Cq(n,dxe),a=t.props||{},o=a.children,s=Cq(a,fxe);return r&&o?pq(i,s)&&Nq(r,o):!r&&!o&&pq(i,s)}return!1},Fq=function(e,t){var n=[],r={};return Oq(e).forEach(function(e,i){if(hxe(e))n.push(e);else if(e){var a=Tq(e.type),o=t[a]||{},s=o.handler,c=o.once;if(s&&(!c||!r[a])){var l=s(e,a,i);n.push(l),r[a]=!0}}}),n},_xe=function(e){var t=e&&e.type;return t&&wq[t]?wq[t]:null},vxe=function(e,t){return Oq(t).indexOf(e)},yxe=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Iq(){return Iq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iq.apply(this,arguments)}function bxe(e,t){if(e==null)return{};var n=xxe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xxe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Lq(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=bxe(e,yxe),u=i||{width:n,height:r,x:0,y:0},d=Ol(`recharts-surface`,a);return y.createElement(`svg`,Iq({},Mq(l,!0,`svg`),{className:d,width:n,height:r,style:o,viewBox:`${u.x} ${u.y} ${u.width} ${u.height}`}),y.createElement(`title`,null,s),y.createElement(`desc`,null,c),t)}var Sxe=[`children`,`className`];function Rq(){return Rq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rq.apply(this,arguments)}function Cxe(e,t){if(e==null)return{};var n=wxe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wxe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var zq=y.forwardRef(function(e,t){var n=e.children,r=e.className,i=Cxe(e,Sxe),a=Ol(`recharts-layer`,r);return y.createElement(`g`,Rq({className:a},Mq(i,!0),{ref:t}),n)}),Txe=s(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Exe=s(((e,t)=>{var n=Txe();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),Bq=s(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),Dxe=s(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),Oxe=s(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),kxe=s(((e,t)=>{var n=Dxe(),r=Bq(),i=Oxe();function a(e){return r(e)?i(e):n(e)}t.exports=a})),Axe=s(((e,t)=>
464{var n=Exe(),r=Bq(),i=kxe(),a=XK();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),jxe=s(((e,t)=>{t.exports=Axe()(`toUpperCase`)}));function Vq(e){return function(){return e}}var Hq=Math.cos,Uq=Math.sin,Wq=Math.sqrt,Gq=Math.PI;Gq/2;var Kq=2*Gq,qq=Math.PI,Jq=2*qq,Yq=1e-6,Mxe=Jq-Yq;function Xq(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Nxe(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Xq;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Zq=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Xq:Nxe(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Yq)if(!(Math.abs(u*s-c*l)>Yq)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((qq-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Yq&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Yq||Math.abs(this._y1-l)>Yq)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Jq+Jq),d>Mxe?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Yq&&this._append`A${n},${n},0,${+(d>=qq)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Pxe(){return new Zq}Pxe.prototype=Zq.prototype;function Qq(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Zq(t)}Array.prototype.slice;function $q(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function eJ(e){this._context=e}eJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function tJ(e){return new eJ(e)}function nJ(e){return e[0]}function rJ(e){return e[1]}function iJ(e,t){var n=Vq(!0),r=null,i=tJ,a=null,o=Qq(s);e=typeof e==`function`?e:e===void 0?nJ:Vq(e),t=typeof t==`function`?t:t===void 0?rJ:Vq(t);function s(s){var c,l=(s=$q(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Vq(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Vq(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Vq(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function aJ(e,t,n){var r=null,i=Vq(!0),a=null,o=tJ,s=null,c=Qq(l);e=typeof e==`function`?e:e===void 0?nJ:Vq(+e),t=typeof t==`function`?t:Vq(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?rJ:Vq(+n);function l(l){var u,d,f,p=(l=$q(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return iJ().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Vq(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Vq(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Vq(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Vq(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Vq(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Vq(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:Vq(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var oJ=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function Fxe(e){return new oJ(e,!0)}function Ixe(e){return new oJ(e,!1)}var sJ={draw(e,t){let n=Wq(t/Gq);e.moveTo(n,0),e.arc(0,0,n,0,Kq)}},Lxe={draw(e,t){let n=Wq(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},cJ=Wq(1/3),Rxe=cJ*2,zxe={draw(e,t){let n=Wq(t/Rxe),r=n*cJ;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Bxe={draw(e,t){let n=Wq(t),r=-n/2;e.rect(r,r,n,n)}},Vxe=.8908130915292852,lJ=Uq(Gq/10)/Uq(7*Gq/10),Hxe=Uq(Kq/10)*lJ,Uxe=-Hq(Kq/10)*lJ,Wxe={draw(e,t){let n=Wq(t*Vxe),r=Hxe*n,i=Uxe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Kq*t/5,o=Hq(a),s=Uq(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},uJ=Wq(3),Gxe={draw(e,t){let n=-Wq(t/(uJ*3));e.moveTo(0,n*2),e.lineTo(-uJ*n,-n),e.lineTo(uJ*n,-n),e.closePath()}},dJ=-.5,fJ=Wq(3)/2,pJ=1/Wq(12),Kxe=(pJ/2+1)*3,qxe={draw(e,t){let n=Wq(t/Kxe),r=n/2,i=n*pJ,a=r,o=n*pJ+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(dJ*r-fJ*i,fJ*r+dJ*i),e.lineTo(dJ*a-fJ*o,fJ*a+dJ*o),e.lineTo(dJ*s-fJ*c,fJ*s+dJ*c),e.lineTo(dJ*r+fJ*i,dJ*i-fJ*r),e.lineTo(dJ*a+fJ*o,dJ*o-fJ*a),e.lineTo(dJ*s+fJ*c,dJ*c-fJ*s),e.closePath()}};function Jxe(e,t){let n=null,r=Qq(i);e=typeof e==`function`?e:Vq(e||sJ),t=typeof t==`function`?t:Vq(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:Vq(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Vq(+e),i):t}
464,i.context=function(e){return arguments.length?(n=e??null,i):n},i}function mJ(){}function hJ(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function gJ(e){this._context=e}gJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:hJ(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:hJ(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Yxe(e){return new gJ(e)}function _J(e){this._context=e}_J.prototype={areaStart:mJ,areaEnd:mJ,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:hJ(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xxe(e){return new _J(e)}function vJ(e){this._context=e}vJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:hJ(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Zxe(e){return new vJ(e)}function yJ(e){this._context=e}yJ.prototype={areaStart:mJ,areaEnd:mJ,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Qxe(e){return new yJ(e)}function bJ(e){return e<0?-1:1}function xJ(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(bJ(a)+bJ(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function SJ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CJ(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function wJ(e){this._context=e}wJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:CJ(this,this._t0,SJ(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,CJ(this,SJ(this,n=xJ(this,e,t)),n);break;default:CJ(this,this._t0,n=xJ(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function TJ(e){this._context=new EJ(e)}(TJ.prototype=Object.create(wJ.prototype)).point=function(e,t){wJ.prototype.point.call(this,t,e)};function EJ(e){this._context=e}EJ.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function $xe(e){return new wJ(e)}function eSe(e){return new TJ(e)}function DJ(e){this._context=e}DJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=OJ(e),i=OJ(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function OJ(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function tSe(e){return new DJ(e)}function kJ(e,t){this._context=e,this._t=t}kJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function nSe(e){return new kJ(e,.5)}function rSe(e){return new kJ(e,0)}function iSe(e){return new kJ(e,1)}function AJ(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function jJ(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function aSe(e,t){return e[t]}function oSe(e){let t=[];return t.key=e,t}function sSe(){var e=Vq([]),t=jJ,n=AJ,r=aSe;function i(i){var a=Array.from(e.apply(this,arguments),oSe),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=$q(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Vq(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Vq(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?jJ:typeof e==`function`?e:Vq(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??AJ,i):n},i}function cSe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}AJ(e,t)}}function lSe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}AJ(e,t)}}function uSe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,AJ(e,t)}}var MJ=u(jxe());function NJ(e){"@babel/helpers - typeof";return NJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NJ(e)}var dSe=[`type`,`size`,`sizeType`];function PJ(){return PJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PJ.apply(this,arguments)}function FJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
464t%2?FJ(Object(n),!0).forEach(function(t){fSe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fSe(e,t,n){return t=pSe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=mSe(e,`string`);return NJ(t)==`symbol`?t:String(t)}function mSe(e,t){if(NJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hSe(e,t){if(e==null)return{};var n=gSe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gSe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var LJ={symbolCircle:sJ,symbolCross:Lxe,symbolDiamond:zxe,symbolSquare:Bxe,symbolStar:Wxe,symbolTriangle:Gxe,symbolWye:qxe},_Se=Math.PI/180,vSe=function(e){return LJ[`symbol${(0,MJ.default)(e)}`]||sJ},ySe=function(e,t,n){if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*_Se;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},bSe=function(e,t){LJ[`symbol${(0,MJ.default)(e)}`]=t},RJ=function(e){var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=IJ(IJ({},hSe(e,dSe)),{},{type:n,size:i,sizeType:o}),c=function(){var e=vSe(n);return Jxe().type(e).size(ySe(i,o,n))()},l=s.className,u=s.cx,d=s.cy,f=Mq(s,!0);return u===+u&&d===+d&&i===+i?y.createElement(`path`,PJ({}
464,f,{className:Ol(`recharts-symbols`,l),transform:`translate(${u}, ${d})`,d:c()})):null};RJ.registerSymbol=bSe;function zJ(e){"@babel/helpers - typeof";return zJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zJ(e)}function BJ(){return BJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BJ.apply(this,arguments)}function VJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VJ(Object(n),!0).forEach(function(t){KJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SSe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function HJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,qJ(r.key),r)}}function CSe(e,t,n){return t&&HJ(e.prototype,t),n&&HJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wSe(e,t,n){return t=WJ(t),TSe(e,UJ()?Reflect.construct(t,n||[],WJ(e).constructor):t.apply(e,n))}function TSe(e,t){if(t&&(zJ(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ESe(e)}function ESe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function UJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UJ=function(){return!!e})()}function WJ(e){return WJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WJ(e)}function DSe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GJ(e,t)}function GJ(e,t){return GJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GJ(e,t)}function KJ(e,t,n){return t=qJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qJ(e){var t=OSe(e,`string`);return zJ(t)==`symbol`?t:String(t)}function OSe(e,t){if(zJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JJ=32,YJ=function(e){DSe(t,e);function t(){return SSe(this,t),wSe(this,t,arguments)}return CSe(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=JJ/2,r=JJ/6,i=JJ/3,a=e.inactive?t:e.color;if(e.type===`plainline`)return y.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:JJ,y2:n,className:`recharts-legend-icon`});if(e.type===`line`)return y.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:a,d:`M0,${n}h${i} 465 A${r},${r},0,1,1,${2*i},${n} 466 H${JJ}M${2*i},${n} 467 A${r},${r},0,1,1,${i},${n}`,className:`recharts-legend-icon`});if(e.type===`rect`)return y.createElement(`path`,{stroke:`none`,fill:a,d:`M0,${JJ/8}h${JJ}v${JJ*3/4}h${-JJ}z`,className:`recharts-legend-icon`});if(y.isValidElement(e.legendIcon)){var o=xSe({},e);return delete o.legendIcon,y.cloneElement(e.legendIcon,o)}return y.createElement(RJ,{fill:a,cx:n,cy:n,size:JJ,sizeType:`diameter`,type:e.type})}},{key:`renderItems`,value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,a=t.formatter,o=t.inactiveColor,s={x:0,y:0,width:JJ,height:JJ},c={display:i===`horizontal`?`inline-block`:`block`,marginRight:10},l={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return n.map(function(t,n){var i=t.formatter||a,u=Ol(KJ(KJ({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var d=(0,xq.default)(t.value)?null:t.value;(0,xq.default)(t.value);var f=t.inactive?o:t.color;return y.createElement(`li`,BJ({className:u,style:c,key:`legend-item-${n}`},yq(e.props,t,n)),y.createElement(Lq,{width:r,height:r,viewBox:s,style:l},e.renderIcon(t)),y.createElement(`span`,{className:`recharts-legend-item-text`,style:{color:f}},i?i(d,t,n):d))})}},{key:`render`,value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n===`horizontal`?r:`left`};return y.createElement(`ul`,{className:`recharts-default-legend`,style:i},this.renderItems())}}]),t}(y.PureComponent);KJ(YJ,`displayName`,`Legend`),KJ(YJ,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var kSe=s(((e,t)=>{var n=WK();function r(){this.__data__=new n,this.size=0}t.exports=r})),ASe=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),jSe=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),MSe=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),NSe=s(((e,t)=>{var n=WK(),r=GK(),i=qK(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),XJ=s(((e,t)=>{var n=WK(),r=kSe(),i=ASe(),a=jSe(),o=MSe(),s=NSe();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exp
vendor: 4,185 bytes, line 467
467orts=c})),PSe=s(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),FSe=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ZJ=s(((e,t)=>{var n=qK(),r=PSe(),i=FSe();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),QJ=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),$J=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),eY=s(((e,t)=>{var n=ZJ(),r=QJ(),i=$J(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),ISe=s(((e,t)=>{t.exports=jK().Uint8Array})),LSe=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),tY=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),RSe=s(((e,t)=>{var n=MK(),r=ISe(),i=HK(),a=eY(),o=LSe(),s=tY(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),nY=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),zSe=s(((e,t)=>{var n=nY(),r=kK();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),BSe=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),VSe=s(((e,t)=>{function n(){return[]}t.exports=n})),HSe=s(((e,t)=>{var n=BSe(),r=VSe(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),USe=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),WSe=s(((e,t)=>{var n=NK(),r=PK(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),rY=s(((e,t)=>{var n=WSe(),r=PK(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),GSe=s(((e,t)=>{function n(){return!1}t.exports=n})),iY=s(((e,t)=>{var n=jK(),r=GSe(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),aY=s(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),oY=s(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),KSe=s(((e,t)=>{var n=NK(),r=oY(),i=PK(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array
467]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),sY=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),qSe=s(((e,t)=>{var n=AK(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),cY=s(((e,t)=>{var n=KSe(),r=sY(),i=qSe(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),JSe=s(((e,t)=>{var n=USe(),r=rY(),i=kK(),a=iY(),o=aY(),s=cY(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),YSe=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),lY=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),XSe=s(((e,t)=>{t.exports=lY()(Object.keys,Object)})),ZSe=s(((e,t)=>{var n=YSe(),r=XSe(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),uY=s(((e,t)=>{var n=RK(),r=oY();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),dY=s(((e,t)=>{var n=JSe(),r=ZSe(),i=uY();function a(e){return i(e)?n(e):r(e)}t.exports=a})),QSe=s(((e,t)=>{var n=zSe(),r=HSe(),i=dY();function a(e){return n(e,i,r)}t.exports=a})),$Se=s(((e,t)=>{var n=QSe(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),eCe=s(((e,t)=>{t.exports=BK()(jK(),`DataView`)})),tCe=s(((e,t)=>{t.exports=BK()(jK(),`Promise`)})),fY=s(((e,t)=>{t.exports=BK()(jK(),`Set`)})),nCe=s(((e,t)=>{t.exports=BK()(jK(),`WeakMap`)})),rCe=s(((e,t)=>{var n=eCe(),r=GK(),i=tCe(),a=fY(),o=nCe(),s=NK(),c=zK(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),iCe=s(((e,t)=>{var n=XJ(),r=eY(),i=RSe(),a=$Se(),o=rCe(),s=kK(),c=iY(),l=cY(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),pY=s(((e,t)=>{var n=iCe(),r=PK();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),aCe=s(((e,t)=>{var n=XJ(),r=pY(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];
vendor: 2,601 bytes, line 467
467var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),mY=s(((e,t)=>{var n=LK();function r(e){return e===e&&!n(e)}t.exports=r})),oCe=s(((e,t)=>{var n=mY(),r=dY();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),hY=s(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),sCe=s(((e,t)=>{var n=aCe(),r=oCe(),i=hY();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),cCe=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),lCe=s(((e,t)=>{var n=ZK(),r=rY(),i=kK(),a=aY(),o=oY(),s=QK();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),uCe=s(((e,t)=>{var n=cCe(),r=lCe();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),dCe=s(((e,t)=>{var n=pY(),r=eq(),i=uCe(),a=IK(),o=mY(),s=hY(),c=QK(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),gY=s(((e,t)=>{function n(e){return e}t.exports=n})),fCe=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),pCe=s(((e,t)=>{var n=$K();function r(e){return function(t){return n(t,e)}}t.exports=r})),mCe=s(((e,t)=>{var n=fCe(),r=pCe(),i=IK(),a=QK();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),_Y=s(((e,t)=>{var n=sCe(),r=dCe(),i=gY(),a=kK(),o=mCe();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),vY=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),hCe=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),gCe=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),_Ce=s(((e,t)=>{var n=vY(),r=hCe(),i=gCe();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),vCe=s(((e,t)=>{var n=_Ce();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),yCe=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),bCe=s(((e,t)=>{function n(){}t.exports=n})),xCe=s(((e,t)=>{var n=fY(),r=bCe(),i=tY();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),SCe=s(((e,t)=>
467{var n=ZJ(),r=vCe(),i=yCe(),a=$J(),o=xCe(),s=tY(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),yY=u(s(((e,t)=>{var n=_Y(),r=SCe();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function bY(e,t,n){return t===!0?(0,yY.default)(e,n):(0,xq.default)(t)?(0,yY.default)(e,t):e}function xY(e){"@babel/helpers - typeof";return xY=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},xY(e)}var CCe=[`ref`];function SY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?SY(Object(n),!0).forEach(function(t){kY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wCe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function wY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,AY(r.key),r)}}function TCe(e,t,n){return t&&wY(e.prototype,t),n&&wY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ECe(e,t,n){return t=EY(t),DCe(e,TY()?Reflect.construct(t,n||[],EY(e).constructor):t.apply(e,n))}function DCe(e,t){if(t&&(xY(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return DY(e)}function TY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TY=function(){return!!e})()}function EY(e){return EY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},EY(e)}function DY(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function OCe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OY(e,t)}function OY(e,t){return OY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OY(e,t)}function kY(e,t,n){return t=AY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AY(e){var t=kCe(e,`string`);return xY(t)==`symbol`?t:String(t)}function kCe(e,t){if(xY(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(xY(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ACe(e,t){if(e==null)return{};var n=jY(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jY(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function jCe(e){return e.value}function MCe(e,t){if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e==`function`)return y.createElement(e,t);t.ref;var n=ACe(t,CCe);return y.createElement(YJ,n)}var MY=1,NY=function(e){OCe(t,e);function t(){var e;wCe(this,t);var n=[...arguments];return e=ECe(this,t,[].concat(n)),kY(DY(e),`lastBoundingBox`,{width:-1,height:-1}),e}return TCe(t,[{key:`componentDidMount`,value:function(){this.updateBBox()}},{key:`componentDidUpdate`,value:function(){this.updateBBox()}},{key:`getBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:`updateBBox`,value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();
467t?(Math.abs(t.width-this.lastBoundingBox.width)>MY||Math.abs(t.height-this.lastBoundingBox.height)>MY)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:`getBBoxSnapshot`,value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?CY({},this.lastBoundingBox):{width:0,height:0}}},{key:`getDefaultPosition`,value:function(e){var t=this.props,n=t.layout,r=t.align,i=t.verticalAlign,a=t.margin,o=t.chartWidth,s=t.chartHeight,c,l;if(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))if(r===`center`&&n===`vertical`){var u=this.getBBoxSnapshot();c={left:((o||0)-u.width)/2}}else c=r===`right`?{right:a&&a.right||0}:{left:a&&a.left||0};if(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))if(i===`middle`){var d=this.getBBoxSnapshot();l={top:((s||0)-d.height)/2}}else l=i===`bottom`?{bottom:a&&a.bottom||0}:{top:a&&a.top||0};return CY(CY({},c),l)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,a=t.wrapperStyle,o=t.payloadUniqBy,s=t.payload,c=CY(CY({position:`absolute`,width:r||`auto`,height:i||`auto`},this.getDefaultPosition(a)),a);return y.createElement(`div`,{className:`recharts-legend-wrapper`,style:c,ref:function(t){e.wrapperNode=t}},MCe(n,CY(CY({},this.props),{},{payload:bY(s,o,jCe)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=e.props.layout;return n===`vertical`&&X(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}]),t}(y.PureComponent);kY(NY,`displayName`,`Legend`),kY(NY,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var NCe=s(((e,t)=>{var n=MK(),r=rY(),i=kK(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),PY=s(((e,t)=>{var n=nY(),r=NCe();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),PCe=s(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),FCe=s(((e,t)=>{t.exports=PCe()()})),FY=s(((e,t)=>{var n=FCe(),r=dY();function i(e,t){return e&&n(e,t,r)}t.exports=i})),ICe=s(((e,t)=>{var n=uY();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),IY=s(((e,t)=>{var n=FY();t.exports=ICe()(n)})),LY=s(((e,t)=>{var n=IY(),r=uY();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),LCe=s(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),RCe=s(((e,t)=>{var n=FK();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),zCe=s(((e,t)=>{var n=RCe();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),BCe=s(((e,t)=>{var n=YK(),r=$K(),i=_Y(),a=LY(),o=LCe(),s=sY(),c=zCe(),l=gY(),u=kK();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),VCe=s(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),HCe=s(((e,t)=>{var n=VCe(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),UCe=s(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),RY=s(((e,t)=>{var n=BK();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),WCe=s(((e,t)=>{var n=UCe(),r=RY(),i=gY();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),GCe=s(((e,t)=>{var n=Date.now;function r(e){var t=0,r=0;return function(){var i=n(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=r})),KCe=s(((e,t)=>{var n=WCe();t.exports=GCe()(n)})),qCe=s(((e,t)=>{var n=gY(),r=HCe(),i=KCe();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),zY=s(((e,t)=>{var n=HK(),r=uY(),i=aY(),a=LK();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),BY=u(s(((e,t)=>{var n=PY(),r=BCe(),i=qCe(),a=zY();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function VY(e){"@babel/helpers - typeof";return VY=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},VY(e)}function HY(){return HY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HY.apply(this,arguments)}function JCe(e,t){return QCe(e)||ZCe(e,t)||XCe(e,t)||YCe()}
467function YCe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 468In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XCe(e,t){if(e){if(typeof e==`string`)return UY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UY(e,t)}}function UY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZCe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function QCe(e){if(Array.isArray(e))return e}function WY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WY(Object(n),!0).forEach(function(t){$Ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $Ce(e,t,n){return t=ewe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ewe(e){var t=twe(e,`string`);return VY(t)==`symbol`?t:String(t)}function twe(e,t){if(VY(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VY(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nwe(e){return Array.isArray(e)&&sq(e[0])&&sq(e[1])?e.join(` ~ `):e}var rwe=function(e){var t=e.separator,n=t===void 0?` : `:t,r=e.contentStyle,i=r===void 0?{}:r,a=e.itemStyle,o=a===void 0?{}:a,s=e.labelStyle,c=s===void 0?{}:s,l=e.payload,u=e.formatter,d=e.itemSorter,f=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,_=g!==void 0&&g,v=function(){if(l&&l.length){var e={padding:0,margin:0},t=(d?(0,BY.default)(l,d):l).map(function(e,t){if(e.type===`none`)return null;var r=GY({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||u||nwe,a=e.value,s=e.name,c=a,d=s;if(i&&c!=null&&d!=null){var f=i(a,s,e,t,l);if(Array.isArray(f)){var p=JCe(f,2);c=p[0],d=p[1]}else c=f}return y.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},sq(d)?y.createElement(`span`,{className:`recharts-tooltip-item-name`},d):null,sq(d)?y.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,y.createElement(`span`,{className:`recharts-tooltip-item-value`},c),y.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return y.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},b=GY({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=GY({margin:0},c),S=!(0,bq.default)(m),C=S?m:``,w=Ol(`recharts-default-tooltip`,f),T=Ol(`recharts-tooltip-label`,p);S&&h&&l!=null&&(C=h(m,l));var E=_?{role:`status`,"aria-live":`assertive`}:{};return y.createElement(`div`,HY({className:w,style:b},E),y.createElement(`p`,{className:T,style:x},y.isValidElement(C)?C:`${C}`),v())};function KY(e){"@babel/helpers - typeof";return KY=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},KY(e)}function qY(e,t,n){return t=iwe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iwe(e){var t=awe(e,`string`);return KY(t)==`symbol`?t:String(t)}function awe(e,t){if(KY(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(KY(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JY=`recharts-tooltip-wrapper`,owe={visibility:`hidden`};function swe(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ol(JY,qY(qY(qY(qY({},`${JY}-right`,X(n)&&t&&X(t.x)&&n>=t.x),`${JY}-left`,X(n)&&t&&X(t.x)&&n<t.x),`${JY}-bottom`,X(r)&&t&&X(t.y)&&r>=t.y),`${JY}-top`,X(r)&&t&&X(t.y)&&r<t.y))}
468function YY(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&X(a[r]))return a[r];var u=n[r]-s-i,d=n[r]+i;return t[r]?o[r]?u:d:o[r]?u<c[r]?Math.max(d,c[r]):Math.max(u,c[r]):d+s>c[r]+l?Math.max(u,c[r]):Math.max(d,c[r])}function cwe(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function lwe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,u,d;return o.height>0&&o.width>0&&n?(u=YY({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=YY({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=cwe({translateX:u,translateY:d,useTranslate3d:s})):l=owe,{cssProperties:l,cssClasses:swe({translateX:u,translateY:d,coordinate:n})}}function XY(e){"@babel/helpers - typeof";return XY=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XY(e)}function ZY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZY(Object(n),!0).forEach(function(t){iX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uwe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,aX(r.key),r)}}function dwe(e,t,n){return t&&$Y(e.prototype,t),n&&$Y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fwe(e,t,n){return t=tX(t),pwe(e,eX()?Reflect.construct(t,n||[],tX(e).constructor):t.apply(e,n))}function pwe(e,t){if(t&&(XY(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return nX(e)}function eX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eX=function(){return!!e})()}function tX(e){return tX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tX(e)}function nX(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function mwe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rX(e,t)}function rX(e,t){return rX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rX(e,t)}function iX(e,t,n){return t=aX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aX(e){var t=hwe(e,`string`);return XY(t)==`symbol`?t:String(t)}function hwe(e,t){if(XY(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XY(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oX=1,gwe=function(e){mwe(t,e);function t(){var e;uwe(this,t);var n=[...arguments];return e=fwe(this,t,[].concat(n)),iX(nX(e),`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),iX(nX(e),`handleKeyDown`,function(t){t.key===`Escape`&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:e.props.coordinate?.x??0,y:e.props.coordinate?.y??0}})}),e}return dwe(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>oX||Math.abs(e.height-this.state.lastBoundingBox.height)>oX)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:`componentDidMount`,value:function(){document.addEventListener(`ke
468ydown`,this.handleKeyDown),this.updateBBox()}},{key:`componentWillUnmount`,value:function(){document.removeEventListener(`keydown`,this.handleKeyDown)}},{key:`componentDidUpdate`,value:function(){this.props.active&&this.updateBBox(),this.state.dismissed&&(this.props.coordinate?.x!==this.state.dismissedAtCoordinate.x||this.props.coordinate?.y!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.children,s=t.coordinate,c=t.hasPayload,l=t.isAnimationActive,u=t.offset,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.viewBox,h=t.wrapperStyle,g=lwe({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:u,position:d,reverseDirection:f,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),_=g.cssClasses,v=g.cssProperties,b=QY(QY({transition:l&&n?`transform ${i}ms ${a}`:void 0},v),{},{pointerEvents:`none`,visibility:!this.state.dismissed&&n&&c?`visible`:`hidden`,position:`absolute`,top:0,left:0},h);return y.createElement(`div`,{tabIndex:-1,className:_,style:b,ref:function(t){e.wrapperNode=t}},o)}}]),t}(y.PureComponent),sX={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return sX[e]},set:function(e,t){if(typeof e==`string`)sX[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){sX[t]=e[t]})}}};function cX(e){"@babel/helpers - typeof";return cX=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cX(e)}function lX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lX(Object(n),!0).forEach(function(t){hX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _we(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function dX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,gX(r.key),r)}}function vwe(e,t,n){return t&&dX(e.prototype,t),n&&dX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ywe(e,t,n){return t=pX(t),bwe(e,fX()?Reflect.construct(t,n||[],pX(e).constructor):t.apply(e,n))}function bwe(e,t){if(t&&(cX(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return xwe(e)}function xwe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function fX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fX=function(){return!!e})()}function pX(e){return pX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pX(e)}function Swe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mX(e,t)}function mX(e,t){return mX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mX(e,t)}function hX(e,t,n){return t=gX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gX(e){var t=Cwe(e,`string`);return cX(t)==`symbol`?t:String(t)}function Cwe(e,t){if(cX(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cX(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wwe(e){return e.dataKey}function Twe(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e==`function`?y.createElement(e,t):y.createElement(rwe,t)}
468var _X=function(e){Swe(t,e);function t(){return _we(this,t),ywe(this,t,arguments)}return vwe(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.coordinate,c=t.filterNull,l=t.isAnimationActive,u=t.offset,d=t.payload,f=t.payloadUniqBy,p=t.position,m=t.reverseDirection,h=t.useTranslate3d,g=t.viewBox,_=t.wrapperStyle,v=d??[];c&&v.length&&(v=bY(d.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),f,wwe));var b=v.length>0;return y.createElement(gwe,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:l,active:n,coordinate:s,hasPayload:b,offset:u,position:p,reverseDirection:m,useTranslate3d:h,viewBox:g,wrapperStyle:_},Twe(o,uX(uX({},this.props),{},{payload:v})))}}]),t}(y.PureComponent);hX(_X,`displayName`,`Tooltip`),hX(_X,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!sX.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ewe=s(((e,t)=>{var n=jK();t.exports=function(){return n.Date.now()}})),Dwe=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Owe=s(((e,t)=>{var n=Dwe(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),vX=s(((e,t)=>{var n=Owe(),r=LK(),i=FK(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),kwe=s(((e,t)=>{var n=LK(),r=Ewe(),i=vX(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),yX=u(s(((e,t)=>{var n=kwe(),r=LK(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function bX(e){"@babel/helpers - typeof";return bX=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bX(e)}function xX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xX(Object(n),!0).forEach(function(t){Awe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Awe(e,t,n){return t=jwe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jwe(e){var t=Mwe(e,`string`);return bX(t)==`symbol`?t:String(t)}function Mwe(e,t){if(bX(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(bX(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Nwe(e,t){return Lwe(e)||Iwe(e,t)||Fwe(e,t)||Pwe()}
468function Pwe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 469In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fwe(e,t){if(e){if(typeof e==`string`)return CX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CX(e,t)}}function CX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Iwe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Lwe(e){if(Array.isArray(e))return e}var wX=(0,y.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?`100%`:a,s=e.height,c=s===void 0?`100%`:s,l=e.minWidth,u=l===void 0?0:l,d=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?0:m,g=e.id,_=e.className,v=e.onResize,b=e.style,x=b===void 0?{}:b,S=(0,y.useRef)(null),C=(0,y.useRef)();C.current=v,(0,y.useImperativeHandle)(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn(`The usage of ref.current.current is deprecated and will no longer be supported.`),S.current},configurable:!0})});var w=Nwe((0,y.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,y.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,y.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;D(r,i),(t=C.current)==null||t.call(C,r,i)};h>0&&(e=(0,yX.default)(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),function(){t.disconnect()}},[D,h]);var O=(0,y.useMemo)(function(){var e=T.containerWidth,t=T.containerHeight;if(e<0||t<0)return null;oq(o)||oq(c);var r=oq(o)?e:o,i=oq(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),f&&i>f&&(i=f));var a=!Array.isArray(p)&&(0,Sq.isElement)(p)&&Tq(p.type).endsWith(`Chart`);return y.Children.map(p,function(e){return(0,Sq.isElement)(e)?(0,y.cloneElement)(e,SX({width:r,height:i},a?{style:SX({height:`100%`,width:`100%`,maxHeight:i,maxWidth:r},e.props.style)}:{})):e})},[n,p,c,f,d,u,T,o]);return y.createElement(`div`,{id:g?`${g}`:void 0,className:Ol(`recharts-responsive-container`,_),style:SX(SX({},x),{},{width:o,height:c,minWidth:u,minHeight:d,maxHeight:f}),ref:S},O)}),TX=function(e){return null};TX.displayName=`Cell`;function EX(e){"@babel/helpers - typeof";return EX=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},EX(e)}function DX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DX(Object(n),!0).forEach(function(t){Rwe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rwe(e,t,n){return t=zwe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zwe(e){var t=Bwe(e,`string`);return EX(t)==`symbol`?t:String(t)}function Bwe(e,t){if(EX(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(EX(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var kX={widthCache:{}
469,cacheCount:0},Vwe=2e3,Hwe={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},AX=`recharts_measurement_span`;function Uwe(e){var t=OX({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var jX=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||sX.isSsr)return{width:0,height:0};var n=Uwe(t),r=JSON.stringify({text:e,copyStyle:n});if(kX.widthCache[r])return kX.widthCache[r];try{var i=document.getElementById(AX);i||(i=document.createElement(`span`),i.setAttribute(`id`,AX),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=OX(OX({},Hwe),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return kX.widthCache[r]=s,++kX.cacheCount>Vwe&&(kX.cacheCount=0,kX.widthCache={}),s}catch{return{width:0,height:0}}},Wwe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function MX(e){"@babel/helpers - typeof";return MX=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},MX(e)}function NX(e,t){return Jwe(e)||qwe(e,t)||Kwe(e,t)||Gwe()}function Gwe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 470In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kwe(e,t){if(e){if(typeof e==`string`)return PX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PX(e,t)}}function PX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qwe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Jwe(e){if(Array.isArray(e))return e}function Ywe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function FX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Zwe(r.key),r)}}function Xwe(e,t,n){return t&&FX(e.prototype,t),n&&FX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zwe(e){var t=Qwe(e,`string`);return MX(t)==`symbol`?t:String(t)}function Qwe(e,t){if(MX(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(MX(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var IX=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LX=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$we=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,eTe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,RX={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},tTe=Object.keys(RX),zX=`NaN`;function nTe(e,t){return e*RX[t]}var BX=function(){function e(t,n){Ywe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!$we.test(n)&&(this.num=NaN,this.unit=``),tTe.includes(n)&&(this.num=nTe(t,n),this.unit=`px`)}return Xwe(e,[{key:`add`,value:function(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}},{key:`subtract`,value:function(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}},{key:`multiply`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}},{key:`divide`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}},{key:`toString`,value:function(){return`${this.num}${this.unit}`}}
470,{key:`isNaN`,value:function(){return Number.isNaN(this.num)}}],[{key:`parse`,value:function(t){var n=NX(eTe.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}]),e}();function VX(e){if(e.includes(zX))return zX;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=NX(IX.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=BX.parse(r??``),s=BX.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return zX;t=t.replace(IX,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=NX(LX.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=BX.parse(u??``),m=BX.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return zX;t=t.replace(LX,h.toString())}return t}var HX=/\(([^()]*)\)/;function rTe(e){for(var t=e;t.includes(`(`);){var n=NX(HX.exec(t),2)[1];t=t.replace(HX,VX(n))}return t}function iTe(e){var t=e.replace(/\s+/g,``);return t=rTe(t),t=VX(t),t}function aTe(e){try{return iTe(e)}catch{return zX}}function UX(e){var t=aTe(e.slice(5,-1));return t===zX?``:t}var oTe=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],sTe=[`dx`,`dy`,`angle`,`className`,`breakAll`];function WX(){return WX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WX.apply(this,arguments)}function GX(e,t){if(e==null)return{};var n=cTe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cTe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function KX(e,t){return fTe(e)||dTe(e,t)||uTe(e,t)||lTe()}function lTe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 471In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uTe(e,t){if(e){if(typeof e==`string`)return qX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qX(e,t)}}function qX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dTe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function fTe(e){if(Array.isArray(e))return e}var JX=/[ \f\n\r\t\v\u2028\u2029]+/,YX=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,bq.default)(t)||(i=n?t.toString().split(``):t.toString().split(JX)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:jX(e,r).width}}),spaceWidth:n?0:jX(`\xA0`,r).width}}catch{return null}},pTe=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=X(a),u=o,d=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(e,t){var a=t.word,o=t.width,s=e[e.length-1];if(s&&(r==null||i||s.width+o+n<Number(r)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[])},f=d(t),p=function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})};if(!l)return f;for(var m=`â¦`,h=function(e){var t=YX({breakAll:c,style:s,children:u.slice(0,e)+m}).wordsWithComputedWidth,n=d(t);return[n.length>a||p(n).width>Number(r),n]},g=0,_=u.length-1,v=0,y;g<=_&&v<=u.length-1;){var b=Math.floor((g+_)/2),x=KX(h(b-1),2),S=x[0],C=x[1],w=KX(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},XX=function(e){return[{words:(0,bq.default)(e)?[]:e.toString().split(JX)}]},mTe=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!sX.isSsr){var s,c,l=YX({breakAll:a,children:r,style:i});
471if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return XX(r);return pTe({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return XX(r)},ZX=`#808080`,QX=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.lineHeight,o=a===void 0?`1em`:a,s=e.capHeight,c=s===void 0?`0.71em`:s,l=e.scaleToFit,u=l!==void 0&&l,d=e.textAnchor,f=d===void 0?`start`:d,p=e.verticalAnchor,m=p===void 0?`end`:p,h=e.fill,g=h===void 0?ZX:h,_=GX(e,oTe),v=(0,y.useMemo)(function(){return mTe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:u,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,u,_.style,_.width]),b=_.dx,x=_.dy,S=_.angle,C=_.className,w=_.breakAll,T=GX(_,sTe);if(!sq(n)||!sq(i))return null;var E=n+(X(b)?b:0),D=i+(X(x)?x:0),O;switch(m){case`start`:O=UX(`calc(${c})`);break;case`middle`:O=UX(`calc(${(v.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=UX(`calc(${v.length-1} * -${o})`);break}var k=[];if(u){var A=v[0].width,j=_.width;k.push(`scale(${(X(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),y.createElement(`text`,WX({},Mq(T,!0),{x:E,y:D,className:Ol(`recharts-text`,C),textAnchor:f,fill:g.includes(`url`)?ZX:g}),v.map(function(e,t){var n=e.words.join(w?``:` `);return y.createElement(`tspan`,{x:E,dy:t===0?O:o,key:n},n)}))};function $X(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function hTe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function eZ(e){let t,n,r;e.length===2?(t=e===$X||e===hTe?e:gTe,n=e,r=e):(t=$X,n=(t,n)=>$X(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function gTe(){return 0}function tZ(e){return e===null?NaN:+e}function*_Te(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var nZ=eZ($X),rZ=nZ.right;nZ.left,eZ(tZ).center;var iZ=class extends Map{constructor(e,t=bTe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(aZ(this,e))}has(e){return super.has(aZ(this,e))}set(e,t){return super.set(vTe(this,e),t)}delete(e){return super.delete(yTe(this,e))}};function aZ({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function vTe({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function yTe({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function bTe(e){return typeof e==`object`&&e?e.valueOf():e}function xTe(e=$X){if(e===$X)return oZ;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function oZ(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var STe=Math.sqrt(50),CTe=Math.sqrt(10),wTe=Math.sqrt(2);function sZ(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=STe?10:a>=CTe?5:a>=wTe?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?sZ(e,t,n*2):[s,c,l]}function cZ(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?sZ(t,e,n):sZ(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function lZ(e,t,n){return t=+t,e=+e,n=+n,sZ(e,t,n)[2]}function uZ(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?lZ(t,e,n):lZ(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function dZ(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function fZ(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}
471function pZ(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?oZ:xTe(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));pZ(e,t,u,d,i)}let a=e[t],o=n,s=r;for(mZ(e,n,t),i(e[r],a)>0&&mZ(e,n,r);o<s;){for(mZ(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?mZ(e,n,s):(++s,mZ(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function mZ(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function TTe(e,t,n){if(e=Float64Array.from(_Te(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return fZ(e);if(t>=1)return dZ(e);var r,i=(r-1)*t,a=Math.floor(i),o=dZ(pZ(e,a).subarray(0,a+1));return o+(fZ(e.subarray(a+1))-o)*(i-a)}}function ETe(e,t,n=tZ){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function DTe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function hZ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function gZ(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var _Z=Symbol(`implicit`);function vZ(){var e=new iZ,t=[],n=[],r=_Z;function i(i){let a=e.get(i);if(a===void 0){if(r!==_Z)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new iZ;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return vZ(t,n).unknown(r)},hZ.apply(i,arguments),i}function yZ(){var e=vZ().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=DTe(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()}
vendor: 4,304 bytes, line 471
471,e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return yZ(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},hZ.apply(d(),arguments)}function bZ(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return bZ(t())},e}function xZ(){return bZ(yZ.apply(null,arguments).paddingInner(1))}function SZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function CZ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wZ(){}var TZ=.7,EZ=1/TZ,DZ=`\\s*([+-]?\\d+)\\s*`,OZ=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,kZ=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,OTe=/^#([0-9a-f]{3,8})$/,kTe=RegExp(`^rgb\\(${DZ},${DZ},${DZ}\\)$`),ATe=RegExp(`^rgb\\(${kZ},${kZ},${kZ}\\)$`),jTe=RegExp(`^rgba\\(${DZ},${DZ},${DZ},${OZ}\\)$`),MTe=RegExp(`^rgba\\(${kZ},${kZ},${kZ},${OZ}\\)$`),NTe=RegExp(`^hsl\\(${OZ},${kZ},${kZ}\\)$`),PTe=RegExp(`^hsla\\(${OZ},${kZ},${kZ},${OZ}\\)$`),AZ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};SZ(wZ,NZ,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()}
471,hex:jZ,formatHex:jZ,formatHex8:FTe,formatHsl:ITe,formatRgb:MZ,toString:MZ});function jZ(){return this.rgb().formatHex()}function FTe(){return this.rgb().formatHex8()}function ITe(){return WZ(this).formatHsl()}function MZ(){return this.rgb().formatRgb()}function NZ(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=OTe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?PZ(t):n===3?new LZ(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?FZ(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?FZ(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kTe.exec(e))?new LZ(t[1],t[2],t[3],1):(t=ATe.exec(e))?new LZ(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jTe.exec(e))?FZ(t[1],t[2],t[3],t[4]):(t=MTe.exec(e))?FZ(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=NTe.exec(e))?UZ(t[1],t[2]/100,t[3]/100,1):(t=PTe.exec(e))?UZ(t[1],t[2]/100,t[3]/100,t[4]):AZ.hasOwnProperty(e)?PZ(AZ[e]):e===`transparent`?new LZ(NaN,NaN,NaN,0):null}function PZ(e){return new LZ(e>>16&255,e>>8&255,e&255,1)}function FZ(e,t,n,r){return r<=0&&(e=t=n=NaN),new LZ(e,t,n,r)}function LTe(e){return e instanceof wZ||(e=NZ(e)),e?(e=e.rgb(),new LZ(e.r,e.g,e.b,e.opacity)):new LZ}function IZ(e,t,n,r){return arguments.length===1?LTe(e):new LZ(e,t,n,r??1)}function LZ(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}SZ(LZ,IZ,CZ(wZ,{brighter(e){return e=e==null?EZ:EZ**+e,new LZ(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?TZ:TZ**+e,new LZ(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new LZ(VZ(this.r),VZ(this.g),VZ(this.b),BZ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:RZ,formatHex:RZ,formatHex8:RTe,formatRgb:zZ,toString:zZ}));function RZ(){return`#${HZ(this.r)}${HZ(this.g)}${HZ(this.b)}`}function RTe(){return`#${HZ(this.r)}${HZ(this.g)}${HZ(this.b)}${HZ((isNaN(this.opacity)?1:this.opacity)*255)}`}function zZ(){let e=BZ(this.opacity);return`${e===1?`rgb(`:`rgba(`}${VZ(this.r)}, ${VZ(this.g)}, ${VZ(this.b)}${e===1?`)`:`, ${e})`}`}function BZ(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function VZ(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function HZ(e){return e=VZ(e),(e<16?`0`:``)+e.toString(16)}function UZ(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new GZ(e,t,n,r)}function WZ(e){if(e instanceof GZ)return new GZ(e.h,e.s,e.l,e.opacity);if(e instanceof wZ||(e=NZ(e)),!e)return new GZ;if(e instanceof GZ)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new GZ(o,s,c,e.opacity)}function zTe(e,t,n,r){return arguments.length===1?WZ(e):new GZ(e,t,n,r??1)}function GZ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}SZ(GZ,zTe,CZ(wZ,{brighter(e){return e=e==null?EZ:EZ**+e,new GZ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?TZ:TZ**+e,new GZ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new LZ(JZ(e>=240?e-240:e+120,i,r),JZ(e,i,r),JZ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new GZ(KZ(this.h),qZ(this.s),qZ(this.l),BZ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=BZ(this.opacity);return`${e===1?`hsl(`:`hsla(`}${KZ(this.h)}, ${qZ(this.s)*100}%, ${qZ(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function KZ(e){return e=(e||0)%360,e<0?e+360:e}function qZ(e){return Math.max(0,Math.min(1,e||0))}function JZ(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var YZ=e=>()=>e;function BTe(e,t){return function(n){return e+n*t}}function VTe(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function HTe(e){return(e=+e)==1?XZ:function(t,n){return n-t?VTe(t,n,e):YZ(isNaN(t)?n:t)}}function XZ(e,t){var n=t-e;return n?BTe(e,n):YZ(isNaN(e)?t:e)}var ZZ=(function e(t){var n=HTe(t);function r(e,t){var r=n((e=IZ(e)).r,(t=IZ(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=XZ(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function UTe(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function WTe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function GTe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=tQ(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function KTe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function QZ(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function qTe(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=tQ(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var $Z=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,eQ=new RegExp($Z.source,`g`);function JTe(e){return function(){return e}}function YTe(e){return function(t){return e(t)+``}}function XTe(e,t){var n=$Z.lastIndex=eQ.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=$Z.exec(e))&&(i=eQ.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:QZ(r,i)})),n=eQ.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?YTe(c[0].x):JTe(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function tQ(e,t){var n=typeof t,r;return t==null||n===`boolean`?YZ(t):(n===`number`?QZ:n===`string`?(r=NZ(t))?(t=r,ZZ):XTe:t instanceof NZ?ZZ:t instanceof Date?KTe:WTe(t)?UTe:Array.isArray(t)?GTe:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?qTe:QZ)(e,t)}function nQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ZTe(e,t){t===void 0&&(t=e,e=tQ);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function QTe(e){return function(){return e}}function rQ(e){return+e}var iQ=[0,1];function aQ(e){return e}function oQ(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:QTe(isNaN(t)?NaN:.5)}function $Te(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function eEe(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=oQ(i,r),a=n(o,a)):(r=oQ(r,i),a=n(a,o)),function(e){return a(r(e))}}function tEe(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=oQ(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=rZ(e,t,1,r)-1;return a[n](i[n](t))}}function sQ(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function cQ(){var e=iQ,t=iQ,n=tQ,r,i,a,o=aQ,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==aQ&&(o=$Te(e[0],e[n-1])),s=n>2?tEe:eEe,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),QZ))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,rQ),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()}
vendor: 4,739 bytes, line 471
471,d.rangeRound=function(e){return t=Array.from(e),n=nQ,u()},d.clamp=function(e){return arguments.length?(o=e?!0:aQ,u()):o!==aQ},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function lQ(){return cQ()(aQ,aQ)}function nEe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function uQ(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function dQ(e){return e=uQ(Math.abs(e)),e?e[1]:NaN}function rEe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function iEe(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var aEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fQ(e){if(!(t=aEe.exec(e)))throw Error(`invalid format: `+e);var t;return new pQ({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}fQ.prototype=pQ.prototype;function pQ(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}pQ.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function oEe(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var mQ;function sEe(e,t){var n=uQ(e,t);if(!n)return e+``;var r=n[0],i=n[1],a=i-(mQ=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+uQ(e,Math.max(0,t+a-1))[0]}function hQ(e,t){var n=uQ(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var gQ={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:nEe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>hQ(e*100,t),r:hQ,s:sEe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _Q(e){return e}var vQ=Array.prototype.map,yQ=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function cEe(e){var t=e.grouping===void 0||e.thousands===void 0?_Q:rEe(vQ.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?_Q:iEe(vQ.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`â`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e){e=fQ(e);var l=e.fill,u=e.align,d=e.sign,f=e.symbol,p=e.zero,m=e.width,h=e.comma,g=e.precision,_=e.trim,v=e.type;v===`n`?(h=!0,v=`g`):gQ[v]||(g===void 0&&(g=12),_=!0,v=`g`),(p||l===`0`&&u===`=`)&&(p=!0,l=`0`,u=`=`);var y=f===`$`?n:f===`#`&&/[boxX]/.test(v)?`0`+v.toLowerCase():``,b=f===`$`?r:/[%p]/.test(v)?o:``,x=gQ[v],S=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function C(e){var n=y,r=b,o,f,C;if(v===`c`)r=x(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),g),_&&(e=oEe(e)),w&&+e==0&&d!==`+`&&(w=!1),n=(w?d===`(`?d:s:d===`-`||d===`(`?``:d)+n,r=(v===`s`?yQ[8+mQ/3]:``)+r+(w&&d===`(`?`)`:``),S){for(o=-1,f=e.length;++o<f;)if(C=e.charCodeAt(o),48>C||C>57){r=(C===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}h&&!p&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<m?Array(m-T+1).join(l):``;switch(h&&p&&(e=t(E+e,E.length?m-r.length:1/0),E=``),u){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return C.toString=function(){return e+``},C}function u(e,t){var n=l((e=fQ(e),e.type=`f`,e)),r=Math.max(-8,Math.min(8,Math.floor(dQ(t)/3)))*3,i=10**-r,a=yQ[8+r/3];return function(e){return n(i*e)+a}}return{format:l,formatPrefix:u}}var bQ,xQ,SQ;
471lEe({thousands:`,`,grouping:[3],currency:[`$`,``]});function lEe(e){return bQ=cEe(e),xQ=bQ.format,SQ=bQ.formatPrefix,bQ}function uEe(e){return Math.max(0,-dQ(Math.abs(e)))}function dEe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(dQ(t)/3)))*3-dQ(Math.abs(e)))}function fEe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,dQ(t)-dQ(e))+1}function CQ(e,t,n,r){var i=uZ(e,t,n),a;switch(r=fQ(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=dEe(i,o))&&(r.precision=a),SQ(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=fEe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=uEe(i))&&(r.precision=a-(r.type===`%`)*2);break}return xQ(r)}function wQ(e){var t=e.domain;return e.ticks=function(e){var n=t();return cZ(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return CQ(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=lZ(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function TQ(){var e=lQ();return e.copy=function(){return sQ(e,TQ())},hZ.apply(e,arguments),wQ(e)}function EQ(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,rQ),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return EQ(e).unknown(t)},e=arguments.length?Array.from(e,rQ):[0,1],wQ(n)}function DQ(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function OQ(e){return Math.log(e)}function kQ(e){return Math.exp(e)}function pEe(e){return-Math.log(-e)}function mEe(e){return-Math.exp(-e)}function hEe(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function gEe(e){return e===10?hEe:e===Math.E?Math.exp:t=>e**+t}function _Ee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function AQ(e){return(t,n)=>-e(-t,n)}function jQ(e){let t=e(OQ,kQ),n=t.domain,r=10,i,a;function o(){return i=_Ee(r),a=gEe(r),n()[0]<0?(i=AQ(i),a=AQ(a),e(pEe,mEe)):e(OQ,kQ),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=cZ(o,s,p))}else m=cZ(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=fQ(n)).precision==null&&(n.trim=!0),n=xQ(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(DQ(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function MQ(){let e=jQ(cQ()).domain([1,10]);return e.copy=()=>sQ(e,MQ()).base(e.base()),hZ.apply(e,arguments),e}function NQ(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function PQ(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function FQ(e){var t=1,n=e(NQ(t),PQ(t));return n.constant=function(n){return arguments.length?e(NQ(t=+n),PQ(t)):t},wQ(n)}function IQ(){var e=FQ(cQ());return e.copy=function(){return sQ(e,IQ()).constant(e.constant())},hZ.apply(e,arguments)}function LQ(e){return function(t){return t<0?-((-t)**+e):t**+e}}function vEe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function yEe(e){return e<0?-e*e:e*e}function RQ(e){var t=e(aQ,aQ),n=1;function r(){return n===1?e(aQ,aQ):n===.5?e(vEe,yEe):e(LQ(n),LQ(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},wQ(t)}function zQ(){var e=RQ(cQ());return e.copy=function(){return sQ(e,zQ()).exponent(e.exponent())},hZ.apply(e,arguments),e}function bEe(){return zQ.apply(null,arguments).exponent(.5)}function BQ(e){return Math.sign(e)*e*e}function xEe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function VQ(){var e=lQ(),t=[0,1],n=!1,r;function i(t){var i=xEe(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(BQ(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,rQ)).map(BQ)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return VQ(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},hZ.apply(i,arguments),wQ(i)}function HQ(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=ETe(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[rZ(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort($X),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return HQ().domain(e).range(t).unknown(r)},hZ.apply(a,arguments)}function UQ(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[rZ(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return UQ().domain([e,t]).range(i).unknown(a)},hZ.apply(wQ(o),arguments)}function WQ(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[rZ(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=M
471ath.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return WQ().domain(e).range(t).unknown(n)},hZ.apply(i,arguments)}var GQ=new Date,KQ=new Date;function qQ(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>qQ(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(GQ.setTime(+t),KQ.setTime(+r),e(GQ),e(KQ),Math.floor(n(GQ,KQ))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var JQ=qQ(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);JQ.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qQ(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):JQ),JQ.range;var YQ=1e3,XQ=YQ*60,ZQ=XQ*60,QQ=ZQ*24,$Q=QQ*7,e$=QQ*30,t$=QQ*365,n$=qQ(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*YQ)},(e,t)=>(t-e)/YQ,e=>e.getUTCSeconds());n$.range;var r$=qQ(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*YQ)},(e,t)=>{e.setTime(+e+t*XQ)},(e,t)=>(t-e)/XQ,e=>e.getMinutes());r$.range;var i$=qQ(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*XQ)},(e,t)=>(t-e)/XQ,e=>e.getUTCMinutes());i$.range;var a$=qQ(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*YQ-e.getMinutes()*XQ)},(e,t)=>{e.setTime(+e+t*ZQ)},(e,t)=>(t-e)/ZQ,e=>e.getHours());a$.range;var o$=qQ(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ZQ)},(e,t)=>(t-e)/ZQ,e=>e.getUTCHours());o$.range;var s$=qQ(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*XQ)/QQ,e=>e.getDate()-1);s$.range;var c$=qQ(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/QQ,e=>e.getUTCDate()-1);c$.range;var l$=qQ(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/QQ,e=>Math.floor(e/QQ));l$.range;function u$(e){return qQ(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*XQ)/$Q)}var d$=u$(0),f$=u$(1),SEe=u$(2),CEe=u$(3),p$=u$(4),wEe=u$(5),TEe=u$(6);d$.range,f$.range,SEe.range,CEe.range,p$.range,wEe.range,TEe.range;function m$(e){return qQ(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/$Q)}var h$=m$(0),g$=m$(1),EEe=m$(2),DEe=m$(3),_$=m$(4),OEe=m$(5),kEe=m$(6);h$.range,g$.range,EEe.range,DEe.range,_$.range,OEe.range,kEe.range;var v$=qQ(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());v$.range;var y$=qQ(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());y$.range;var b$=qQ(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());b$.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qQ(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),b$.range;var x$=qQ(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());x$.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qQ(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),x$.range;function S$(e,t,n,r,i,a){let o=[[n$,1,YQ],[n$,5,5*YQ],[n$,15,15*YQ],[n$,30,30*YQ],[a,1,XQ],[a,5,5*XQ],[a,15,15*XQ],[a,30,30*XQ],[i,1,ZQ],[i,3,3*ZQ],[i,6,6*ZQ],[i,12,12*ZQ],[r,1,QQ],[r,2,2*QQ],[n,1,$Q],[t,1,e$],[t,3,3*e$],[e,1,t$]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=eZ(([,,e])=>e).right(o,i);if(a===o.length)return e.every(uZ(t/t$,n/t$,r));if(a===0)return JQ.every(Math.max(uZ(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[AEe,jEe]=S$(x$,y$,h$,l$,o$,i$),[MEe,NEe]=S$(b$,v$,d$,s$,a$,r$);function C$(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function w$(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function T$(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function PEe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=k$(i),u=A$(i),d=k$(a),f=A$(a),p=k$(o),m=A$(o),h=k$(s),g=A$(s),_=k$(c),v=A$(c),y={a:N,A:ee,b:te,B:ne,c:null,d:F$,e:F$,f:rDe,g:pDe,G:hDe,H:eDe,I:tDe,j:nDe,L:I$,m:iDe,M:aDe,p:re,q:ie,Q:H$,s:U$,S:oDe,u:sDe,U:cDe,V:lDe,w:uDe,W:dDe,x:null,X:null,y:fDe,Y:mDe,Z:gDe,"%":V$},b={a:ae,A:oe,b:se,B:ce,c:null,d:R$,e:R$,f:bDe,g:ADe,G:MDe,H:_De,I:vDe,j:yDe,L:z$,m:xDe,M:SDe,p:le,q:ue,Q:H$,s:U$,S:CDe,u:wDe,U:TDe,V:EDe,w:DDe,W:ODe,x:null,X:null,y:kDe,Y:jDe,Z:NDe,"%":V$},x={a:E,A:D,b:O,B:k,c:A,d:N$,e:N$,f:XEe,g:M$,G:j$,H:P$,I:P$,j:KEe,L:YEe,m:GEe,M:qEe,p:T,q:WEe,Q:QEe,s:$Ee,S:JEe,u:zEe,U:BEe,V:VEe,w:REe,W:HEe,x:j,X:M,y:M$,Y:j$,Z:UEe,"%":ZEe};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;
471for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=E$[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=T$(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=w$(T$(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?g$.ceil(a):g$(a),a=c$.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=C$(T$(r.y,0,1)),o=a.getDay(),a=o>4||o===0?f$.ceil(a):f$(a),a=s$.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?w$(T$(r.y,0,1)).getUTCDay():C$(T$(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,w$(r)):C$(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in E$?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function ee(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function re(e){return i[+(e.getHours()>=12)]}function ie(e){return 1+~~(e.getMonth()/3)}function ae(e){return o[e.getUTCDay()]}function oe(e){return a[e.getUTCDay()]}function se(e){return c[e.getUTCMonth()]}function ce(e){return s[e.getUTCMonth()]}function le(e){return i[+(e.getUTCHours()>=12)]}function ue(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var E$={"-":``,_:` `,0:`0`},D$=/^\s*\d+/,FEe=/^%/,IEe=/[\\^$*+?|[\]().{}]/g;function O$(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function LEe(e){return e.replace(IEe,`\\$&`)}function k$(e){return RegExp(`^(?:`+e.map(LEe).join(`|`)+`)`,`i`)}function A$(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function REe(e,t,n){var r=D$.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zEe(e,t,n){var r=D$.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function VEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function HEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function j$(e,t,n){var r=D$.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function M$(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function UEe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function WEe(e,t,n){var r=D$.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function GEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function N$(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function KEe(e,t,n){var r=D$.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function P$(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function JEe(e,t,n){var r=D$.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function YEe(e,t,n){var r=D$.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function XEe(e,t,n){var r=D$.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ZEe(e,t,n){var r=FEe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function QEe(e,t,n){var r=D$.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function $Ee(e,t,n){var r=D$.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function F$(e,t){return O$(e.getDate(),t,2)}function eDe(e,t){return O$(e.getHours(),t,2)}function tDe(e,t){return O$(e.getHours()%12||12,t,2)}function nDe(e,t){return O$(1+s$.count(b$(e),e),t,3)}function I$(e,t){return O$(e.getMilliseconds(),t,3)}function rDe(e,t){return I$(e,t)+`000`}function iDe(e,t){return O$(e.getMonth()+1,t,2)}function aDe(e,t){return O$(e.getMinutes(),t,2)}function oDe(e,t){return O$(e.getSeconds(),t,2)}function sDe(e){var t=e.getDay();return t===0?7:t}function cDe(e,t){return O$(d$.count(b$(e)-1,e),t,2)}function L$(e){var t=e.getDay();return t>=4||t===0?p$(e):p$.ceil(e)}function lDe(e,t){return e=L$(e),O$(p$.count(b$(e),e)+(b$(e).getDay()===4),t,2)}function uDe(e){return e.getDay()}function dDe(e,t){return O$(f$.count(b$(e)-1,e),t,2)}function fDe(e,t){return O$(e.getFullYear()%100,t,2)}function pDe(e,t){return e=L$(e),O$(e.getFullYear()%100,t,2)}function mDe(e,t){return O$(e.getFullYear()%1e4,t,4)}function hDe(e,t){var n=e.getDay();return e=n>=4||n===0?p$(e):p$.ceil(e),O$(e.getFullYear()%1e4,t,4)}function gDe(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+O$(t/60|0,`0`,2)+O$(t%60,`0`,2)}function R$(e,t){return O$(e.getUTCDate(),t,2)}function _De(e,t){return O$(e.getUTCHours(),t,2)}function vDe(e,t){return O$(e.getUTCHours()%12||12,t,2)}function yDe(e,t){return O$(1+c$.count(x$(e),e),t,3)}function z$(e,t){return O$(e.getUTCMilliseconds(),t,3)}function bDe(e,t){return z$(e,t)+`000`}function xDe(e,t){return O$(e.getUTCMonth()+1,t,2)}function SDe(e,t){return O$(e.getUTCMinutes(),t,2)}function CDe(e,t){return O$(e.getUTCSeconds(),t,2)}function wDe(e){var t=e.getUTCDay();return t===0?7:t}function TDe(e,t){return O$(h$.count(x$(e)-1,e),t,2)}function B$(e){var t=e.getUTCDay();return t>=4||t===0?_$(e):_$.ceil(e)}function EDe(e,t){return e=B$(e),O$(_$.count(x$(e),e)+(x$(e).getUTCDay()===4),t,2)}function DDe(e){return e.getUTCDay()}function ODe(e,t){return O$(g$.count(x$(e)-1,e),t,2)}function kDe(e,t){return O$(e.getUTCFullYear()%100,t,2)}function ADe(e,t){return e=B$(e),O$(e.getUTCFullYear()%100,t,2)}function jDe(e,t){return O$(e.getUTCFullYear()%1e4,t,4)}function MDe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?_$(e):_$.ceil(e),O$(e.getUTCFullYear()%1e4,t,4)}function NDe(){return`+0000`}function V$(){return`%`}function H$(e){return+e}function U$(e){return Math.floor(e/1e3)}var W$,G$,K$;PDe({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function PDe(e){return W$=PEe(e),G$=W$.format,W$.parse,K$=W$.utcFormat,W$.utcParse,W$}function FDe(e){return new Date(e)}function IDe(e){return e instanceof Date?+e:+new Date(+e)}function q$(e,t,n,r,i,a,o,s,c,l){var u=lQ(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,IDe)):f().map(FDe)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(DQ(n,e)):u},u.copy=function(){return sQ(u,q$(e,t,n,r,i,a,o,s,c,l))},u}function LDe(){return hZ.apply(q$(MEe,NEe,b$,v$,d$,s$,a$,r$,n$,G$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function RDe(){return hZ.apply(q$(AEe,jEe,x$,y$,h$,c$,o$,i$,n$,K$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function J$(){var e=0,t=1,n,r,i,a,o=aQ,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(tQ),l.rangeRound=u(nQ),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function Y$(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}
471function X$(){var e=wQ(J$()(aQ));return e.copy=function(){return Y$(e,X$())},gZ.apply(e,arguments)}function Z$(){var e=jQ(J$()).domain([1,10]);return e.copy=function(){return Y$(e,Z$()).base(e.base())},gZ.apply(e,arguments)}function Q$(){var e=FQ(J$());return e.copy=function(){return Y$(e,Q$()).constant(e.constant())},gZ.apply(e,arguments)}function $$(){var e=RQ(J$());return e.copy=function(){return Y$(e,$$()).exponent(e.exponent())},gZ.apply(e,arguments)}function zDe(){return $$.apply(null,arguments).exponent(.5)}function e1(){var e=[],t=aQ;function n(n){if(n!=null&&!isNaN(n=+n))return t((rZ(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort($X),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>TTe(e,r/t))},n.copy=function(){return e1(t).domain(e)},gZ.apply(n,arguments)}function t1(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=aQ,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=ZTe(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(tQ),p.rangeRound=m(nQ),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function n1(){var e=wQ(t1()(aQ));return e.copy=function(){return Y$(e,n1())},gZ.apply(e,arguments)}function r1(){var e=jQ(t1()).domain([.1,1,10]);return e.copy=function(){return Y$(e,r1()).base(e.base())},gZ.apply(e,arguments)}function i1(){var e=FQ(t1());return e.copy=function(){return Y$(e,i1()).constant(e.constant())},gZ.apply(e,arguments)}function a1(){var e=RQ(t1());return e.copy=function(){return Y$(e,a1()).exponent(e.exponent())},gZ.apply(e,arguments)}function BDe(){return a1.apply(null,arguments).exponent(.5)}var o1=c({scaleBand:()=>yZ,scaleDiverging:()=>n1,scaleDivergingLog:()=>r1,scaleDivergingPow:()=>a1,scaleDivergingSqrt:()=>BDe,scaleDivergingSymlog:()=>i1,scaleIdentity:()=>EQ,scaleImplicit:()=>_Z,scaleLinear:()=>TQ,scaleLog:()=>MQ,scaleOrdinal:()=>vZ,scalePoint:()=>xZ,scalePow:()=>zQ,scaleQuantile:()=>HQ,scaleQuantize:()=>UQ,scaleRadial:()=>VQ,scaleSequential:()=>X$,scaleSequentialLog:()=>Z$,scaleSequentialPow:()=>$$,scaleSequentialQuantile:()=>e1,scaleSequentialSqrt:()=>zDe,scaleSequentialSymlog:()=>Q$,scaleSqrt:()=>bEe,scaleSymlog:()=>IQ,scaleThreshold:()=>WQ,scaleTime:()=>LDe,scaleUtc:()=>RDe,tickFormat:()=>CQ}),s1=s(((e,t)=>{var n=FK();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),c1=s(((e,t)=>{function n(e,t){return e>t}t.exports=n})),VDe=s(((e,t)=>{var n=s1(),r=c1(),i=gY();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),l1=s(((e,t)=>{function n(e,t){return e<t}t.exports=n})),HDe=s(((e,t)=>{var n=s1(),r=l1(),i=gY();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),UDe=s(((e,t)=>{var n=YK(),r=_Y(),i=LY(),a=kK();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),WDe=s(((e,t)=>{var n=PY(),r=UDe();function i(e,t){return n(r(e,t),1)}t.exports=i})),GDe=s(((e,t)=>{var n=pY();function r(e,t){return n(e,t)}t.exports=r})),KDe=s(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n}
471,g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;
vendor: 5,099 bytes, line 471
471)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>
4710;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}));function qDe(e){return ZDe(e)||XDe(e)||YDe(e)||JDe()}function JDe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 472In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YDe(e,t){if(e){if(typeof e==`string`)return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u1(e,t)}}function XDe(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function ZDe(e){if(Array.isArray(e))return u1(e)}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var QDe=function(e){return e},d1={"@@functional/placeholder":!0},f1=function(e){return e===d1},p1=function(e){return function t(){return arguments.length===0||arguments.length===1&&f1(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},$De=function e(t,n){return t===1?n:p1(function(){var r=[...arguments],i=r.filter(function(e){return e!==d1}).length;return i>=t?n.apply(void 0,r):e(t-i,p1(function(){var e=[...arguments],t=r.map(function(t){return f1(t)?e.shift():t});return n.apply(void 0,qDe(t).concat(e))}))})},m1=function(e){return $De(e.length,e)},h1=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},eOe=m1(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),tOe=function(){var e=[...arguments];if(!e.length)return QDe;var t=e.reverse(),n=t[0],r=t.slice(1);return function(){return r.reduce(function(e,t){return t(e)},n.apply(void 0,arguments))}},g1=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},_1=function(e){var t=null,n=null;return function(){var r=[...arguments];return t&&r.every(function(e,n){return e===t[n]})?n:(t=r,n=e.apply(void 0,r),n)}},v1=u(KDe());function nOe(e){return e===0?1:Math.floor(new v1.default(e).abs().log(10).toNumber())+1}function rOe(e,t,n){for(var r=new v1.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var y1={rangeStep:rOe,getDigitCount:nOe,interpolateNumber:m1(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:m1(function(e,t,n){var r=t-+e;
472return r||=1/0,(n-e)/r}),uninterpolateTruncation:m1(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function b1(e){return oOe(e)||aOe(e)||S1(e)||iOe()}function iOe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 473In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aOe(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function oOe(e){if(Array.isArray(e))return C1(e)}function x1(e,t){return lOe(e)||cOe(e,t)||S1(e,t)||sOe()}function sOe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 474In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S1(e,t){if(e){if(typeof e==`string`)return C1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C1(e,t)}}function C1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cOe(e,t){if(!(typeof Symbol>`u`||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function lOe(e){if(Array.isArray(e))return e}function w1(e){var t=x1(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function T1(e,t,n){if(e.lte(0))return new v1.default(0);var r=y1.getDigitCount(e.toNumber()),i=new v1.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new v1.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new v1.default(Math.ceil(s))}function uOe(e,t,n){var r=1,i=new v1.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new v1.default(10).pow(y1.getDigitCount(e)-1),i=new v1.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new v1.default(Math.floor(e)))}else e===0?i=new v1.default(Math.floor((t-1)/2)):n||(i=new v1.default(Math.floor(e)));var o=Math.floor((t-1)/2);return tOe(eOe(function(e){return i.add(new v1.default(e-o).mul(r)).toNumber()}),h1)(0,t)}function E1(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new v1.default(0),tickMin:new v1.default(0),tickMax:new v1.default(0)};var a=T1(new v1.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new v1.default(0):(o=new v1.default(e).add(t).div(2),o=o.sub(new v1.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new v1.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?E1(e,t,n,r,i+1):(l<n&&(c=t>0?c+(n-l):c,s=t>0?s:s+(n-l)),{step:a,tickMin:o.sub(new v1.default(s).mul(a)),tickMax:o.add(new v1.default(c).mul(a))})}function dOe(e){var t=x1(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=x1(w1([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(b1(h1(0,i-1).map(function(){return 1/0}))):[].concat(b1(h1(0,i-1).map(function(){return-1/0})),[l]);return n>r?g1(u):u}if(c===l)return uOe(c,i,a);var d=E1(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=y1.rangeStep(p,m.add(new v1.default(.1).mul(f)),f);return n>r?g1(h):h}function fOe(e,t){var n=x1(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=x1(w1([r,i]),2),s=o[0],c=o[1];if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var l=Math.max(t,2),u=T1(new v1.default(c).sub(s).div(l-1),a,0),d=[].concat(b1(y1.rangeStep(new v1.default(s),new v1.default(c).sub(new v1.default(.99).mul(u)),u)),[c]);return r>i?g1(d):d}var pOe=_1(dOe),mOe=_1(fOe),hOe=`Invariant failed`;function D1(e,t){if(!e)throw Error(hOe)}var gOe=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function O1(){return O1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O1.apply(this,arguments)}function _Oe(e,t){return xOe(e)||bOe(e,t)||yOe(e,t)||vOe()}
474function vOe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 475In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yOe(e,t){if(e){if(typeof e==`string`)return k1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k1(e,t)}}function k1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bOe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function xOe(e){if(Array.isArray(e))return e}function SOe(e,t){if(e==null)return{};var n=COe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function COe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function A1(e){var t=e.offset,n=e.layout,r=e.width,i=e.dataKey,a=e.data,o=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,l=Mq(SOe(e,gOe),!1);e.direction===`x`&&s.type!==`number`&&D1(!1);var u=a.map(function(e){var a=o(e,i),u=a.x,d=a.y,f=a.value,p=a.errorVal;if(!p)return null;var m=[],h,g;if(Array.isArray(p)){var _=_Oe(p,2);h=_[0],g=_[1]}else h=g=p;if(n===`vertical`){var v=s.scale,b=d+t,x=b+r,S=b-r,C=v(f-h),w=v(f+g);m.push({x1:w,y1:x,x2:w,y2:S}),m.push({x1:C,y1:b,x2:w,y2:b}),m.push({x1:C,y1:x,x2:C,y2:S})}else if(n===`horizontal`){var T=c.scale,E=u+t,D=E-r,O=E+r,k=T(f-h),A=T(f+g);m.push({x1:D,y1:A,x2:O,y2:A}),m.push({x1:E,y1:k,x2:E,y2:A}),m.push({x1:D,y1:k,x2:O,y2:k})}return y.createElement(zq,O1({className:`recharts-errorBar`,key:`bar-${m.map(function(e){return`${e.x1}-${e.x2}-${e.y1}-${e.y2}`})}`},l),m.map(function(e){return y.createElement(`line`,O1({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return y.createElement(zq,{className:`recharts-errorBars`},u)}A1.defaultProps={stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`},A1.displayName=`ErrorBar`;function j1(e){"@babel/helpers - typeof";return j1=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},j1(e)}function M1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?M1(Object(n),!0).forEach(function(t){wOe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wOe(e,t,n){return t=TOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TOe(e){var t=EOe(e,`string`);return j1(t)==`symbol`?t:String(t)}function EOe(e,t){if(j1(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(j1(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var P1=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=Aq(t,NY);if(!a)return null;var o=a.props&&a.props.payload?a.props&&a.props.payload:i===`children`?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendT
475ype,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.props,r=n.dataKey,i=n.name,o=n.legendType;return{inactive:n.hide,dataKey:r,type:a.props.iconType||o||`square`,color:K1(t),value:i||r,payload:t.props}});return N1(N1(N1({},a.props),NY.getWithHeight(a,r)),{},{payload:o,item:a})},F1=u(VDe()),I1=u(HDe()),DOe=u(WDe()),L1=u(GDe());function R1(e){"@babel/helpers - typeof";return R1=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},R1(e)}function z1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z1(Object(n),!0).forEach(function(t){V1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V1(e,t,n){return t=OOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OOe(e){var t=kOe(e,`string`);return R1(t)==`symbol`?t:String(t)}function kOe(e,t){if(R1(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(R1(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H1(e){return NOe(e)||MOe(e)||jOe(e)||AOe()}function AOe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 476In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jOe(e,t){if(e){if(typeof e==`string`)return U1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U1(e,t)}}function MOe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function NOe(e){if(Array.isArray(e))return U1(e)}function U1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function W1(e,t,n){return(0,bq.default)(e)||(0,bq.default)(t)?n:sq(t)?(0,iq.default)(e,t,n):(0,xq.default)(t)?t(e):n}function G1(e,t,n,r){var i=(0,DOe.default)(e,function(e){return W1(e,t)});if(n===`number`){var a=i.filter(function(e){return X(e)||parseFloat(e)});return a.length?[(0,I1.default)(a),(0,F1.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,bq.default)(e)}):i).map(function(e){return sq(e)||e instanceof Date?e:``})}var POe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=-1,a=t?.length??0;if(a<=1)return 0;if(r&&r.axisType===`angleAxis`&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var o=r.range,s=0;s<a;s++){var c=s>0?n[s-1].coordinate:n[a-1].coordinate,l=n[s].coordinate,u=s>
476=a-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(aq(l-c)!==aq(u-l)){var f=[];if(aq(u-l)===aq(o[1]-o[0])){d=u;var p=l+o[1]-o[0];f[0]=Math.min(p,(p+c)/2),f[1]=Math.max(p,(p+c)/2)}else{d=c;var m=u+o[1]-o[0];f[0]=Math.min(l,(m+l)/2),f[1]=Math.max(l,(m+l)/2)}var h=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(e>h[0]&&e<=h[1]||e>=f[0]&&e<=f[1]){i=n[s].index;break}}else{var g=Math.min(c,u),_=Math.max(c,u);if(e>(g+l)/2&&e<=(_+l)/2){i=n[s].index;break}}}else for(var v=0;v<a;v++)if(v===0&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v>0&&v<a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v===a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2){i=t[v].index;break}return i},K1=function(e){var t=e.type.displayName,n=e.props,r=n.stroke,i=n.fill,a;switch(t){case`Line`:a=r;break;case`Area`:case`Radar`:a=r&&r!==`none`?r:i;break;default:a=i;break}return a},FOe=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,c=o.length;s<c;s++)for(var l=i[o[s]].stackGroups,u=Object.keys(l),d=0,f=u.length;d<f;d++){var p=l[u[d]],m=p.items,h=p.cateAxisId,g=m.filter(function(e){return Tq(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].props.barSize,v=g[0].props[h];a[v]||(a[v]=[]);var y=(0,bq.default)(_)?t:_;a[v].push({item:g[0],stackList:g.slice(1),barSize:(0,bq.default)(y)?void 0:lq(y,n,0)})}}return a},IOe=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,o=e.maxBarSize,s=a.length;if(s<1)return null;var c=lq(t,r,0,!0),l,u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=r/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);p+=(s-1)*c,p>=r&&(p-=(s-1)*c,c=0),p>=r&&f>0&&(d=!0,f*=.9,p=s*f);var m={offset:((r-p)/2>>0)-c,size:0};l=a.reduce(function(e,t){var n={item:t.item,position:{offset:m.offset+m.size+c,size:d?f:t.barSize}},r=[].concat(H1(e),[n]);return m=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:m})}),r},u)}else{var h=lq(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var _=o===+o?Math.min(g,o):g;l=a.reduce(function(e,t,n){var r=[].concat(H1(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-_)/2,size:_}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l},LOe=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=P1({children:i,legendWidth:a-(o.left||0)-(o.right||0)});if(s){var c=r||{},l=c.width,u=c.height,d=s.align,f=s.verticalAlign,p=s.layout;if((p===`vertical`||p===`horizontal`&&f===`middle`)&&d!==`center`&&X(e[d]))return B1(B1({},e),{},V1({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&X(e[f]))return B1(B1({},e),{},V1({},f,e[f]+(u||0)))}return e},ROe=function(e,t,n){return(0,bq.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n!==`y`||t===`yAxis`},q1=function(e,t,n,r,i){var a=t.props.children,o=kq(a,A1).filter(function(e){return ROe(r,i,e.props.direction)});if(o&&o.length){var s=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=W1(t,n);if((0,bq.default)(r))return e;var i=Array.isArray(r)?[(0,I1.default)(r),(0,F1.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=W1(t,n,0),a=i[0]-Math.abs(Array.isArray(r)?r[0]:r),o=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(o,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},zOe=function(e,t,n,r,i){var a=t.map(function(t){return q1(e,t,n,i,r)}).filter(function(e){return!(0,bq.default)(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},J1=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&q1(e,t,a,r)||G1(e,a,n,i)});if(n===`number`)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var o={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)o[t[n]]||(o[t[n]]=!0,e.push(t[n]));return e},[])},Y1=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},X1=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var i,a,o=e.map(function(e){return e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate});return i||o.push(t),a||o.push(n),o},Z1=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,a=e.type,o=e.range,s=e.realScaleType===`scaleBand`?r.bandwidth()/2:2,c=(t||n)&&a===`category`&&r.bandwidth?r.bandwidth()/s:0;return c=e.axisType===`angleAxis`&&o?.length>=2?aq(o[0]-o[1])*2*c:c,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+c,value:e,offset:c}}).filter(function(e){return!(0,rq.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+c,value:e,index:t,offset:c}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+c,value:e,offset:c}}):r.domain().map(function(e,t){return{coordinate:r(e)+c,value:i?i[e]:e,index:t,offset:c}})},Q1=new WeakMap,$1=function(e,t){if(typeof t!=`function`)return e;Q1.has(e)||Q1.set(e,new WeakMap);var n=Q1.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},e0=function(e,t,n){var r=e.scale,i=e.type,a=e.layout,o=e.axisType;if(r===`auto`)return a===`radial`&&o===`radiusAxis`?{scale:yZ(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:TQ(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>
476=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:xZ(),realScaleType:`point`}:i===`category`?{scale:yZ(),realScaleType:`band`}:{scale:TQ(),realScaleType:`linear`};if((0,nq.default)(r)){var s=`scale${(0,MJ.default)(r)}`;return{scale:(o1[s]||xZ)(),realScaleType:o1[s]?s:`point`}}return(0,xq.default)(r)?{scale:r}:{scale:xZ(),realScaleType:`point`}},t0=1e-4,n0=function(e){var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-t0,a=Math.max(r[0],r[1])+t0,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},BOe=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},VOe=function(e,t){if(!t||t.length!==2||!X(t[0])||!X(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!X(e[0])||e[0]<n)&&(i[0]=n),(!X(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},HOe={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0,o=0;o<t;++o){var s=(0,rq.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=i,e[o][n][1]=i+s,i=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1])}},expand:cSe,none:AJ,silhouette:lSe,wiggle:uSe,positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0;a<t;++a){var o=(0,rq.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=i,e[a][n][1]=i+o,i=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},UOe=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=HOe[n];return sSe().keys(r).value(function(e,t){return+W1(e,t,0)}).order(jJ).offset(i)(e)},WOe=function(e,t,n,r,i,a){if(!e)return null;var o=(a?t.reverse():t).reduce(function(e,t){var i=t.props,a=i.stackId;if(i.hide)return e;var o=t.props[n],s=e[o]||{hasStack:!1,stackGroups:{}};if(sq(a)){var c=s.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};c.items.push(t),s.hasStack=!0,s.stackGroups[a]=c}else s.stackGroups[cq(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return B1(B1({},e),{},V1({},o,s))},{});return Object.keys(o).reduce(function(t,a){var s=o[a];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,a){var o=s.stackGroups[a];return B1(B1({},t),{},V1({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:UOe(e,o.items,i)}))},{})),B1(B1({},t),{},V1({},a,s))},{})},r0=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,a=t.originalDomain,o=t.allowDecimals,s=n||t.scale;if(s!==`auto`&&s!==`linear`)return null;if(i&&r===`number`&&a&&(a[0]===`auto`||a[1]===`auto`)){var c=e.domain();if(!c.length)return null;var l=pOe(c,i,o);return e.domain([(0,I1.default)(l),(0,F1.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:mOe(e.domain(),i,o)}:null},i0=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=W1(a,t.dataKey,t.domain[o]);return(0,bq.default)(s)?null:t.scale(s)-i/2+r},GOe=function(e){var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},KOe=function(e,t){var n=e.props.stackId;if(sq(n)){var r=t[n];if(r){var i=r.items.indexOf(e);return i>=0?r.stackedData[i]:null}}return null},qOe=function(e){return e.reduce(function(e,t){return[(0,I1.default)(t.concat([e[0]]).filter(X)),(0,F1.default)(t.concat([e[1]]).filter(X))]},[1/0,-1/0])},a0=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=qOe(r.slice(t,n+1));return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},o0=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,s0=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,c0=function(e,t,n){if((0,xq.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(X(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(o0.test(e[0])){var i=+o0.exec(e[0])[1];r[0]=t[0]-i}else(0,xq.default)(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if(X(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(s0.test(e[1])){var a=+s0.exec(e[1])[1];r[1]=t[1]+a}else(0,xq.default)(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},l0=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,BY.default)(t,function(e){return e.coordinate}),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c.coordinate||0)-(l.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},u0=function(e,t,n){return!e||!e.length||(0,L1.default)(e,(0,iq.default)(n,`type.defaultProps.domain`))?t:e},d0=function(e,t){var n=e.props,r=n.dataKey,i=n.name,a=n.unit,o=n.formatter,s=n.tooltipType,c=n.chartType,l=n.hide;return B1(B1({},Mq(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:K1(e),value:W1(t,r),type:s,payload:t,chartType:c,hide:l})};function f0(e){"@babel/helpers - typeof";return f0=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},f0(e)}function p0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
476t%2?p0(Object(n),!0).forEach(function(t){h0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h0(e,t,n){return t=JOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JOe(e){var t=YOe(e,`string`);return f0(t)==`symbol`?t:String(t)}function YOe(e,t){if(f0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(f0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XOe(e,t){return eke(e)||$Oe(e,t)||QOe(e,t)||ZOe()}function ZOe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 477In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QOe(e,t){if(e){if(typeof e==`string`)return g0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g0(e,t)}}function g0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $Oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function eke(e){if(Array.isArray(e))return e}var _0=Math.PI/180,tke=function(e){return e*180/Math.PI},v0=function(e,t,n,r){return{x:e+Math.cos(-_0*r)*n,y:t+Math.sin(-_0*r)*n}},y0=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},nke=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=lq(e.cx,a,a/2),u=lq(e.cy,o,o/2),d=y0(a,o,n),f=lq(e.innerRadius,d,0),p=lq(e.outerRadius,d,d*.8);return Object.keys(t).reduce(function(e,n){var a=t[n],o=a.domain,d=a.reversed,m;if((0,bq.default)(a.range))r===`angleAxis`?m=[s,c]:r===`radiusAxis`&&(m=[f,p]),d&&(m=[m[1],m[0]]);else{m=a.range;var h=XOe(m,2);s=h[0],c=h[1]}var g=e0(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),n0(v);var y=r0(v,m0(m0({},a),{},{realScaleType:_})),b=m0(m0(m0({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return m0(m0({},e),{},h0({},n,b))},{})},rke=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},ike=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=rke({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:tke(c),angleInRadian:c}},ake=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},oke=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},b0=function(e,t){var n=e.x,r=e.y,i=ike({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c)return!1;if(a===0)return!0;var l=ake(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?m0(m0({},t),{},{radius:a,angle:oke(f,t)}):null},x0=function(e){return!(0,y.isValidElement)(e)&&!(0,xq.default)(e)&&typeof e!=`boolean`?e.className:``};function S0(e){"@babel/helpers - typeof";return S0=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},S0(e)}var ske=[`offset`];function cke(e){return fke(e)||dke(e)||uke(e)||lke()}function lke(){throw TypeError(`Invalid attempt to spread non-iterable instance. 478In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uke(e,t){if(e){if(typeof e==`string`)return C0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C0(e,t)}}function dke(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function fke(e){if(Array.isArray(e))return C0(e)}function C0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pke(e,t){if(e==null)return{};var n=mke(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mke(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function w0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
478t%2?w0(Object(n),!0).forEach(function(t){hke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hke(e,t,n){return t=gke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gke(e){var t=_ke(e,`string`);return S0(t)==`symbol`?t:String(t)}function _ke(e,t){if(S0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(S0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E0(){return E0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E0.apply(this,arguments)}var vke=function(e){var t=e.value,n=e.formatter,r=(0,bq.default)(e.children)?t:e.children;return(0,xq.default)(n)?n(r):r},yke=function(e,t){return aq(t-e)*Math.min(Math.abs(t-e),360)},bke=function(e,t,n){var r=e.position,i=e.viewBox,a=e.offset,o=e.className,s=i,c=s.cx,l=s.cy,u=s.innerRadius,d=s.outerRadius,f=s.startAngle,p=s.endAngle,m=s.clockWise,h=(u+d)/2,g=yke(f,p),_=g>=0?1:-1,v,b;r===`insideStart`?(v=f+_*a,b=m):r===`insideEnd`?(v=p-_*a,b=!m):r===`end`&&(v=p+_*a,b=m),b=g<=0?b:!b;var x=v0(c,l,h,v),S=v0(c,l,h,v+(b?1:-1)*359),C=`M${x.x},${x.y} 479 A${h},${h},0,1,${+!b}, 480 ${S.x},${S.y}`,w=(0,bq.default)(e.id)?cq(`recharts-radial-line-`):e.id;return y.createElement(`text`,E0({},n,{dominantBaseline:`central`,className:Ol(`recharts-radial-bar-label`,o)}),y.createElement(`defs`,null,y.createElement(`path`,{id:w,d:C})),y.createElement(`textPath`,{xlinkHref:`#${w}`},t))},xke=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,a=i.cx,o=i.cy,s=i.innerRadius,c=i.outerRadius,l=(i.startAngle+i.endAngle)/2;if(r===`outside`){var u=v0(a,o,c+n,l),d=u.x;return{x:d,y:u.y,textAnchor:d>=a?`start`:`end`,verticalAnchor:`middle`}}if(r===`center`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`middle`};if(r===`centerTop`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`start`};if(r===`centerBottom`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`end`};var f=v0(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},Ske=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,a=t,o=a.x,s=a.y,c=a.width,l=a.height,u=l>=0?1:-1,d=u*r,f=u>0?`end`:`start`,p=u>0?`start`:`end`,m=c>=0?1:-1,h=m*r,g=m>0?`end`:`start`,_=m>0?`start`:`end`;if(i===`top`)return T0(T0({},{x:o+c/2,y:s-u*r,textAnchor:`middle`,verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:c}:{});if(i===`bottom`)return T0(T0({},{x:o+c/2,y:s+l+d,textAnchor:`middle`,verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(s+l),0),width:c}:{});if(i===`left`){var v={x:o-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`};return T0(T0({},v),n?{width:Math.max(v.x-n.x,0),height:l}:{})}if(i===`right`){var y={x:o+c+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`};return T0(T0({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?T0({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?T0({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?T0({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?T0({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?T0({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?T0({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?T0({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?T0({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,mq.default)(i)&&(X(i.x)||oq(i.x))&&(X(i.y)||oq(i.y))?T0({x:o+lq(i.x,c),y:s+lq(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):T0({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},Cke=function(e){return`cx`in e&&X(e.cx)};function D0(e){var t=e.offset,n=t===void 0?5:t,r=pke(e,ske),i=T0({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,u=i.className,d=u===void 0?``:u,f=i.textBreakAll;if(!a||(0,bq.default)(s)&&(0,bq.default)(c)&&!(0,y.isValidElement)(l)&&!(0,xq.default)(l))return null;if((0,y.isValidElement)(l))return(0,y.cloneElement)(l,i);var p;if((0,xq.default)(l)){if(p=(0,y.createElement)(l,i),(0,y.isValidElement)(p))return p}else p=vke(i);var m=Cke(a),h=Mq(i,!0);if(m&&(o===`insideStart`||o===`insideEnd`||o===`end`))return bke(i,p,h);var g=m?xke(i):Ske(i);return y.createElement(QX,E0({className:Ol(`recharts-label`,d)},h,g,{breakAll:f}),p)}D0.displayName=`Label`;var O0=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,o=e.r,s=e.radius,c=e.innerRadius,l=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,m=e.width,h=e.height,g=e.clockWise,_=e.labelViewBox;if(_)return _;if(X(m)&&X(h)){if(X(u)&&X(d))return{x:u,y:d,width:m,height:h};
480if(X(f)&&X(p))return{x:f,y:p,width:m,height:h}}return X(u)&&X(d)?{x:u,y:d,width:0,height:0}:X(t)&&X(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:l||s||o||0,clockWise:g}:e.viewBox?e.viewBox:{}},wke=function(e,t){return e?e===!0?y.createElement(D0,{key:`label-implicit`,viewBox:t}):sq(e)?y.createElement(D0,{key:`label-implicit`,viewBox:t,value:e}):(0,y.isValidElement)(e)?e.type===D0?(0,y.cloneElement)(e,{key:`label-implicit`,viewBox:t}):y.createElement(D0,{key:`label-implicit`,content:e,viewBox:t}):(0,xq.default)(e)?y.createElement(D0,{key:`label-implicit`,content:e,viewBox:t}):(0,mq.default)(e)?y.createElement(D0,E0({viewBox:t},e,{key:`label-implicit`})):null:null};D0.parseViewBox=O0,D0.renderCallByParent=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=O0(e),a=kq(r,D0).map(function(e,n){return(0,y.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[wke(e.label,t||i)].concat(cke(a)):a};var Tke=u(s(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n}))());function k0(e){"@babel/helpers - typeof";return k0=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},k0(e)}var Eke=[`valueAccessor`],Dke=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function Oke(e){return Mke(e)||jke(e)||Ake(e)||kke()}function kke(){throw TypeError(`Invalid attempt to spread non-iterable instance. 481In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ake(e,t){if(e){if(typeof e==`string`)return A0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A0(e,t)}}function jke(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Mke(e){if(Array.isArray(e))return A0(e)}function A0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j0(){return j0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j0.apply(this,arguments)}function M0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?M0(Object(n),!0).forEach(function(t){Nke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nke(e,t,n){return t=Pke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pke(e){var t=Fke(e,`string`);return k0(t)==`symbol`?t:String(t)}function Fke(e,t){if(k0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(k0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function P0(e,t){if(e==null)return{};var n=Ike(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ike(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Lke=function(e){return Array.isArray(e.value)?(0,Tke.default)(e.value):e.value};function F0(e){var t=e.valueAccessor,n=t===void 0?Lke:t,r=P0(e,Eke),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=P0(r,Dke);return!i||!i.length?null:y.createElement(zq,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,bq.default)(a)?n(e,t):W1(e&&e.payload,a),i=(0,bq.default)(s)?{}:{id:`${s}-${t}`};return y.createElement(D0,j0({},Mq(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:D0.parseViewBox((0,bq.default)(o)?e:N0(N0({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}F0.displayName=`LabelList`;function Rke(e,t){return e?e===!0?y.createElement(F0,{key:`labelList-implicit`,data:t}):y.isValidElement(e)||(0,xq.default)(e)?y.createElement(F0,{key:`labelList-implicit`,data:t,content:e}):(0,mq.default)(e)?y.createElement(F0,j0({data:t},e,{key:`labelList-implicit`})):null:null}function zke(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=kq(r,F0).map(function(e,n){return(0,y.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[Rke(e.label,t)].concat(Oke(i)):i}F0.renderCallByParent=zke;function I0(e){"@babel/helpers - typeof";return I0=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},I0(e)}function L0(){return L0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L0.apply(this,arguments)}function R0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
481t%2?R0(Object(n),!0).forEach(function(t){Bke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bke(e,t,n){return t=Vke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vke(e){var t=Hke(e,`string`);return I0(t)==`symbol`?t:String(t)}function Hke(e,t){if(I0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(I0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Uke=function(e,t){return aq(t-e)*Math.min(Math.abs(t-e),359.999)},B0=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/_0,d=c?i:i+a*u,f=v0(t,n,l,d),p=v0(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:v0(t,n,l*Math.cos(u*_0),m),theta:u}},V0=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=Uke(a,o),c=a+s,l=v0(t,n,i,a),u=v0(t,n,i,c),d=`M ${l.x},${l.y} 482 A ${i},${i},0, 483 ${+(Math.abs(s)>180)},${+(a>c)}, 484 ${u.x},${u.y} 485 `;if(r>0){var f=v0(t,n,r,a),p=v0(t,n,r,c);d+=`L ${p.x},${p.y} 486 A ${r},${r},0, 487 ${+(Math.abs(s)>180)},${+(a<=c)}, 488 ${f.x},${f.y} Z`}else d+=`L ${t},${n} Z`;return d},Wke=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=aq(l-c),d=B0({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=B0({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?`M ${p.x},${p.y} 489 a${a},${a},0,0,1,${a*2},0 490 a${a},${a},0,0,1,${-a*2},0 491 `:V0({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=`M ${p.x},${p.y} 492 A${a},${a},0,0,${+(u<0)},${f.x},${f.y} 493 A${i},${i},0,${+(y>180)},${+(u<0)},${g.x},${g.y} 494 A${a},${a},0,0,${+(u<0)},${_.x},${_.y} 495 `;if(r>0){var x=B0({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=B0({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=`L${D.x},${D.y} 496 A${a},${a},0,0,${+(u<0)},${E.x},${E.y} 497 A${r},${r},0,${+(k>180)},${+(u>0)},${S.x},${S.y} 498 A${a},${a},0,0,${+(u<0)},${C.x},${C.y}Z`}else b+=`L${t},${n}Z`;return b},Gke={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},H0=function(e){var t=z0(z0({},Gke),e),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=Ol(`recharts-sector`,d),p=a-i,m=lq(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?Wke({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):V0({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return y.createElement(`path`,L0({},Mq(t,!0),{className:f,d:h,role:`img`}))};function U0(e){"@babel/helpers - typeof";return U0=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},U0(e)}function W0(){return W0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W0.apply(this,arguments)}function G0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
498t%2?G0(Object(n),!0).forEach(function(t){Kke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kke(e,t,n){return t=qke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qke(e){var t=Jke(e,`string`);return U0(t)==`symbol`?t:String(t)}function Jke(e,t){if(U0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(U0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var q0={curveBasisClosed:Xxe,curveBasisOpen:Zxe,curveBasis:Yxe,curveBumpX:Fxe,curveBumpY:Ixe,curveLinearClosed:Qxe,curveLinear:tJ,curveMonotoneX:$xe,curveMonotoneY:eSe,curveNatural:tSe,curveStep:nSe,curveStepAfter:iSe,curveStepBefore:rSe},J0=function(e){return e.x===+e.x&&e.y===+e.y},Y0=function(e){return e.x},X0=function(e){return e.y},Yke=function(e,t){if((0,xq.default)(e))return e;var n=`curve${(0,MJ.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?q0[`${n}${t===`vertical`?`Y`:`X`}`]:q0[n]||tJ},Xke=function(e){var t=e.type,n=t===void 0?`linear`:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s!==void 0&&s,l=Yke(n,o),u=c?i.filter(function(e){return J0(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return J0(e)}):a,p=u.map(function(e,t){return K0(K0({},e),{},{base:f[t]})});return d=o===`vertical`?aJ().y(X0).x1(Y0).x0(function(e){return e.base.x}):aJ().x(Y0).y1(X0).y0(function(e){return e.base.y}),d.defined(J0).curve(l),d(p)}return d=o===`vertical`&&X(a)?aJ().y(X0).x1(Y0).x0(a):X(a)?aJ().x(Y0).y1(X0).y0(a):iJ().x(Y0).y(X0),d.defined(J0).curve(l),d(u)},Z0=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var a=n&&n.length?Xke(e):r;return y.createElement(`path`,W0({},Mq(e,!1),vq(e),{className:Ol(`recharts-curve`,t),d:a,ref:i}))},Zke=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Qke=s(((e,t)=>{var n=Zke();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),$ke=s(((e,t)=>{t.exports=Qke()()})),eAe=Object.getOwnPropertyNames,tAe=Object.getOwnPropertySymbols,nAe=Object.prototype.hasOwnProperty;function Q0(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function $0(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);var i=r.cache,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r);return i.delete(t),i.delete(n),s}}function e2(e){return eAe(e).concat(tAe(e))}var t2=Object.hasOwn||(function(e,t){return nAe.call(e,t)});function n2(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var r2=`_owner`,i2=Object.getOwnPropertyDescriptor,a2=Object.keys;function rAe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function iAe(e,t){return n2(e.getTime(),t.getTime())}function o2(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),a=0,o,s;(o=i.next())&&!o.done;){for(var c=t.entries(),l=!1,u=0;(s=c.next())&&!s.done;){var d=o.value,f=d[0],p=d[1],m=s.value,h=m[0],g=m[1];!l&&!r[u]&&(l=n.equals(f,h,a,u,e,t,n)&&n.equals(p,g,f,h,e,t,n))&&(r[u]=!0),u++}if(!l)return!1;a++}return!0}function aAe(e,t,n){var r=a2(e),i=r.length;if(a2(t).length!==i)return!1;for(var a;i-->0;)if(a=r[i],a===r2&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!t2(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))return!1;return!0}function s2(e,t,n){var r=e2(e),i=r.length;if(e2(t).length!==i)return!1;for(var a,o,s;i-->0;)if(a=r[i],a===r2&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!t2(t,a)||!n.equals(e[a],t[a],a,a,e,t,n)||(o=i2(e,a),s=i2(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function oAe(e,t){return n2(e.valueOf(),t.valueOf())}function sAe(e,t){return e.source===t.source&&e.flags===t.flags}function c2(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),a,o;(a=i.next())&&!a.done;){for(var s=t.values(),c=!1,l=0;(o=s.next())&&!o.done;)!c&&!r[l]&&(c=n.equals(a.value,o.value,a.value,o.value,e,t,n))&&
498(r[l]=!0),l++;if(!c)return!1}return!0}function cAe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}var lAe=`[object Arguments]`,uAe=`[object Boolean]`,dAe=`[object Date]`,fAe=`[object Map]`,pAe=`[object Number]`,mAe=`[object Object]`,hAe=`[object RegExp]`,gAe=`[object Set]`,_Ae=`[object String]`,vAe=Array.isArray,l2=typeof ArrayBuffer==`function`&&ArrayBuffer.isView?ArrayBuffer.isView:null,u2=Object.assign,yAe=Object.prototype.toString.call.bind(Object.prototype.toString);function bAe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,s=e.areSetsEqual,c=e.areTypedArraysEqual;return function(e,l,u){if(e===l)return!0;if(e==null||l==null||typeof e!=`object`||typeof l!=`object`)return e!==e&&l!==l;var d=e.constructor;if(d!==l.constructor)return!1;if(d===Object)return i(e,l,u);if(vAe(e))return t(e,l,u);if(l2!=null&&l2(e))return c(e,l,u);if(d===Date)return n(e,l,u);if(d===RegExp)return o(e,l,u);if(d===Map)return r(e,l,u);if(d===Set)return s(e,l,u);var f=yAe(e);return f===dAe?n(e,l,u):f===hAe?o(e,l,u):f===fAe?r(e,l,u):f===gAe?s(e,l,u):f===mAe?typeof e.then!=`function`&&typeof l.then!=`function`&&i(e,l,u):f===lAe?i(e,l,u):f===uAe||f===pAe||f===_Ae?a(e,l,u):!1}}function xAe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?s2:rAe,areDatesEqual:iAe,areMapsEqual:r?Q0(o2,s2):o2,areObjectsEqual:r?s2:aAe,arePrimitiveWrappersEqual:oAe,areRegExpsEqual:sAe,areSetsEqual:r?Q0(c2,s2):c2,areTypedArraysEqual:r?s2:cAe};if(n&&(i=u2({},i,n(i))),t){var a=$0(i.areArraysEqual),o=$0(i.areMapsEqual),s=$0(i.areObjectsEqual),c=$0(i.areSetsEqual);i=u2({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:c})}return i}function SAe(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function CAe(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,a=e.strict;if(r)return function(e,o){var s=r(),c=s.cache,l=c===void 0?t?new WeakMap:void 0:c,u=s.meta;return n(e,o,{cache:l,equals:i,meta:u,strict:a})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(e,t){return n(e,t,o)}}var wAe=d2();d2({strict:!0}),d2({circular:!0}),d2({circular:!0,strict:!0}),d2({createInternalComparator:function(){return n2}}),d2({strict:!0,createInternalComparator:function(){return n2}}),d2({circular:!0,createInternalComparator:function(){return n2}}),d2({circular:!0,createInternalComparator:function(){return n2},strict:!0});function d2(e){e===void 0&&(e={});var t=e.circular,n=t!==void 0&&t,r=e.createInternalComparator,i=e.createState,a=e.strict,o=a!==void 0&&a,s=bAe(xAe(e));return CAe({circular:n,comparator:s,createState:i,equals:r?r(s):SAe(s),strict:o})}function TAe(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function f2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):TAe(r)})}function p2(e){"@babel/helpers - typeof";return p2=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p2(e)}function EAe(e){return AAe(e)||kAe(e)||OAe(e)||DAe()}function DAe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 499In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OAe(e,t){if(e){if(typeof e==`string`)return m2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m2(e,t)}}function m2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kAe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function AAe(e){if(Array.isArray(e))return e}function jAe(){var e={},t=function(){return null}
499,n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=EAe(i),o=a[0],s=a.slice(1);if(typeof o==`number`){f2(r.bind(null,s),o);return}r(o),f2(r.bind(null,s));return}p2(i)===`object`&&(e=i,t(e)),typeof i==`function`&&i()}};return{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}function h2(e){"@babel/helpers - typeof";return h2=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},h2(e)}function g2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g2(Object(n),!0).forEach(function(t){v2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v2(e,t,n){return t=MAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MAe(e){var t=NAe(e,`string`);return h2(t)===`symbol`?t:String(t)}function NAe(e,t){if(h2(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(h2(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var PAe=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},FAe=function(e){return e},IAe=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},y2=function(e,t){return Object.keys(t).reduce(function(n,r){return _2(_2({},n),{},v2({},r,e(r,t[r])))},{})},b2=function(e,t,n){return e.map(function(e){return`${IAe(e)} ${t}ms ${n}`}).join(`,`)};function LAe(e,t){return BAe(e)||zAe(e,t)||x2(e,t)||RAe()}function RAe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 500In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zAe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function BAe(e){if(Array.isArray(e))return e}function VAe(e){return WAe(e)||UAe(e)||x2(e)||HAe()}function HAe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 501In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x2(e,t){if(e){if(typeof e==`string`)return S2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S2(e,t)}}function UAe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function WAe(e){if(Array.isArray(e))return S2(e)}function S2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var C2=1e-4,w2=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},T2=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},E2=function(e,t){return function(n){return T2(w2(e,t),n)}},GAe=function(e,t){return function(n){var r=w2(e,t);return T2([].concat(VAe(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},D2=function(){var e=[...arguments],t=e[0],n=e[1],r=e[2],i=e[3];if(e.length===1)switch(e[0]){case`linear`:t=0,n=0,r=1,i=1;break;case`ease`:t=.25,n=.1,r=.25,i=1;break;case`ease-in`:t=.42,n=0,r=1,i=1;break;case`ease-out`:t=.42,n=0,r=.58,i=1;break;case`ease-in-out`:t=0,n=0,r=.58,i=1;break;default:var a=e[0].split(`(`);if(a[0]===`cubic-bezier`&&a[1].split(`)`)[0].split(`,`).length===4){var o=LAe(a[1].split(`)`)[0].split(`,`).map(function(e){return parseFloat(e)}),4);t=o[0],n=o[1],r=o[2],i=o[3]}}[t,r,n,i].every(function(e){return typeof e==`number`&&e>=0&&e<=1});var s=E2(t,r),c=E2(n,i),l=GAe(t,r),u=function(e){return e>1?1:e<0?0:e},d=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=s(n)-t,a=l(n);if(Math.abs(i-t)<C2||a<C2)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},KAe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?17:a,s=function(e,t,r){var a=r+(-(e-t)*n-r*i)*o/1e3,s=r*o/1e3+e;return Math.abs(s-t)<C2&&Math.abs(a)<C2?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},qAe=function(){var e=[...arguments][0];if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return D2(e);case`spring`:return KAe();default:if(e.split(`(`)[0]===`cubic-bezier`)return D2(e)}return typeof e==`function`?e:null};function O2(e){"@babel/helpers - typeof";return O2=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},O2(e)}function k2(e){return XAe(e)||YAe(e)||N2(e)||JAe()}function JAe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 502In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YAe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function XAe(e){if(Array.isArray(e))return P2(e)}function A2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
502t%2?A2(Object(n),!0).forEach(function(t){M2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function M2(e,t,n){return t=ZAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZAe(e){var t=QAe(e,`string`);return O2(t)===`symbol`?t:String(t)}function QAe(e,t){if(O2(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(O2(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $Ae(e,t){return nje(e)||tje(e,t)||N2(e,t)||eje()}function eje(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 503In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N2(e,t){if(e){if(typeof e==`string`)return P2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P2(e,t)}}function P2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tje(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function nje(e){if(Array.isArray(e))return e}var F2=function(e,t,n){return e+(t-e)*n},I2=function(e){return e.from!==e.to},rje=function e(t,n,r){var i=y2(function(e,n){if(I2(n)){var r=$Ae(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return j2(j2({},n),{},{from:i,velocity:a})}return n},n);return r<1?y2(function(e,t){return I2(t)?j2(j2({},t),{},{velocity:F2(t.velocity,i[e].velocity,r),from:F2(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},ije=(function(e,t,n,r,i){var a=PAe(e,t),o=a.reduce(function(n,r){return j2(j2({},n),{},M2({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return j2(j2({},n),{},M2({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return y2(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(I2).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=rje(n,s,a),i(j2(j2(j2({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=y2(function(e,t){return F2.apply(void 0,k2(t).concat([n(s)]))},o);if(i(j2(j2(j2({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=y2(function(e,t){return F2.apply(void 0,k2(t).concat([n(1)]))},o);i(j2(j2(j2({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),L2=u($ke());function R2(e){"@babel/helpers - typeof";return R2=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},R2(e)}var aje=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function oje(e,t){if(e==null)return{};var n=sje(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sje(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function z2(e){return dje(e)||uje(e)||lje(e)||cje()}function cje(){throw TypeError(`Invalid attempt to spread non-iterable instance. 504In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lje(e,t){if(e){if(typeof e==`string`)return B2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B2(e,t)}}function uje(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function dje(e){if(Array.isArray(e))return B2(e)}function B2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
504t%2?V2(Object(n),!0).forEach(function(t){U2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function U2(e,t,n){return t=G2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fje(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function W2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,G2(r.key),r)}}function pje(e,t,n){return t&&W2(e.prototype,t),n&&W2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function G2(e){var t=mje(e,`string`);return R2(t)===`symbol`?t:String(t)}function mje(e,t){if(R2(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(R2(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hje(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K2(e,t)}function K2(e,t){return K2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},K2(e,t)}function gje(e){var t=_je();return function(){var n=Y2(e),r;if(t){var i=Y2(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return q2(this,r)}}function q2(e,t){if(t&&(R2(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return J2(e)}function J2(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function _je(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Y2(e){return Y2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y2(e)}var X2=function(e){hje(n,e);var t=gje(n);function n(e,r){var i;fje(this,n),i=t.call(this,e,r);var a=i.props,o=a.isActive,s=a.attributeName,c=a.from,l=a.to,u=a.steps,d=a.children,f=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(J2(i)),i.changeStyle=i.changeStyle.bind(J2(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),q2(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},q2(i);i.state={style:s?U2({},s,c):c}}else i.state={style:{}};return i}return pje(n,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,!(!t||!n)&&this.runAnimation(this.props)}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,a=t.shouldReAnimate,o=t.to,s=t.from,c=this.state.style;if(r){if(!n){var l={style:i?U2({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l);return}if(!(wAe(e.to,o)&&e.canBegin&&e.isActive)){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?s:e.to;if(this.state&&c){var f={style:i?U2({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(H2(H2({},this.props),{},{from:d,begin:0}))}}}},{key:`componentWillUnmount`,value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&=(this.manager.stop(),null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:`handleStyleChange`,value:function(e){this.changeStyle(e)}},{key:`changeStyle`,value:function(e){this.mounted&&this.setState({style:e})}},{key:`runJSAnimation`,value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,a=e.easing,o=e.begin,s=e.onAnimationEnd,c=e.onAnimationStart,l=ije(n,r,qAe(a),i,this.changeStyle);this.manager.start([c,o,function(){t.stopJSAnimation=l()},i,s])}},{key:`runStepAnimation`,value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,a=n[0],o=a.style,s=a.duration,c=s===void 0?0:s;return this.manager.start([i].concat(z2(n.reduce(function(e,r,i){if(i===0)return e;var a=r.duration,o=r.easing,s=o===void 0?`ease`:o,c=r.style,l=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=l||Object.keys(c);if(typeof s==`function`||s===`spring`)return[].concat(z2(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);
504var p=b2(f,a,s),m=H2(H2(H2({},d.style),c),{},{transition:p});return[].concat(z2(e),[m,a,u]).filter(FAe)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=jAe();var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,a=e.easing,o=e.onAnimationStart,s=e.onAnimationEnd,c=e.steps,l=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),typeof a==`function`||typeof l==`function`||a===`spring`){this.runJSAnimation(e);return}if(c.length>1){this.runStepAnimation(e);return}var d=r?U2({},r,i):i,f=b2(Object.keys(d),n,a);u.start([o,t,H2(H2({},d),{},{transition:f}),n,s])}},{key:`render`,value:function(){var e=this.props,t=e.children;e.begin;var n=e.duration;e.attributeName,e.easing;var r=e.isActive;e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart;var i=oje(e,aje),a=y.Children.count(t),o=this.state.style;if(typeof t==`function`)return t(o);if(!r||a===0||n<=0)return t;var s=function(e){var t=e.props,n=t.style,r=n===void 0?{}:n,a=t.className;return(0,y.cloneElement)(e,H2(H2({},i),{},{style:H2(H2({},r),o),className:a}))};return a===1?s(y.Children.only(t)):y.createElement(`div`,null,y.Children.map(t,function(e){return s(e)}))}}]),n}(y.PureComponent);X2.displayName=`Animate`,X2.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},X2.propTypes={from:L2.default.oneOfType([L2.default.object,L2.default.string]),to:L2.default.oneOfType([L2.default.object,L2.default.string]),attributeName:L2.default.string,duration:L2.default.number,begin:L2.default.number,easing:L2.default.oneOfType([L2.default.string,L2.default.func]),steps:L2.default.arrayOf(L2.default.shape({duration:L2.default.number.isRequired,style:L2.default.object.isRequired,easing:L2.default.oneOfType([L2.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),L2.default.func]),properties:L2.default.arrayOf(`string`),onAnimationEnd:L2.default.func})),children:L2.default.oneOfType([L2.default.node,L2.default.func]),isActive:L2.default.bool,canBegin:L2.default.bool,onAnimationEnd:L2.default.func,shouldReAnimate:L2.default.bool,onAnimationStart:L2.default.func,onAnimationReStart:L2.default.func};function Z2(){return Z2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z2.apply(null,arguments)}function Q2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function $2(e,t){return $2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$2(e,t)}function e4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$2(e,t)}var t4={disabled:!1},n4=y.createContext(null),vje=function(e){return e.scrollTop},r4=`unmounted`,i4=`exited`,a4=`entering`,o4=`entered`,s4=`exiting`,c4=function(e){e4(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=i4,r.appearStatus=a4):o=o4:o=t.unmountOnExit||t.mountOnEnter?r4:i4,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:i4}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=a4):(n===`entering`||n===`entered`)&&(t=s4)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:b.findDOMNode(this);n&&vje(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:r4})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.
504isMounting:e,i=this.props.nodeRef?[r]:[b.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||t4.disabled){this.safeSetState({status:o4},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:a4},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:o4},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:b.findDOMNode(this);if(!t||t4.disabled){this.safeSetState({status:i4},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:s4},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:i4},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:b.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=Q2(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return y.createElement(n4.Provider,{value:null},typeof n==`function`?n(e,r):y.cloneElement(y.Children.only(n),r))},t}(y.Component);c4.contextType=n4,c4.propTypes={};function l4(){}c4.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:l4,onEntering:l4,onEntered:l4,onExit:l4,onExiting:l4,onExited:l4},c4.UNMOUNTED=r4,c4.EXITED=i4,c4.ENTERING=a4,c4.ENTERED=o4,c4.EXITING=s4;function yje(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function u4(e,t){var n=function(e){return t&&(0,y.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&y.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function bje(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}
vendor: 1,536 bytes, line 504
504var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function d4(e,t,n){return n[t]==null?e.props[t]:n[t]}function xje(e,t){return u4(e.children,function(n){return(0,y.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:d4(n,`appear`,e),enter:d4(n,`enter`,e),exit:d4(n,`exit`,e)})})}function Sje(e,t,n){var r=u4(e.children),i=bje(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,y.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,y.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,y.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:d4(o,`exit`,e),enter:d4(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,y.cloneElement)(o,{in:!1}):c&&s&&(0,y.isValidElement)(l)&&(i[a]=(0,y.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:d4(o,`exit`,e),enter:d4(o,`enter`,e)}))}}),i}var Cje=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},wje={component:`div`,childFactory:function(e){return e}},f4=function(e){e4(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(yje(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;
504return{children:t.firstRender?xje(e,r):Sje(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=u4(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Z2({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Q2(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Cje(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?y.createElement(n4.Provider,{value:i},a):y.createElement(n4.Provider,{value:i},y.createElement(t,r,a))},t}(y.Component);f4.propTypes={},f4.defaultProps=wje;var Tje=[`children`,`appearOptions`,`enterOptions`,`leaveOptions`];function p4(e){"@babel/helpers - typeof";return p4=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p4(e)}function m4(){return m4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m4.apply(this,arguments)}function Eje(e,t){if(e==null)return{};var n=Dje(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dje(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function h4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h4(Object(n),!0).forEach(function(t){x4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oje(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,S4(r.key),r)}}function kje(e,t,n){return t&&_4(e.prototype,t),n&&_4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aje(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v4(e,t)}function v4(e,t){return v4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v4(e,t)}function jje(e){var t=Nje();return function(){var n=b4(e),r;if(t){var i=b4(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Mje(this,r)}}function Mje(e,t){if(t&&(p4(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return y4(e)}function y4(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Nje(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b4(e){return b4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b4(e)}function x4(e,t,n){return t=S4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S4(e){var t=Pje(e,`string`);return p4(t)===`symbol`?t:String(t)}function Pje(e,t){if(p4(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p4(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var C4=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},w4=function(e){Aje(n,e);var t=jje(n);function n(){var e;
504return Oje(this,n),e=t.call(this),x4(y4(e),`handleEnter`,function(t,n){var r=e.props,i=r.appearOptions,a=r.enterOptions;e.handleStyleActive(n?i:a)}),x4(y4(e),`handleExit`,function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return kje(n,[{key:`handleStyleActive`,value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(g4(g4({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:`parseTimeout`,value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return C4(t)+C4(n)+C4(r)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.children;t.appearOptions,t.enterOptions,t.leaveOptions;var r=Eje(t,Tje);return y.createElement(c4,m4({},r,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return y.createElement(X2,e.state,y.Children.only(n))})}}]),n}(y.Component);w4.propTypes={appearOptions:L2.default.object,enterOptions:L2.default.object,leaveOptions:L2.default.object,children:L2.default.element};function T4(e){var t=e.component,n=e.children,r=e.appear,i=e.enter,a=e.leave;return y.createElement(f4,{component:t},y.Children.map(n,function(e,t){return y.createElement(w4,{appearOptions:r,enterOptions:i,leaveOptions:a,key:`child-${t}`},e)}))}T4.propTypes={appear:L2.default.object,enter:L2.default.object,leave:L2.default.object,children:L2.default.oneOfType([L2.default.array,L2.default.element]),component:L2.default.any},T4.defaultProps={component:`span`};var E4=X2;function D4(e){"@babel/helpers - typeof";return D4=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},D4(e)}function O4(){return O4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O4.apply(this,arguments)}function Fje(e,t){return zje(e)||Rje(e,t)||Lje(e,t)||Ije()}function Ije(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 505In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lje(e,t){if(e){if(typeof e==`string`)return k4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k4(e,t)}}function k4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rje(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function zje(e){if(Array.isArray(e))return e}function A4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?A4(Object(n),!0).forEach(function(t){Bje(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bje(e,t,n){return t=Vje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vje(e){var t=Hje(e,`string`);return D4(t)==`symbol`?t:String(t)}function Hje(e,t){if(D4(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(D4(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var M4=function(e,t,n,r,i){var a=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,s=n>=0?1:-1,c=+(r>=0&&n>=0||r<0&&n<0),l;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>a?a:i[d];l=`M${e},${t+o*u[0]}`,u[0]>0&&(l+=`A ${u[0]},${u[0]},0,0,${c},${e+s*u[0]},${t}`),l+=`L ${e+n-s*u[1]},${t}`,u[1]>0&&(l+=`A ${u[1]},${u[1]},0,0,${c}, 506 ${e+n},${t+o*u[1]}`),l+=`L ${e+n},${t+r-o*u[2]}`,u[2]>0&&(l+=`A ${u[2]},${u[2]},0,0,${c}, 507 ${e+n-s*u[2]},${t+r}`),l+=`L ${e+s*u[3]},${t+r}`,u[3]>0&&(l+=`A ${u[3]},${u[3]},0,0,${c}, 508 ${e},${t+r-o*u[3]}`),l+=`Z`}else if(a>0&&i===+i&&i>0){var p=Math.min(a,i);l=`M ${e},${t+o*p} 509 A ${p},${p},0,0,${c},${e+s*p},${t} 510 L ${e+n-s*p},${t} 511 A ${p},${p},0,0,${c},${e+n},${t+o*p} 512 L ${e+n},${t+r-o*p} 513 A ${p},${p},0,0,${c},${e+n-s*p},${t+r} 514 L ${e+s*p},${t+r} 515 A ${p},${p},0,0,${c},${e},${t+r-o*p} Z`}else l=`M ${e},${t} h ${n} v ${r} h ${-n} Z`;return l},Uje=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,a=t.y,o=t.width,s=t.height;if(Math.abs(o)>0&&Math.abs(s)>0){var c=Math.min(i,i+o),l=Math.max(i,i+o),u=Math.min(a,a+s),d=Math.max(a,a+s);return n>=c&&n<=l&&r>=u&&r<=d}return!1},Wje={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},N4=function(e){var t=j4(j4({},Wje),e),n=(0,y.useRef)(),r=Fje((0,y.useState)(-1),2),i=r[0],a=r[1];(0,y.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var _=Ol(`recharts-rectangle`,d);return g?y.createElement(E4,{canBegin:i>0,from:{width:c,height:l,x:o,y:s},to:{width:c,height:l,x:o,y:s},duration:p,animationEasing:f,isActive:g},function(e){var r=e.width,a=e.height,o=e.x,s=e.y;return y.createElement(E4,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,isActive:h,easing:f},y.createElement(`path`,O4({},Mq(t,!0),{className:_,d:M4(o,s,r,a,u),ref:n})))}):y.createElement(`path`,O4({},Mq(t,!0),{className:_,d:M4(o,s,c,l,u)}))},Gje=[`points`,`className`,`baseLinePoints`,`connectNulls`];function P4(){return P4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P4.apply(this,arguments)}function Kje(e,t){if(e==null)return{};var n=qje(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qje(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}
515function F4(e){return Zje(e)||Xje(e)||Yje(e)||Jje()}function Jje(){throw TypeError(`Invalid attempt to spread non-iterable instance. 516In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yje(e,t){if(e){if(typeof e==`string`)return I4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I4(e,t)}}function Xje(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Zje(e){if(Array.isArray(e))return I4(e)}function I4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L4=function(e){return e&&e.x===+e.x&&e.y===+e.y},Qje=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){L4(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),L4(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},R4=function(e,t){var n=Qje(e);t&&(n=[n.reduce(function(e,t){return[].concat(F4(e),F4(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return`${e}${n===0?`M`:`L`}${t.x},${t.y}`},``)}).join(``);return n.length===1?`${r}Z`:r},$je=function(e,t,n){var r=R4(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${R4(t.reverse(),n).slice(1)}`},eMe=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=Kje(e,Gje);if(!t||!t.length)return null;var o=Ol(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=$je(t,r,i);return y.createElement(`g`,{className:o},y.createElement(`path`,P4({},Mq(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?y.createElement(`path`,P4({},Mq(a,!0),{fill:`none`,d:R4(t,i)})):null,s?y.createElement(`path`,P4({},Mq(a,!0),{fill:`none`,d:R4(r,i)})):null)}var l=R4(t,i);return y.createElement(`path`,P4({},Mq(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function z4(){return z4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z4.apply(this,arguments)}var B4=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Ol(`recharts-dot`,i);return t===+t&&n===+n&&r===+r?y.createElement(`circle`,z4({},Mq(e,!1),vq(e),{className:a,cx:t,cy:n,r})):null};function V4(e){"@babel/helpers - typeof";return V4=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},V4(e)}var tMe=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function H4(){return H4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H4.apply(this,arguments)}function U4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?U4(Object(n),!0).forEach(function(t){rMe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rMe(e,t,n){return t=iMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iMe(e){var t=aMe(e,`string`);return V4(t)==`symbol`?t:String(t)}function aMe(e,t){if(V4(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(V4(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oMe(e,t){if(e==null)return{};var n=sMe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sMe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var cMe=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},lMe=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=oMe(e,tMe),h=nMe({x:n,y:i,top:o,left:c,width:u,height:f},m);return!X(n)||!X(i)||!X(u)||!X(f)||!X(o)||!X(c)?null:y.createElement(`path`,H4({},Mq(h,!0),{className:Ol(`recharts-cross`,p),d:cMe(n,i,u,f,o,c)}
516))},uMe=s(((e,t)=>{var n=s1(),r=c1(),i=_Y();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),dMe=s(((e,t)=>{var n=s1(),r=_Y(),i=l1();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),fMe=u(uMe()),pMe=u(dMe()),mMe=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],hMe=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function W4(e){"@babel/helpers - typeof";return W4=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},W4(e)}function G4(){return G4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G4.apply(this,arguments)}function K4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?K4(Object(n),!0).forEach(function(t){$4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function J4(e,t){if(e==null)return{};var n=gMe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gMe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _Me(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Y4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,e3(r.key),r)}}function vMe(e,t,n){return t&&Y4(e.prototype,t),n&&Y4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yMe(e,t,n){return t=Z4(t),bMe(e,X4()?Reflect.construct(t,n||[],Z4(e).constructor):t.apply(e,n))}function bMe(e,t){if(t&&(W4(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return xMe(e)}function xMe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function X4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X4=function(){return!!e})()}function Z4(e){return Z4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z4(e)}function SMe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q4(e,t)}function Q4(e,t){return Q4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q4(e,t)}function $4(e,t,n){return t=e3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e3(e){var t=CMe(e,`string`);return W4(t)==`symbol`?t:String(t)}function CMe(e,t){if(W4(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(W4(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var t3=function(e){SMe(t,e);function t(){return _Me(this,t),yMe(this,t,arguments)}return vMe(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return v0(i,a,t,r)}},{key:`getTickTextAnchor`,value:function(){var e=this.props.orientation,t;switch(e){case`left`:t=`end`;break;case`right`:t=`start`;break;default:t=`middle`;break}return t}},{key:`getViewBox`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=(0,fMe.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,pMe.default)(i,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=e.axisLine,o=J4(e,mMe),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=v0(t,n,s[0],r),l=v0(t,n,s[1],r),u=q4(q4(q4({},Mq(o,!1)),{},{fill:`none`},Mq(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return y.createElement(`line`,G4({className:`recharts-polar-radius-axis-line`},u))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.angle,o=n.tickFormatter,s=n.stroke,c=J4(n,hMe),l=this.getTickTextAnchor(),u=Mq(c,!1),d=Mq(i,!1),f=r.map(function(n,r){var c=e.getTickValueCoord(n),f=q4(q4(q4(q4({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},u),{},{stroke:`none`,fill:s},d),{},{index:r},c),{},{payload:n});return y.createElement(zq,G4({className:Ol(`recharts-polar-radius-axis-tick`,x0(i)),key:`tick-${n.coordinate}`},yq(e.props,n,r)),t.renderTickItem(i,f,o?o(n.value,r):n.value))});return y.createElement(zq,{className:`recharts-polar-radius-axis-ticks`},f)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return!t||!t.length?null:y.createElement(zq,{className:Ol(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),D0.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(QX,G4({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}]),t}(y.PureComponent);$4(t3,`displayName`,`PolarRadiusAxis`),$4(t3,`axisType`,`radiusAxis`),$4(t3,`defaultProps`,{type:`number`,radiusAxisId:0,cx:0,cy:0,angle:0,orientation:`right`,stroke:`#ccc`,axisLine
516:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:`auto`,allowDuplicatedCategory:!0});function n3(e){"@babel/helpers - typeof";return n3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n3(e)}function r3(){return r3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r3.apply(this,arguments)}function i3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i3(Object(n),!0).forEach(function(t){u3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wMe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,d3(r.key),r)}}function TMe(e,t,n){return t&&o3(e.prototype,t),n&&o3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function EMe(e,t,n){return t=c3(t),DMe(e,s3()?Reflect.construct(t,n||[],c3(e).constructor):t.apply(e,n))}function DMe(e,t){if(t&&(n3(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return OMe(e)}function OMe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function s3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(s3=function(){return!!e})()}function c3(e){return c3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c3(e)}function kMe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l3(e,t)}function l3(e,t){return l3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l3(e,t)}function u3(e,t,n){return t=d3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d3(e){var t=AMe(e,`string`);return n3(t)==`symbol`?t:String(t)}function AMe(e,t){if(n3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(n3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jMe=Math.PI/180,f3=1e-5,p3=function(e){kMe(t,e);function t(){return wMe(this,t),EMe(this,t,arguments)}return TMe(t,[{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=v0(n,r,i,e.coordinate),c=v0(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:`getTickTextAnchor`,value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*jMe);return n>f3?t===`outer`?`start`:`end`:n<-f3?t===`outer`?`end`:`start`:`middle`}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,i=e.axisLine,a=e.axisLineType,o=a3(a3({},Mq(this.props,!1)),{},{fill:`none`},Mq(i,!1));if(a===`circle`)return y.createElement(B4,r3({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return v0(t,n,r,e.coordinate)});return y.createElement(eMe,r3({className:`recharts-polar-angle-axis-line`},o,{points:s}))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.tickLine,o=n.tickFormatter,s=n.stroke,c=Mq(this.props,!1),l=Mq(i,!1),u=a3(a3({},c),{},{fill:`none`}
516,Mq(a,!1)),d=r.map(function(n,r){var d=e.getTickLineCoord(n),f=a3(a3(a3({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:d.x2,y:d.y2});return y.createElement(zq,r3({className:Ol(`recharts-polar-angle-axis-tick`,x0(i)),key:`tick-${n.coordinate}`},yq(e.props,n,r)),a&&y.createElement(`line`,r3({className:`recharts-polar-angle-axis-tick-line`},u,d)),i&&t.renderTickItem(i,f,o?o(n.value,r):n.value))});return y.createElement(zq,{className:`recharts-polar-angle-axis-ticks`},d)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:y.createElement(zq,{className:Ol(`recharts-polar-angle-axis`,this.props.className)},r&&this.renderAxisLine(),this.renderTicks())}}],[{key:`renderTickItem`,value:function(e,t,n){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(QX,r3({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}]),t}(y.PureComponent);u3(p3,`displayName`,`PolarAngleAxis`),u3(p3,`axisType`,`angleAxis`),u3(p3,`defaultProps`,{type:`category`,angleAxisId:0,scale:`auto`,cx:0,cy:0,orientation:`outer`,axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var MMe=s(((e,t)=>{t.exports=lY()(Object.getPrototypeOf,Object)})),NMe=s(((e,t)=>{var n=NK(),r=MMe(),i=PK(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),PMe=s(((e,t)=>{var n=NK(),r=PK(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function m3(e){"@babel/helpers - typeof";return m3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m3(e)}function h3(){return h3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h3.apply(this,arguments)}function FMe(e,t){return zMe(e)||RMe(e,t)||LMe(e,t)||IMe()}function IMe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 517In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LMe(e,t){if(e){if(typeof e==`string`)return g3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g3(e,t)}}function g3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RMe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function zMe(e){if(Array.isArray(e))return e}function _3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_3(Object(n),!0).forEach(function(t){BMe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BMe(e,t,n){return t=VMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VMe(e){var t=HMe(e,`string`);return m3(t)==`symbol`?t:String(t)}function HMe(e,t){if(m3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(m3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var y3=function(e,t,n,r,i){var a=n-r,o=`M ${e},${t}`;return o+=`L ${e+n},${t}`,o+=`L ${e+n-a/2},${t+i}`,o+=`L ${e+n-a/2-r},${t+i}`,o+=`L ${e},${t} Z`,o}
517,UMe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},WMe=function(e){var t=v3(v3({},UMe),e),n=(0,y.useRef)(),r=FMe((0,y.useState)(-1),2),i=r[0],a=r[1];(0,y.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.upperWidth,l=t.lowerWidth,u=t.height,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||u!==+u||c===0&&l===0||u===0)return null;var g=Ol(`recharts-trapezoid`,d);return h?y.createElement(E4,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:u,x:o,y:s},to:{upperWidth:c,lowerWidth:l,height:u,x:o,y:s},duration:p,animationEasing:f,isActive:h},function(e){var r=e.upperWidth,a=e.lowerWidth,o=e.height,s=e.x,c=e.y;return y.createElement(E4,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,easing:f},y.createElement(`path`,h3({},Mq(t,!0),{className:g,d:y3(s,c,r,a,o),ref:n})))}):y.createElement(`g`,null,y.createElement(`path`,h3({},Mq(t,!0),{className:g,d:y3(o,s,c,l,u)})))},GMe=u(NMe()),KMe=u(PMe()),qMe=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function b3(e){"@babel/helpers - typeof";return b3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b3(e)}function JMe(e,t){if(e==null)return{};var n=YMe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YMe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function x3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?x3(Object(n),!0).forEach(function(t){XMe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XMe(e,t,n){return t=ZMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZMe(e){var t=QMe(e,`string`);return b3(t)==`symbol`?t:String(t)}function QMe(e,t){if(b3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $Me(e,t){return S3(S3({},t),e)}function eNe(e,t){return e===`symbols`}function C3(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return y.createElement(N4,n);case`trapezoid`:return y.createElement(WMe,n);case`sector`:return y.createElement(H0,n);case`symbols`:if(eNe(t,n))return y.createElement(RJ,n);break;default:return null}}function tNe(e){return(0,y.isValidElement)(e)?e.props:e}function w3(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?$Me:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=JMe(e,qMe),l;if((0,y.isValidElement)(t))l=(0,y.cloneElement)(t,S3(S3({},c),tNe(t)));else if((0,xq.default)(t))l=t(c);else if((0,GMe.default)(t)&&!(0,KMe.default)(t)){var u=i(t,c);l=y.createElement(C3,{shapeType:n,elementProps:u})}else{var d=c;l=y.createElement(C3,{shapeType:n,elementProps:d})}return s?y.createElement(zq,{className:o},l):l}function T3(e,t){return t!=null&&`trapezoids`in e.props}function E3(e,t){return t!=null&&`sectors`in e.props}function D3(e,t){return t!=null&&`points`in e.props}function nNe(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)==null?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)==null?void 0:r.y
517)||e.y===t.y;return i&&a}function rNe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function iNe(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function aNe(e,t){var n;return T3(e,t)?n=nNe:E3(e,t)?n=rNe:D3(e,t)&&(n=iNe),n}function oNe(e,t){var n;return T3(e,t)?n=`trapezoids`:E3(e,t)?n=`sectors`:D3(e,t)&&(n=`points`),n}function sNe(e,t){if(T3(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(E3(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return D3(e,t)?t.payload:{}}function cNe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=oNe(n,t),a=sNe(n,t),o=r.filter(function(e,r){var o=(0,L1.default)(a,e),s=n.props[i].filter(function(e){return aNe(n,t)(e,t)}),c=r===n.props[i].indexOf(s[s.length-1]);return o&&c});return r.indexOf(o[o.length-1])}var O3;function k3(e){"@babel/helpers - typeof";return k3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},k3(e)}function A3(){return A3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A3.apply(this,arguments)}function j3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?j3(Object(n),!0).forEach(function(t){R3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lNe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function N3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,z3(r.key),r)}}function uNe(e,t,n){return t&&N3(e.prototype,t),n&&N3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dNe(e,t,n){return t=F3(t),fNe(e,P3()?Reflect.construct(t,n||[],F3(e).constructor):t.apply(e,n))}function fNe(e,t){if(t&&(k3(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return I3(e)}function P3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P3=function(){return!!e})()}function F3(e){return F3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F3(e)}function I3(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function pNe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L3(e,t)}function L3(e,t){return L3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L3(e,t)}function R3(e,t,n){return t=z3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z3(e){var t=mNe(e,`string`);return k3(t)==`symbol`?t:String(t)}function mNe(e,t){if(k3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(k3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var B3=function(e){pNe(t,e);function t(e){var n;return lNe(this,t),n=dNe(this,t,[e]),R3(I3(n),`pieRef`,null),R3(I3(n),`sectorRefs`,[]),R3(I3(n),`id`,cq(`recharts-pie-`)),R3(I3(n),`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,xq.default)(e)&&e()}),R3(I3(n),`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,xq.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return uNe(t,[{key:`isActiveIndex`,value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?t.indexOf(e)!==-1:e===t}},{key:`hasActiveIndex`,value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:`renderLabels`,value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.label,i=n.labelLine,a=n.dataKey,o=n.valueKey,s=Mq(this.props,!1),c=Mq(r,!1),l=Mq(i,!1),u=r&&r.offsetRadius||20,d=e.map(function(e,n){var d=(e.startAngle+e.endAngle)/2,f=v0(e.cx,e.cy,e.outerRadius+u,d),p=M3(M3(M3(M3({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(f.x,e.cx)},f),m=M3(M3(M3(M3({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[v0(e.cx,e.cy,e.outerRadius,d),f],key:`line`}),h=a;return(0,bq.default)(a)&&(0,bq.default)(o)?h=`value`:(0,bq.default)(a)&&(h=o),y.createElement(zq,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,m),t.renderLabelItem(r,p,W1(e,h)))});return y.createElement(zq,{className:`recharts-pie-labels`},d)}}
517,{key:`renderSectorsStatically`,value:function(e){var t=this,n=this.props,r=n.activeShape,i=n.blendStroke,a=n.inactiveShape;return e.map(function(n,o){if(n?.startAngle===0&&n?.endAngle===0&&e.length!==1)return null;var s=t.isActiveIndex(o),c=a&&t.hasActiveIndex()?a:null,l=s?r:c,u=M3(M3({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return y.createElement(zq,A3({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},yq(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),y.createElement(w3,A3({option:l,isActive:s,shapeType:`sector`},u)))})}},{key:`renderSectorsWithAnimation`,value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.animationId,c=this.state,l=c.prevSectors,u=c.prevIsAnimationActive;return y.createElement(E4,{begin:i,duration:a,isActive:r,easing:o,from:{t:0},to:{t:1},key:`pie-${s}-${u}`,onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,i=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=l&&l[t],o=t>0?(0,iq.default)(e,`paddingAngle`,0):0;if(n){var s=dq(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=M3(M3({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=dq(0,u-d)(r),p=M3(M3({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),y.createElement(zq,null,e.renderSectorsStatically(i))})}},{key:`attachKeyboardHandlers`,value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case`ArrowLeft`:var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case`ArrowRight`:var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case`Escape`:t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0});break;default:}}}},{key:`renderSectors`,value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!(0,L1.default)(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:`componentDidMount`,value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,i=t.className,a=t.label,o=t.cx,s=t.cy,c=t.innerRadius,l=t.outerRadius,u=t.isAnimationActive,d=this.state.isAnimationFinished;if(n||!r||!r.length||!X(o)||!X(s)||!X(c)||!X(l))return null;var f=Ol(`recharts-pie`,i);return y.createElement(zq,{tabIndex:this.props.rootTabIndex,className:f,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),D0.renderCallByParent(this.props,null,!1),(!u||d)&&F0.renderCallByParent(this.props,r,!1))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return t.prevIsAnimationActive===e.isAnimationActive?e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors===t.curSectors?null:{curSectors:e.sectors,isAnimationFinished:!0}:{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}}},{key:`getTextAnchor`,value:function(e,t){return e>t?`start`:e<t?`end`:`middle`}},{key:`renderLabelLineItem`,value:function(e,t){if(y.isValidElement(e))return y.cloneElement(e,t);if((0,xq.default)(e))return e(t);var n=Ol(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return y.createElement(Z0,A3({},t,{type:`linear`,className:n}))}},{key:`renderLabelItem`,value:function(e,t,n){if(y.isValidElement(e))return y.cloneElement(e,t);var r=n;if((0,xq.default)(e)&&(r=e(t),y.isValidElement(r)))return r;var i=Ol(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,xq.default)(e)?e.className:``);return y.createElement(QX,A3({},t,{alignmentBaseline:`middle`,className:i}),r)}}]),t}(y.PureComponent);O3=B3,R3(B3,`displayName`,`Pie`),R3(B3,`defaultProps`,{stroke:`#fff`,fill:`#808080`,legendType:`rect`,cx:`50%`,cy:`50%`,startAngle:0,endAngle:360,innerRadius:0,outerRadius:`80%`,paddingAngle:0,labelLine:!0,hide:!1,minA
517ngle:0,isAnimationActive:!sX.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),R3(B3,`parseDeltaAngle`,function(e,t){return aq(t-e)*Math.min(Math.abs(t-e),360)}),R3(B3,`getRealPieData`,function(e){var t=e.props,n=t.data,r=t.children,i=Mq(e.props,!1),a=kq(r,TX);return n&&n.length?n.map(function(e,t){return M3(M3(M3({payload:e},i),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return M3(M3({},i),e.props)}):[]}),R3(B3,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=y0(i,a);return{cx:r+lq(e.props.cx,i,i/2),cy:n+lq(e.props.cy,a,a/2),innerRadius:lq(e.props.innerRadius,o,0),outerRadius:lq(e.props.outerRadius,o,o*.8),maxRadius:e.props.maxRadius||Math.sqrt(i*i+a*a)/2}}),R3(B3,`getComposedData`,function(e){var t=e.item,n=e.offset,r=O3.getRealPieData(t);if(!r||!r.length)return null;var i=t.props,a=i.cornerRadius,o=i.startAngle,s=i.endAngle,c=i.paddingAngle,l=i.dataKey,u=i.nameKey,d=i.valueKey,f=i.tooltipType,p=Math.abs(t.props.minAngle),m=O3.parseCoordinateOfPie(t,n),h=O3.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,bq.default)(l)&&(0,bq.default)(d)?_=`value`:(0,bq.default)(l)&&(_=d);var v=r.filter(function(e){return W1(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=r.reduce(function(e,t){var n=W1(t,_,0);return e+(X(n)?n:0)},0),S;if(x>0){var C;S=r.map(function(e,t){var n=W1(e,_,0),r=W1(e,u,t),i=(X(n)?n:0)/x,s=t?C.endAngle+aq(h)*c*(n===0?0:1):o,l=s+aq(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=M3(M3(M3({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:v0(m.cx,m.cy,g,d)},e),m),{},{value:W1(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:aq(h)*c}),C})}return M3(M3({},m),{},{sectors:S,data:r})});var hNe=s(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),V3=s(((e,t)=>{var n=vX(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),gNe=s(((e,t)=>{var n=hNe(),r=zY(),i=V3();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),_Ne=s(((e,t)=>{t.exports=gNe()()}));function H3(e){"@babel/helpers - typeof";return H3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},H3(e)}function U3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?U3(Object(n),!0).forEach(function(t){G3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function G3(e,t,n){return t=vNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vNe(e){var t=yNe(e,`string`);return H3(t)==`symbol`?t:String(t)}function yNe(e,t){if(H3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(H3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bNe=[`Webkit`,`Moz`,`O`,`ms`],xNe=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=bNe.reduce(function(e,r){return W3(W3({},e),{},G3({},r+n,t))},{});return r[e]=t,r},K3=u(_Ne());function q3(e){"@babel/helpers - typeof";return q3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q3(e)}function J3(){return J3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J3.apply(this,arguments)}function Y3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
517t%2?Y3(Object(n),!0).forEach(function(t){n6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SNe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Z3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r6(r.key),r)}}function CNe(e,t,n){return t&&Z3(e.prototype,t),n&&Z3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wNe(e,t,n){return t=$3(t),TNe(e,Q3()?Reflect.construct(t,n||[],$3(e).constructor):t.apply(e,n))}function TNe(e,t){if(t&&(q3(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return e6(e)}function Q3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q3=function(){return!!e})()}function $3(e){return $3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$3(e)}function e6(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function ENe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&t6(e,t)}function t6(e,t){return t6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t6(e,t)}function n6(e,t,n){return t=r6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r6(e){var t=DNe(e,`string`);return q3(t)==`symbol`?t:String(t)}function DNe(e,t){if(q3(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q3(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ONe=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,a=e.width,o=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,c=xZ().domain((0,K3.default)(0,s)).range([i,i+a-o]),l=c.domain().map(function(e){return c(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}},i6=function(e){return e.changedTouches&&!!e.changedTouches.length},a6=function(e){ENe(t,e);function t(e){var n;return SNe(this,t),n=wNe(this,t,[e]),n6(e6(n),`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),n6(e6(n),`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),n6(e6(n),`handleDragEnd`,function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,i=e.startIndex;r?.({endIndex:t,startIndex:i})}),n.detachDragEndListener()}),n6(e6(n),`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),n6(e6(n),`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),n6(e6(n),`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),n6(e6(n),`handleSlideDragStart`,function(e){var t=i6(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(e6(n),`startX`),endX:n.handleTravellerDragStart.bind(e6(n),`endX`)},n.state={},n}return CNe(t,[{key:`componentWillUnmount`,value:function(){this.leaveTimer&&=(clearTimeout(this.leaveTimer),null),this.detachDragEndListener()}},{key:`getIndex`,value:function(e){var n=e.startX,r=e.endX,i=this.state.scaleValues,a=this.props,o=a.gap,s=a.data.length-1,c=Math.min(n,r),l=Math.max(n,r),u=t.getIndexInRange(i,c),d=t.getIndexInRange(i,l);
vendor: 4,679 bytes, line 517
517return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}},{key:`getTextOfTick`,value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,a=W1(n[e],i,e);return(0,xq.default)(r)?r(a,e):a}},{key:`attachDragEndListener`,value:function(){window.addEventListener(`mouseup`,this.handleDragEnd,!0),window.addEventListener(`touchend`,this.handleDragEnd,!0),window.addEventListener(`mousemove`,this.handleDrag,!0)}},{key:`detachDragEndListener`,value:function(){window.removeEventListener(`mouseup`,this.handleDragEnd,!0),window.removeEventListener(`touchend`,this.handleDragEnd,!0),window.removeEventListener(`mousemove`,this.handleDrag,!0)}},{key:`handleSlideDrag`,value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,a=this.props,o=a.x,s=a.width,c=a.travellerWidth,l=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,o+s-c-i,o+s-c-r):f<0&&(f=Math.max(f,o-r,o-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==l||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:`handleTravellerDragStart`,value:function(e,t){var n=i6(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:`handleTravellerMove`,value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,a=t.startX,o=this.state[r],s=this.props,c=s.x,l=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,p=s.data,m={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,c+l-u-o):h<0&&(h=Math.max(h,c-o)),m[r]=o+h;var g=this.getIndex(m),_=g.startIndex,v=g.endIndex,y=function(){var e=p.length-1;return r===`startX`&&(i>a?_%f===0:v%f===0)||i<a&&v===e||r===`endX`&&(i>a?v%f===0:_%f===0)||i>a&&v===e};this.setState(n6(n6({},r,o+h),`brushMoveStartX`,e.pageX),function(){d&&y()&&d(g)})}},{key:`handleTravellerMoveKeyboard`,value:function(e,t){var n=this,r=this.state,i=r.scaleValues,a=r.startX,o=r.endX,s=this.state[t],c=i.indexOf(s);if(c!==-1){var l=c+e;if(!(l===-1||l>=i.length)){var u=i[l];t===`startX`&&u>=o||t===`endX`&&u<=a||this.setState(n6({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:`renderBackground`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.fill,o=e.stroke;return y.createElement(`rect`,{stroke:o,fill:a,x:t,y:n,width:r,height:i})}},{key:`renderPanorama`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.data,o=e.children,s=e.padding,c=y.Children.only(o);return c?y.cloneElement(c,{x:t,y:n,width:r,height:i,margin:s,compact:!0,data:a}):null}},{key:`renderTravellerLayer`,value:function(e,n){var r=this,i=this.props,a=i.y,o=i.travellerWidth,s=i.height,c=i.traveller,l=i.ariaLabel,u=i.data,d=i.startIndex,f=i.endIndex,p=Math.max(e,this.props.x),m=X3(X3({},Mq(this.props,!1)),{},{x:p,y:a,width:o,height:s}),h=l||`Min value: ${u[d]?.name}, Max value: ${u[f]?.name}`;return y.createElement(zq,{tabIndex:0,role:`slider`,"aria-label":h,"aria-valuenow":e,className:`recharts-brush-traveller`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){[`ArrowLeft`,`ArrowRight`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard(e.key===`ArrowRight`?1:-1,n))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:`col-resize`}},t.renderTraveller(c,m))}},{key:`renderSlide`,value:function(e,t){var n=this.props,r=n.y,i=n.height,a=n.stroke,o=n.travellerWidth,s=Math.min(e,t)+o,c=Math.max(Math.abs(t-e)-o,0);return y.createElement(`rect`,{className:`recharts-brush-slide`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:`move`},stroke:`none`,fill:a,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:`renderText`,value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,a=e.travellerWidth,o=e.stroke,s=this.state,c=s.startX,l=s.endX,u=5,d={pointerEvents:`none`,fill:o};return y.createElement(zq,{className:`recharts-brush-texts`},y.createElement(QX,J3({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-u,y:r+i/2},d),this.getTextOfTick(t)),y.createElement(QX,J3({textAnchor:`start`,verticalAnchor:`middle`,x:Math.max(c,l)+a+u,y:r+i/2},d),this.getTextOfTick(n)))}},{key:`render`,value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,a=e.
517y,o=e.width,s=e.height,c=e.alwaysShowText,l=this.state,u=l.startX,d=l.endX,f=l.isTextActive,p=l.isSlideMoving,m=l.isTravellerMoving,h=l.isTravellerFocused;if(!t||!t.length||!X(i)||!X(a)||!X(o)||!X(s)||o<=0||s<=0)return null;var g=Ol(`recharts-brush`,n),_=y.Children.count(r)===1,v=xNe(`userSelect`,`none`);return y.createElement(zq,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:v},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(u,d),this.renderTravellerLayer(u,`startX`),this.renderTravellerLayer(d,`endX`),(f||p||m||h||c)&&this.renderText())}}],[{key:`renderDefaultTraveller`,value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.stroke,o=Math.floor(n+i/2)-1;return y.createElement(y.Fragment,null,y.createElement(`rect`,{x:t,y:n,width:r,height:i,fill:a,stroke:`none`}),y.createElement(`line`,{x1:t+1,y1:o,x2:t+r-1,y2:o,fill:`none`,stroke:`#fff`}),y.createElement(`line`,{x1:t+1,y1:o+2,x2:t+r-1,y2:o+2,fill:`none`,stroke:`#fff`}))}},{key:`renderTraveller`,value:function(e,n){return y.isValidElement(e)?y.cloneElement(e,n):(0,xq.default)(e)?e(n):t.renderDefaultTraveller(n)}},{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.data,r=e.width,i=e.x,a=e.travellerWidth,o=e.updateId,s=e.startIndex,c=e.endIndex;if(n!==t.prevData||o!==t.prevUpdateId)return X3({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?ONe({data:n,width:r,x:i,travellerWidth:a,startIndex:s,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([i,i+r-a]);var l=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:`getIndexInRange`,value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var a=Math.floor((r+i)/2);e[a]>t?i=a:r=a}return t>=e[i]?i:r}}]),t}(y.PureComponent);n6(a6,`displayName`,`Brush`),n6(a6,`defaultProps`,{height:40,travellerWidth:5,gap:1,fill:`#fff`,stroke:`#666`,padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var kNe=s(((e,t)=>{var n=IY();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),ANe=s(((e,t)=>{var n=QJ(),r=_Y(),i=kNe(),a=kK(),o=zY();function s(e,t,s){var c=a(e)?n:i;return s&&o(e,t,s)&&(t=void 0),c(e,r(t,3))}t.exports=s})),o6=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},jNe=s(((e,t)=>{var n=RY();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),MNe=s(((e,t)=>{var n=jNe(),r=FY(),i=_Y();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),NNe=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=n})),PNe=s(((e,t)=>{var n=IY();function r(e,t){var r=!0;return n(e,function(e,n,i){return r=!!t(e,n,i),r}),r}t.exports=r})),FNe=s(((e,t)=>{var n=NNe(),r=PNe(),i=_Y(),a=kK(),o=zY();function s(e,t,s){var c=a(e)?n:r;return s&&o(e,t,s)&&(t=void 0),c(e,i(t,3))}t.exports=s})),INe=[`x`,`y`];function s6(e){"@babel/helpers - typeof";return s6=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},s6(e)}function c6(){return c6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c6.apply(this,arguments)}function l6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?l6(Object(n),!0).forEach(function(t){LNe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l6(Object(n)).forEac
517h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LNe(e,t,n){return t=RNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RNe(e){var t=zNe(e,`string`);return s6(t)==`symbol`?t:String(t)}function zNe(e,t){if(s6(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(s6(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function BNe(e,t){if(e==null)return{};var n=VNe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VNe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function HNe(e,t){var n=e.x,r=e.y,i=BNe(e,INe),a=`${n}`,o=parseInt(a,10),s=`${r}`,c=parseInt(s,10),l=`${t.height||i.height}`,u=parseInt(l,10),d=`${t.width||i.width}`,f=parseInt(d,10);return u6(u6(u6(u6(u6({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function d6(e){return y.createElement(w3,c6({shapeType:`rectangle`,propTransformer:HNe,activeClassName:`recharts-active-bar`},e))}var UNe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,r){if(typeof e==`number`)return e;var i=typeof n==`number`;return i?e(n,r):(!i&&D1(!1),t)}},WNe=[`value`,`background`],f6;function p6(e){"@babel/helpers - typeof";return p6=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p6(e)}function GNe(e,t){if(e==null)return{};var n=KNe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KNe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m6.apply(this,arguments)}function h6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h6(Object(n),!0).forEach(function(t){S6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qNe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _6(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,C6(r.key),r)}}function JNe(e,t,n){return t&&_6(e.prototype,t),n&&_6(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YNe(e,t,n){return t=y6(t),XNe(e,v6()?Reflect.construct(t,n||[],y6(e).constructor):t.apply(e,n))}function XNe(e,t){if(t&&(p6(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return b6(e)}function v6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v6=function(){return!!e})()}function y6(e){return y6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y6(e)}function b6(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function ZNe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x6(e,t)}
517function x6(e,t){return x6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x6(e,t)}function S6(e,t,n){return t=C6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C6(e){var t=QNe(e,`string`);return p6(t)==`symbol`?t:String(t)}function QNe(e,t){if(p6(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p6(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var w6=function(e){ZNe(t,e);function t(){var e;qNe(this,t);var n=[...arguments];return e=YNe(this,t,[].concat(n)),S6(b6(e),`state`,{isAnimationFinished:!1}),S6(b6(e),`id`,cq(`recharts-bar-`)),S6(b6(e),`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),S6(b6(e),`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return JNe(t,[{key:`renderRectanglesStatically`,value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,a=n.activeIndex,o=n.activeBar,s=Mq(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,u=g6(g6(g6({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return y.createElement(zq,m6({className:`recharts-bar-rectangle`},yq(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}`}),y.createElement(d6,u))})}},{key:`renderRectanglesWithAnimation`,value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationId,l=this.state.prevData;return y.createElement(E4,{begin:a,duration:o,isActive:i,easing:s,from:{t:0},to:{t:1},key:`bar-${c}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,a=n.map(function(e,t){var n=l&&l[t];if(n){var a=dq(n.x,e.x),o=dq(n.y,e.y),s=dq(n.width,e.width),c=dq(n.height,e.height);return g6(g6({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=dq(0,e.height)(i);return g6(g6({},e),{},{y:e.y+e.height-u,height:u})}var d=dq(0,e.width)(i);return g6(g6({},e),{},{width:d})});return y.createElement(zq,null,e.renderRectanglesStatically(a))})}},{key:`renderRectangles`,value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,L1.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:`renderBackground`,value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,a=Mq(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=GNe(t,WNe);if(!o)return null;var c=g6(g6(g6(g6(g6({},s),{},{fill:`#eee`},o),a),yq(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,key:`background-bar-${n}`,className:`recharts-bar-background-rectangle`});return y.createElement(d6,m6({option:e.props.background,isActive:n===i},c))})}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=kq(s,A1);if(!c)return null;var l=o===`vertical`?r[0].height/2:r[0].width/2,u=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:W1(e,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return y.createElement(zq,d,c.map(function(e){return y.cloneElement(e,{key:`error-bar-${t}-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,offset:l,dataPointFormatter:u})}))}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,a=e.yAxis,o=e.left,s=e.top,c=e.width,l=e.height,u=e.isAnimationActive,d=e.background,f=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,m=Ol(`recharts-bar`,r),h=i&&i.allowDataOverflow,g=a&&a.allowDataOverflow,_=h||g,v=(0,bq.default)(f)?this.id:f;return y.createElement(zq,{className:m},h||g?y.createElement(`defs`,null,y.createElement(`clipPath`,{id:`clipPath-${v}`},y.createElement(`rect`,{x:h?o:o-c/2,y:g?s:s-l/2,width:h?c:c*2,height:g?l:l*2}))):null,y.createElement(zq,{className:`recharts-bar-rectangles`,clipPath:_?`url(#clipPath-${v})`:null}
517,d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,v),(!u||p)&&F0.renderCallByParent(this.props,n))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.data===t.curData?null:{curData:e.data}:{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}}}]),t}(y.PureComponent);f6=w6,S6(w6,`displayName`,`Bar`),S6(w6,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!sX.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),S6(w6,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=BOe(r,n);if(!p)return null;var m=t.layout,h=n.props,g=h.dataKey,_=h.children,v=h.minPointSize,y=m===`horizontal`?o:a,b=l?y.scale.domain():null,x=GOe({numericAxis:y}),S=kq(_,TX);return g6({data:d.map(function(e,t){var r,d,f,h,_,y;l?r=VOe(l[u+t],b):(r=W1(e,g),Array.isArray(r)||(r=[x,r]));var C=UNe(v,f6.defaultProps.minPointSize)(r[1],t);if(m===`horizontal`){var w=[o.scale(r[0]),o.scale(r[1])],T=w[0],E=w[1];d=i0({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),f=E??T??void 0,h=p.size;var D=T-E;if(_=Number.isNaN(D)?0:D,y={x:d,y:o.y,width:h,height:o.height},Math.abs(C)>0&&Math.abs(_)<Math.abs(C)){var O=aq(_||C)*(Math.abs(C)-Math.abs(_));f-=O,_+=O}}else{var k=[a.scale(r[0]),a.scale(r[1])],A=k[0],j=k[1];if(d=A,f=i0({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:e,index:t}),h=j-A,_=p.size,y={x:a.x,y:f,width:a.width,height:_},Math.abs(C)>0&&Math.abs(h)<Math.abs(C)){var M=aq(h||C)*(Math.abs(C)-Math.abs(h));h+=M}}return g6(g6(g6({},e),{},{x:d,y:f,width:h,height:_,value:l?r:r[1],payload:e,background:y},S&&S[t]&&S[t].props),{},{tooltipPayload:[d0(n,e)],tooltipPosition:{x:d+h/2,y:f+_/2}})}),layout:m},f)});var $Ne=u(MNe()),T6=u(FNe());function E6(e){"@babel/helpers - typeof";return E6=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},E6(e)}function ePe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function D6(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,j6(r.key),r)}}function tPe(e,t,n){return t&&D6(e.prototype,t),n&&D6(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O6(Object(n),!0).forEach(function(t){A6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A6(e,t,n){return t=j6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j6(e){var t=nPe(e,`string`);return E6(t)==`symbol`?t:String(t)}function nPe(e,t){if(E6(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(E6(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rPe=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.layout,c=e.children,l=Object.keys(t),u={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},d=!!Aq(c,w6);return l.reduce(function(a,o){var c=t[o],l=c.orientation,f=c.domain,p=c.padding,m=p===void 0?{}:p,h=c.mirror,g=c.reversed,_=`${l}${h?`Mirror`:``}`,v,y,b,x,S;if(c.type===`number`&&(c.padding===`gap`||c.padding===`no-gap`)){var C=f[1]-f[0],w=1/0,T=c.categoricalDomain.sort();if(T.forEach(function(e,t){t>0&&(w=Math.min((e||0)-(T[t-1]||0),w))}),Number.isFinite(w)){var E=w/C,D=c.layout===`vertical`?n.height:n.width;if(c.padding===`gap`&&(v=E*D/2),c.padding===`no-gap`){var O=lq(e.barCategoryGap,E*D),k=E*D/2;v=k-O-(k-O)/D*O}}}y=r===`xAxis`?[n.left+(m.left||0)+(v||0),n.left+n.width-(m.right||0)-(v||0)]:r===`yAxis`?s===`horizontal`?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(v||0),n.top+n.height-(m.bottom||0)-(v||0)]:c.range,g&&(y=[y[1],y[0]]);var A=e0(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),n0(j);var N=r0(j,k6(k6({},c),{},{realScaleType:M}));r===`xAxis`?(S=l===`top`&&!h||l===`bottom`&&h,b=n.left,x=u[_]-S*c.height):r===`yAxis`&&(S=l===`left`&&!h||l===`right`&&h,b=u[_]-S*c.width,x=n.top);var ee=k6(k6(k6({},c),N),{},{realScaleType:M,x:b,y:x,scale:j,width:r===`xAxis`?n.width:c.width,height:r===`yAxis`?n.height:c.height});return ee.bandSize=l0(ee,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*ee.height:c.hide||(u[_]+=(S?-1:1)*ee.width),k6(k6({},a),{},A6({},o,ee))},{})},M6=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},iPe=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return M6({x:t,y:n},{x:r,y:i})},N6=function(){function e(t){ePe(this,e),this.scale=t}return tPe(e,[{key:`domain`,get:function(){return this.scale.domain}},{key:`range`,get:function(){return this.scale.range}},{key:`rangeMin`,get:function(){return this.range()[0]}},{key:`rangeMax`,get:function(){return this.range()[1]}},{key:`bandwidth`,get:function(){return this.scale.bandwidth}},{key:`apply`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.bandAware,r=t.position;if(e!==void 0){if(r)switch(r){case`start`:return this.scale(e);case`middle`:var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case`end`:var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a;default:return this.scale(e)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o}return this.scale(e)}}}
517,{key:`isInRange`,value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],[{key:`create`,value:function(t){return new e(t)}}]),e}();A6(N6,`EPS`,1e-4);var P6=function(e){var t=Object.keys(e).reduce(function(t,n){return k6(k6({},t),{},A6({},n,N6.create(e[n])))},{});return k6(k6({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,$Ne.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,T6.default)(e,function(e,n){return t[n].isInRange(e)})}})};function aPe(e){return(e%180+180)%180}var oPe=function(e){var t=e.width,n=e.height,r=aPe(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},sPe=s(((e,t)=>{var n=_Y(),r=uY(),i=dY();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),cPe=s(((e,t)=>{var n=V3();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),lPe=s(((e,t)=>{var n=vY(),r=_Y(),i=cPe(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),uPe=s(((e,t)=>{t.exports=sPe()(lPe())})),dPe=(0,u(JK()).default)(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return[`l`,e.left,`t`,e.top,`w`,e.width,`h`,e.height].join(``)}),fPe=u(uPe()),F6=(0,y.createContext)(void 0),I6=(0,y.createContext)(void 0),L6=(0,y.createContext)(void 0),R6=(0,y.createContext)({}),z6=(0,y.createContext)(void 0),B6=(0,y.createContext)(0),V6=(0,y.createContext)(0),H6=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,a=e.clipPathId,o=e.children,s=e.width,c=e.height,l=dPe(i);return y.createElement(F6.Provider,{value:n},y.createElement(I6.Provider,{value:r},y.createElement(R6.Provider,{value:i},y.createElement(L6.Provider,{value:l},y.createElement(z6.Provider,{value:a},y.createElement(B6.Provider,{value:c},y.createElement(V6.Provider,{value:s},o)))))))},pPe=function(){return(0,y.useContext)(z6)},U6=function(e){var t=(0,y.useContext)(F6);t??D1(!1);var n=t[e];return n??D1(!1),n},mPe=function(){return uq((0,y.useContext)(F6))},hPe=function(){var e=(0,y.useContext)(I6);return(0,fPe.default)(e,function(e){return(0,T6.default)(e.domain,Number.isFinite)})||uq(e)},W6=function(e){var t=(0,y.useContext)(I6);t??D1(!1);var n=t[e];return n??D1(!1),n},gPe=function(){return(0,y.useContext)(L6)},_Pe=function(){return(0,y.useContext)(R6)},G6=function(){return(0,y.useContext)(V6)},K6=function(){return(0,y.useContext)(B6)},vPe=u(ANe());function q6(e){"@babel/helpers - typeof";return q6=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q6(e)}function J6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?J6(Object(n),!0).forEach(function(t){yPe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yPe(e,t,n){return t=bPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bPe(e){var t=xPe(e,`string`);return q6(t)==`symbol`?t:String(t)}function xPe(e,t){if(q6(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q6(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function SPe(e,t){return EPe(e)||TPe(e,t)||wPe(e,t)||CPe()}
517function CPe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 518In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wPe(e,t){if(e){if(typeof e==`string`)return X6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X6(e,t)}}function X6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TPe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function EPe(e){if(Array.isArray(e))return e}function Z6(){return Z6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z6.apply(this,arguments)}var DPe=function(e,t){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(`line`,Z6({},t,{className:`recharts-reference-line-line`}))},OPe=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(o6(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(o6(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return o6(c,`discard`)&&(0,vPe.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function Q6(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className;e.alwaysShow;var c=pPe(),l=U6(i),u=W6(a),d=gPe();if(!c||!d)return null;var f=OPe(P6({x:l.scale,y:u.scale}),sq(t),sq(n),r&&r.length===2,d,e.position,l.orientation,u.orientation,e);if(!f)return null;var p=SPe(f,2),m=p[0],h=m.x,g=m.y,_=p[1],v=_.x,b=_.y,x=Y6(Y6({clipPath:o6(e,`hidden`)?`url(#${c})`:void 0},Mq(e,!0)),{},{x1:h,y1:g,x2:v,y2:b});return y.createElement(zq,{className:Ol(`recharts-reference-line`,s)},DPe(o,x),D0.renderCallByParent(e,iPe({x1:h,y1:g,x2:v,y2:b})))}Q6.displayName=`ReferenceLine`,Q6.defaultProps={isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`};function $6(e){"@babel/helpers - typeof";return $6=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$6(e)}function e8(){return e8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e8.apply(this,arguments)}function t8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?t8(Object(n),!0).forEach(function(t){kPe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kPe(e,t,n){return t=APe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function APe(e){var t=jPe(e,`string`);return $6(t)==`symbol`?t:String(t)}function jPe(e,t){if($6(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($6(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var MPe=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=P6({x:r.
518scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return o6(e,`discard`)&&!a.isInRange(o)?null:o};function r8(e){var t=e.x,n=e.y,r=e.r;e.alwaysShow;var i=e.clipPathId,a=sq(t),o=sq(n);if(!a||!o)return null;var s=MPe(e);if(!s)return null;var c=s.x,l=s.y,u=e.shape,d=e.className,f=n8(n8({clipPath:o6(e,`hidden`)?`url(#${i})`:void 0},Mq(e,!0)),{},{cx:c,cy:l});return y.createElement(zq,{className:Ol(`recharts-reference-dot`,d)},r8.renderDot(u,f),D0.renderCallByParent(e,{x:c-r,y:l-r,width:2*r,height:2*r}))}r8.displayName=`ReferenceDot`,r8.defaultProps={isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1},r8.renderDot=function(e,t){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(B4,e8({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))};function i8(e){"@babel/helpers - typeof";return i8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i8(e)}function a8(){return a8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a8.apply(this,arguments)}function o8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o8(Object(n),!0).forEach(function(t){NPe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NPe(e,t,n){return t=PPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PPe(e){var t=FPe(e,`string`);return i8(t)==`symbol`?t:String(t)}function FPe(e,t){if(i8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var IPe=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=P6({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return o6(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:M6(f,p)};function c8(e){var t=e.x1,n=e.x2,r=e.y1,i=e.y2,a=e.className;e.alwaysShow;var o=e.clipPathId,s=sq(t),c=sq(n),l=sq(r),u=sq(i),d=e.shape;if(!s&&!c&&!l&&!u&&!d)return null;var f=IPe(s,c,l,u,e);if(!f&&!d)return null;var p=o6(e,`hidden`)?`url(#${o})`:void 0;return y.createElement(zq,{className:Ol(`recharts-reference-area`,a)},c8.renderRect(d,s8(s8({clipPath:p},Mq(e,!0)),f)),D0.renderCallByParent(e,f))}c8.displayName=`ReferenceArea`,c8.defaultProps={isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1},c8.renderRect=function(e,t){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(N4,a8({},t,{className:`recharts-reference-area-rect`}))};function l8(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)if(n===void 0||n(e[i])===!0)r.push(e[i]);else return;return r}function LPe(e,t,n){return oPe({width:e.width+t.width,height:e.height+t.height},n)}function RPe(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function u8(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function zPe(e,t){return l8(e,t+1)}function BPe(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:l8(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||u8(e,p,f,u,s);
518m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function d8(e){"@babel/helpers - typeof";return d8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},d8(e)}function f8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?f8(Object(n),!0).forEach(function(t){VPe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VPe(e,t,n){return t=HPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HPe(e){var t=UPe(e,`string`);return d8(t)==`symbol`?t:String(t)}function UPe(e,t){if(d8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(d8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function WPe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t],l,u=function(){return l===void 0&&(l=n(r,t)),l};if(t===o-1){var d=e*(r.coordinate+e*u()/2-c);a[t]=r=p8(p8({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=p8(p8({},r),{},{tickCoord:r.coordinate});u8(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=p8(p8({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function GPe(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=p8(p8({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u8(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=p8(p8({},u),{},{isShow:!0}))}for(var p=a?s-1:s,m=function(t){var r=o[t],a,s=function(){return a===void 0&&(a=n(r,t)),a};if(t===0){var u=e*(r.coordinate-e*s()/2-c);o[t]=r=p8(p8({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=p8(p8({},r),{},{tickCoord:r.coordinate});u8(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=p8(p8({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function m8(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(X(c)||sX.isSsr)return zPe(i,typeof c==`number`&&X(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?jX(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,xq.default)(l)?l(e.value,r):e.value;return p===`width`?LPe(jX(i,{fontSize:t,letterSpacing:n}),m,d):jX(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?aq(i[1].coordinate-i[0].coordinate):1,_=RPe(a,g,p);return c===`equidistantPreserveStart`?BPe(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?GPe(g,_,h,i,o,c===`preserveStartEnd`):WPe(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var KPe=[`viewBox`],qPe=[`viewBox`],JPe=[`ticks`];function h8(e){"@babel/helpers - typeof";return h8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},h8(e)}function g8(){return g8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g8.apply(this,arguments)}function _8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
518t%2?_8(Object(n),!0).forEach(function(t){w8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y8(e,t){if(e==null)return{};var n=YPe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YPe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function XPe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function b8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,T8(r.key),r)}}function ZPe(e,t,n){return t&&b8(e.prototype,t),n&&b8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QPe(e,t,n){return t=S8(t),$Pe(e,x8()?Reflect.construct(t,n||[],S8(e).constructor):t.apply(e,n))}function $Pe(e,t){if(t&&(h8(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return eFe(e)}function eFe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function x8(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x8=function(){return!!e})()}function S8(e){return S8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S8(e)}function tFe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C8(e,t)}function C8(e,t){return C8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C8(e,t)}function w8(e,t,n){return t=T8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T8(e){var t=nFe(e,`string`);return h8(t)==`symbol`?t:String(t)}function nFe(e,t){if(h8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(h8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var E8=function(e){tFe(t,e);function t(e){var n;return XPe(this,t),n=QPe(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return ZPe(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=y8(e,KPe),i=this.props,a=i.viewBox,o=y8(i,qPe);return!pq(n,a)||!pq(r,o)||!pq(t,this.state)}},{key:`componentDidMount`,value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`)[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.x,r=t.y,i=t.width,a=t.height,o=t.orientation,s=t.tickSize,c=t.mirror,l=t.tickMargin,u,d,f,p,m,h,g=c?-1:1,_=e.tickSize||s,v=X(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case`top`:u=d=e.coordinate,p=r+ +!c*a,f=p-g*_,h=f-g*l,m=v;break;case`left`:f=p=e.coordinate,d=n+ +!c*i,u=d-g*_,m=u-g*l,h=v;break;case`right`:f=p=e.coordinate,d=n+ +c*i,u=d+g*_,m=u+g*l,h=v;break;default:u=d=e.coordinate,p=r+ +c*a,f=p+g*_,h=f+g*l,m=v;break}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:m,y:h}}}},{key:`getTickTextAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r;switch(t){case`left`:r=n?`start`:`end`;break;case`right`:r=n?`end`:`start`;break;default:r=`middle`;break}return r}},{key:`getTickVerticalAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r=`end`;switch(t){case`left`:case`right`:r=`middle`;break;case`top`:r=n?`start`:`end`;break;default:r=n?`end`:`start`;break}return r}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.he
518ight,a=e.orientation,o=e.mirror,s=e.axisLine,c=v8(v8(v8({},Mq(this.props,!1)),Mq(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=v8(v8({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var u=+(a===`left`&&!o||a===`right`&&o);c=v8(v8({},c),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return y.createElement(`line`,g8({},c,{className:Ol(`recharts-cartesian-axis-line`,(0,iq.default)(s,`className`))}))}},{key:`renderTicks`,value:function(e,n,r){var i=this,a=this.props,o=a.tickLine,s=a.stroke,c=a.tick,l=a.tickFormatter,u=a.unit,d=m8(v8(v8({},this.props),{},{ticks:e}),n,r),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),m=Mq(this.props,!1),h=Mq(c,!1),g=v8(v8({},m),{},{fill:`none`},Mq(o,!1)),_=d.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,_=r.tick,v=v8(v8(v8(v8({textAnchor:f,verticalAnchor:p},m),{},{stroke:`none`,fill:s},h),_),{},{index:n,payload:e,visibleTicksCount:d.length,tickFormatter:l});return y.createElement(zq,g8({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},yq(i.props,e,n)),o&&y.createElement(`line`,g8({},g,a,{className:Ol(`recharts-cartesian-axis-tick-line`,(0,iq.default)(o,`className`))})),c&&t.renderTickItem(c,v,`${(0,xq.default)(l)?l(e.value,n):e.value}${u||``}`))});return y.createElement(`g`,{className:`recharts-cartesian-axis-ticks`},_)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,a=t.ticksGenerator,o=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,l=y8(s,JPe),u=c;return(0,xq.default)(a)&&(u=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!u||!u.length?null:y.createElement(zq,{className:Ol(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),D0.renderCallByParent(this.props))}}],[{key:`renderTickItem`,value:function(e,t,n){return y.isValidElement(e)?y.cloneElement(e,t):(0,xq.default)(e)?e(t):y.createElement(QX,g8({},t,{className:`recharts-cartesian-axis-tick-value`}),n)}}]),t}(y.Component);w8(E8,`displayName`,`CartesianAxis`),w8(E8,`defaultProps`,{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`});var rFe=[`x1`,`y1`,`x2`,`y2`,`key`],iFe=[`offset`];function D8(e){"@babel/helpers - typeof";return D8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},D8(e)}function O8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O8(Object(n),!0).forEach(function(t){aFe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aFe(e,t,n){return t=oFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oFe(e){var t=sFe(e,`string`);return D8(t)==`symbol`?t:String(t)}function sFe(e,t){if(D8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(D8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function A8(){return A8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A8.apply(this,arguments)}function j8(e,t){if(e==null)return{};var n=cFe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cFe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var lFe=function(e){var t=e.fill;if(!t||t===`none`)return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height;return y.createElement(`rect`,{x:r,y:i,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function M8(e,t){var n;if(y.isValidElement(e))n=y.cloneElement(e,t);else if((0,xq.default)(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,c=Mq(j8(t,rFe),!1);c.offset;var l=j8(c,iFe);n=y.createElement(`line`,A8({},l,{x1:r,y1:i,x2:a,y2:o,fill:`none`,key:s}))}return n}function uFe(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0||r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(r,a){return M8(i,k8(k8({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:`line-${a}`,index:a}))});return y.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},o)}function dFe(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0||r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(r,a){return M8(i,k8(k8({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:`line-${a}`,index:a}))});return y.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},o)}function fFe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(c===void 0||c)||!t||!t.length)return null;var l=s.map(function(e){return Math.round(e+i-i)}).sort(function(e,t){return e-t});i!==l[0]&&l.unshift(0);var u=l.map(function(e,s){var c=l[s+1]?l[s+1]-e:i+o-e;if(c<=0)return null;var u=s%t.length;return y.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:c,width:a,stroke:`none`,fill:t[u],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return y.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function pFe(e){var t=e.vertical,n=t===void 0||t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var u=l.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,t){var n=u[t+1]?u[t+1]-e:a+s-e;if(n<=0)return null;var l=t%r.length;return y.createElement(`rect`,{key:`react-${t}`,x:e,y:o,width:n,height:c,stroke:`none`,fill:r[l],fillOpacity:i,className:`recharts-cartesian-grid-bg`})});return y.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},d)}
vendor: 6,074 bytes, lines 518-519
518var mFe=function(e,t){var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return X1(m8(k8(k8(k8({},E8.defaultProps),n),{},{ticks:Z1(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},hFe=function(e,t){var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return X1(m8(k8(k8(k8({},E8.defaultProps),n),{},{ticks:Z1(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},N8={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[]};function P8(e){var t=G6(),n=K6(),r=_Pe(),i=k8(k8({},e),{},{stroke:e.stroke??N8.stroke,fill:e.fill??N8.fill,horizontal:e.horizontal??N8.horizontal,horizontalFill:e.horizontalFill??N8.horizontalFill,vertical:e.vertical??N8.vertical,verticalFill:e.verticalFill??N8.verticalFill,x:X(e.x)?e.x:r.left,y:X(e.y)?e.y:r.top,width:X(e.width)?e.width:r.width,height:X(e.height)?e.height:r.height}),a=i.x,o=i.y,s=i.width,c=i.height,l=i.syncWithTicks,u=i.horizontalValues,d=i.verticalValues,f=mPe(),p=hPe();if(!X(s)||s<=0||!X(c)||c<=0||!X(a)||a!==+a||!X(o)||o!==+o)return null;var m=i.verticalCoordinatesGenerator||mFe,h=i.horizontalCoordinatesGenerator||hFe,g=i.horizontalPoints,_=i.verticalPoints;if((!g||!g.length)&&(0,xq.default)(h)){var v=u&&u.length,b=h({yAxis:p?k8(k8({},p),{},{ticks:v?u:p.ticks}):void 0,width:t,height:n,offset:r},v?!0:l);`${D8(b)}`,Array.isArray(b)&&(g=b)}if((!_||!_.length)&&(0,xq.default)(m)){var x=d&&d.length,S=m({xAxis:f?k8(k8({},f),{},{ticks:x?d:f.ticks}):void 0,width:t,height:n,offset:r},x?!0:l);`${D8(S)}`,Array.isArray(S)&&(_=S)}return y.createElement(`g`,{className:`recharts-cartesian-grid`},y.createElement(lFe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height}),y.createElement(uFe,A8({},i,{offset:r,horizontalPoints:g,xAxis:f,yAxis:p})),y.createElement(dFe,A8({},i,{offset:r,verticalPoints:_,xAxis:f,yAxis:p})),y.createElement(fFe,A8({},i,{horizontalPoints:g})),y.createElement(pFe,A8({},i,{verticalPoints:_})))}P8.displayName=`CartesianGrid`;function F8(){return F8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F8.apply(this,arguments)}var I8=function(e){var t=e.xAxisId,n=G6(),r=K6(),i=U6(t);return i==null?null:y.createElement(E8,F8({},i,{className:Ol(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return Z1(e,!0)}}))};I8.displayName=`XAxis`,I8.defaultProps={allowDecimals:!0,hide:!1,orientation:`bottom`,width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:`category`,padding:{left:0,right:0},allowDataOverflow:!1,scale:`auto`,reversed:!1,allowDuplicatedCategory:!0};function L8(){return L8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L8.apply(this,arguments)}var R8=function(e){var t=e.yAxisId,n=G6(),r=K6(),i=W6(t);return i==null?null:y.createElement(E8,L8({},i,{className:Ol(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return Z1(e,!0)}}))};R8.displayName=`YAxis`,R8.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:`left`,width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:`number`,padding:{top:0,bottom:0},allowDataOverflow:!1,scale:`auto`,reversed:!1};function z8(e){return yFe(e)||vFe(e)||_Fe(e)||gFe()}function gFe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 519In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Fe(e,t){if(e){if(typeof e==`string`)return B8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B8(e,t)}}function vFe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function yFe(e){if(Array.isArray(e))return B8(e)}function B8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V8=function(e,t,n,r,i){var a=kq(e,Q6),o=kq(e,r8),s=[].concat(z8(a),z8(o)),c=kq(e,c8),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&o6(t.props,`extendDomain`)&&X(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&o6(t.props,`extendDomain`)&&X(t.props[f])&&X(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return X(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},H8=new(u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;
519if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,U8=`recharts.syncMouseEvents`;function W8(e){"@babel/helpers - typeof";return W8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},W8(e)}function bFe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function G8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,q8(r.key),r)}}function xFe(e,t,n){return t&&G8(e.prototype,t),n&&G8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function K8(e,t,n){return t=q8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q8(e){var t=SFe(e,`string`);return W8(t)==`symbol`?t:String(t)}function SFe(e,t){if(W8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(W8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var CFe=function(){function e(){bFe(this,e),K8(this,`activeIndex`,0),K8(this,`coordinateList`,[]),K8(this,`layout`,`horizontal`)}return xFe(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:`focus`,value:function(){this.spoofMouse()}},{key:`keyboardEvent`,value:function(e){if(this.coordinateList.length!==0)switch(e.key){case`ArrowRight`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case`ArrowLeft`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break;default:break}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}]),e}();function wFe(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&X(r)&&X(i))return!0}return!1}function TFe(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}
519function J8(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[v0(t,n,r,i),v0(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function EFe(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=v0(s,c,l,d),p=v0(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return J8(t);return[{x:r,y:i},{x:a,y:o}]}function Y8(e){"@babel/helpers - typeof";return Y8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Y8(e)}function X8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X8(Object(n),!0).forEach(function(t){DFe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DFe(e,t,n){return t=OFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OFe(e){var t=kFe(e,`string`);return Y8(t)==`symbol`?t:String(t)}function kFe(e,t){if(Y8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Y8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AFe(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,u=e.chartName;if(!t||!t.props.cursor||!r||!i||u!==`ScatterChart`&&n!==`axis`)return null;var d,f=Z0;if(u===`ScatterChart`)d=i,f=lMe;else if(u===`BarChart`)d=TFe(l,i,o,c),f=N4;else if(l===`radial`){var p=J8(i),m=p.cx,h=p.cy,g=p.radius;d={cx:m,cy:h,startAngle:p.startAngle,endAngle:p.endAngle,innerRadius:g,outerRadius:g},f=H0}else d={points:EFe(l,i,o)},f=Z0;var _=Z8(Z8(Z8(Z8({stroke:`#ccc`,pointerEvents:`none`},o),d),Mq(t.props.cursor,!1)),{},{payload:a,payloadIndex:s,className:Ol(`recharts-tooltip-cursor`,t.props.cursor.className)});return(0,y.isValidElement)(t.props.cursor)?(0,y.cloneElement)(t.props.cursor,_):(0,y.createElement)(f,_)}var jFe=[`item`],MFe=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function Q8(e){"@babel/helpers - typeof";return Q8=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Q8(e)}function $8(){return $8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$8.apply(this,arguments)}function e5(e,t){return FFe(e)||PFe(e,t)||c5(e,t)||NFe()}function NFe(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 520In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PFe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function FFe(e){if(Array.isArray(e))return e}function t5(e,t){if(e==null)return{};var n=IFe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IFe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function LFe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function n5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,f5(r.key),r)}}function RFe(e,t,n){return t&&n5(e.prototype,t),n&&n5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zFe(e,t,n){return t=i5(t),BFe(e,r5()?Reflect.construct(t,n||[],i5(e).constructor):t.apply(e,n))}function BFe(e,t){if(t&&(Q8(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return a5(e)}function r5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r5=function(){return!!e})()}
520function i5(e){return i5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i5(e)}function a5(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function VFe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o5(e,t)}function o5(e,t){return o5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o5(e,t)}function s5(e){return WFe(e)||UFe(e)||c5(e)||HFe()}function HFe(){throw TypeError(`Invalid attempt to spread non-iterable instance. 521In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c5(e,t){if(e){if(typeof e==`string`)return l5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l5(e,t)}}function UFe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function WFe(e){if(Array.isArray(e))return l5(e)}function l5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u5(Object(n),!0).forEach(function(t){d5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d5(e,t,n){return t=f5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f5(e){var t=GFe(e,`string`);return Q8(t)==`symbol`?t:String(t)}function GFe(e,t){if(Q8(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Q8(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var KFe={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},qFe={width:`100%`,height:`100%`},p5={x:0,y:0};function m5(e){return e}var JFe=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},YFe=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Z(Z(Z({},r),v0(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Z(Z(Z({},r),v0(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return p5},h5=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(s5(e),s5(n)):e},[]);return a.length>0?a:e&&e.length&&X(r)&&X(i)?e.slice(r,i+1):[]};function g5(e){return e===`number`?[0,`auto`]:void 0}var _5=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=h5(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?fq(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(s5(i),[d0(s,l)]):i},[])},v5=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=JFe(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=POe(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:_5(e,t,l,u),activeCoordinate:YFe(n,o,l,i)}}return null},XFe=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=Y1(l,i);return n.reduce(function(t,n){var p=n.props,m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=n.props[a];if(t[x])return t;var S=h5(e.data,{graphicalItems:r.filter(function(e){return e.props[a]===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;wFe(n.props.domain,g,m)&&(w=c0(n.props.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=G1(S,h,`category`)));var D=g5(m);if(!w||w.length===0){var O=n.props.domain??D;if(h){if(w=G1(S,h,m),m===`category`&&f){var k=oxe(w);_&&k?(T=w,w=(0,K3.default)(0,C)):_||(w=u0(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(s5(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,bq.default)(e)}):u0(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,bq.default)(t)?e:[].concat(s5(e),[t])},[]);else if(m===`number`){var A=zOe(S,r.filter(function(e){return e.props[a]===x&&(b||!e.props.hide)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=G1(S,h,`category`))}else w=f?(0,K3.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:a0(o[x].stackGroups,s,c):J1(S,r.filter(function(e){return e.props[a]===x&&(b||!e.props.hide)}),m,l,!0);if(m===`number`)w=V8(u,w,x,i,y),O&&(w=c0(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Z(Z({},t),{},d5({},x,Z(Z({},n.props),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:n.props.domain??D,isCategorical:f,layout:l})))},{})},ZFe=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=h5(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=Y1(l,i),m=-1;return n.reduce(function(e,t){var h=t.props[a],g=g5(`number`);if(!e[h]){m++;var _;return p?_=(0,K3.default)(0,f):o&&o[h]&&o[h].hasStack?(_=a0(o[h].stackGroups,s,c),_=V8(u,_,h,i)):(_=c0(g,J1(d,n.filter(function(e){return e.props[a]===h&&!e.props.hide}),`number`,l),r.defaultProps.allowDataOverflow),_=V8(u,_,h,i)),Z(Z({},e),{},d5({},h,Z(Z({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,iq.default)(KFe,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},QFe=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=kq(l,i),f={};return d&&d.length?f=XFe(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=ZFe(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},$Fe=function(e){var t=uq(e),n=Z1(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,BY.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:l0(t,n)}},y5=function(e){var t=e.children,n=e.defaultShowTooltip,r=Aq(t,a6),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},eIe=function(e){return!e||!e.length?!1:e.some(function(e){var t=Tq(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},b5=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},tIe=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=Aq(u,a6),p=Aq(u,NY),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},d5({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Z(Z({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},d5({},r,(0,iq.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||a6.defaultProps.height),p&&t&&(h=LOe(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Z(Z({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},nIe=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},x5=function(e){var t,n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?`axis`:i,o=e.validateTooltipEventTypes,s=o===void 0?[`axis`]:o,c=e.axisComponents,l=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,s=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=b5(u),h=m.numericAxisName,g=m.cateAxisName,_=eIe(n),v=[];
521return n.forEach(function(n,m){var y=h5(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:s}),b=n.props,x=b.dataKey,S=b.maxBarSize,C=n.props[`${h}Id`],w=n.props[`${g}Id`],T=c.reduce(function(e,r){var i=t[`${r.axisType}Map`],a=n.props[`${r.axisType}Id`];!(i&&i[a]||r.axisType===`zAxis`)&&D1(!1);var o=i[a];return Z(Z({},e),{},d5(d5({},r.axisType,o),`${r.axisType}Ticks`,Z1(o)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&KOe(n,r[C].stackGroups),k=Tq(n.type).indexOf(`Bar`)>=0,A=l0(E,D),j=[],M=_&&FOe({barSize:l,stackGroups:r,totalSize:nIe(T,g)});if(k){var N=(0,bq.default)(S)?p:S,ee=l0(E,D,!0)??N??0;j=IOe({barGap:d,barCategoryGap:f,bandSize:ee===A?A:ee,sizeList:M[w],maxBarSize:N}),ee!==A&&(j=j.map(function(e){return Z(Z({},e),{},{position:Z(Z({},e.position),{},{offset:e.position.offset-ee/2})})}))}var te=n&&n.type&&n.type.getComposedData;te&&v.push({props:Z(Z({},te(Z(Z({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:s}))),{},d5(d5(d5({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:vxe(n,e.children),item:n})}),v},p=function(e,t){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,s=e.updateId;if(!jq({props:i}))return null;var l=i.children,d=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=b5(d),_=g.numericAxisName,v=g.cateAxisName,y=kq(l,r),b=WOe(m,y,`${_}Id`,`${v}Id`,p,h),x=c.reduce(function(e,t){var n=`${t.axisType}Map`;return Z(Z({},e),{},d5({},n,QFe(i,Z(Z({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=tIe(Z(Z({},x),{},{props:i,graphicalItems:y}),t?.legendBBox);Object.keys(x).forEach(function(e){x[e]=u(i,x[e],S,e.replace(`Map`,``),n)});var C=x[`${v}Map`],w=$Fe(C);return Z(Z({formattedGraphicalItems:f(i,Z(Z({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:s,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)};return t=function(e){VFe(t,e);function t(e){var r;return LFe(this,t),r=zFe(this,t,[e]),d5(a5(r),`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),d5(a5(r),`accessibilityManager`,new CFe),d5(a5(r),`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Z({legendBBox:e},p({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Z(Z({},r.state),{},{legendBBox:e}))))}}),d5(a5(r),`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),d5(a5(r),`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Z({dataStartIndex:t,dataEndIndex:n},p({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),d5(a5(r),`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,xq.default)(i)&&i(n,e)}}),d5(a5(r),`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Z(Z({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,xq.default)(i)&&i(n,e)}),d5(a5(r),`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),d5(a5(r),`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),d5(a5(r),`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),d5(a5(r),`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,xq.default)(n)&&n(t,e)}),d5(a5(r),`handleOuterEvent`,function(e){var t=_xe(e),n=(0,iq.default)(r.props,`${t}`);t&&(0,xq.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),d5(a5(r),`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,xq.default)(i)&&i(n,e)}}),d5(a5(r),`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,xq.default)(t)&&t(r.getMouseInfo(e),e)}),d5(a5(r),`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,xq.default)(t)&&t(r.getMouseInfo(e),e)}),d5(a5(r),`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),d5(a5(r),`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),d5(a5(r),`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),d5(a5(r),`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&H8.emit(U8,r.props.syncId,e,r.eventEmitterSymbol)}),d5(a5(r),`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Z({dataStartIndex:o,dataEndIndex:s},p({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,f=d.offset,m=d.tooltipTicks;if(!f)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Z(Z({},f),{},{x:f.left,y:f.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=_5(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:p5;r.setState(Z(Z({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),d5(a5(r),`renderCursor`,function(e){var t=r.state,i=t.isTooltipActive,a=t.activeCoordinate,o=t.activePayload,s=t.offset,c=t.activeTooltipIndex,l=t.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return y.createElement(AFe,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:n,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),d5(a5(r),`renderPolarAxis`,function(e,t,n){var i=(0,iq.default)(e,`type.axisType`),a=(0,iq.default)(r.state,`${i}Map`),o=a&&a[e.props[`${i}Id`]];return(0,y.cloneElement)(e,Z(Z({},o),{},{className:Ol(i,o.className),key:e.key||`${t}-${n}`,ticks:Z1(o,!0)}))}),d5(a5(r),`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=uq(s),u=uq(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,y.cloneElement)(e,{polarAngles:Array.isArray(i)?i:Z1(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:Z1(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),d5(a5(r),`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.
521width,a=t.height,o=r.props.margin||{},s=P1({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:l});if(!s)return null;var c=s.item;return(0,y.cloneElement)(c,Z(Z({},t5(s,jFe)),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),d5(a5(r),`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=Aq(t,_X);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,y.cloneElement)(i,{viewBox:Z(Z({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),d5(a5(r),`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,y.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:$1(r.handleBrushChange,e.props.onChange),data:i,x:X(e.props.x)?e.props.x:o.left,y:X(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:X(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),d5(a5(r),`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=a5(r).clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.props,u=l.xAxisId,d=l.yAxisId;return(0,y.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[u],yAxis:s[d],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),d5(a5(r),`renderActivePoints`,function(e){var n=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=n.props.key,l=n.item.props,u=l.activeDot,d=l.dataKey,f=Z(Z({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:K1(n.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value,key:`${c}-activePoint-${a}`},Mq(u,!1)),vq(u));return s.push(t.renderActiveDot(u,f)),i?s.push(t.renderActiveDot(u,Z(Z({},f),{},{cx:i.x,cy:i.y,key:`${c}-basePoint-${a}`}))):o&&s.push(null),s}),d5(a5(r),`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=Aq(d,_X),p=i.props,m=p.points,h=p.isRange,g=p.baseLine,_=i.item.props,v=_.activeDot,b=_.hide,x=_.activeBar,S=_.activeShape,C=!!(!b&&s&&f&&(v||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:$1(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:$1(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:$1(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,y.cloneElement)(e,Z(Z({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C)if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=fq(m,k,u),O=h&&g&&fq(g,k,u)}else D=m?.[l],O=h&&g&&g[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,y.cloneElement)(e,Z(Z(Z({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,bq.default)(D))return[T].concat(s5(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,ee=j.childIndex;return[(0,y.cloneElement)(N,Z(Z(Z({},i.props),w),{},{activeIndex:ee})),null,null]}return h?[T,null,null]:[T,null]}),d5(a5(r),`renderCustomized`,function(e,t,n){return(0,y.cloneElement)(e,Z(Z({key:`recharts-customized-${n}`},r.props),r.state))}),d5(a5(r),`renderMap`,{CartesianGrid:{handler:m5,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:m5},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:m5},YAxis:{handler:m5},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??cq(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,yX.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return RFe(t,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=Aq(t,_X);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=_5(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Z(Z({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}}),null):null}},{key:`componentDidUpdate`,value:function(e){Nq([Aq(e.children,_X)],[Aq(this.props.children,_X)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=Aq(this.props.children,_X);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return s.indexOf(t)>=0?t:a}return a}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=Wwe(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap;if(this.getTooltipEventType()!==`axis`&&c&&l){var u=uq(c).scale,d=uq(l).scale,f=u&&u.invert?u.
521invert(i.chartX):null,p=d&&d.invert?d.invert(i.chartY):null;return Z(Z({},i),{},{xValue:f,yValue:p})}var m=v5(this.state,this.props.data,this.props.layout,o);return m?Z(Z({},i),m):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=uq(c);return b0({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=Aq(e,_X),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),Z(Z({},vq(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){H8.on(U8,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){H8.removeListener(U8,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===Tq(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return y.createElement(`defs`,null,y.createElement(`clipPath`,{id:e},y.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e5(t,2),r=n[0],i=n[1];return Z(Z({},e),{},d5({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e5(t,2),r=n[0],i=n[1];return Z(Z({},e),{},d5({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=Tq(c.type);if(l===`Bar`){var u=(s.data||[]).find(function(t){return Uje(e,t)});if(u)return{graphicalItem:o,payload:u}}else if(l===`RadialBar`){var d=(s.data||[]).find(function(t){return b0(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(T3(o,r)||E3(o,r)||D3(o,r)){var f=cNe({graphicalItem:o,activeTooltipItem:r,itemData:c.props.data}),p=c.props.activeIndex===void 0?f:c.props.activeIndex;return{graphicalItem:Z(Z({},o),{},{childIndex:p}),payload:D3(o,r)?c.props.data[f]:o.props.data[f]}}}return null}},{key:`render`,value:function(){var e=this;if(!jq(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=Mq(t5(t,MFe),!1);if(s)return y.createElement(H6,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement(Lq,$8({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),Fq(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return y.createElement(H6,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement(`div`,$8({className:Ol(`recharts-wrapper`,r),style:Z({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),y.createElement(Lq,$8({},u,{width:i,height:a,title:c,desc:l,style:qFe}),this.renderClipPath(),Fq(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}]),t}(y.Component),d5(t,`displayName`,n),d5(t,`defaultProps`,Z({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},d)),d5(t,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var f=y5(e);return Z(Z(Z({},f),{},{updateId:0},p(Z(Z({props:e},f),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!pq(l,t.prevMargin)){var m=y5(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Z(Z({},v5(t,r,s)),{},{updateId:t.updateId+1}),_=Z(Z(Z({},m),h),g);return Z(Z(Z({},_),p(Z({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!Nq(i,t.prevChildren)){var v=Aq(i,a6),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,bq.default)(r)&&!x?t.updateId:t.updateId+1;return Z(Z({updateId:S},p(Z(Z({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),d5(t,`renderActiveDot`,function(e,t){var n=(0,y.isValidElement)(e)?(0,y.cloneElement)(e,t):(0,xq.default)(e)?e(t):y.createElement(B4,t);return y.createElement(zq,{className:`recharts-active-dot`,key:t.key},n)}),t},S5=x5({chartName:`BarChart`,GraphicalChild:w6,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:I8},{axisType:`yAxis`,AxisComp:R8}],formatAxisMap:rPe}),rIe=x5({chartName:`PieChart`,GraphicalChild:B3,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:p3}
521,{axisType:`radiusAxis`,AxisComp:t3}],formatAxisMap:nke,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}}),iIe=()=>{let{session:e}=_l(),{data:t,isLoading:n}=OK(),{data:r,isLoading:i}=sr({queryKey:[`admin-user-activity`],queryFn:async()=>{let t=await R.functions.invoke(`admin-get-user-activity`,{method:`POST`,headers:{Authorization:`Bearer ${e?.access_token}`},body:{days:7}});if(t.error)throw console.error(`Error fetching user activity:`,t.error),Error(`Failed to fetch user activity data`);return t.data?.dailyActiveUsers||[]},enabled:!!e?.access_token}),{data:a,isLoading:o}=sr({queryKey:[`admin-aggregate-analytics`,t,r],queryFn:()=>t?wbe(t,r):null,enabled:!!t});return n||i||o?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):(0,F.jsx)(`div`,{className:`space-y-6`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Usage Overview`}),(0,F.jsx)(Mu,{children:`Aggregate token usage metrics`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4`,children:[(0,F.jsxs)(`div`,{className:`bg-muted/20 p-4 rounded-lg text-center`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:a?.totalUsers||0}),(0,F.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Total Users`})]}),(0,F.jsxs)(`div`,{className:`bg-muted/20 p-4 rounded-lg text-center`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:(a?.totalTokensUsed||0).toLocaleString()}),(0,F.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Total Tokens Used`})]}),(0,F.jsxs)(`div`,{className:`bg-muted/20 p-4 rounded-lg text-center`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:(a?.avgTokensPerUser||0).toLocaleString()}),(0,F.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Avg. Tokens/User`})]})]})})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{children:(0,F.jsx)(ju,{children:`User Type Distribution`})}),(0,F.jsx)(H,{children:(0,F.jsx)(`div`,{className:`h-[250px]`,children:(0,F.jsx)(wX,{width:`100%`,height:`100%`,children:(0,F.jsxs)(rIe,{children:[(0,F.jsx)(B3,{data:a?.userTypeDistribution,cx:`50%`,cy:`50%`,labelLine:!1,outerRadius:80,fill:`#8884d8`,dataKey:`value`,label:({name:e,percent:t})=>`${e} ${(t*100).toFixed(0)}%`,children:a?.userTypeDistribution.map((e,t)=>(0,F.jsx)(TX,{fill:DK[t%DK.length]},`cell-${t}`))}),(0,F.jsx)(_X,{})]})})})})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{children:(0,F.jsx)(ju,{children:`Token Usage by User Type`})}),(0,F.jsx)(H,{children:(0,F.jsx)(`div`,{className:`h-[250px]`,children:(0,F.jsx)(wX,{width:`100%`,height:`100%`,children:(0,F.jsxs)(S5,{data:a?.tokenUsageByType,margin:{top:10,right:30,left:0,bottom:20},children:[(0,F.jsx)(P8,{strokeDasharray:`3 3`}),(0,F.jsx)(I8,{dataKey:`name`}),(0,F.jsx)(R8,{}),(0,F.jsx)(_X,{formatter:e=>[`${e.toLocaleString()} tokens`,`Usage`]}),(0,F.jsx)(w6,{dataKey:`tokens`,fill:`#10b981`})]})})})})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{children:(0,F.jsx)(ju,{children:`Daily Active Users (Last 7 Days)`})}),(0,F.jsx)(H,{children:(0,F.jsx)(`div`,{className:`h-[250px]`,children:(0,F.jsx)(wX,{width:`100%`,height:`100%`,children:(0,F.jsxs)(S5,{data:a?.dailyActiveUsers,margin:{top:10,right:30,left:0,bottom:20},children:[(0,F.jsx)(P8,{strokeDasharray:`3 3`}),(0,F.jsx)(I8,{dataKey:`date`}),(0,F.jsx)(R8,{}),(0,F.jsx)(_X,{formatter:e=>[`${e} users`,`Active Users`]}),(0,F.jsx)(w6,{dataKey:`count`,fill:`#3b82f6`})]})})})})]})]})})},C5=({isLoading:e,users:t,showStatus:n,onImpersonate:r,impersonatingUserId:i})=>{if(e)return(0,F.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,F.jsx)(F_,{className:`h-6 w-6 animate-spin text-akito-teal`})});if(!t.length)return(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-gray-500`,children:`No users found for this view.`});let a=e=>r&&e.userType!==`admin`&&e.emailConfirmedAt;return(0,F.jsx)(`div`,{className:`rounded-md border`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`N
521ame`}),(0,F.jsx)(J,{children:`Email`}),(0,F.jsx)(J,{children:`Role`}),n&&(0,F.jsx)(J,{children:`Status`}),(0,F.jsx)(J,{children:`Last Sign In`}),r&&(0,F.jsx)(J,{className:`w-[100px]`,children:`Actions`})]})}),(0,F.jsx)(QG,{children:t.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.fullName||e.email||`Unknown user`}),(0,F.jsx)(Y,{children:e.email??`â`}),(0,F.jsx)(Y,{children:(0,F.jsx)(mM,{variant:`outline`,className:`capitalize`,children:e.userType??`unknown`})}),n&&(0,F.jsx)(Y,{children:e.emailConfirmedAt?(0,F.jsx)(mM,{variant:`outline`,className:`border-green-500 text-green-700`,children:`Accepted`}):(0,F.jsx)(mM,{variant:`outline`,className:`border-amber-500 text-amber-700`,children:`Invite pending`})}),(0,F.jsx)(Y,{children:e.lastSignInAt?new Date(e.lastSignInAt).toLocaleString():`Never signed in`}),r&&(0,F.jsx)(Y,{children:a(e)?(0,F.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>r(e.id),disabled:i===e.id,className:`h-8 px-2 text-xs`,title:`View as ${e.fullName||e.email}`,children:i===e.id?(0,F.jsx)(F_,{className:`h-4 w-4 animate-spin`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(q_,{className:`h-4 w-4 mr-1`}),`Impersonate`]})}):e.userType===`admin`?(0,F.jsx)(RW,{children:(0,F.jsxs)(zW,{children:[(0,F.jsx)(BW,{asChild:!0,children:(0,F.jsx)(`span`,{tabIndex:0,children:(0,F.jsxs)(B,{variant:`ghost`,size:`sm`,disabled:!0,className:`h-8 px-2 text-xs`,children:[(0,F.jsx)(q_,{className:`h-4 w-4 mr-1`}),`Impersonate`]})})}),(0,F.jsx)(VW,{children:(0,F.jsx)(`p`,{children:`Cannot impersonate other administrators`})})]})}):e.emailConfirmedAt?null:(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:`Pending`})})]},e.id))})]})})},aIe=()=>{let{users:e,isLoading:t,fetchUsers:n,onImpersonate:r,impersonatingUserId:i}=qe();return(0,y.useEffect)(()=>{n({page:1,filter:`all`}).catch(()=>{})},[n]),(0,F.jsx)(C5,{isLoading:t,users:e,onImpersonate:r,impersonatingUserId:i})},oIe=()=>{let{users:e,isLoading:t,fetchUsers:n}=qe();return(0,y.useEffect)(()=>{n({page:1,filter:`pending`}).catch(()=>{})},[n]),(0,F.jsx)(C5,{isLoading:t,users:e,showStatus:!0})},sIe=()=>{let{user:e}=_l();return(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`General`}),(0,F.jsx)(Mu,{children:`Your account information`})]}),(0,F.jsx)(H,{className:`space-y-4`,children:(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`email`,children:`Email address`}),(0,F.jsx)(ku,{id:`email`,type:`email`,value:e?.email||``,readOnly:!0}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your email address is used for sign-in and notifications.`})]})})]})},w5;(function(e){e.assertEqual=e=>e;function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(w5||={});var T5;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(T5||={});var E5=w5.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),D5=e=>{switch(typeof e){case`undefined`:return E5.undefined;case`string`:return E5.string;case`number`:return isNaN(e)?E5.nan:E5.number;case`boolean`:return E5.boolean;case`function`:return E5.function;case`bigint`:return E5.bigint;case`symbol`:return E5.symbol;case`object`:return Array.isArray(e)?E5.array:e===null?E5.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?E5.promise:typeof Map<`u`&&e instanceof Map?E5.map:typeof Set<`u`&&e instanceof Set?E5.set
vendor: 4,668 bytes, line 521
521:typeof Date<`u`&&e instanceof Date?E5.date:E5.object;default:return E5.unknown}},Q=w5.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),cIe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`),O5=class e extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w5.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};O5.create=e=>new O5(e);var k5=(e,t)=>{let n;switch(e.code){case Q.invalid_type:n=e.received===E5.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,w5.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${w5.joinValues(e.keys,`, `)}`;break;case Q.invalid_union:n=`Invalid input`;break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${w5.joinValues(e.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${w5.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:n=`Invalid function arguments`;break;case Q.invalid_return_type:n=`Invalid function return type`;break;case Q.invalid_date:n=`Invalid date`;break;case Q.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:w5.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Q.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Q.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Q.custom:n=`Invalid input`;break;case Q.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,w5.assertNever(e)}return{message:n}},A5=k5;function lIe(e){A5=e}function j5(){return A5}var M5=e=>
521{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},uIe=[];function $(e,t){let n=j5(),r=M5({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===k5?void 0:k5].filter(e=>!!e)});e.common.issues.push(r)}var N5=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return P5;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return P5;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},P5=Object.freeze({status:`aborted`}),F5=e=>({status:`dirty`,value:e}),I5=e=>({status:`valid`,value:e}),L5=e=>e.status===`aborted`,R5=e=>e.status===`dirty`,z5=e=>e.status===`valid`,B5=e=>typeof Promise<`u`&&e instanceof Promise;function V5(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function H5(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var U5;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(U5||={});var W5,G5,K5=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},q5=(e,t)=>{if(z5(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new O5(e.common.issues);return this._error=t,this._error}}};function J5(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Y5=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return D5(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:D5(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new N5,ctx:{common:e.parent.common,data:e.data,parsedType:D5(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(B5(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D5(e)};return q5(n,this._parseSync({data:e,path:n.path,parent:n}))}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D5(e)}
vendor: 9,746 bytes, line 521
521,r=this._parse({data:e,path:n.path,parent:n});return q5(n,await(B5(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Q.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new j7({schema:this,typeName:V7.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return M7.create(this,this._def)}nullable(){return N7.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return f7.create(this,this._def)}promise(){return A7.create(this,this._def)}or(e){return h7.create([this,e],this._def)}and(e){return y7.create(this,e,this._def)}transform(e){return new j7({...J5(this._def),schema:this,typeName:V7.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new P7({...J5(this._def),innerType:this,defaultValue:t,typeName:V7.ZodDefault})}brand(){return new L7({typeName:V7.ZodBranded,type:this,...J5(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new F7({...J5(this._def),innerType:this,catchValue:t,typeName:V7.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return R7.create(this,e)}readonly(){return z7.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},dIe=/^c[^\s-]{8,}$/i,fIe=/^[0-9a-z]+$/,pIe=/^[0-9A-HJKMNP-TV-Z]{26}$/,mIe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hIe=/^[a-z0-9_-]{21}$/i,gIe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_Ie=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vIe=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,X5,yIe=/^(?:(?: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])$/,bIe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,xIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Z5=`((\\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])))`,SIe=RegExp(`^${Z5}$`);function Q5(e){let t=`([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`),t}function CIe(e){return RegExp(`^${Q5(e)}$`)}function $5(e){let t=`${Z5}T${Q5(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function wIe(e,t){return!!((t===`v4`||!t)&&yIe.test(e)||(t===`v6`||!t)&&bIe.test(e))}var e7=class e extends Y5{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==E5.string){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.string,received:t.parsedType}),P5}let t=new N5,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?$(n,{code:Q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&$(n,{code:Q.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)_Ie.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`email`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)X5||=new RegExp(vIe,`u`),X5.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`emoji`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)mIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`uuid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)hIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`nanoid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)dIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`cuid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)fIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`cuid2`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)pIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`ulid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),$(n,{validation:`url`,code:Q.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`regex`,code:Q.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?$5(r).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?SIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?CIe(r).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?gIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`duration`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?wIe(e.data,r.version)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`ip`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?xIe.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`base64`,code:Q.invalid_string,message:r.message}),t.dirty()):w5.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Q.invalid_string,...U5.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...U5.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...U5.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...U5.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...U5.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...U5.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...U5.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...U5.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...U5.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...U5.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...U5.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...U5.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...U5.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...U5.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...U5.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...U5.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...U5.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...U5.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...U5.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...U5.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...U5.errToObj(t)})}nonempty(e){return this.min(1,U5.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}
vendor: 23,562 bytes, line 521
521get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};e7.create=e=>new e7({checks:[],typeName:V7.ZodString,coerce:e?.coerce??!1,...J5(e)});function TIe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var t7=class e extends Y5{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==E5.number){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.number,received:t.parsedType}),P5}let t,n=new N5;for(let r of this._def.checks)r.kind===`int`?w5.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),$(t,{code:Q.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?TIe(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_finite,message:r.message}),n.dirty()):w5.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,U5.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,U5.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,U5.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,U5.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:U5.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:U5.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:U5.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:U5.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:U5.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:U5.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:U5.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:U5.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:U5.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:U5.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&w5.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};t7.create=e=>new t7({checks:[],typeName:V7.ZodNumber,coerce:e?.coerce||!1,...J5(e)});var n7=class e extends Y5{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==E5.bigint){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.bigint,received:t.parsedType}),P5}let t,n=new N5;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):w5.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,U5.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,U5.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,U5.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,U5.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:U5.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:U5.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:U5.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:U5.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:U5.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:U5.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};n7.create=e=>new n7({checks:[],typeName:V7.ZodBigInt,coerce:e?.coerce??!1,...J5(e)});var r7=class extends Y5{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==E5.boolean){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.boolean,received:t.parsedType}),P5}return I5(e.data)}};r7.create=e=>new r7({typeName:V7.ZodBoolean,coerce:e?.coerce||!1,...J5(e)});var i7=class e extends Y5{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==E5.date){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.date,received:t.parsedType}),P5}if(isNaN(e.data.getTime()))return $(this._getOrReturnCtx(e),{code:Q.invalid_date}),P5;let t=new N5,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):w5.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:U5.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:U5.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};i7.create=e=>new i7({checks:[],coerce:e?.coerce||!1,typeName:V7.ZodDate,...J5(e)});var a7=class extends Y5{_parse(e){if(this._getType(e)!==E5.symbol){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.symbol,received:t.parsedType}),P5}return I5(e.data)}};a7.create=e=>new a7({typeName:V7.ZodSymbol,...J5(e)});var o7=class extends Y5{_parse(e){if(this._getType(e)!==E5.undefined){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.undefined,received:t.parsedType}),P5}return I5(e.data)}};o7.create=e=>new o7({typeName:V7.ZodUndefined,...J5(e)});var s7=class extends Y5{_parse(e){if(this._getType(e)!==E5.null){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.null,received:t.parsedType}),P5}return I5(e.data)}};s7.create=e=>new s7({typeName:V7.ZodNull,...J5(e)});var c7=class extends Y5{constructor(){super(...arguments),this._any=!0}_parse(e){return I5(e.data)}};c7.create=e=>new c7({typeName:V7.ZodAny,...J5(e)});var l7=class extends Y5{constructor(){super(...arguments),this._unknown=!0}_parse(e){return I5(e.data)}};l7.create=e=>new l7({typeName:V7.ZodUnknown,...J5(e)});var u7=class extends Y5{_parse(e){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.never,received:t.parsedType}),P5}};u7.create=e=>new u7({typeName:V7.ZodNever,...J5(e)});var d7=class extends Y5{_parse(e){if(this._getType(e)!==E5.undefined){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.void,received:t.parsedType}),P5}return I5(e.data)}};d7.create=e=>new d7({typeName:V7.ZodVoid,...J5(e)});var f7=class e extends Y5{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==E5.array)return $(t,{code:Q.invalid_type,expected:E5.array,received:t.parsedType}),P5;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&($(t,{code:e?Q.too_big:Q.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&($(t,{code:Q.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&($(t,{code:Q.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new K5(t,e,t.path,n)))).then(e=>N5.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new K5(t,e,t.path,n)));return N5.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:U5.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:U5.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:U5.toString(n)}})}nonempty(e){return this.min(1,e)}};f7.create=(e,t)=>new f7({type:e,minLength:null,maxLength:null,exactLength:null,typeName:V7.ZodArray,...J5(t)});function p7(e){if(e instanceof m7){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=M7.create(p7(r))}return new m7({...e._def,shape:()=>t})}else if(e instanceof f7)return new f7({...e._def,type:p7(e.element)});else if(e instanceof M7)return M7.create(p7(e.unwrap()));else if(e instanceof N7)return N7.create(p7(e.unwrap()));else if(e instanceof b7)return b7.create(e.items.map(e=>p7(e)));else return e}var m7=class e extends Y5{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=w5.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==E5.object){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.object,received:t.parsedType}),P5}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof u7&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new K5(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof u7){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&($(n,{code:Q.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new K5(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>N5.mergeObjectSync(t,e)):N5.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return U5.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{var r;let i=(r=this._def).errorMap?.call(r,e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:U5.errToObj(t).message??i}:{message:i}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:V7.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return w5.objectKeys(t).forEach(e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return w5.objectKeys(this.shape).forEach(e=>{t[e]||(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}deepPartial(){return p7(this)}partial(t){let n={};return w5.objectKeys(this.shape).forEach(e=>{let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return w5.objectKeys(this.shape).forEach(e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof M7;)t=t._def.innerType;n[e]=t}}),new e({...this._def,shape:()=>n})}keyof(){return D7(w5.objectKeys(this.shape))}};m7.create=(e,t)=>new m7({shape:()=>e,unknownKeys:`strip`,catchall:u7.create(),typeName:V7.ZodObject,...J5(t)}),m7.strictCreate=(e,t)=>new m7({shape:()=>e,unknownKeys:`strict`,catchall:u7.create(),typeName:V7.ZodObject,...J5(t)}),m7.lazycreate=(e,t)=>new m7({shape:e,unknownKeys:`strip`,catchall:u7.create(),typeName:V7.ZodObject,...J5(t)});var h7=class extends Y5{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new O5(e.ctx.common.issues));return $(t,{code:Q.invalid_union,unionErrors:n}),P5}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new O5(e));return $(t,{code:Q.invalid_union,unionErrors:i}),P5}}get options(){return this._def.options}};h7.create=(e,t)=>new h7({options:e,typeName:V7.ZodUnion,...J5(t)});var g7=e=>e instanceof T7?g7(e.schema):e instanceof j7?g7(e.innerType()):e instanceof E7?[e.value]:e instanceof O7?e.options:e instanceof k7?w5.objectValues(e.enum):e instanceof P7?g7(e._def.innerType):e instanceof o7?[void 0]:e instanceof s7?[null]:e instanceof M7?[void 0,...g7(e.unwrap())]:e instanceof N7?[null,...g7(e.unwrap())]:e instanceof L7||e instanceof z7?g7(e.unwrap()):e instanceof F7?g7(e._def.innerType):[],_7=class e extends Y5{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==E5.object)return $(t,{code:Q.invalid_type,expected:E5.object,received:t.parsedType}),P5;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P5)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=g7(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:V7.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...J5(r)})}};function v7(e,t){let n=D5(e),r=D5(t);if(e===t)return{valid:!0,data:e};if(n===E5.object&&r===E5.object){let n=w5.objectKeys(t),r=w5.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=v7(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===E5.array&&r===E5.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=v7(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===E5.date&&r===E5.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var y7=class extends Y5{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(L5(e)||L5(r))return P5;let i=v7(e.value,r.value);return i.valid?((R5(e)||R5(r))&&t.dirty(),{status:t.value,value:i.data}):($(n,{code:Q.invalid_intersection_types}),P5)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};y7.create=(e,t,n)=>new y7({left:e,right:t,typeName:V7.ZodIntersection,...J5(n)});var b7=class e extends Y5{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==E5.array)return $(n,{code:Q.invalid_type,expected:E5.array,received:n.parsedType}),P5;if(n.data.length<this._def.items.length)return $(n,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),P5;!this._def.rest&&n.data.length>this._def.items.length&&($(n,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new K5(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>N5.mergeArray(t,e)):N5.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};b7.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new b7({items:e,typeName:V7.ZodTuple,rest:null,...J5(t)})};var x7=class e extends Y5{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==E5.object)return $(n,{code:Q.invalid_type,expected:E5.object,received:n.parsedType}),P5;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new K5(n,e,n.path,e)),value:a._parse(new K5(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?N5.mergeObjectAsync(t,r):N5.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Y5?new e({keyType:t,valueType:n,typeName:V7.ZodRecord,...J5(r)}):new e({keyType:e7.create(),valueType:t,typeName:V7.ZodRecord,...J5(n)})}},S7=class extends Y5{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==E5.map)return $(n,{code:Q.invalid_type,expected:E5.map,received:n.parsedType}),P5;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new K5(n,e,n.path,[a,`key`])),value:i._parse(new K5(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return P5;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return P5;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};S7.create=(e,t,n)=>new S7({valueType:t,keyType:e,typeName:V7.ZodMap,...J5(n)});var C7=class e extends Y5{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==E5.set)return $(n,{code:Q.invalid_type,expected:E5.set,received:n.parsedType}),P5;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&($(n,{code:Q.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&($(n,{code:Q.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return P5;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new K5(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:U5.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:U5.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};C7.create=(e,t)=>new C7({valueType:e,minSize:null,maxSize:null,typeName:V7.ZodSet,...J5(t)});var w7=class e extends Y5{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==E5.function)return $(t,{code:Q.invalid_type,expected:E5.function,received:t.parsedType}),P5;function n(e,n){return M5({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j5(),k5].filter(e=>!!e),issueData:{code:Q.invalid_arguments,argumentsError:n}})}function r(e,n){return M5({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j5(),k5].filter(e=>!!e),issueData:{code:Q.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof A7){let e=this;return I5(async function(...t){let o=new O5([]),s=await e._def.args.parseAsync(t,i).c
vendor: 1,527 bytes, line 521
521atch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return I5(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new O5([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new O5([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:b7.create(t).rest(l7.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||b7.create([]).rest(l7.create()),returns:n||l7.create(),typeName:V7.ZodFunction,...J5(r)})}},T7=class extends Y5{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};T7.create=(e,t)=>new T7({getter:e,typeName:V7.ZodLazy,...J5(t)});var E7=class extends Y5{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:Q.invalid_literal,expected:this._def.value}),P5}return{status:`valid`,value:e.data}}get value(){return this._def.value}};E7.create=(e,t)=>new E7({value:e,typeName:V7.ZodLiteral,...J5(t)});function D7(e,t){return new O7({values:e,typeName:V7.ZodEnum,...J5(t)})}var O7=class e extends Y5{constructor(){super(...arguments),W5.set(this,void 0)}
521_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{expected:w5.joinValues(n),received:t.parsedType,code:Q.invalid_type}),P5}if(V5(this,W5,`f`)||H5(this,W5,new Set(this._def.values),`f`),!V5(this,W5,`f`).has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{received:t.data,code:Q.invalid_enum_value,options:n}),P5}return I5(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};W5=new WeakMap,O7.create=D7;var k7=class extends Y5{constructor(){super(...arguments),G5.set(this,void 0)}_parse(e){let t=w5.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==E5.string&&n.parsedType!==E5.number){let e=w5.objectValues(t);return $(n,{expected:w5.joinValues(e),received:n.parsedType,code:Q.invalid_type}),P5}if(V5(this,G5,`f`)||H5(this,G5,new Set(w5.getValidEnumValues(this._def.values)),`f`),!V5(this,G5,`f`).has(e.data)){let e=w5.objectValues(t);return $(n,{received:n.data,code:Q.invalid_enum_value,options:e}),P5}return I5(e.data)}get enum(){return this._def.values}};G5=new WeakMap,k7.create=(e,t)=>new k7({values:e,typeName:V7.ZodNativeEnum,...J5(t)});var A7=class extends Y5{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==E5.promise&&t.common.async===!1?($(t,{code:Q.invalid_type,expected:E5.promise,received:t.parsedType}),P5):I5((t.parsedType===E5.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};A7.create=(e,t)=>new A7({type:e,typeName:V7.ZodPromise,...J5(t)});var j7=class extends Y5{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V7.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{$(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return P5;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?P5:r.status===`dirty`||t.value===`dirty`?F5(r.value):r});{if(t.value===`aborted`)return P5;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?P5:r.status===`dirty`||t.value===`dirty`?F5(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?P5:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?P5:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!z5(e))return e;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>z5(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);w5.assertNever(r)}};j7.create=(e,t,n)=>new j7({schema:e,typeName:V7.ZodEffects,effect:t,...J5(n)}),j7.createWithPreprocess=(e,t,n)=>new j7({schema:t,effect:{type:`preprocess`,transform:e},typeName:V7.ZodEffects,...J5(n)});var M7=class extends Y5{_parse(e){return this._getType(e)===E5.undefined?I5(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M7.create=(e,t)=>
vendor: 4,623 bytes, line 521
521new M7({innerType:e,typeName:V7.ZodOptional,...J5(t)});var N7=class extends Y5{_parse(e){return this._getType(e)===E5.null?I5(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N7.create=(e,t)=>new N7({innerType:e,typeName:V7.ZodNullable,...J5(t)});var P7=class extends Y5{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===E5.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};P7.create=(e,t)=>new P7({innerType:e,typeName:V7.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...J5(t)});var F7=class extends Y5{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return B5(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new O5(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new O5(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};F7.create=(e,t)=>new F7({innerType:e,typeName:V7.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...J5(t)});var I7=class extends Y5{_parse(e){if(this._getType(e)!==E5.nan){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:E5.nan,received:t.parsedType}),P5}return{status:`valid`,value:e.data}}};I7.create=e=>new I7({typeName:V7.ZodNaN,...J5(e)});var EIe=Symbol(`zod_brand`),L7=class extends Y5{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},R7=class e extends Y5{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?P5:e.status===`dirty`?(t.dirty(),F5(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?P5:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:V7.ZodPipeline})}},z7=class extends Y5{_parse(e){let t=this._def.innerType._parse(e),n=e=>(z5(e)&&(e.value=Object.freeze(e.value)),e);return B5(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};z7.create=(e,t)=>new z7({innerType:e,typeName:V7.ZodReadonly,...J5(t)});function B7(e,t={},n){return e?c7.create().superRefine((r,i)=>{if(!e(r)){let e=typeof t==`function`?t(r):typeof t==`string`?{message:t}:t,a=e.fatal??n??!0,o=typeof e==`string`?{message:e}:e;i.addIssue({code:`custom`,...o,fatal:a})}}):c7.create()}var DIe={object:m7.lazycreate},V7;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(V7||={});var OIe=(e,t={message:`Input not instance of ${e.name}`})=>B7(t=>t instanceof e,t),H7=e7.create,U7=t7.create,kIe=I7.create,AIe=n7.create,W7=r7.create,jIe=i7.create,MIe=a7.create,NIe=o7.create,PIe=s7.create,FIe=c7.create,IIe=l7.create,LIe=u7.create,RIe=d7.create,zIe=f7.create,BIe=m7.create,VIe=m7.strictCreate,HIe=h7.create,UIe=_7.create,WIe=y7.create,GIe=b7.create,KIe=x7.create,qIe=S7.create,JIe=C7.create,YIe=w7.create,XIe=T7.create,ZIe=E7.create,QIe=O7.create,$Ie=k7.create,eLe=A7.create,G7=j7.create,tLe=M7.create,nLe=N7.create,rLe=j7.createWithPreprocess,iLe=R7.create,K7=Object.freeze({__proto__:null,defaultErrorMap:k5,setErrorMap:lIe,getErrorMap:j5,makeIssue:M5,EMPTY_PATH:uIe,addIssueToContext:$,ParseStatus:N5,INVALID:P5,DIRTY:F5,OK:I5,isAborted:L5,isDirty:R5,isValid:z5,isA
521sync:B5,get util(){return w5},get objectUtil(){return T5},ZodParsedType:E5,getParsedType:D5,ZodType:Y5,datetimeRegex:$5,ZodString:e7,ZodNumber:t7,ZodBigInt:n7,ZodBoolean:r7,ZodDate:i7,ZodSymbol:a7,ZodUndefined:o7,ZodNull:s7,ZodAny:c7,ZodUnknown:l7,ZodNever:u7,ZodVoid:d7,ZodArray:f7,ZodObject:m7,ZodUnion:h7,ZodDiscriminatedUnion:_7,ZodIntersection:y7,ZodTuple:b7,ZodRecord:x7,ZodMap:S7,ZodSet:C7,ZodFunction:w7,ZodLazy:T7,ZodLiteral:E7,ZodEnum:O7,ZodNativeEnum:k7,ZodPromise:A7,ZodEffects:j7,ZodTransformer:j7,ZodOptional:M7,ZodNullable:N7,ZodDefault:P7,ZodCatch:F7,ZodNaN:I7,BRAND:EIe,ZodBranded:L7,ZodPipeline:R7,ZodReadonly:z7,custom:B7,Schema:Y5,ZodSchema:Y5,late:DIe,get ZodFirstPartyTypeKind(){return V7},coerce:{string:(e=>e7.create({...e,coerce:!0})),number:(e=>t7.create({...e,coerce:!0})),boolean:(e=>r7.create({...e,coerce:!0})),bigint:(e=>n7.create({...e,coerce:!0})),date:(e=>i7.create({...e,coerce:!0}))},any:FIe,array:zIe,bigint:AIe,boolean:W7,date:jIe,discriminatedUnion:UIe,effect:G7,enum:QIe,function:YIe,instanceof:OIe,intersection:WIe,lazy:XIe,literal:ZIe,map:qIe,nan:kIe,nativeEnum:$Ie,never:LIe,null:PIe,nullable:nLe,number:U7,object:BIe,oboolean:()=>W7().optional(),onumber:()=>U7().optional(),optional:tLe,ostring:()=>H7().optional(),pipeline:iLe,preprocess:rLe,promise:eLe,record:KIe,set:JIe,strictObject:VIe,string:H7,symbol:MIe,transformer:G7,tuple:GIe,undefined:NIe,union:HIe,unknown:IIe,void:RIe,NEVER:P5,ZodIssueCode:Q,quotelessJson:cIe,ZodError:O5}),q7=(e,t,n)=>{if(e&&`reportValidity`in e){let r=q(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},J7=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?q7(r.ref,n,e):r.refs&&r.refs.forEach(t=>q7(t,n,e))}},aLe=(e,t)=>{t.shouldUseNativeValidation&&J7(e,t);let n={};for(let r in e){let i=q(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(oLe(t.names||Object.keys(e),r)){let e=Object.assign({},q(n,r));hz(e,`root`,a),hz(n,r,e)}else hz(n,r,a)}return n},oLe=(e,t)=>e.some(e=>e.startsWith(t+`.`)),sLe=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Pz(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},Y7=function(e,t,n){return n===void 0&&(n={}),function(r,i,a){try{return Promise.resolve(function(i,o){try{var s=Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&J7({},a),{errors:{},values:n.raw?r:e}})}catch(e){return o(e)}return s&&s.then?s.then(void 0,o):s}(0,function(e){if(function(e){return Array.isArray(e?.errors)}(e))return{values:{},errors:aLe(sLe(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}}},X7=e=>K7.string().trim().refine(e=>e.length===0||e.length>=2,{message:`${e} must be at least 2 characters`}),Z7={full_name:X7(`Full name`),location:K7.string().trim(),about:K7.string().trim()},cLe=K7.object({...Z7,skills:K7.string().trim(),education:K7.string().trim(),experience:K7.string().trim(),career_goals:K7.string().trim(),resume_url:K7.string().url({message:`Please enter a valid URL`}).optional().or(K7.literal(``))}),lLe=K7.object({...Z7}),uLe=K7.object({...Z7,company_name:X7(`Company name`),services:K7.string().trim()}),dLe=K7.object({...Z7}),Q7=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),fLe=()=>{let{user:e,profile:t,updateProfile:n}=_l(),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(K7.object(Z7));(0,y.useEffect)(()=>{if(t)switch(t.user_type){case`job_seeker`:o(cLe);break;case`organization`:o(lLe);break;case`career_tech`:o(uLe);break;case`admin`:o(dLe);break;default:o(K7.object(Z7))}},[t]);let s=wB({resolver:Y7(a),defaultValues:{full_name:t?.full_name||``,location:t?.location||``,about:t?.about||``,skills:Array.isArray(t?.skills)?t?.skills.join(`, `):``,education:Array.isArray(t?.education)?t?.education.join(`, `):``,experience:Array.isArray(t?.experience)?t?.experience.join(`, `):``,career_goals:t?.career_goals||``,resume_url:t?.resume_url||``,company_name:t?.company_name||``,services:Array.isArray(t?.services)?t?.services.join(`, `):``}}),c=async r=>{if(e){i(!0);try{let e={};e.full_name=r.full_name||null,e.location=r.location||null,e.about=r.about||null,t?.user_type===`job_seeker`&&(typeof r.skills==`string`&&(e.skills=Q7(r.skills)),typeof r.education==`string`&&(e.education=Q7(r.education)),typeof r.experience
521==`string`&&(e.experience=Q7(r.experience)),e.career_goals=r.career_goals||null,e.resume_url=r.resume_url||null),t?.user_type===`career_tech`&&(typeof r.services==`string`&&(e.services=Q7(r.services)),e.company_name=r.company_name||null),await n(e),fl({title:`Profile updated`,description:`Your profile information has been saved successfully.`})}catch(e){console.error(`Error updating profile:`,e),fl({title:`Update failed`,description:`There was an error updating your profile. Please try again.`,variant:`destructive`})}finally{i(!1)}}};return t?(0,F.jsx)(r_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`max-w-3xl mx-auto`,children:(0,F.jsx)(V,{className:`border-0 shadow-none`,children:(0,F.jsx)(H,{className:`p-0`,children:(0,F.jsx)(TB,{...s,children:(0,F.jsxs)(`form`,{onSubmit:s.handleSubmit(c),className:`space-y-6`,children:[(0,F.jsx)(DB,{control:s.control,name:`full_name`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Full Name`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`Your full name`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`about`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`About`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`Tell us a bit about yourself`,...e,className:`min-h-[100px]`})}),(0,F.jsx)(NB,{children:`This information will be used to personalize your experience`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`location`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Location`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`City, Country`,...e})}),(0,F.jsx)(NB,{children:`Where are you based?`}),(0,F.jsx)(PB,{})]})}),t.user_type===`job_seeker`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(DB,{control:s.control,name:`skills`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Skills`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`React, TypeScript, Project Management, etc.`,...e})}),(0,F.jsx)(NB,{children:`Comma-separated list of your skills`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`education`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Education`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`BS Computer Science, University of Example, 2020`,...e})}),(0,F.jsx)(NB,{children:`Comma-separated list of your education credentials`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`experience`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Experience`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`Software Engineer at Tech Co (2020-2022), Lead Developer at Other Co (2022-present)`,...e})}),(0,F.jsx)(NB,{children:`Comma-separated list of your work experience`}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`career_goals`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Career Goals`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`I aim to become a senior full-stack developer specializing in AI applications...`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`resume_url`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Resume URL`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`https://example.com/my-resume.pdf`,...e})}),(0,F.jsx)(NB,{children:`Link to your resume if you have one`}),(0,F.jsx)(PB,{})]})})]}),t.user_type===`career_tech`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(DB,{control:s.control,name:`company_name`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Company Name`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`Your company's name`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`services`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Services`}),(0,F.jsx)(MB,{children:(0,F.jsx)(SC,{placeholder:`Career Coaching, Resume Review, Interview Preparation, etc.`,...e})}),(0,F.jsx)(NB,{children:`Comma-separated list of services you provide`}),(0,F.jsx)(PB,{})]})})]}),(0,F.jsx)(`div`,{className:`flex justify-end pt-4`,children:(0,F.jsx)(B,{type:`submit`,disabled:r,children:r?`Saving...`:`Save Profile`})})]})})})})}):(0,F.jsx)(`div`,{children:`Loading...`})}
521,pLe=()=>(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Personal Profile`}),(0,F.jsx)(Mu,{children:`Update your personal and professional information.`})]}),(0,F.jsx)(H,{children:(0,F.jsx)(fLe,{})})]}),mLe={woman:`Woman`,man:`Man`,nonbinary:`Nonbinary`,other:`Other (specify)`,prefer_not_to_say:`Prefer not to answer`},hLe={under_18:`Under 18`,age_18_25:`18-25`,age_26_30:`26-30`,age_31_35:`31-35`,age_36_44:`36-44`,age_45_54:`45-54`,age_55_plus:`55+`},gLe={alberta:`Alberta`,british_columbia:`British Columbia`,manitoba:`Manitoba`,new_brunswick:`New Brunswick`,newfoundland_and_labrador:`Newfoundland and Labrador`,northwest_territories:`Northwest Territories`,nova_scotia:`Nova Scotia`,nunavut:`Nunavut`,ontario:`Ontario`,prince_edward_island:`Prince Edward Island`,quebec:`Quebec`,saskatchewan:`Saskatchewan`,yukon:`Yukon`},_Le={employed_full_time:`Employed - Full time`,employed_part_time:`Employed - Part time`,unemployed:`Unemployed`,under_employed:`Under-employed`},vLe={disability:`Person with a disability`,visible_minority:`Visible minority`,women_in_stem:`Women in STEM`,linguistic_minority:`Linguistic minority`,two_slgbtqia:`2SLGBTQIA+`},yLe=Object.entries(mLe).map(([e,t])=>({value:e,label:t})),bLe=Object.entries(hLe).map(([e,t])=>({value:e,label:t})),xLe=Object.entries(gLe).map(([e,t])=>({value:e,label:t})),SLe=Object.entries(_Le).map(([e,t])=>({value:e,label:t})),CLe=Object.entries(vLe).map(([e,t])=>({value:e,label:t})),wLe=K7.object({gender:K7.enum([`woman`,`man`,`nonbinary`,`other`,`prefer_not_to_say`]).nullable(),gender_other:K7.string().trim().max(100,`Please use 100 characters or fewer`),age_band:K7.enum([`under_18`,`age_18_25`,`age_26_30`,`age_31_35`,`age_36_44`,`age_45_54`,`age_55_plus`]).nullable(),province:K7.enum([`alberta`,`british_columbia`,`manitoba`,`new_brunswick`,`newfoundland_and_labrador`,`northwest_territories`,`nova_scotia`,`nunavut`,`ontario`,`prince_edward_island`,`quebec`,`saskatchewan`,`yukon`]).nullable(),employment_status:K7.enum([`employed_full_time`,`employed_part_time`,`unemployed`,`under_employed`]).nullable(),equity_groups:K7.array(K7.enum([`disability`,`visible_minority`,`women_in_stem`,`linguistic_minority`,`two_slgbtqia`])).default([])}).superRefine((e,t)=>{e.gender===`other`&&!e.gender_other&&t.addIssue({code:K7.ZodIssueCode.custom,path:[`gender_other`],message:`Please specify your gender identity`})}),TLe=()=>{let{demographics:e,isLoading:t,isError:n,error:r,refetchDemographics:i,saveDemographics:a,isSaving:o}=GG(),s=wB({resolver:Y7(wLe),defaultValues:{gender:null,gender_other:``,age_band:null,province:null,employment_status:null,equity_groups:[]}}),c=s.watch(`gender`);(0,y.useEffect)(()=>{e&&s.reset({gender:e.gender,gender_other:e.gender_other||``,age_band:e.age_band,province:e.province,employment_status:e.employment_status,equity_groups:e.equity_groups||[]})},[e,s]);let l=e=>{a({gender:e.gender,gender_other:e.gender===`other`?e.gender_other:null,age_band:e.age_band,province:e.province,employment_status:e.employment_status,equity_groups:e.equity_groups.length>0?e.equity_groups:null})};return t?(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-6`,children:(0,F.jsxs)(`div`,{className:`animate-pulse space-y-4`,children:[(0,F.jsx)(`div`,{className:`h-4 bg-muted rounded w-1/4`}),(0,F.jsx)(`div`,{className:`h-10 bg-muted rounded`}),(0,F.jsx)(`div`,{className:`h-4 bg-muted rounded w-1/4`}),(0,F.jsx)(`div`,{className:`h-10 bg-muted rounded`})]})})}):n?(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Personal Information`}),(0,F.jsx)(Mu,{children:`Your saved information could not be loaded. Saving is disabled to protect your existing answers.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsx)(Vu,{variant:`destructive`,children:(0,F.jsx)(Uu,{children:r instanceof Error?r.message:`Please try loading your information again.`})}),(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>void i(),children:`Retry`})]})]}):(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(Vu,{className:`bg-blue-50 border-blue-200`,children:[(0,F.jsx)(Cre,{className:`h-4 w-4 text-blue-600`}),(0,F.jsx)(Uu,{className:`text-blue-800`,children:`Your information is private and is used only for aggregate reporting and improving our services.`})]}),(0,F.jsx)(TB,{...s,children:(0,F.jsxs)(`form`,{onSubmit:s.handleSubmit(l),className:`space-y-6`,children:[(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Personal Information`}),(0,F.jsx)(Mu,{children:`This information helps us understand our user community and improve our services.`})]}),(0,F.jsxs)(H,{className:`space-y-6`,children:[(0,F.jsx)(DB,{control:s.control,name:`gender`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Gender`}),(0,F.jsxs)(Tk,{onValueChange:t=>e.onChange(t||null),value:e.value||``,children:[(0,F.jsx)(MB,{children:(0,F.jsx)(Dk,{children:(0,F.jsx)(Ek,{placeholder:`Select your gender`})})}),(0,F.jsx)(Ak,{children:yLe.map(e=>(0,F.jsx)(jk,{value:e.value,children:e.label},e.value))})]}),(0,F.jsx)(PB,{})]})}),c===`other`&&(0,F.jsx)(DB,{control:s.control,name:`gender_other`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Please specify`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`Your gender identity`,...e})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`age_band`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Age`}),(0,F.jsxs)(Tk,{onValueChange:t=>e.onChange(t||null),value:e.value||``,children:[(0,F.jsx)(MB,{children:(0,F.jsx)(Dk,{children:(0,F.jsx)(Ek,{placeholder:`Select your age range`})})}),(0,F.jsx)(Ak,{children:bLe.map(e=>(0,F.jsx)(jk,{value:e.value,children:e.label},e.value))})]}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`province`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Province or Territory`}),(0,F.jsxs)(Tk,{onValueChange:t=>e.onChange(t||null),value:e.value||``,children:[(0,F.jsx)(MB,{children:(0,F.jsx)(Dk,{children:(0,F.jsx)(Ek,{placeholder:`Select your province or territory`})})}),(0,F.jsx)(Ak,{children:xLe.map(e=>(0,F.jsx)(jk,{value:e.value,children:e.label},e.value))})]}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:s.control,name:`employment_status`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Employment Status`}),(0,F.jsxs)(Tk,{onValueChange:t=>e.onChange(t||null),value:e.value||``,children:[(0,F.jsx)(MB,{children:(0,F.jsx)(Dk,{children:(0,F.jsx)(Ek,{placeholder:`Select your employment status`})})}),(0,F.jsx)(Ak,{children:SLe.map(e=>(0,F.jsx)(jk,{value:e.value,children:e.label},e.value))})]}),(0,F.jsx)(PB,{})]})})]})]}),(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Equity and Diversity`}),(0,F.jsx)(Mu,{children:`Select any groups you identify with. This information is optional and helps us track our progress in serving diverse communities.`})]}),(0,F.jsx)(H,{children:(0,F.jsx)(DB,{control:s.control,name:`equity_groups`,render:()=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(`div`,{className:`space-y-4`,children:CLe.map(e=>(0,F.jsx)(DB,{control:s.control,name:`equity_groups`,render:({field:t})=>(0,F.jsxs)(AB,{className:`flex flex-row items-start space-x-3 space-y-0`,children:[(0,F.jsx)(MB,{children:(0,F.jsx)(zI,{checked:t.value?.includes(e.value),onCheckedChange:n=>{let r=t.value||[];n?t.onChange([...r,e.value]):t.onChange(r.filter(t=>t!==e.value))}})}),(0,F.jsx)(jB,{className:`font-normal cursor-pointer`,children:e.label})]},e.value)},e.value))}),(0,F.jsx)(PB,{})]})})})]}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsx)(B,{type:`submit`,disabled:o,children:o?`Saving...`:`Save`})})]})})]})},ELe=()=>(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsxs)(ju,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M_,{className:`h-5 w-5 text-red-500`}),`Share Your Feedback`]}),(0,F.jsx)(Mu,{children:`Your feedback helps us improve our platform and better meet your needs`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`text-center p-4`,children:[(0,F.jsxs)(`p`,{className:`mb-4`,children:[`We're continuously working to improve our platform based on user feedback.`,(0,F.jsx)(`br`,{}),`Let us know what you think!`]}),(0,F.jsxs)(B,{onClick:()=>{window.open(`https://advancerite.io/contact`,`_blank`)},className:`gap-2`,children:[(0,F.jsx)(M_,{className:`h-4 w-4`}),`Send Feedback`,(0,F.jsx)(O_,{className:`h-4 w-4 ml-1`})]})]})})]}),DLe=()=>(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Frequently Asked Questions`}),(0,F.jsx)(Mu,{children:`Find answers to common questions about our platform`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`text-center p-4`,children:[(0,F.jsxs)(`p`,{className:`mb-4`,children:[`Our comprehensive FAQ section is coming soon.`,(0,F.jsx)(`br`,{}),`Please contact our support team for any questions in the meantime.`]}),(0,F.jsxs)(B,{onClick:()=>{window.open(`https://advancerite.io/contact`,`_blank`)},variant:`outline`,className:`gap-2`,children:[(0,F.jsx)(z_,{className:`h-4 w-4`}),`Contact Support`,(0,F.jsx)(O_,{className:`h-4 w-4 ml-1`})]})]})})]}),OLe=()=>(0,F.jsxs)(`div`,{className:`bg-white rounded-lg p-8 shadow-sm`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold mb-6`,children:`Terms and Conditions`}),(0,F.jsx)(`p`,{className:`mb-4 text-sm text-gray-500`,children:`Last Updated: May 21, 2025`}),(0,F.jsxs)(`div`,{className:`mb-6 p-4 bg-amber-50 border border-amber-200 rounded-md flex items-center gap-3`,children:[(0,F.jsx)(y_,{className:`h-5 w-5 text-amber-600 flex-shrink-0`}),(0,F.jsxs)(`p`,{className:`text-amber-800`,children:[(0,F.jsx)(`strong`,{children:`Early Access Beta Notice:`}),` This platform is currently in Early Access Beta. Features may be incomplete, and bugs are expected. Your feedback helps us improve.`]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`Introduction`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`Welcome to Akito ("Platform"). These Terms and Conditions ("Terms") govern your use of our platform operated by Advancerite Technologies Inc., an Alberta corporation. By accessing or using the Platform, you agree to be bound by these Terms. If you disagree with any part of these Terms, you may
521not access the Platform.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`1. Definitions`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`"Platform"`}),` refers to the Akito application, website, and services.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`"User"`}),` refers to any individual who accesses or uses the Platform.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`"Content"`}),` refers to all information, data, text, software, music, sound, photographs, graphics, video, messages, or other materials submitted, posted, displayed, or otherwise made available through the Platform.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`"AI-Generated Content"`}),` refers to content that is algorithmically generated by our artificial intelligence systems.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`"Early Access Beta"`}),` refers to the pre-release state of the Platform, where features may be incomplete, and bugs are expected.`]})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`2. Account Registration`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`To access certain features of the Platform, you may be required to register for an account. You agree to provide accurate, current, and complete information during the registration process and to update such information to keep it accurate, current, and complete.`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`You are responsible for safeguarding your password and for all activities that occur under your account. You agree to notify us immediately of any unauthorized use of your account or any other breach of security.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`3. Use of the Platform`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`By using our Platform, you agree:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`Not to use the Platform in any way that violates any applicable laws or regulations.`}),(0,F.jsx)(`li`,{children:`Not to impersonate or attempt to impersonate another user or person.`}),(0,F.jsx)(`li`,{children:`Not to use the Platform to transmit any viruses, malware, or other harmful computer code.`}),(0,F.jsx)(`li`,{children:`Not to attempt to gain unauthorized access to any part of the Platform.`}),(0,F.jsx)(`li`,{children:`Not to use the Platform for any purpose that is unlawful or prohibited by these Terms.`})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`4. AI-Generated Content`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`Our Platform utilizes artificial intelligence technologies to generate content. You acknowledge and agree that:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`AI-generated content may not always be accurate, complete, or suitable for your intended purposes.`}),(0,F.jsx)(`li`,{children:`You are responsible for evaluating and verifying the accuracy of any AI-generated content.`}),(0,F.jsx)(`li`,{children:`We do not guarantee the accuracy, quality, or appropriateness of AI-generated content.`}),(0,F.jsx)(`li`,{children:`The Platform may collect and use your inputs to improve our AI systems, subject to our Privacy Policy.`})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`5. Intellectual Property`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`The Platform and its original content, features, and functionality are owned by Advancerite Technologies Inc. and are protected by international copyright, trademark, patent, trade secret, and other intellectual property or proprietary rights laws.`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`You retain ownership of any content you submit to the Platform. However, by submitting content, you grant us a worldwide, non-exclusive, royalty-free license to use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and display such content in connection with providing and promoting the Platform.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`6. Subscription and Payments`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`Some features of the Platform may require a subscription. By subscribing to these features, you agree to pay the applicable fees. We reserve the right to change our pricing at any time, with or without notice.`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`All payments are non-refundable except as required by law or as explicitly stated in our refund policy.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`7. Early Access Beta`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`You acknowledge and agree that the Platform is currently in an Early Access Beta phase. By using the Platform during this phase:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`You understand that the Platform may contain bugs, errors, and incomplete features.`}),(0,F.jsx)(`li`,{children:`You accept that services may be interrupted, changed, or discontinued without prior notice.`}),(0,F.jsx)(`li`,{children:`You acknowledge that data loss may occur, and we do not guarantee the preservation of any data.`}),(0,F.jsx)(`li`,{children:`You agree to provide feedback when requested to help improve the Platform.`}),(0,F.jsx)(`li`,{children:`You understand that the final version may differ substantially from the Beta version.`})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`8. Limitation of Liability`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`In addition to the general limitations of liability and particularly during the Early Access Beta phase, Advancerite Technologies Inc., its directors, employees, partners, agents, suppliers, or affiliates shall not be liable for any damages resulting from:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-6 mb-4 space-y-2`,children:[(0,F.jsx)(`li`,{children:`Your access to or use of or inability to access or use the Platform;`}),(0,F.jsx)(`li`,{children:`Any conduct or content of any third party on the Platform;`}),(0,F.jsx)(`li`,{children:`Any content obtained from the Platform;`}),(0,F.jsx)(`li`,{children:`Unauthorized access, use, or alteration of your transmissions or content;`}),(0,F.jsx)(`li`,{children:`Bugs, errors, or defects in the Beta version of the Platform;`}),(0,F.jsx)(`li`,{children:`Data loss or service interruptions common during Beta testing.`})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`9. Disclaimer`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`The Platform is provided on an "AS IS" and "AS AVAILABLE" basis. We make no warranties, expressed or implied, regarding the operation of the Platform or the information, content, materials, or products included.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`10. Governing Law`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`These Terms shall be governed by and construed in accordance with the laws of the Province of Alberta, Canada, without regard to its conflict of law provisions.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`11. Changes to Terms`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`We reserve the right to modify these Terms at any time. We will provide notice of any significant changes by updating the "Last Updated" date at the top of these Terms.`})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-3`,children:`12. Contact Us`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`If you have any questions about these Terms, please contact us at:`}),(0,F.jsx)(`div`,{className:`bg-gray-50 p-4 rounded-md flex items-center gap-2`,children:(0,F.jsxs)(`a`,{href:`https://advancerite.io/contact`,target:`_blank`,rel:`noopener noreferrer`,className:`text-akito-teal flex items-center gap-1`,children:[`Contact Us `,(0,F.jsx)(O_,{className:`h-3 w-3`})]})})]})]}),kLe=()=>(0,F.jsxs)(`div`,{className:`bg-white rounded-lg p-8 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold`,children:`About Early Access`}),(0,F.jsx)(mM,{variant:`outline`,className:`bg-amber-100 text-amber-800 border-amber-300`,children:`Beta`})]}),(0,F.jsx)(`div`,{className:`mb-8 p-5 bg-amber-50 border border-amber-200 rounded-md`,children:(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(y_,{className:`h-6 w-6 text-amber-600 flex-shrink-0 mt-0.5`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-semibold text-amber-800 mb-2`,children:`What is Early Access Beta?`}),(0,F.jsx)(`p`,{className:`text-amber-700`,children:`Akito is currently in Early Access Beta, which means you're getting access to our platform before its official release. This gives you the opportunity to explore and use our innovative features while they're still being refined.`})]})]})}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-4`,children:`What to Expect`}),(0,F.jsxs)(`ul`,{className:`space-y-4`,children:[(0,F.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`bg-blue-100 rounded-full p-1 mt-0.5`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-blue-600`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-medium mb-1`,children:`Incomplete Features`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`Some features may be partially implemented or temporarily unavailable as we continue development.`})]})]}),(0,F.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`bg-blue-100 rounded-full p-1 mt-0.5`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-blue-600`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-medium mb-1`,children:`Bugs and Issues`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`You may encounter errors, unexpected behaviors, or performance issues as we identify and resolve them.`})]})]}),(0,F.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`bg-blue-100 rounded-full p-1 mt-0.5`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-blue-600`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-medium mb-1`,children:`Frequent Updates`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`We'll be regularly updating the platform with improvements and fixes based on user feedback.`})]})]}),(0,F.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`bg-blue-100 rounded-full p-1 mt-0.5`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-blue-600`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`font-medium mb-1`,children:`Changes to Functionality`}),(0,F.jsx)(`p`,{className:`text-gray-600`,children:`Features and interfaces may change as we refine the platform based on testing and feedback.`})]})]})]})]}),(0,F.jsxs)(`section`,{className:`mb-8`,children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-4`,children:`Your Role in Early Access`}),(0,F.jsx)(`p`,{className:`mb-4`,children:`As an Early Access participant, your experience and feedback are invaluable to us. Here's how y
521ou can help:`}),(0,F.jsxs)(`ul`,{className:`space-y-3 mb-6`,children:[(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`bg-green-100 rounded-full p-1`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-green-600`})}),(0,F.jsx)(`span`,{children:`Report bugs and issues you encounter`})]}),(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`bg-green-100 rounded-full p-1`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-green-600`})}),(0,F.jsx)(`span`,{children:`Share your thoughts on existing features`})]}),(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`bg-green-100 rounded-full p-1`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-green-600`})}),(0,F.jsx)(`span`,{children:`Suggest improvements or new features`})]}),(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`bg-green-100 rounded-full p-1`,children:(0,F.jsx)(y_,{className:`h-4 w-4 text-green-600`})}),(0,F.jsx)(`span`,{children:`Be patient as we address issues and implement changes`})]})]}),(0,F.jsxs)(`div`,{className:`bg-gray-50 p-5 rounded-md`,children:[(0,F.jsx)(`h3`,{className:`font-semibold mb-3`,children:`Contact Us with Feedback`}),(0,F.jsx)(`p`,{className:`mb-4 text-gray-600`,children:`We welcome all feedback to help improve Akito. If you encounter any issues or have suggestions, please reach out to our team.`}),(0,F.jsx)(B,{asChild:!0,className:`bg-akito-teal hover:bg-akito-teal-deep`,children:(0,F.jsxs)(`a`,{href:`https://advancerite.io/contact`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2`,children:[`Contact Support Team`,(0,F.jsx)(O_,{className:`h-4 w-4`})]})})]})]}),(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h2`,{className:`text-xl font-semibold mb-4`,children:`Legal Disclaimer`}),(0,F.jsxs)(`div`,{className:`p-4 border border-gray-200 rounded-md bg-gray-50 text-sm`,children:[(0,F.jsx)(`p`,{className:`mb-2`,children:`By participating in the Early Access Beta program, you acknowledge that:`}),(0,F.jsxs)(`ul`,{className:`list-disc pl-5 space-y-1 mb-2`,children:[(0,F.jsx)(`li`,{children:`The platform is provided "as is" without warranties of any kind.`}),(0,F.jsx)(`li`,{children:`Advancerite Technologies Inc. is not liable for any damages or losses resulting from the use of the beta platform.`}),(0,F.jsx)(`li`,{children:`Features, functionality, and availability may change without prior notice.`}),(0,F.jsx)(`li`,{children:`Data loss may occur, and we recommend not relying on the platform for critical operations.`})]}),(0,F.jsx)(`p`,{children:`For complete terms regarding the Early Access Beta, please refer to the Terms & Conditions.`})]})]})]});function ALe(){let[e,t]=(0,y.useState)(!1);return{inviteUser:async({email:e,fullName:n})=>{t(!0);try{let{data:{session:t}}=await R.auth.getSession();if(!t)return{success:!1,error:`Not authenticated`};let r=await fetch(`undefined/functions/v1/org-invite-user`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({email:e,fullName:n})}),i=await r.json();return r.ok?{success:!0,invite:i.invite}:{success:!1,error:i.error||`Failed to send invite`}}catch(e){return console.error(`Error inviting user:`,e),{success:!1,error:e instanceof Error?e.message:`An unexpected error occurred`}}finally{t(!1)}},isInviting:e}}var jLe=({onInvited:e})=>{let{inviteUser:t,isInviting:n}=ALe(),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(null),d=()=>{o(``),c(``),u(null)},f=e=>{i(e),e||d()};return(0,F.jsxs)(aE,{open:r,onOpenChange:f,children:[(0,F.jsx)(oE,{asChild:!0,children:(0,F.jsxs)(B,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Y_,{className:`h-4 w-4`}),`Invite Member`]})}),(0,F.jsxs)(cE,{className:`sm:max-w-[450px]`,children:[(0,F.jsxs)(lE,{children:[(0,F.jsx)(dE,{children:`Invite a team member`}),(0,F.jsx)(fE,{children:`Send an invitation email to add someone to your organization.`})]}),(0,F.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),u(null);let r=a.trim(),o=s.trim();if(!r){u(`Please enter the personâs name`);return}if(r.length<2||r.length>100){u(`Name must be between 2 and 100 characters`);return}if(!o){u(`Please enter an email address`);return}let c=await t({fullName:r,email:o});c.success?(fl({title:`Invitation sent`,description:`An invitation has been sent to ${r}`}),d(),i(!1),e?.()):c.error?.includes(`already have an account`)?u(`This email can't be invited â it may already have an account`):c.error?.includes(`already pending`)?u(`An invitation is already pending for this email`):u(c.error||`Failed to send invitation`)},className:`space-y-4`,children:[l&&(0,F.jsxs)(Vu,{variant:`destructive`,children:[(0,F.jsx)(y_,{className:`h-4 w-4`}),(0,F.jsx)(Uu,{children:l})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`invite-name`,children:`N
521ame`}),(0,F.jsx)(ku,{id:`invite-name`,type:`text`,autoComplete:`name`,placeholder:`Alex Smith`,value:a,onChange:e=>{o(e.target.value),u(null)},maxLength:100,required:!0,disabled:n})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(zu,{htmlFor:`invite-email`,children:`Email address`}),(0,F.jsx)(ku,{id:`invite-email`,type:`email`,autoComplete:`email`,placeholder:`[email protected]`,value:s,onChange:e=>{c(e.target.value),u(null)},required:!0,disabled:n}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The person will receive an email invitation to join your organization.`})]}),(0,F.jsxs)(uE,{children:[(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>f(!1),disabled:n,children:`Cancel`}),(0,F.jsx)(B,{type:`submit`,disabled:n,children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(F_,{className:`h-4 w-4 mr-2 animate-spin`}),`Sending...`]}):`Send invitation`})]})]})]})]})},MLe=()=>{let{user:e,profile:t}=_l(),[n,r]=(0,y.useState)(!0),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)([]),[u,d]=(0,y.useState)([]),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),g=(0,y.useCallback)(async()=>{if(h(null),!t?.organization_id||!e){r(!1);return}try{let{data:n,error:r}=await R.from(`organizations`).select(`id, name, owner_id`).eq(`id`,t.organization_id).single();if(r)throw r;let i=n.owner_id===e.id;s(n),a(i);let{data:o,error:c}=await R.from(`profiles`).select(`id, full_name, created_at`).eq(`organization_id`,t.organization_id).order(`created_at`,{ascending:!0});if(c)throw c;if(o&&o.length>0){let e=o.map(e=>e.id),{data:t,error:n}=await R.rpc(`get_user_emails`,{user_ids:e});if(n)throw n;let r=new Map((t??[]).map(e=>[e.id,e]));l(o.map(e=>{let t=r.get(e.id);return{...e,email:t?.email||void 0,isAccepted:i?!!(t?.email_confirmed_at||t?.last_sign_in_at):!!t}}))}else l([]);if(n.owner_id===e.id){let{data:e,error:n}=await R.from(`organization_invites`).select(`id, email, invitee_name, status, created_at, expires_at`).eq(`organization_id`,t.organization_id).eq(`status`,`pending`).order(`created_at`,{ascending:!1});if(n)throw n;d(e||[])}}catch(e){console.error(`Error fetching organization data:`,e),h(e instanceof Error?e.message:`Failed to load organization data`),fl({title:`Error`,description:`Failed to load organization data`,variant:`destructive`})}finally{r(!1)}},[t?.organization_id,e]);(0,y.useEffect)(()=>{g()},[g]);let _=async e=>{p(e);try{let{error:t}=await R.from(`organization_invites`).update({status:`revoked`}).eq(`id`,e);if(t)throw t;d(u.filter(t=>t.id!==e)),fl({title:`Invite revoked`,description:`The invitation has been revoked.`})}catch(e){console.error(`Error revoking invite:`,e),fl({title:`Error`,description:`Failed to revoke invitation`,variant:`destructive`})}finally{p(null)}};if(n)return(0,F.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-primary`})});if(m)return(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Team`}),(0,F.jsx)(Mu,{children:`Your organization members could not be loaded. No changes have been made.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsx)(`p`,{className:`text-sm text-destructive`,children:m}),(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>{r(!0),g()},children:`Retry`})]})]});if(!t?.organization_id)return(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Team`}),(0,F.jsx)(Mu,{children:`You are not currently a member of an organization.`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`Create your organization profile before managing team members.`}),(0,F.jsx)(B,{asChild:!0,children:(0,F.jsx)(Pt,{to:`/settings/organization/profile`,children:`Complete Organization Profile`})})]})})]});let v=c.filter(e=>e.isAccepted);return i?(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Team`}),(0,F.jsx)(Mu,{children:`Manage your organization's members and invitations`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:`Organization Name`}),(0,F.jsx)(`p`,{className:`text-lg font-semibold`,children:o?.name||`Unnamed Organization`})]}),(0,F.jsx)(mM,{variant:`default`,children:`Owner`})]})})]}),(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Z_,{className:`h-5 w-5`}),(0,F.jsx)(ju,{children:`Members`})]}),(0,F.jsxs)(Mu,{children:[v.length,` `,v.length===1?`member`:`members`,` in your organization`]})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`N
521ame`}),(0,F.jsx)(J,{children:`Email`}),(0,F.jsx)(J,{children:`Joined`}),(0,F.jsx)(J,{children:`Role`})]})}),(0,F.jsx)(QG,{children:v.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.full_name||`No name`}),(0,F.jsx)(Y,{children:e.email||`â`}),(0,F.jsx)(Y,{children:new Date(e.created_at).toLocaleDateString()}),(0,F.jsx)(Y,{children:e.id===o?.owner_id?(0,F.jsx)(mM,{variant:`default`,children:`Owner`}):(0,F.jsx)(mM,{variant:`secondary`,children:`Member`})})]},e.id))})]})})]}),(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(L_,{className:`h-5 w-5`}),(0,F.jsx)(ju,{children:`Pending Invitations`})]}),(0,F.jsx)(jLe,{onInvited:g})]}),(0,F.jsxs)(Mu,{children:[u.length,` pending `,u.length===1?`invitation`:`invitations`]})]}),(0,F.jsx)(H,{children:u.length===0?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,F.jsx)(E_,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`No pending invitations`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Invite team members to join your organization`})]}):(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`N
521ame`}),(0,F.jsx)(J,{children:`Email`}),(0,F.jsx)(J,{children:`Sent`}),(0,F.jsx)(J,{children:`Expires`}),(0,F.jsx)(J,{className:`text-right`,children:`Actions`})]})}),(0,F.jsx)(QG,{children:u.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.invitee_name||`Not provided`}),(0,F.jsx)(Y,{children:e.email}),(0,F.jsx)(Y,{children:new Date(e.created_at).toLocaleDateString()}),(0,F.jsx)(Y,{children:e.expires_at?new Date(e.expires_at).toLocaleDateString():`Never`}),(0,F.jsx)(Y,{className:`text-right`,children:(0,F.jsxs)(khe,{children:[(0,F.jsx)(Ahe,{asChild:!0,children:(0,F.jsxs)(B,{variant:`ghost`,size:`sm`,disabled:f===e.id,children:[(0,F.jsx)(Q_,{className:`h-4 w-4 mr-1`}),`Revoke`]})}),(0,F.jsxs)(jF,{children:[(0,F.jsxs)(MF,{children:[(0,F.jsx)(PF,{children:`Revoke invitation?`}),(0,F.jsxs)(FF,{children:[`This will revoke the invitation sent to `,e.email,`. They will no longer be able to join your organization using this invite.`]})]}),(0,F.jsxs)(NF,{children:[(0,F.jsx)(LF,{children:`Cancel`}),(0,F.jsx)(IF,{onClick:()=>_(e.id),children:`Revoke`})]})]})]})})]},e.id))})]})})]})]}):(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Team`}),(0,F.jsx)(Mu,{children:`View accepted members of your organization.`})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:`Organization`}),(0,F.jsx)(`p`,{className:`text-lg font-semibold`,children:o?.name||`Unnamed Organization`})]}),(0,F.jsx)(mM,{variant:`secondary`,children:`Member`})]})})]}),(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Z_,{className:`h-5 w-5`}),(0,F.jsx)(ju,{children:`Members`})]}),(0,F.jsxs)(Mu,{children:[v.length,` `,v.length===1?`member`:`members`,` in your organization`]})]}),(0,F.jsx)(H,{children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`N
521ame`}),(0,F.jsx)(J,{children:`Email`}),(0,F.jsx)(J,{children:`Role`})]})}),(0,F.jsx)(QG,{children:v.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.full_name||`No name`}),(0,F.jsx)(Y,{children:e.email||`â`}),(0,F.jsx)(Y,{children:e.id===o?.owner_id?(0,F.jsx)(mM,{variant:`default`,children:`Owner`}):(0,F.jsx)(mM,{variant:`secondary`,children:`Member`})})]},e.id))})]})})]})]})},NLe=K7.object({name:K7.string().trim().refine(e=>e.length===0||e.length>=2,{message:`Organization name must be at least 2 characters`}),industry:K7.string().trim(),company_size:K7.string().trim(),services:K7.string().trim()}),PLe=()=>{let{user:e,profile:t,refreshProfile:n}=_l(),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!0),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(0),p=!!t,m=t?.organization_id,h=t?.company_name||``,g=t?.services?.join(`, `)||``,_=wB({resolver:Y7(NLe),defaultValues:{name:``,industry:``,company_size:``,services:``}});(0,y.useEffect)(()=>{(async()=>{if(!p){u(`Your user profile could not be loaded. Please refresh and try again.`),o(!1);return}if(o(!0),u(null),!m){i(null),_.reset({name:h,industry:``,company_size:``,services:g}),o(!1);return}i(null);let{data:e,error:t}=await R.from(`organizations`).select(`id, name, owner_id, industry, company_size, services`).eq(`id`,m).single();if(t){u(t.message),fl({title:`Unable to load organization profile`,description:t.message,variant:`destructive`}),o(!1);return}i(e),_.reset({name:e.name||``,industry:e.industry||``,company_size:e.company_size||``,services:e.services?.join(`, `)||``}),o(!1)})()},[h,g,_,p,d,m]);let v=!l&&(t?.organization_id?r?.owner_id===e?.id:t?.user_type===`organization`),b=async a=>{if(!e||!t||!v)return;if(t.organization_id&&!r){fl({title:`Unable to save organization profile`,description:`The existing organization could not be loaded. Please retry.`,variant:`destructive`});return}c(!0);let o={name:a.name.trim()||null,industry:a.industry?.trim()||null,company_size:a.company_size?.trim()||null,services:a.services?a.services.split(`,`).map(e=>e.trim()).filter(Boolean):null,updated_at:new Date().toISOString()};try{if(r){let{data:e,error:t}=await R.from(`organizations`).update(o).eq(`id`,r.id).select(`id, name, owner_id, industry, company_size, services`).single();if(t)throw t;i(e),await n()}else{let{data:e,error:t}=await R.rpc(`ensure_current_user_organization`,{p_name:o.name||``,p_industry:o.industry||``,p_company_size:o.company_size||``,p_services:o.services??[]}).single();if(t)throw t;i(e),await n()}fl({title:`Organization profile saved`,description:`Your organization information has been updated.`})}catch(e){fl({title:`Unable to save organization profile`,description:e instanceof Error?e.message:`Please try again.`,variant:`destructive`})}finally{c(!1)}};return a?(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-6`,children:(0,F.jsx)(`div`,{className:`h-40 animate-pulse rounded-md bg-muted`})})}):l?(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Organization Profile`}),(0,F.jsx)(Mu,{children:`The organization profile could not be loaded. No changes have been made.`})]}),(0,F.jsxs)(H,{className:`space-y-4`,children:[(0,F.jsx)(Vu,{variant:`destructive`,children:(0,F.jsx)(Uu,{children:l})}),(0,F.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>f(e=>e+1),children:`Retry`})]})]}):(0,F.jsxs)(V,{children:[(0,F.jsxs)(Au,{children:[(0,F.jsx)(ju,{children:`Organization Profile`}),(0,F.jsx)(Mu,{children:`Manage the shared information that describes your organization.`})]}),(0,F.jsxs)(H,{children:[!v&&(0,F.jsxs)(Vu,{className:`mb-6`,children:[(0,F.jsx)(Sre,{className:`h-4 w-4`}),(0,F.jsx)(Uu,{children:`Only the organization owner can update this information.`})]}),(0,F.jsx)(TB,{..._,children:(0,F.jsxs)(`form`,{onSubmit:_.handleSubmit(b),className:`space-y-6`,children:[(0,F.jsx)(DB,{control:_.control,name:`name`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Organization Name`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{...e,disabled:!v})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:_.control,name:`industry`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Industry`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`Technology, healthcare, finance, etc.`,...e,disabled:!v})}),(0,F.jsx)(PB,{})]})}
521),(0,F.jsx)(DB,{control:_.control,name:`company_size`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Organization Size`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`1â10, 11â50, 51â200, etc.`,...e,disabled:!v})}),(0,F.jsx)(PB,{})]})}),(0,F.jsx)(DB,{control:_.control,name:`services`,render:({field:e})=>(0,F.jsxs)(AB,{children:[(0,F.jsx)(jB,{children:`Services`}),(0,F.jsx)(MB,{children:(0,F.jsx)(ku,{placeholder:`Career coaching, recruiting, training`,...e,disabled:!v})}),(0,F.jsx)(NB,{children:`Separate multiple services with commas.`}),(0,F.jsx)(PB,{})]})}),v&&(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsx)(B,{type:`submit`,disabled:s,children:s?`Saving...`:`Save Organization Profile`})})]})})]})]})},FLe=({children:e})=>{let{profile:t}=_l(),{hasAccess:n,isLoading:r}=RG();return r&&t?.user_type===`job_seeker`?(0,F.jsx)(tv,{}):n?(0,F.jsx)(F.Fragment,{children:e}):(0,F.jsx)(mt,{to:ev(t?.user_type),replace:!0})},ILe=({basePath:e})=>(0,F.jsx)(ht,{context:{riipenBase:e}});function $7(){let e=qe();if(!e?.riipenBase)throw Error(`useRiipenBase must be used within a RiipenLayout route tree`);return e.riipenBase}function LLe(){return sr({queryKey:[`riipen-experiences`],queryFn:async()=>{let{data:e,error:t}=await R.from(`riipen_experiences`).select(`*`).order(`created_at`,{ascending:!1});return t?(console.error(`Error fetching experiences:`,t),[]):Promise.all((e||[]).map(async e=>{let{count:t}=await R.from(`riipen_matches`).select(`*`,{count:`exact`,head:!0}).eq(`experience_id`,e.id);return{...e,match_count:t||0}}))}})}function RLe(e){return sr({queryKey:[`riipen-experience`,e],enabled:!!e,queryFn:async()=>{let{data:t,error:n}=await R.from(`riipen_experiences`).select(`*`).eq(`id`,e).maybeSingle();return n?(console.error(`Error fetching experience:`,n),null):t}})}var e9=y.forwardRef(({...e},t)=>(0,F.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));e9.displayName=`Breadcrumb`;var t9=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`ol`,{ref:n,className:z(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));t9.displayName=`BreadcrumbList`;var n9=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`li`,{ref:n,className:z(`inline-flex items-center gap-1.5`,e),...t}));n9.displayName=`BreadcrumbItem`;var r9=y.forwardRef(({asChild:e,className:t,...n},r)=>(0,F.jsx)(e?xl:`a`,{ref:r,className:z(`transition-colors hover:text-foreground`,t),...n}));r9.displayName=`BreadcrumbLink`;var i9=y.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:z(`font-normal text-foreground`,e),...t}));i9.displayName=`BreadcrumbPage`;var a9=({children:e,className:t,...n})=>(0,F.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:z(`[&>svg]:size-3.5`,t),...n,children:e??(0,F.jsx)(v_,{})});a9.displayName=`BreadcrumbSeparator`;var zLe=({className:e,...t})=>(0,F.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,F.jsx)(sre,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{className:`sr-only`,children:`More`})]});zLe.displayName=`BreadcrumbElipssis`;var o9=({items:e})=>e.length===0?null:(0,F.jsx)(e9,{children:(0,F.jsx)(t9,{children:e.map((t,n)=>{let r=n===e.length-1;return(0,F.jsxs)(y.Fragment,{children:[(0,F.jsx)(n9,{children:r||!t.href?(0,F.jsx)(i9,{children:t.label}):(0,F.jsx)(r9,{asChild:!0,children:(0,F.jsx)(Pt,{to:t.href,children:t.label})})}),!r&&(0,F.jsx)(a9,{})]},n)})})}),BLe=()=>{let{profile:e}=_l(),{experienceId:t}=Ye(),n=$7(),r=e?.user_type===`admin`,[i,a]=(0,y.useState)(null),{toast:o}=pl(),s=Gn(),c=(0,y.useCallback)(e=>{a(e)},[]),{data:l,isLoading:u}=RLe(t),d=cr({mutationFn:async e=>{let{data:n,error:r}=await R.from(`riipen_experiences`).update({assessments_closed:e}).eq(`id`,t).select(`id`);if(r)throw r;if(!n||n.length===0)throw Error(`Update not permitted or experience not found`);return e},onSuccess:e=>{s.invalidateQueries({queryKey:[`riipen-experience`,t]}),o({title:e?`Assessments Closed`:`Assessments Opened`,description:e?`New assessment submissions are now blocked for this experience.`:`Assessment submissions are now allowed for this experience.`})},onError:e=>{console.error(`Failed to update assessments status:`,e),o({title:`Error`,description:`Failed to update assessment status. Please try again.`,variant:`destructive`})}}),{data:f,isLoading:p}=sr({queryKey:[`riipen-experience-project-count`,t],enabled:!!t,queryFn:async()=>{let{count:e}=await R.from(`riipen_matches`).select(`id`,{count:`exact`,head:!0}).eq(`experience_id`,t);return e||0}}),{data:m,isLoading:h}=sr({queryKey:[`riipen-experience-learner-count`,t],enabled:!!t&&r,queryFn:async()=>{let{count:e}=await R.from(`riipen_experience_members`).select(`id`,{count:`exact`,head:!0}).eq(`experience_id`,t);return e||0}}),g=[{to:`projects`,label:p?`Projects (â¦)`:`Projects (${f??0})`,icon:f_,end:!0},...r?[{to:`learners`,label:h?`Learners (â¦)`:`Learners (${m??0})`,icon:Z_,end:!0}]:[]];return u&&!l?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):l?(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(o9,{items:[{label:`Riipen Experiences`,href:n},{label:l.name}]}),(0,F.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h3`,{className:`text-xl font-semibold flex items-center gap-2`,children:[(0,F.jsx)(j_,{className:`h-5 w-5`}),l.name,l.assessments_closed&&(0,F.jsxs)(mM,{variant:`secondary`,className:`ml-2 gap-1`,children:[(0,F.jsx)(I_,{className:`h-3 w-3`}),`Assessments Closed`]})]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage projects and learners for this experience`})]}),r&&(0,F.jsxs)(`div`,{className:`flex items-center gap-3 p-3 bg-muted/50 rounded-lg border`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l.assessments_closed?(0,F.jsx)(I_,{className:`h-4 w-4 text-muted-foreground`}):(0,F.jsx)(fre,{className:`h-4 w-4 text-green-600`}),(0,F.jsx)(zu,{htmlFor:`assessments-toggle`,className:`text-sm font-medium cursor-pointer`,children:`Accept Assessments`})]}),(0,F.jsx)(OG,{id:`assessments-toggle`,checked:!l.assessments_closed,onCheckedChange:e=>d.mutate(!e),disabled:d.isPending})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(zG,{items:g,className:r?`grid w-full max-w-md grid-cols-2`:``}),r&&i&&(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:i.handler,children:[(0,F.jsx)(D_,{className:`h-4 w-4 mr-1`}),i.label]})]}),(0,F.jsx)(ht,{context:{experienceId:t,isAdmin:r,riipenBase:n,registerExport:c,assessmentsClosed:l.assessments_closed}})]}):(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(o9,{items:[{label:`Riipen Experiences`,href:n},{label:`Experience not found`}]}),(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(j_,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`Experience not found.`})]})})]})},VLe=()=>{let{profile:e}=_l(),t=We(),n=$7(),r=e?.user_type===`admin`,{data:i,isLoading:a}=LLe();return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h3`,{className:`text-xl font-semibold flex items-center gap-2`,children:[(0,F.jsx)(j_,{className:`h-5 w-5`}),`Riipen Experiences`]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Learning experiences synced from Rii
521pen`})]}),r&&(0,F.jsxs)(HR,{children:[(0,F.jsx)(UR,{asChild:!0,children:(0,F.jsxs)(B,{variant:`outline`,size:`sm`,children:[(0,F.jsx)(Tre,{className:`h-4 w-4 mr-2`}),`Dev Tools`]})}),(0,F.jsx)(KR,{align:`end`,children:(0,F.jsxs)(qR,{onClick:()=>t(`/dev/riipen-webhook-tester`),children:[(0,F.jsx)(O_,{className:`h-4 w-4 mr-2`}),`Webhook Tester`]})})]})]}),a?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):i&&i.length>0?(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Experience Name`}),(0,F.jsx)(J,{children:`Portal ID`}),(0,F.jsx)(J,{children:`Projects`}),(0,F.jsx)(J,{children:`Synced`}),(0,F.jsx)(J,{})]})}),(0,F.jsx)(QG,{children:i.map(e=>(0,F.jsxs)($G,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>t(`${n}/experience/${e.id}`),children:[(0,F.jsx)(Y,{className:`font-medium`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.name,e.assessments_closed&&(0,F.jsxs)(mM,{variant:`secondary`,className:`gap-1 text-xs`,children:[(0,F.jsx)(I_,{className:`h-3 w-3`}),`Closed`]})]})}),(0,F.jsx)(Y,{children:(0,F.jsx)(`code`,{className:`text-xs bg-muted px-1.5 py-0.5 rounded`,children:e.riipen_portal_id})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(mM,{variant:`secondary`,children:[e.match_count,` project`,e.match_count===1?``:`s`]})}),(0,F.jsx)(Y,{className:`text-muted-foreground`,children:hN(new Date(e.synced_at),`MMM d, yyyy`)}),(0,F.jsx)(Y,{children:(0,F.jsx)(B,{variant:`ghost`,size:`sm`,children:(0,F.jsx)(v_,{className:`h-4 w-4`})})})]},e.id))})]})})}):(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(j_,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`No Riipen experiences found.`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Experiences are created when match requests are accepted in Riipen.`})]})})]})};function HLe(e,t){let n=t.map(e=>e.map(e=>`"${String(e??``).replace(/"/g,`""`)}"`).join(`,`)).join(` 522`),r=new Blob([n],{type:`text/csv;charset=utf-8;`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}var ULe=()=>{let{profile:e}=_l(),t=We(),{experienceId:n,isAdmin:r,riipenBase:i,registerExport:a,assessmentsClosed:o}=qe(),{data:s,isLoading:c}=sr({queryKey:[`riipen-matches`,n,e?.id,r],enabled:!!n,staleTime:0,queryFn:async()=>{let{data:t,error:i}=await R.from(`riipen_matches`).select(`*, riipen_projects(*, riipen_organizations(*, organizations(name))), assessment_links(id, link_code, is_active)`).eq(`experience_id`,n).order(`created_at`,{ascending:!1});if(i)return console.error(`Error fetching matches:`,i),[];let a=(t||[]).map(e=>e.assessment_links?.link_code).filter(e=>!!e);if(a.length===0)return(t||[]).map(e=>({...e,has_submission:!1,submission_count:0}));let o={},s=new Set;if(r){let{data:e}=await R.from(`assessment_submissions`).select(`link_code`).in(`link_code`,a);o=(e||[]).reduce((e,t)=>(t.link_code&&(e[t.link_code]=(e[t.link_code]||0)+1),e),{})}else{let{data:t}=await R.from(`assessment_submissions`).select(`link_code`).in(`link_code`,a).eq(`user_id`,e.id);s=new Set((t||[]).map(e=>e.link_code))}return(t||[]).map(e=>{let t=e.assessment_links?.link_code;return{...e,has_submission:t?s.has(t):!1,submission_count:t&&o[t]||0}})}}),l=(0,y.useCallback)(()=>{s&&HLe(`riipen-projects.csv`,[[`Project Name`,`Company`,`Applicants`],...s.map(e=>[e.riipen_projects?.name||e.project_id,e.riipen_projects?.riipen_organizations?.organizations?.name||``,String(e.submission_count||0)])])},[s]);return(0,y.useEffect)(()=>(s&&s.length>0?a({label:`Export Projects`,handler:l}):a(null),()=>a(null)),[s,l,a]),c?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):!s||s.length===0?(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(f_,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`No projects found for this experience.`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Projects are created when match requests are accepted in Riipen.`})]})}):(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Project Name`}),(0,F.jsx)(J,{children:`Company`}),r?(0,F.jsx)(J,{children:`Applicants`}):(0,F.jsx)(J,{children:`Status`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:s.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:(0,F.jsx)(`button`,{type:`button`,className:`text-left hover:underline hover:text-akito-teal focus:outline-none focus-visible:ring-2 focus-visible:ring-akito-teal rounded`,onClick:()=>t(`${i}/matches/${e.id}`),children:e.riipen_projects?.name||(0,F.jsx)(`code`,{className:`text-xs bg-muted px-1.5 py-0.5 rounded`,children:e.project_id})})}),(0,F.jsx)(Y,{children:e.riipen_projects?.riipen_organizations?.organizations?.name?(0,F.jsx)(`span`,{className:`text-sm`,children:e.riipen_projects.riipen_organizations.organizations.name}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,F.jsx)(Y,{children:r?(0,F.jsxs)(mM,{variant:e.submission_count?`default`:`secondary`,children:[e.submission_count||0,` applicant`,e.submission_count===1?``:`s`]}):e.has_submission?(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(b_,{className:`h-4 w-4 text-green-600`}),(0,F.jsx)(`span`,{className:`text-sm text-green-600 font-medium`,children:`Applied`})]}):o?(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(I_,{className:`h-4 w-4 text-muted-foreground`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Closed`})]}):e.assessment_links?.is_active?(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(E_,{className:`h-4 w-4 text-amber-600`}),(0,F.jsx)(`span`,{className:`text-sm text-amber-600`,children:`Not Applied`})]}):(0,F.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`-`})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>t(`${i}/matches/${e.id}`),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),`View Project`]})})]},e.id))})]})})})};function WLe(e,t){let n=t.map(e=>e.map(e=>`"${String(e??``).replace(/"/g,`""`)}"`).join(`,`)).join(` 523`),r=new Blob([n],{type:`text/csv;charset=utf-8;`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}var GLe=e=>{if(!e)return`?`;let t=e.split(` `);return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():t[0][0].toUpperCase()},KLe=()=>{let e=We(),{experienceId:t,riipenBase:n,registerExport:r}=qe(),{data:i,isLoading:a}=sr({queryKey:[`riipen-experience-learners`,t],enabled:!!t,queryFn:async()=>{let{data:e,error:n}=await R.from(`riipen_experience_members`).select(`*, profiles(id, full_name, avatar_url, location, skills)`).eq(`experience_id`,t).order(`created_at`,{ascending:!1});if(n)return console.error(`Error fetching learners:`,n),[];let{data:r}=await R.from(`riipen_matches`).select(`assessment_links(link_code)`).eq(`experience_id`,t),i=(r||[]).flatMap(e=>e.assessment_links?.link_code).filter(e=>!!e);if(i.length===0)return(e||[]).map(e=>({...e,application_count:0}));let a=(e||[]).map(e=>e.profile_id).filter(e=>!!e);if(a.length===0)return(e||[]).map(e=>({...e,application_count:0}));let{data:o}=await R.from(`assessment_submissions`).select(`user_id`).in(`user_id`,a).in(`link_code`,i),s=(o||[]).reduce((e,t)=>
523(t.user_id&&(e[t.user_id]=(e[t.user_id]||0)+1),e),{});return(e||[]).map(e=>({...e,application_count:e.profile_id&&s[e.profile_id]||0}))}}),o=(0,y.useCallback)(()=>{i&&WLe(`riipen-learners.csv`,[[`Learner Name`,`Riipen Member ID`,`Riipen User ID`,`Location`,`Skills`,`Applications`],...i.map(e=>[e.profiles?.full_name||``,e.riipen_id||``,e.riipen_user_id||``,e.profiles?.location||``,e.profiles?.skills?.join(`, `)||``,String(e.application_count||0)])])},[i]);return(0,y.useEffect)(()=>(i&&i.length>0?r({label:`Export Learners`,handler:o}):r(null),()=>r(null)),[i,o,r]),a?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):!i||i.length===0?(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(Z_,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`No learners found for this experience.`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Learners are added when they join the experience in Riipen.`})]})}):(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Learner`}),(0,F.jsx)(J,{children:`Location`}),(0,F.jsx)(J,{children:`Skills`}),(0,F.jsx)(J,{children:`Applications`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:i.map(t=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsxs)(JF,{className:`h-8 w-8`,children:[(0,F.jsx)(YF,{src:t.profiles?.avatar_url||void 0}),(0,F.jsx)(XF,{className:`text-xs`,children:GLe(t.profiles?.full_name??null)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`button`,{type:`button`,className:`font-medium text-left hover:underline hover:text-akito-teal focus:outline-none focus-visible:ring-2 focus-visible:ring-akito-teal rounded`,onClick:()=>e(`${n}/learners/${t.id}`),children:t.profiles?.full_name||(0,F.jsx)(`span`,{className:`text-muted-foreground italic`,children:`No profile linked`})}),(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Riipen ID: `,t.riipen_user_id]})]})]})}),(0,F.jsx)(Y,{children:t.profiles?.location||(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,F.jsx)(Y,{children:t.profiles?.skills&&t.profiles.skills.length>0?(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1 max-w-xs`,children:[t.profiles.skills.slice(0,3).map(e=>(0,F.jsx)(mM,{variant:`secondary`,className:`text-xs`,children:e},e)),t.profiles.skills.length>3&&(0,F.jsxs)(mM,{variant:`outline`,className:`text-xs`,children:[`+`,t.profiles.skills.length-3,` more`]})]}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,F.jsx)(Y,{children:(0,F.jsx)(mM,{variant:t.application_count?`default`:`secondary`,children:t.application_count||0})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>e(`${n}/learners/${t.id}`),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),`View Learner`]})})]},t.id))})]})})})},qLe={mcq:`MCQ`,"multi-select":`Multi-Select`,"short-q":`Short Answer`,"long-q":`Long Answer`};function JLe(e){let t=` 524 <style> 525 button[type="submit"], 526 button:disabled, 527 .submit-button, 528 [data-submit], 529 button:has(svg.animate-spin) { 530 display: none !important; 531 } 532 </style> 533 `;return e.includes(`</head>`)?e.replace(`</head>`,`${t}</head>`):t+e}var s9=({applicant:e,open:t,onOpenChange:n,contextLabel:r=`Project`,contextValue:i})=>{let{toast:a}=pl(),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!1),f=async()=>{if(e)try{l(null),d(!0),s(!0);let{data:t,error:n}=await R.from(`assessment_submissions`).select(`submission_snapshot`).eq(`id`,e.id).maybeSingle();if(n){console.error(`Error fetching submission snapshot:`,n),a({title:`Error`,description:`Could not load submission snapshot.`,variant:`destructive`}),l(null);return}let r=t?.submission_snapshot||null;l(r),r||a({title:`No snapshot`,description:`No submission snapshot was found for this applicant.`})}finally{d(!1)}},p=e?.submitted_at||e?.created_at,m=i||e?.project_name||`Unknown`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(aE,{open:t,onOpenChange:n,children:(0,F.jsxs)(cE,{className:`sm:max-w-[800px] max-h-[85vh] overflow-auto`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:e?.full_name?`Applicant Details`:`Application Details`})}),e&&(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(`div`,{className:`rounded-md border bg-gray-50 p-4`,children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[e.full_name&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Applicant`}),(0,F.jsx)(`div`,{className:`text-base font-medium`,children:e.full_name}),e.email&&(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.email})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r}),(0,F.jsx)(`div`,{className:`text-base`,children:m})]}),(0,F.jsx)(`div`,{children:e.evaluated_score!==null&&e.total_score?(0,F.jsxs)(`span`,{className:`inline-block px-3 py-1 rounded-full text-sm font-medium ${e.evaluated_score/e.total_score>=.75?`bg-green-100 text-green-800`:e.evaluated_score/e.total_score>=.5?`bg-yellow-100 text-yellow-800`:`bg-red-100 text-red-800`}`,children:[Math.round(e.evaluated_score/e.total_score*100),`%`]}):(0,F.jsx)(`span`,{className:`inline-block px-3 py-1 rounded-full text-sm bg-gray-100 text-gray-600`,children:`Not graded`})}),p&&(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:hN(new Date(p),`MMMM d, yyyy`)})]})}),e.questions_data&&e.questions_data.length>0?(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-3`,children:`Per-Question Evaluation`}),(0,F.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto space-y-3`,children:e.questions_data.map((e,t)=>{let n=e.result/e.max_points*100,r=n===100,i=n>0&&n<100,a=r?`bg-green-100 text-green-800 border-green-300`:i?`bg-yellow-100 text-yellow-800 border-yellow-300`:`bg-red-100 text-red-800 border-red-300`,o=r?`Correct`:i?`Partial`:`Incorrect`;return(0,F.jsxs)(`div`,{className:`border rounded-lg p-3 bg-white hover:shadow-sm transition-shadow`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-xs font-bold text-gray-700 bg-gray-100 px-2 py-1 rounded`,children:[`Q`,e.question_number]}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-700 rounded border border-blue-200`,children:qLe[e.type]||e.type}),(0,F.jsx)(`span`,{className:`text-xs px-2 py-1 rounded border font-medium ${a}`,children:o})]}),(0,F.jsxs)(`span`,{className:`text-xs font-semibold text-gray-700`,children:[e.result.toFixed(1),` / `,e.max_points]})]}),(0,F.jsx)(`p`,{className:`text-xs text-gray-700 leading-relaxed`,children:e.explanation})]},t)})})]}):e.explanation_to_evaluation?(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Evaluation Explanation`}),(0,F.jsx)(`div`,{className:`bg-gray-50 p-4 rounded border text-sm max-h-[240px] overflow-y-auto whitespace-pre-wrap`,children:e.explanation_to_evaluation})]}):null,(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h4`,{className:`font-semibold text-sm text-muted-foreground mb-2`,children:`Submitted Assessment`}),(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:f,children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),`View Submitted Answers`]})]}),(0,F.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,F.jsx)(B,{variant:`outline`,onClick:()=>n(!1),children:`Close`})})]})]})}),(0,F.jsx)(aE,{open:o,onOpenChange:s,children:(0,F.jsxs)(cE,{className:`sm:max-w-[900px] max-h-[80vh] overflow-auto`,children:[(0,F.jsx)(lE,{children:(0,F.jsx)(dE,{children:`Submitted Assessment`})}),u?(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading snapshot...`}):c?(0,F.jsx)(`div`,{className:`border rounded p-2`,children:(0,F.jsx)(`iframe`,{title:`submission-snapshot`,srcDoc:JLe(c),className:`w-full h-[70vh] border-0`})}):(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No snapshot available.`})]})})]})},YLe=e=>{if(!e)return`?`;let t=e.split(` `);return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():t[0][0].toUpperCase()},XLe=()=>{let{memberId:e}=Ye(),t=We(),n=$7(),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),{data:s,isLoading:c}=sr({queryKey:[`riipen-experience-member`,e],enabled:!!e,queryFn:async()=>{let{data:t,error:n}=await R.from(`riipen_experience_members`).select(`*, profiles(id, full_name, avatar_url, location, skills), riipen_experiences(id, name)`).eq(`id`,e).maybeSingle();return n?(console.error(`Error fetching member:`,n),null):t}}),{data:l,isLoading:u}=sr({queryKey:[`riipen-learner-applications`,s?.experience_id,s?.profile_id],enabled:!!s?.experience_id&&!!s?.profile_id,queryFn:async()=>{let{data:e,error:t}=await R.from(`riipen_matches`).select(`id, project_id, riipen_projects(*), assessment_links(link_code)`).eq(`experience_id`,s.experience_id);if(t)return console.error(`Error fetching matches:`,t),[];let n=new Map;for(let t of e||[]){let e=t.assessment_links?.link_code;e&&n.set(e,{matchId:t.id,project:t.riipen_projects})}if(n.size===0)return[];let{data:r,error:i}=await R.from(`assessment_submissions`).select(`id, link_code, submitted_at, evaluated_score, total_score, explanation_to_evaluation, questions_data`).eq(`user_id`,s.profile_id).in(`link_code`,Array.from(n.keys())).order(`submitted_at`,{ascending:!1});return i?(console.error(`Error fetching submissions:`,i),[]):(r||[]).map(e=>{let t=n.get(e.link_code);return{id:e.id,link_code:e.link_code,submitted_at:e.submitted_at,evaluated_score:e.evaluated_score,total_score:e.total_score,explanation_to_evaluation:e.explanation_to_evaluation,questions_data:e.questions_data,project:t?.project||null,match_id:t?.matchId||``}})}}),d=c||u,f=e=>{i({id:e.id,link_code:e.link_code,evaluated_score:e.evaluated_score,total_score:e.total_score,explanation_to_evaluation:e.explanation_to_evaluation,questions_data:e.questions_data,submitted_at:e.submitted_at,project_name:e.project?.name||void 0}),o(!0)};if(d)return(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(F_,{className:`h-10 w-10 animate-spin text-akito-teal`})});if(!s)return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(o9,{items:[{label:`Riipen Experiences`,href:n},{label:`Learner not found`}]}),(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`py-8 text-center text-muted-foreground`,children:`Learner not found or you do not have access.`})})]});let p=s.riipen_experiences,m=s.profiles?.full_name||`Learner`;return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(o9,{items:[{label:`Riipen Experiences`,href:n},...p?[{label:p.name,href:`${n}/experience/${p.id}`},{label:`Learners`,href:`${n}/experience/${p.id}/learners`}]:[],{label:m}]}),(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`pt-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsxs)(JF,{className:`h-16 w-16`,children:[(0,F.jsx)(YF,{src:s.profiles?.avatar_url||void 0}),(0,F.jsx)(XF,{className:`text-lg`,children:YLe(s.profiles?.full_name??null)})]}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,F.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:s.profiles?.full_name||(0,F.jsx)(`span`,{className:`text-muted-foreground italic`,children:`No profile linked`})}),s.profiles?.location&&(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground flex items-center gap-1 mt-1`,children:[(0,F.jsx)(R_,{className:`h-3.5 w-3.5`}),s.profiles.location]}),(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-2`,children:[`Riipen ID: `,s.riipen_user_id]})]}),(0,F.jsxs)(mM,{variant:`secondary`,children:[l?.length||0,` application`,l?.length===1?``:`s`]})]}),s.profiles?.skills&&s.profiles.skills.length>0&&(0,F.jsxs)(`div`,{className:`mt-6`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-semibold text-foreground mb-2`,children:`Skills`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:s.profiles.skills.map(e=>(0,F.jsx)(mM,{variant:`outline`,className:`font-normal`,children:e},e))})]})]})}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-2`,children:(0,F.jsxs)(ju,{className:`text-lg flex items-center gap-2`,children:[(0,F.jsx)(T_,{className:`h-5 w-5`}),`Applications (`,l?.length||0,`)`]})}),(0,F.jsx)(H,{className:`p-0`,children:l&&l.length>0?(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Project`}),(0,F.jsx)(J,{children:`Submitted`}),(0,F.jsx)(J,{children:`Score`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:l.map(e=>(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{className:`font-medium`,children:e.project?.name||(0,F.jsx)(`span`,{className:`text-muted-foreground italic`,children:`Unknown project`})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground flex items-center gap-1`,children:[(0,F.jsx)(Qne,{className:`h-3.5 w-3.5`}),e.submitted_at?new Date(e.submitted_at).toLocaleDateString():`-`]})}),(0,F.jsx)(Y,{className:`whitespace-nowrap`,children:e.evaluated_score!==null&&e.total_score!==null?(0,F.jsxs)(mM,{variant:e.evaluated_score/e.total_score>=.7?`default`:`secondary`,children:[e.evaluated_score.toFixed(1),` / `,e.total_score.toFixed(1)]}):(0,F.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Pending`})}),(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>f(e),children:[(0,F.jsx)(A_,{className:`h-4 w-4 mr-1`}),`View Application`]}
533),e.match_id&&(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>t(`${n}/matches/${e.match_id}`),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),`View Project`]})]})})]},e.id))})]}):(0,F.jsxs)(`div`,{className:`py-12 text-center text-muted-foreground`,children:[(0,F.jsx)(T_,{className:`h-12 w-12 mx-auto mb-4 opacity-50`}),(0,F.jsx)(`p`,{children:`No applications submitted yet.`})]})})]}),(0,F.jsx)(s9,{applicant:r,open:a,onOpenChange:o,contextLabel:`Project`})]})};function c9(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZLe(e){if(Array.isArray(e))return e}function QLe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $Le(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 534In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eRe(e,t){return ZLe(e)||QLe(e,t)||tRe(e,t)||$Le()}function tRe(e,t){if(e){if(typeof e==`string`)return c9(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c9(e,t):void 0}}var l9=Object.entries,u9=Object.setPrototypeOf,nRe=Object.isFrozen,rRe=Object.getPrototypeOf,iRe=Object.getOwnPropertyDescriptor,d9=Object.freeze,f9=Object.seal,p9=Object.create,m9=typeof Reflect<`u`&&Reflect,h9=m9.apply,g9=m9.construct;d9||=function(e){return e},f9||=function(e){return e},h9||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},g9||=function(e){return new e(...[...arguments].slice(1))};var _9=M9(Array.prototype.forEach),aRe=M9(Array.prototype.lastIndexOf),v9=M9(Array.prototype.pop),y9=M9(Array.prototype.push),oRe=M9(Array.prototype.splice),b9=Array.isArray,x9=M9(String.prototype.toLowerCase),S9=M9(String.prototype.toString),C9=M9(String.prototype.match),w9=M9(String.prototype.replace),T9=M9(String.prototype.indexOf),sRe=M9(String.prototype.trim),cRe=M9(Number.prototype.toString),lRe=M9(Boolean.prototype.toString),E9=typeof BigInt>`u`?null:M9(BigInt.prototype.toString),D9=typeof Symbol>`u`?null:M9(Symbol.prototype.toString),O9=M9(Object.prototype.hasOwnProperty),k9=M9(Object.prototype.toString),A9=M9(RegExp.prototype.test),j9=uRe(TypeError);function M9(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return h9(e,t,n)}}function uRe(e){return function(){return g9(e,[...arguments])}}function N9(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x9;if(u9&&u9(e,null),!b9(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(nRe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function dRe(e){for(let t=0;t<e.length;t++)O9(e,t)||(e[t]=null);return e}function P9(e){let t=p9(null);for(let r of l9(e)){var n=eRe(r,2);let i=n[0],a=n[1];O9(e,i)&&(b9(a)?t[i]=dRe(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=P9(a):t[i]=a)}return t}function fRe(e){switch(typeof e){case`string`:return e;case`number`:return cRe(e);case`boolean`:return lRe(e);case`bigint`:return E9?E9(e):`0`;case`symbol`:return D9?D9(e):`Symbol()`;case`undefined`:return k9(e);case`function`:case`object`:{if(e===null)return k9(e);let t=e,n=F9(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:k9(e)}return k9(e)}default:return k9(e)}}function F9(e,t){for(;e!==null;){let n=iRe(e,t);if(n){if(n.get)return M9(n.get);if(typeof n.value==`function`)return M9(n.value)}e=rRe(e)}function n(){return null}return n}function pRe(e){try{return A9(e,``),!0}catch{return!1}}var I9=d9(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.f
534igcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),L9=d9(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),R9=d9([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),mRe=d9([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),z9=d9(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),hRe=d9([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),B9=d9([`#text`]),V9=d9(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),H9=d9(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),U9=d9(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),W9=d9([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),gRe=f9(/{{[\w\W]*|^[\w\W]*}}/g),_Re=f9(/<%[\w\W]*|^[\w\W]*%>/g),vRe=f9(/\${[\w\W]*/g),yRe=f9(/^data-[\-\w.\u00B7-\uFFFF]+$/),bRe=f9(/^aria-[\-\w]+$/),G9=f9(/^(?:(?:(?
vendor: 8,670 bytes, line 534
534:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xRe=f9(/^(?:\w+script|data):/i),SRe=f9(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),CRe=f9(/^html$/i),wRe=f9(/^[a-z][.\w]*(-[.\w]+)+$/i),K9=f9(/<[/\w!]/g),q9=f9(/<[/\w]/g),TRe=f9(/<\/no(script|embed|frames)/i),ERe=f9(/\/>/i),J9={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},DRe=function(){return typeof window>`u`?null:window},ORe=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Y9=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},X9=function(e,t,n,r){return O9(e,t)&&b9(e[t])?N9(r.base?P9(r.base):{},e[t],r.transform):n};function Z9(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DRe(),t=e=>Z9(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==J9.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=F9(d,`cloneNode`),p=F9(d,`remove`),m=F9(d,`nextSibling`),h=F9(d,`childNodes`),g=F9(d,`parentNode`),_=F9(d,`shadowRoot`),v=F9(d,`attributes`),y=o&&o.prototype?F9(o.prototype,`nodeType`):null,b=o&&o.prototype?F9(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw j9(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=ORe(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,ee=A.getElementsByTagName,te=r.importNode,ne=Y9();t.isSupported=typeof l9==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let re=gRe,ie=_Re,ae=vRe,oe=yRe,se=bRe,ce=xRe,le=SRe,ue=wRe,de=G9,fe=null,pe=N9({},[...I9,...L9,...R9,...z9,...B9]),me=null,he=N9({},[...V9,...H9,...U9,...W9]),ge=Object.seal(p9(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,ve=null,ye=Object.seal(p9(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),be=!0,xe=!0,Se=!1,Ce=!0,we=!1,Te=!0,Ee=!1,De=!1,Oe=null,ke=null,Ae=!1,je=!1,Me=!1,Ne=!1,Pe=!0,Fe=!1,Ie=`user-content-`,Le=!0,Re=!1,ze={},Be=null,Ve=N9({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),He=null,Ue=N9({},[`audio`,`video`,`img`,`source`,`image`,`track`]),We=null,Ge=N9({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ke=`http://www.w3.org/1998/Math/MathML`,qe=`http://www.w3.org/2000/svg`,Je=`http://www.w3.org/1999/xhtml`,Ye=Je,Xe=!1,Ze=null,Qe=N9({},[Ke,qe,Je],S9),$e=d9([`mi`,`mo`,`mn`,`ms`,`mtext`]),et=N9({},$e),tt=d9([`annotation-xml`]),nt=N9({},tt),rt=N9({},[`title`,`style`,`font`,`a`,`script`]),it=null,at=[`application/xhtml+xml`,`text/html`],ot=null,st=null,ct=n.createElement(`form`),lt=function(e){return e instanceof RegExp||e instanceof Function},ut=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(st&&st===e)return;(!e||typeof e!=`object`)&&(e={}),e=P9(e),it=at.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ot=it===`application/xhtml+xml`?S9:x9,fe=X9(e,`ALLOWED_TAGS`,pe,{transform:ot}),me=X9(e,`ALLOWED_ATTR`,he,{transform:ot}),Ze=X9(e,`ALLOWED_NAMESPACES`,Qe,{transform:S9}),We=X9(e,`ADD_URI_SAFE_ATTR`,Ge,{transform:ot,base:Ge}),He=X9(e,`ADD_DATA_URI_TAGS`,Ue,{transform:ot,base:Ue}),Be=X9(e,`FORBID_CONTENTS`,Ve,{transform:ot}),_e=X9(e,`FORBID_TAGS`,P9({}),{transform:ot}),ve=X9(e,`FORBID_ATTR`,P9({}),{transform:ot}),ze=O9(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?P9(e.USE_PROFILES):e.USE_PROFILES:!1,be=e.ALLOW_ARIA_ATTR!==!1,xe=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=e.SAFE_FOR_TEMPLATES||!1,Te=e.SAFE_FOR_XML!==!1,Ee=e.WHOLE_DOCUMENT||!1,je=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Ne=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Pe=e.SANITIZE_DOM!==!1,Fe=e.SANITIZE_NAMED_PROPS||!1,Le=e.KEEP_CONTENT!==!1,Re=e.IN_PLACE||!1,de=pRe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:G9,Ye=typeof e.NAMESPACE==`string`?e.NAMESPACE:Je,et=O9(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?P9(e.MATHML_TEXT_INTEGRATION_POINTS):N9({},$e),nt=O9(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?P9(e.HTML_INTEGRATION_POINTS):N9({},tt);let t=O9(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?P9(e.CUSTOM_ELEMENT_HANDLING):p9(null);if(ge=p9(null),O9(t,`tagNameCheck`)&<(t.tagNameCheck)&&(ge.tagNameCheck=t.tagNameCheck),O9(t,`attributeNameCheck`)&<(t.attributeNameCheck)&&(ge.attributeNameCheck=t.attributeNameCheck),O9(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ge.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),f9(ge),we&&(xe=!1),Me&&(je=!0),ze&&(fe=N9({},B9),me=p9(null),ze.html===!0&&(N9(fe,I9),N9(me,V9)),ze.svg===!0&&(N9(fe,L9),N9(me,H9),N9(me,W9)),ze.svgFilters===!0&&(N9(fe,R9),N9(me,H9),N9(me,W9)),ze.mathMl===!0&&(N9(fe,z9),N9(me,U9),N9(me,W9))),ye.tagCheck=null,ye.attributeCheck=null,O9(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ye.tagCheck=e.ADD_TAGS:b9(e.ADD_TAGS)&&(fe===pe&&(fe=P9(fe)),N9(fe,e.ADD_TAGS,ot))),O9(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ye.attributeCheck=e.ADD_ATTR:b9(e.ADD_ATTR)&&(me===he&&(me=P9(me)),N9(me,e.ADD_ATTR,ot))),O9(e,`ADD_URI_SAFE_ATTR`)&&b9(e.ADD_URI_SAFE_ATTR)&&N9(We,e.ADD_URI_SAFE_ATTR,ot),O9(e,`FORBID_CONTENTS`)&&b9(e.FORBID_CONTENTS)&&(Be===Ve&&(Be=P9(Be)),N9(Be,e.FORBID_CONTENTS,ot)),O9(e,`ADD_FORBID_CONTENTS`)&&b9(e.ADD_FORBID_CONTENTS)&&(Be===Ve&&(Be=P9(Be)),N9(Be,e.ADD_FORBID_CONTENTS,ot)),Le&&(fe[`#text`]=!0),Ee&&N9(fe,[`html`,`head`,`body`]),fe.table&&(N9(fe,[`tbody`]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw j9(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw j9(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));d9&&d9(e),st=e},dt=N9({},[...L9,...R9,...mRe]),ft=N9({},[...z9,...hRe]),pt=function(e,t,n){return t.namespaceURI===Je?e===`svg`:t.namespaceURI===Ke?e===`svg`&&(n===`annotation-xml`||et[n]):!!dt[e]},mt=function(e,t,n){return t.namespaceURI===Je?e===`math`:t.namespaceURI===qe?e===`math`&&nt[n]:!!ft[e]},ht=function(e,t,n){return t.namespaceURI===qe&&!nt[n]||t.namespaceURI===Ke&&!et[n]?!1:!ft[e]&&(rt[e]||!dt[e])},P=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ye,tagName:`template`});let n=x9(e.tagName),r=x9(t.tagName);return Ze[e.namespaceURI]?e.namespaceURI===qe?pt(n,t,r):e.namespaceURI===Ke?mt(n,t,r):e.namespaceURI===Je?ht(n,t,r):!!(it===`application/xhtml+xml`&&Ze[e.namespaceURI]):!1},gt=function(e){y9(t.removed,{element:e});try{g(e).removeChild(e)}
vendor: 6,235 bytes, line 534
534catch{if(p(e),!g(e))throw j9(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_t=function(e){bt(e);let t=h(e);if(t){let e=[];_9(t,t=>{y9(e,t)}),_9(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},vt=function(e,n){try{y9(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{y9(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(je||Me)try{gt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},yt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||me[ot(i)]))try{e.removeAttribute(i)}catch{}}},bt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===J9.element&&yt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e){if(!Te)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===J9.processingInstruction||n===J9.comment&&A9(q9,e.data)){try{p(e)}catch{}continue}if(n===J9.element){let t=e,n=ot(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},St=function(e){let t=null,r=null;if(Ae)e=`<remove></remove>`+e;else{let t=C9(e,/^[\r\n\t ]+/);r=t&&t[0]}it===`application/xhtml+xml`&&Ye===Je&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ye===Je)try{t=new l().parseFromString(i,it)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ye,`template`,null);try{t.documentElement.innerHTML=Xe?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ye===Je?ee.call(t,Ee?`html`:`body`)[0]:Ee?t.documentElement:a},Ct=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wt=function(e){return e=w9(e,re,` `),e=w9(e,ie,` `),e=w9(e,ae,` `),e},Tt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=wt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&_9(r,e=>{Dt(e.content)&&Tt(e.content)})},Et=function(e){let t=b?b(e):null;return typeof t!=`string`||ot(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Dt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===J9.documentFragment}catch{return!1}},Ot=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function kt(e,n,r){e.length!==0&&_9(e,e=>{e.call(t,n,r,st)})}let At=function(e,t){return!!(Te&&e.hasChildNodes()&&!Ot(e.firstElementChild)&&A9(K9,e.textContent)&&A9(K9,e.innerHTML)||Te&&e.namespaceURI===Je&&t===`style`&&Ot(e.firstElementChild)||e.nodeType===J9.processingInstruction||Te&&e.nodeType===J9.comment&&A9(q9,e.data))},jt=function(e,t){if(!_e[t]&&Ft(t)&&(ge.tagNameCheck instanceof RegExp&&A9(ge.tagNameCheck,t)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(t)))return!1;if(Le&&!Be[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Re?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return gt(e),!0},Mt=function(e,n){if(kt(ne.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(Et(e))return gt(e),!0;let r=ot(b?b(e):e.nodeName);if(kt(ne.uponSanitizeElement,e,{tagName:r,allowedTags:fe}),e!==n&&g(e)===null)return!0;if(At(e,r))return gt(e),!0;if(_e[r]||!(ye.tagCheck instanceof Function&&ye.tagCheck(r))&&!fe[r]){let t=jt(e,r);return t===!1&&kt(ne.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===J9.element&&!P(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&A9(TRe,e.innerHTML))return gt(e),!0;if(we&&e.nodeType===J9.text){let n=wt(e.textContent);e.textContent!==n&&(y9(t.removed,{element:e.cloneNode()}),e.textContent=n)}return kt(ne.afterSanitizeElements,e,null),!1},Nt=function(e,t,r){if(ve[t]||Te&&t===`patchsrc`||Te&&t===`for`&&e!==`label`&&e!==`output`||Pe&&(t===`id`||t===`name`)&&(r in n||r in ct))return!1;let i=me[t]||ye.attributeCheck instanceof Function&&ye.attributeCheck(t,e);if(!(xe&&A9(oe,t))&&!(be&&A9(se,t))){if(!i){if(!(Ft(e)&&(ge.tagNameCheck instanceof RegExp&&A9(ge.tagNameCheck,e)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(e))&&(ge.attributeNameCheck instanceof RegExp&&A9(ge.attributeNameCheck,t)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(t,e))||t===`is`&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&A9(ge.tagNameCheck,r)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(r))))return!1}else if(!We[t]&&!A9(de,w9(r,le,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&T9(r,`data:`)===0&&He[e])&&!(Se&&!A9(ce,w9(r,le,``)))&&r)return!1}return!0},Pt=N9({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ft=function(e){return!Pt[x9(e)]&&A9(ue,e)},It=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},Lt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Et(e)?gt(e):v9(t.removed)}catch{vt(n,e)}},Rt=function(e){kt(ne.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Et(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:me,forceKeepAttr:void 0},r=t.length,i=ot(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=ot(o),u=c,d=o===`value`?u:sRe(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,kt(ne.uponSanitizeAttribute,e,n),d=n.attrValue,Fe&&(l===`id`||l===`
534name`)&&T9(d,Ie)!==0&&(vt(o,e),d=Ie+d),Te&&A9(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){vt(o,e);continue}if(l===`attributename`&&C9(d,`href`)){vt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){vt(o,e);continue}if(!Ce&&A9(ERe,d)){vt(o,e);continue}if(we&&(d=wt(d)),!Nt(i,l,d)){vt(o,e);continue}d=It(i,l,s,d),d!==u&&Lt(e,o,s,d)}}kt(ne.afterSanitizeAttributes,e,null)},zt=function(e){let t=null,n=Ct(e);for(kt(ne.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(kt(ne.uponSanitizeShadowNode,t,null),Mt(t,e),Rt(t),Dt(t.content)&&zt(t.content),(y?y(t):t.nodeType)===J9.element){let e=_(t);Dt(e)&&(Bt(e),zt(e))}kt(ne.afterSanitizeShadowDOM,e,null)},Bt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){zt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===J9.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&ot(e)===`template`){let e=n.content;Dt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Dt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Xe=!e,Xe&&(e=`<!-->`),typeof e!=`string`&&!Ot(e)&&(e=fRe(e),typeof e!=`string`))throw j9(`dirty is not a string, aborting`);if(!t.isSupported)return e;De?(fe=Oe,me=ke):ut(n),(ne.uponSanitizeElement.length>0||ne.uponSanitizeAttribute.length>0)&&(fe=P9(fe)),ne.uponSanitizeAttribute.length>0&&(me=P9(me)),t.removed=[];let c=Re&&typeof e!=`string`&&Ot(e);if(c){xt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=ot(t);if(!fe[n]||_e[n])throw _t(e),j9(`root node is forbidden and cannot be sanitized in-place`)}if(Et(e))throw _t(e),j9(`root node is clobbered and cannot be sanitized in-place`);try{Bt(e)}catch(t){throw _t(e),t}}else if(Ot(e))i=St(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===J9.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Bt(a);else{if(!je&&!we&&!Ee&&e.indexOf(`<`)===-1)return x&&Ne?D(e):e;if(i=St(e),!i)return je?null:Ne?S:``}i&&Ae&>(i.firstChild);let l=c?e:i,u=Ct(l);try{for(;o=u.nextNode();)Mt(o,l),Rt(o),Dt(o.content)&&zt(o.content)}catch(n){throw c&&(_t(e),_9(t.removed,e=>{e.element&&bt(e.element)})),n}if(c)return _9(t.removed,e=>{e.element&&bt(e.element)}),we&&Tt(e),e;if(je){if(we&&Tt(i),Me)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(me.shadowroot||me.shadowrootmode)&&(s=te.call(r,s,!0)),s}let d=Ee?i.outerHTML:i.innerHTML;return Ee&&fe[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&A9(CRe,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`> 535`+d),we&&(d=wt(d)),x&&Ne?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ut(e),De=!0,Oe=fe,ke=me},t.clearConfig=function(){st=null,De=!1,Oe=null,ke=null,x=C,S=``},t.isValidAttribute=function(e,t,n){st||ut({});let r=ot(e),i=ot(t);return Nt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&O9(ne,e)&&y9(ne[e],t)},t.removeHook=function(e,t){if(O9(ne,e)){if(t!==void 0){let n=aRe(ne[e],t);return n===-1?void 0:oRe(ne[e],n,1)[0]}return v9(ne[e])}},t.removeHooks=function(e){O9(ne,e)&&(ne[e]=[])},t.removeAllHooks=function(){ne=Y9()},t}var kRe=Z9(),ARe={USE_PROFILES:{html:!0}};function Q9({html:e,className:t}){return(0,F.jsx)(`div`,{className:t,dangerouslySetInnerHTML:{__html:(0,y.useMemo)(()=>kRe.sanitize(e,ARe),[e])}})}function jRe(e,t=!0){return sr({queryKey:[`riipen-project-applicants`,e],enabled:t&&!!e,queryFn:async()=>{let{data:t,error:n}=await R.from(`assessment_submissions`).select(` 536 id, 537 user_id, 538 link_code, 539 evaluated_score, 540 total_score, 541 explanation_to_evaluation, 542 questions_data, 543 created_at, 544 profiles!inner(id, full_name) 545 `).eq(`link_code`,e).order(`created_at`,{ascending:!1});if(n)return console.error(`Error fetching applicants:`,n),[];let r=new Map;if((t||[]).length>0)try{let{data:e}=await R.rpc(`get_all_user_emails`);
545Array.isArray(e)&&e.forEach(e=>{e.user_id&&e.user_email&&r.set(e.user_id,e.user_email)})}catch(e){console.warn(`Could not fetch user emails:`,e)}return(t||[]).map(e=>({id:e.id,user_id:e.user_id,link_code:e.link_code,full_name:e.profiles?.full_name||`Unknown`,email:r.get(e.user_id)||null,evaluated_score:e.evaluated_score,total_score:e.total_score,explanation_to_evaluation:e.explanation_to_evaluation,questions_data:e.questions_data,created_at:e.created_at}))}})}function MRe(e,t){if(e===null||t===null||t===0)return`text-gray-500`;let n=e/t*100;return n>=75?`text-green-600`:n>=50?`text-yellow-600`:`text-red-600`}function NRe(e){return{id:e.id,user_id:e.user_id,link_code:e.link_code,full_name:e.full_name,email:e.email,evaluated_score:e.evaluated_score,total_score:e.total_score,explanation_to_evaluation:e.explanation_to_evaluation,questions_data:e.questions_data,created_at:e.created_at}}var PRe=({linkCode:e,projectName:t,variant:n=`card`})=>{let{data:r,isLoading:i}=jRe(e),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),l=e=>{o(NRe(e)),c(!0)},u=()=>(0,F.jsxs)(XG,{children:[(0,F.jsx)(ZG,{children:(0,F.jsxs)($G,{children:[(0,F.jsx)(J,{children:`Applicant`}),(0,F.jsx)(J,{children:`Score`}),(0,F.jsx)(J,{children:`Submitted`}),(0,F.jsx)(J,{children:`Actions`})]})}),(0,F.jsx)(QG,{children:r.map(e=>{let t=e.evaluated_score!==null&&e.total_score?Math.round(e.evaluated_score/e.total_score*100):null;return(0,F.jsxs)($G,{children:[(0,F.jsx)(Y,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.full_name}),e.email&&(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.email})]})}),(0,F.jsx)(Y,{children:t===null?(0,F.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Not graded`}):(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`font-medium ${MRe(e.evaluated_score,e.total_score)}`,children:[t,`%`]}),(0,F.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`(`,e.evaluated_score,`/`,e.total_score,`)`]})]})}),(0,F.jsx)(Y,{className:`text-sm text-muted-foreground`,children:hN(new Date(e.created_at),`MMM d, yyyy h:mm a`)}),(0,F.jsx)(Y,{children:(0,F.jsxs)(B,{variant:`outline`,size:`sm`,onClick:()=>l(e),children:[(0,F.jsx)(k_,{className:`h-4 w-4 mr-1`}),`View Application`]})})]},e.id)})})]}),d=!!r&&r.length>0,f;return f=i?n===`card`?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-akito-teal`})}):(0,F.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,F.jsx)(F_,{className:`h-8 w-8 animate-spin text-akito-teal`})}):d?n===`card`?(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`p-0`,children:u()})}):u():n===`card`?(0,F.jsx)(V,{children:(0,F.jsxs)(H,{className:`flex flex-col items-center justify-center py-12`,children:[(0,F.jsx)(Z_,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`No applicants yet.`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Applicants will appear here after they submit their assessments.`})]})}):(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8`,children:[(0,F.jsx)(Z_,{className:`h-10 w-10 text-muted-foreground mb-3`}),(0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No applicants yet.`}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Applicants will appear here after they submit their assessments.`})]}),(0,F.jsxs)(F.Fragment,{children:[f,(0,F.jsx)(s9,{applicant:a,open:s,onOpenChange:c,contextLabel:`Project`,contextValue:t})]})};function FRe(e){return`https://akito.riipen.com/matches/${e}`}var IRe=()=>{let{matchId:e}=Ye(),t=We(),{profile:n,loading:r}=_l(),i=$7(),a=n?.user_type===`admin`,{data:o,isLoading:s,error:c}=sr({queryKey:[`riipen-match-detail`,e,n?.id,a],enabled:!!e&&!!n?.id,queryFn:async()=>{let{data:t,error:r}=await R.from(`riipen_matches`).select(` 546 id, 547 riipen_id, 548 riipen_projects (*, riipen_organizations(*, organizations(name))), 549 riipen_experiences (*), 550 assessment_links (id, link_code, is_active) 551 `).eq(`id`,e).maybeSingle();if(r)throw r;if(!t)return null;let i=t.assessment_links?.link_code,o=!1,s=0;
551if(i)if(a){let{count:e}=await R.from(`assessment_submissions`).select(`id`,{count:`exact`,head:!0}).eq(`link_code`,i);s=e||0}else{let{count:e}=await R.from(`assessment_submissions`).select(`id`,{count:`exact`,head:!0}).eq(`link_code`,i).eq(`user_id`,n.id);o=(e||0)>0}return{...t,hasSubmission:o,submissionCount:s}}});if((0,y.useEffect)(()=>{!r&&!n&&t(`/auth`)},[r,n,t]),r||!n)return(0,F.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,F.jsx)(F_,{className:`h-10 w-10 animate-spin text-akito-teal`})});let l=o?.riipen_projects,u=o?.riipen_experiences,d=o?.assessment_links;return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(o9,{items:u?.id?[{label:`Riipen Experiences`,href:i},{label:u.name,href:`${i}/experience/${u.id}`},{label:`Projects`,href:`${i}/experience/${u.id}/projects`},{label:l?.name||`Project`}]:[{label:`Riipen Experiences`,href:i},{label:l?.name||`Project`}]}),s&&(0,F.jsx)(`div`,{className:`flex justify-center py-24`,children:(0,F.jsx)(F_,{className:`h-10 w-10 animate-spin text-akito-teal`})}),c&&(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`py-8 text-center text-destructive`,children:`Could not load this project. You may not have access.`})}),!s&&!c&&!o&&(0,F.jsx)(V,{children:(0,F.jsx)(H,{className:`py-8 text-center text-muted-foreground`,children:`Project not found or you do not have access.`})}),!s&&l&&u&&o&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,F.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:l.name}),l.riipen_organizations?.organizations?.name&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l.riipen_organizations.organizations.name})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 items-start`,children:[(0,F.jsx)(`div`,{className:`flex flex-col items-start gap-2`,children:a?(0,F.jsxs)(mM,{variant:o.submissionCount?`default`:`secondary`,children:[o.submissionCount||0,` applicant`,o.submissionCount===1?``:`s`]}):o.hasSubmission?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-emerald-300/80 bg-emerald-50 px-3 py-1.5 text-sm font-semibold text-emerald-900 shadow-sm ring-1 ring-emerald-500/15`,role:`status`,children:[(0,F.jsx)(b_,{className:`h-4 w-4 shrink-0 text-emerald-600`,"aria-hidden":!0}),`Applied`]}):d?.is_active?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-amber-200 bg-amber-50/90 px-3 py-1.5 text-sm font-medium text-amber-900`,role:`status`,children:[(0,F.jsx)(E_,{className:`h-4 w-4 shrink-0 text-amber-600`,"aria-hidden":!0}),`Not Applied`]}):(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`-`})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2 justify-start`,children:[o.riipen_id&&(0,F.jsx)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,F.jsxs)(`a`,{href:FRe(o.riipen_id),target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(O_,{className:`h-4 w-4 mr-1`}),`View on Riipen`]})}),d?.link_code&&d.is_active&&(0,F.jsxs)(B,{size:`sm`,variant:!a&&o.hasSubmission?`outline`:`default`,className:a||o.hasSubmission?``:`bg-akito-gradient hover:opacity-90`,onClick:()=>t(`/assessment/${d.link_code}`),children:[(0,F.jsx)(T_,{className:`h-4 w-4 mr-1`}),a?`Open assessment`:o.hasSubmission?`View Assessment`:`Apply Now`]})]})]})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-2`,children:(0,F.jsx)(ju,{className:`text-lg`,children:`Details`})}),(0,F.jsxs)(H,{className:`space-y-8 pt-2`,children:[l.category_list&&l.category_list.length>0&&(0,F.jsxs)(`section`,{"aria-labelledby":`riipen-project-categories`,children:[(0,F.jsx)(`h3`,{id:`riipen-project-categories`,className:`text-sm font-semibold text-foreground mb-3`,children:`Categories`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:l.category_list.map((e,t)=>(0,F.jsx)(mM,{variant:`secondary`,className:`font-normal`,children:e},`cat-${t}-${e}`))})]}),l.skill_list&&l.skill_list.length>0&&(0,F.jsxs)(`section`,{"aria-labelledby":`riipen-project-skills`,children:[(0,F.jsx)(`h3`,{id:`riipen-project-skills`,className:`text-sm font-semibold text-foreground mb-3`,children:`Skills`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:l.skill_list.map((e,t)=>(0,F.jsx)(mM,{variant:`outline`,className:`font-normal`,children:e},`skill-${t}-${e}`))})]}),l.details?(0,F.jsxs)(`section`,{"aria-labelledby":`riipen-project-details`,children:[(0,F.jsx)(`h3`,{id:`riipen-project-details`,className:`text-sm font-semibold text-foreground mb-3`,children:`Details`}),(0,F.jsx)(Q9,{html:l.details,className:`text-sm text-muted-foreground leading-relaxed [&_a]:text-primary [&_a]:underline [&_p]:mb-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 last:[&_p]:mb-0`})]}):null,l.deliverables?(0,F.jsxs)(`section`,{"aria-labelledby":`riipen-project-deliverables`,children:[(0,F.jsx)(`h3`,{id:`riipen-project-deliverables`,className:`text-sm font-semibold text-foreground mb-3`,children:`Deliverables`}),(0,F.jsx)(Q9,{html:l.deliverables,className:`text-sm text-muted-foreground leading-relaxed [&_a]:text-primary [&_a]:underline [&_p]:mb-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 last:[&_p]:mb-0`})]}):null,!l.category_list?.length&&!l.skill_list?.length&&!l.details&&!l.deliverables&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No scope details synced yet.`})]})]}),(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-2`,children:(0,F.jsx)(ju,{className:`text-lg`,children:`Experience`})}),(0,F.jsxs)(H,{className:`space-y-2 pt-2`,children:[(0,F.jsx)(`p`,{className:`font-medium`,children:u.name}),u.details?(0,F.jsx)(Q9,{html:u.details,className:`text-sm text-muted-foreground leading-relaxed [&_a]:text-primary [&_a]:underline [&_p]:mb-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 last:[&_p]:mb-0`}):null]})]}),a&&d?.link_code&&(0,F.jsxs)(V,{children:[(0,F.jsx)(Au,{className:`pb-2`,children:(0,F.jsxs)(ju,{className:`text-lg flex items-center gap-2`,children:[(0,F.jsx)(Z_,{className:`h-5 w-5`}),`Applicants (`,o.submissionCount,`)`]})}),(0,F.jsx)(H,{className:`pt-2`,children:(0,F.jsx)(PRe,{linkCode:d.link_code,projectName:l?.name||`Project`,variant:`inline`})})]})]})]})},LRe=e=>(0,F.jsx)(FLe,{children:(0,F.jsx)(ILe,{basePath:e})});function $9(e){return(0,F.jsxs)(P,{path:`riipen`,element:LRe(e),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(VLe,{})}),(0,F.jsxs)(P,{path:`experience/:experienceId`,element:(0,F.jsx)(BLe,{}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`projects`,replace:!0})}),(0,F.jsx)(P,{path:`projects`,element:(0,F.jsx)(ULe,{})}),(0,F.jsx)(P,{path:`learners`,element:(0,F.jsx)(KLe,{})})]}),(0,F.jsx)(P,{path:`learners/:memberId`,element:(0,F.jsx)(XLe,{})}),(0,F.jsx)(P,{path:`matches/:matchId`,element:(0,F.jsx)(IRe,{})})]})}function RRe(){return(0,y.useEffect)(()=>{document.body.classList.add(`bg-background`)},[]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(_t,{children:[(0,F.jsx)(P,{path:`/auth`,element:(0,F.jsx)(Ore,{})}),(0,F.jsx)(P,{path:`/assessment/:linkCode`,element:(0,F.jsx)(fye,{})}),(0,F.jsx)(P,{path:`/assessment-success`,element:(0,F.jsx)(pye,{})}),(0,F.jsx)(P,{path:`/assessment-already-submitted`,element:(0,F.jsx)(mye,{})}),(0,F.jsx)(P,{path:`/email-verification`,element:(0,F.jsx)(hye,{})}),(0,F.jsx)(P,{path:`/riipen`,element:(0,F.jsx)(bye,{})}),(0,F.jsx)(P,{path:`/dev/riipen-webhook-tester`,element:(0,F.jsx)(Dye,{})}),(0,F.jsx)(P,{path:`/`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(aye,{})})}),(0,F.jsx)(P,{path:`/profile-completion`,element:(0,F.jsx)(mt,{to:`/settings/profile`,replace:!0})}),(0,F.jsxs)(P,{path:`/settings`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(Gye,{})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`profile`,replace:!0})}),(0,F.jsx)(P,{path:`profile`,element:(0,F.jsx)(pLe,{})}),(0,F.jsx)(P,{path:`demographics`,element:(0,F.jsx)(TLe,{})}),(0,F.jsx)(P,{path:`organization`,element:(0,F.jsx)(mt,{to:`/settings/organization/team`,replace:!0})}),(0,F.jsx)(P,{path:`organization/profile`,element:(0,F.jsx)(PLe,{})}),(0,F.jsx)(P,{path:`organization/team`,element:(0,F.jsx)(MLe,{})}),(0,F.jsx)(P,{path:`notifications`,element:(0,F.jsx)(mt,{to:`/settings/account`,replace:!0})}),(0,F.jsx)(P,{path:`account`,element:(0,F.jsx)(sIe,{})})]}),(0,F.jsxs)(P,{path:`/help-center`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(qye,{})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`feedback`,replace:!0})}),(0,F.jsx)(P,{path:`feedback`,element:(0,F.jsx)(ELe,{})}),(0,F.jsx)(P,{path:`faq`,element:(0,F.jsx)(DLe,{})})]}),(0,F.jsxs)(P,{path:`/terms`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(Yye,{})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`conditions`,replace:!0})}),(0,F.jsx)(P,{path:`conditions`,element:(0,F.jsx)(OLe,{})}),(0,F.jsx)(P,{path:`early-access`,element:(0,F.jsx)(kLe,{})})]}),(0,F.jsx)(P,{path:`/privacy-policy`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(gye,{})})}),(0,F.jsx)(P,{path:`/subscription`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(_ye,{})})}),(0,F.jsx)(P,{path:`/contact`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(vye,{})})}),(0,F.jsxs)(P,{path:`/job-seeker`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(NG,{allowedRoles:[`job_seeker`],children:(0,F.jsx)(Aye,{})})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`jobs`,replace:!0})}),(0,F.jsx)(P,{path:`jobs`,element:(0,F.jsx)(Qye,{})}),(0,F.jsx)(P,{path:`applications`,element:(0,F.jsx)($ye,{})}),(0,F.jsx)(P,{path:`courses`,element:(0,F.jsx)(CK,{})}),$9(`/job-seeker/riipen`)]}),(0,F.jsxs)(P,{path:`/organization`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(NG,{allowedRoles:[`organization`,`career_tech`],children:(0,F.jsx)(Mye,{})})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`talent-pipeline`,replace:!0})}),(0,F.jsxs)(P,{path:`talent-pipeline`,element:(0,F.jsx)(HG,{}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`job-listings`,replace:!0})}),(0,F.jsx)(P,{path:`job-listings`,element:(0,F.jsx)(wK,{})}),(0,F.jsx)(P,{path:`candidates`,element:(0,F.jsx)(TK,{})}),(0,F.jsx)(P,{path:`assessment-links`,element:(0,F.jsx)(EK,{})})]}),(0,F.jsx)(P,{path:`courses`,element:(0,F.jsx)(CK,{})}),(0,F.jsx)(P,{path:`settings`,element:(0,F.jsx)(mt,{to:`/settings/organization/team`,replace:!0})}),$9(`/organization/riipen`)]}),(0,F.jsxs)(P,{path:`/admin`,element:(0,F.jsx)(yG,{children:(0,F.jsx)(NG,{allowedRoles:[`admin`],children:(0,F.jsx)(Pye,{})})}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`talent-pipeline`,replace:!0})}),(0,F.jsxs)(P,{path:`talent-pipeline`,element:(0,F.jsx)(HG,{}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`job-listings`,replace:!0})}),(0,F.jsx)(P,{path:`job-listings`,element:(0,F.jsx)(wK,{})}),(0,F.jsx)(P,{path:`candidates`,element:(0,F.jsx)(TK,{})}),(0,F.jsx)(P,{path:`assessment-links`,element:(0,F.jsx)(EK,{})})]}),(0,F.jsx)(P,{path:`courses`,element:(0,F.jsx)(CK,{})}),(0,F.jsxs)(P,{path:`analytics`,element:(0,F.jsx)(Bye,{}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`users`,replace:!0})}),(0,F.jsx)(P,{path:`users`,element:(0,F.jsx)(Ebe,{})}),(0,F.jsx)(P,{path:`aggregate`,element:(0,F.jsx)(iIe,{})})]}),(0,F.jsxs)(P,{path:`users`,element:(0,F.jsx)(Uye,{}),children:[(0,F.jsx)(P,{index:!0,element:(0,F.jsx)(mt,{to:`all`,replace:!0})}),(0,F.jsx)(P,{path:`all`,element:(0,F.jsx)(aIe,{})}
551),(0,F.jsx)(P,{path:`pending`,element:(0,F.jsx)(oIe,{})})]}),$9(`/admin/riipen`)]}),(0,F.jsx)(P,{path:`*`,element:(0,F.jsx)(oye,{})})]}),(0,F.jsx)(lye,{})]})}var zRe=Bj({reducer:{canvas:dM}}),BRe=new Pn({defaultOptions:{queries:{staleTime:1e3*60*5,retry:1}}});x.createRoot(document.getElementById(`root`)).render((0,F.jsx)(y.StrictMode,{children:(0,F.jsx)(Kn,{client:BRe,children:(0,F.jsx)(Cpe,{store:zRe,children:(0,F.jsx)(jt,{children:(0,F.jsx)(gl,{children:(0,F.jsx)(RRe,{})})})})})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.